[rlgl] Fix condition for WebGL depth texture support#5500
[rlgl] Fix condition for WebGL depth texture support#5500SlateyDev wants to merge 2 commits intoraysan5:masterfrom
Conversation
Condition looks to be incorrect. If texDepthWebGL is available, it should be using GL_DEPTH_COMPONENT16/24/32 but currently in WebGL always uses GL_DEPTH_COMPONENT which can fail especially in WebGL2.
|
This does not work for ES2 as WEBGL_depth_texture extension may exist, but it does not support the formats GL_DEPTH_COMPONENT16/24/32. These formats are supported for renderbuffer but not for texImage2D in ES2 and you need to use GL_DEPTH_COMPONENT for a 16-bit depth buffer. |
|
@SlateyDev I'm reviewing this issue but I think I'm not understanding it... As per WebGL 1.0 specifications, Checking the official specs for
Checking WebGL 2 specs, the sized components are supported but the provided information is missleading in reference to WebGL 1.
So, I'm confused, probably the code should be reviewed to consider |
|
The problem is when WebGL2 is in use, RLGL.ExtSupported.texDepthWebGL is true and so it does not use sized pixel formats and fails because it does not work with GL_DEPTH_COMPONENT as it did in WebGL1. I haven't yet been able to test under all cases to come up with a better design that works with all of ES2, WebGL1 and WebGL2 as I also haven't played with render buffers in any of my testing yet. |
Ok, now I see the issue.
Ok, I will wait for those tests, feel free to redesign that approach if required. |

Condition looks to be incorrect. If texDepthWebGL is available, it should be using GL_DEPTH_COMPONENT16/24/32 but currently in WebGL always uses GL_DEPTH_COMPONENT which can fail especially in WebGL2.