Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gl-cpp] Fix depth/stencil buffers not working correctly with three.js #7543

Merged
merged 4 commits into from Mar 31, 2020

Conversation

tsapeta
Copy link
Member

@tsapeta tsapeta commented Mar 31, 2020

Why

Fixes #7502

How

It turned out that Three.js uses gl.DEPTH_STENCIL constant when calling renderbufferStorage method used as part of lights rendering. This constant is valid in WebGL, but is invalid in OpenGL ES 3.0, so we need to fall back it to GL_DEPTH24_STENCIL8 which is valid in OpenGL and has the same effect.

Test Plan

Added new example to NCL which is almost the same as the one provided in the issue. Also received a feedback that JS workaround doing the same thing works as expected.

@tsapeta tsapeta marked this pull request as ready for review March 31, 2020 11:26
@tsapeta tsapeta requested a review from bbarthec as a code owner March 31, 2020 11:26
@tsapeta tsapeta requested a review from wkozyra95 March 31, 2020 11:27
Copy link
Contributor

@bbarthec bbarthec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯 congrats on solving this issue! 😄

@tsapeta tsapeta merged commit 3cd0a4d into master Mar 31, 2020
@tsapeta tsapeta deleted the @tsapeta/fix-gl-depth-stencil branch March 31, 2020 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GL Shadows rendering not working properly
3 participants