Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The root cause of the issue is that OpenGL ES 2 does not support the `textureCubeLod` function. There are (optional) extensions to support this, but they don't appear to be exposed with the ES2 renderer (even though the hardware needed to support LOD features are certainly available.) The existing shim in `drivers/gles2/shaders/cubemap_filter.glsl` just creates a macro: ``` #define textureCubeLod(img, coord, lod) textureCube(img, coord) ``` But the third parameter of `textureCube` is actually a mip bias, not an absolute mip level. (And it doesn't seem to work regardless.) In this specific case, the `cubemap_filter` should only sample from the first level of the "source" panorama cubemap. In lieu of a method to force a lod level of zero, I've chosen to comment out the switchover from a 2D equirectangular panorama to the cubemap version of the same image, therefore always sampling roughness values from the 2D equirectangular panorama. This may cause additional artifacts or issues across the seam, but at least it prevents the glaringly obvious black areas. --- This same issue (no fragment texture LOD support) has rather large repercussions elsewhere too; it means materials with larger cubemap density (i.e. planar or distant objects) will be far rougher than expected. Since GLES 3 appears to properly support fragment `texture*Lod` functions, switching to the GLES 3 backend would solve this problem. --- Root cause discovered with help from @kaadmy.
- Loading branch information