webgl-operate icon indicating copy to clipboard operation
webgl-operate copied to clipboard

Refine logic to determine internal texture format for shadow pass

Open scheibel opened this issue 4 years ago • 2 comments

It seems as if 32-bit float textures are not considered filterable in WebGL 2 [1]. The necessary extension for those textures does not change that, either [2]. With this in mind, we should redesign the algorithm to determine bitness, number of channels and specific internal format, and filtering method for the shadow map of a shadow pass.

Possible combinations seems to be:

  • RED with R8 and linear filtering
  • RED with R8 and nearest filtering
  • RG with RG8 and linear filtering
  • RG with RG8 and nearest filtering
  • RGBA with RGBA8 and nearest filtering

Sources: [1] https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D) [2] https://developer.mozilla.org/en-US/docs/Web/API/OES_texture_float

scheibel avatar Aug 18 '20 12:08 scheibel

perhaps we should enable OES_texture_float_linear in such cases, e.g., when rendering shadow maps

cgcostume avatar Aug 18 '20 12:08 cgcostume

this is well suited for the wizard.ts ...

cgcostume avatar Jan 26 '22 08:01 cgcostume