Skip to content

Commit

Permalink
#5584: Set front face culling to match the surfaces - they are using …
Browse files Browse the repository at this point in the history
…an identity matrix right now
  • Loading branch information
codereader committed Nov 7, 2021
1 parent b435b0b commit 752b7ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions radiantcore/rendersystem/backend/OpenGLShader.cpp
Expand Up @@ -132,6 +132,9 @@ void OpenGLShader::drawSurfaces()
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);

// Surfaces like windings are using CW culling
glFrontFace(GL_CW);

if (hasSurfaces())
{
_vertexBuffer->renderAllBatches(GL_TRIANGLES, false);
Expand Down Expand Up @@ -159,6 +162,7 @@ void OpenGLShader::drawSurfaces()
}

// Render all windings
glFrontFace(GL_CCW);
WindingRenderer::render();

glDisableClientState(GL_NORMAL_ARRAY);
Expand Down
2 changes: 0 additions & 2 deletions radiantcore/rendersystem/backend/OpenGLShaderPass.cpp
Expand Up @@ -576,8 +576,6 @@ void OpenGLShaderPass::render(OpenGLState& current,
// Apply our state to the current state object
applyState(current, flagsMask, viewer, time, NULL);

// Surfaces like windings are using CCW culling and an identity matrix
glFrontFace(GL_CCW);
_owner.drawSurfaces();

if (!_renderablesWithoutEntity.empty())
Expand Down

0 comments on commit 752b7ee

Please sign in to comment.