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

Material: document disabling depth test disables depth write caveat. #27000

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

fleroviux
Copy link
Contributor

When setting the depthTest flag of a material to false, this will also implicitly disable the depth write, because glDisable(GL_DEPTH_TEST) is called internally.

See: https://www.khronos.org/opengl/wiki/Depth_Test

When depth testing is disabled, writes to the depth buffer are also disabled.

While the behavior makes sense I think (after all depthFunc can be used to achieve the desired behavior), it caught me off guard, so I thought it would make sense to document it.

When setting the `depthTest` flag of a material to false, this will also implicitly disable the depth write, because `glDisable(GL_DEPTH_TEST)` is called internally. 

See: https://www.khronos.org/opengl/wiki/Depth_Test
> When depth testing is disabled, writes to the depth buffer are also disabled. 

While the behavior makes sense I think (`depthFunc` can be used to achieve the desired behavior), it caught me off guard, so I thought it would make sense to document it.
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.

2 participants