Fix rendering without shadows
This commit is contained in:
+5
-1
@@ -98,6 +98,9 @@ renderLightingNoShadows positiontexture normaltexture lightPoints pdata = do
|
|||||||
(fromIntegral (4 :: Int))
|
(fromIntegral (4 :: Int))
|
||||||
--cleanup: may not be necessary, depending on what comes after...
|
--cleanup: may not be necessary, depending on what comes after...
|
||||||
glDisable GL_CULL_FACE
|
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
|
-- glDisable GL_STENCIL_TEST
|
||||||
|
|
||||||
|
|
||||||
@@ -113,6 +116,8 @@ renderFlatLighting pdata = do
|
|||||||
glDisable GL_CULL_FACE
|
glDisable GL_CULL_FACE
|
||||||
glDepthFunc GL_ALWAYS
|
glDepthFunc GL_ALWAYS
|
||||||
glDepthMask GL_FALSE
|
glDepthMask GL_FALSE
|
||||||
|
glStencilFunc GL_NOTEQUAL 128 255
|
||||||
|
glStencilOp GL_KEEP GL_KEEP GL_KEEP
|
||||||
|
|
||||||
renderShadows ::
|
renderShadows ::
|
||||||
ShadowRendering ->
|
ShadowRendering ->
|
||||||
@@ -143,7 +148,6 @@ renderShadows shadrendertype nWalls nSils nCaps positiontexture normaltexture li
|
|||||||
ptr
|
ptr
|
||||||
-- setup stencil and blending
|
-- setup stencil and blending
|
||||||
glBlendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
|
glBlendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
|
||||||
glEnable GL_STENCIL_TEST
|
|
||||||
glStencilOpSeparate GL_FRONT GL_KEEP GL_KEEP GL_INCR_WRAP
|
glStencilOpSeparate GL_FRONT GL_KEEP GL_KEEP GL_INCR_WRAP
|
||||||
glStencilOpSeparate GL_BACK GL_KEEP GL_KEEP GL_DECR_WRAP
|
glStencilOpSeparate GL_BACK GL_KEEP GL_KEEP GL_DECR_WRAP
|
||||||
-- bind world position texture-- these will be used by the lighting shader
|
-- bind world position texture-- these will be used by the lighting shader
|
||||||
|
|||||||
Reference in New Issue
Block a user