webgl-operate
webgl-operate copied to clipboard
Refine logic to determine internal texture format for shadow pass
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
perhaps we should enable OES_texture_float_linear
in such cases, e.g., when rendering shadow maps
this is well suited for the wizard.ts
...