engine icon indicating copy to clipboard operation
engine copied to clipboard

Possible issue with dynamic refraction

Open mvaligursky opened this issue 7 months ago • 0 comments

This can be reproduced in the dispersion example on WebGPU. When DISPLAYFORMAT_LDR_SRGB displaFormat is used, the prisms rendered with the dynamic reflection are darker than they are on WebGL. The reason is unclear at this stage, but some observations were made:

  • if in evalRefractionColor function of refractionDynamic.js chunk, refraction is converted from linear to gamma space, this works as on WebGL. But as this should all work in linear space, it suggests there is a bug / workaround elsewhere in WebGL code perhaps, or some other issue is causing this.
  • the test GLB contains this: Screenshot 2024-07-22 at 17 26 37

and from a quick check, this should affect the refracted colors. Perhaps the issue is related to this somehow, but it's worth noting that all other webgl based glb viewers render it the same way as our WebGL implementation.

WebGL rendering Screenshot 2024-07-22 at 16 55 34

WebGPU rendering in DISPLAYFORMAT_LDR_SRGB mode: image

mvaligursky avatar Jul 22 '24 16:07 mvaligursky