diff options
author | Arisotura <thetotalworm@gmail.com> | 2019-05-25 02:34:14 +0200 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2019-05-25 02:34:14 +0200 |
commit | 04f1809dd17b5f7c034bcf394dbe040844c10712 (patch) | |
tree | 37a929b0324e5d7253c236ccdf4789131836414c /src | |
parent | 182e123598ca7ad641df47c0854928dd99f52345 (diff) |
finish fixing shadows
Diffstat (limited to 'src')
-rw-r--r-- | src/GPU3D_OpenGL.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/GPU3D_OpenGL.cpp b/src/GPU3D_OpenGL.cpp index 74e736a..264d3b9 100644 --- a/src/GPU3D_OpenGL.cpp +++ b/src/GPU3D_OpenGL.cpp @@ -594,6 +594,8 @@ void RenderSceneChunk(int y, int h) { RendererPolygon* rp = &PolygonList[i]; + if (rp->PolyData->IsShadowMask) { i++; continue; } + // zorp glDepthFunc(GL_LESS); @@ -627,11 +629,6 @@ void RenderSceneChunk(int y, int h) if (rp->PolyData->IsShadowMask) { - // clear shadow bits in stencil buffer - - glStencilMask(0x80); - glClear(GL_STENCIL_BUFFER_BIT); - // draw actual shadow mask UseRenderShader(flags | RenderFlag_ShadowMask); @@ -642,7 +639,7 @@ void RenderSceneChunk(int y, int h) glDepthMask(GL_FALSE); glDepthFunc(GL_LESS); - glStencilFunc(GL_EQUAL, 0xFF, 0xFE); + glStencilFunc(GL_EQUAL, 0xFF, 0xFF); glStencilOp(GL_KEEP, GL_INVERT, GL_KEEP); glStencilMask(0x01); |