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

Fix front face definition #11958

Merged
merged 1 commit into from
Oct 11, 2017
Merged

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Oct 9, 2017

This will fix the shadow artifact reported in this issue #11848 (the first issue of the two issueses reported there).

I will explain a bit more detail even though the commit is so small.
I found that the first call of RasterizerSceneGLES3::_render_list (more specifically, _render_geometry and glDrawXXX from that function) uses front face mode GL_CCW (counter clock wise) since that's the default value and glFrontFace(GL_CW) is only called at the end of the RasterizerSceneGLES3::_render_list.
This led to the opposite front face definition when we generate shadow map for the first time in the application lifetime, which causes shadow artifact as in that issue.
Another thing to note is that shadow map is not re-drawed in every frame when scene is static, so the first wrong front face shadow map is continued to be used in that case.

I figured this type of one-time gl state setup can be in RasterizerSceneGLES3::initialize, so that's what my PR is.

@groud groud added this to the 3.0 milestone Oct 9, 2017
@akien-mga akien-mga requested a review from reduz October 9, 2017 13:22
@groud
Copy link
Member

groud commented Oct 11, 2017

Ok, this looks good to me and pretty straightforward. Merging.

@groud groud merged commit 45c878e into godotengine:master Oct 11, 2017
@groud groud mentioned this pull request Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants