Stop overwriting depth buffer when combining cloud positions
This commit is contained in:
+5
-6
@@ -47,10 +47,10 @@ createLightMap ::
|
||||
TO ->
|
||||
IO ()
|
||||
createLightMap cfig pdata lightPoints nWalls nSils nCaps shadsdrawtype
|
||||
toPos
|
||||
positiontexture
|
||||
normaltexture
|
||||
= case shadsdrawtype of
|
||||
InstancingShads -> instanceLightMap cfig pdata lightPoints nWalls nSils nCaps toPos
|
||||
InstancingShads -> instanceLightMap cfig pdata lightPoints nWalls nSils nCaps positiontexture
|
||||
NoShadows -> do
|
||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboLighting pdata)))
|
||||
let ltextShad = _lightingTextureShader pdata
|
||||
@@ -86,7 +86,7 @@ createLightMap cfig pdata lightPoints nWalls nSils nCaps shadsdrawtype
|
||||
--draw lightmap itself
|
||||
glDepthFunc GL_ALWAYS
|
||||
-- bind world position texture
|
||||
bindTO toPos
|
||||
glBindTextureUnit 0 (positiontexture ^. unTO)
|
||||
glColorMask GL_TRUE GL_TRUE GL_TRUE GL_TRUE
|
||||
glStencilFunc GL_EQUAL 0 255
|
||||
glUseProgram (ltextShad ^. shadName)
|
||||
@@ -114,7 +114,7 @@ createLightMap cfig pdata lightPoints nWalls nSils nCaps shadsdrawtype
|
||||
0
|
||||
ptr
|
||||
glDisable GL_CULL_FACE
|
||||
glBindTextureUnit 0 (toPos ^. unTO)
|
||||
glBindTextureUnit 0 (positiontexture ^. unTO)
|
||||
glDepthFunc GL_ALWAYS
|
||||
glDepthMask GL_FALSE
|
||||
_ -> do
|
||||
@@ -192,14 +192,13 @@ createLightMap cfig pdata lightPoints nWalls nSils nCaps shadsdrawtype
|
||||
glDepthFunc GL_ALWAYS
|
||||
-- bind world position texture
|
||||
glDisable GL_CULL_FACE
|
||||
bindTO toPos
|
||||
glBindTextureUnit 0 (positiontexture ^. unTO)
|
||||
glBindTextureUnit 1 (normaltexture ^. unTO)
|
||||
glColorMask GL_TRUE GL_TRUE GL_TRUE GL_TRUE
|
||||
glStencilFunc GL_EQUAL 0 255
|
||||
glUseProgram (ltextShad ^. shadName) --Just (_shadProg ltextShad)
|
||||
glUniform3f 0 x y z
|
||||
glUniform4f 1 r g b rad
|
||||
--bindVertexArrayObject $= ltextShad ^? shadVAO' . vaoName -- Just (_vao $ _shadVAO ltextShad)
|
||||
glBindVertexArray $ ltextShad ^. shadVAO . vaoName -- Just (_vao $ _shadVAO ltextShad)
|
||||
glDrawArrays
|
||||
(marshalEPrimitiveMode (_shadPrim' ltextShad))
|
||||
|
||||
Reference in New Issue
Block a user