From 833d4562e2acdc9868a23d681ca266221454a0fa Mon Sep 17 00:00:00 2001 From: justin Date: Sun, 2 Nov 2025 22:58:06 +0000 Subject: [PATCH] Fix rendering without shadows --- src/Render.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Render.hs b/src/Render.hs index caf2de301..64d85ad0e 100644 --- a/src/Render.hs +++ b/src/Render.hs @@ -98,6 +98,9 @@ renderLightingNoShadows positiontexture normaltexture lightPoints pdata = do (fromIntegral (4 :: Int)) --cleanup: may not be necessary, depending on what comes after... glDisable GL_CULL_FACE + glStencilFunc GL_NOTEQUAL 128 255 + glStencilOp GL_KEEP GL_KEEP GL_KEEP + glColorMask GL_TRUE GL_TRUE GL_TRUE GL_TRUE -- glDisable GL_STENCIL_TEST @@ -113,6 +116,8 @@ renderFlatLighting pdata = do glDisable GL_CULL_FACE glDepthFunc GL_ALWAYS glDepthMask GL_FALSE + glStencilFunc GL_NOTEQUAL 128 255 + glStencilOp GL_KEEP GL_KEEP GL_KEEP renderShadows :: ShadowRendering -> @@ -143,7 +148,6 @@ renderShadows shadrendertype nWalls nSils nCaps positiontexture normaltexture li ptr -- setup stencil and blending glBlendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR - glEnable GL_STENCIL_TEST glStencilOpSeparate GL_FRONT GL_KEEP GL_KEEP GL_INCR_WRAP glStencilOpSeparate GL_BACK GL_KEEP GL_KEEP GL_DECR_WRAP -- bind world position texture-- these will be used by the lighting shader