Fix wall depth rendering

This commit is contained in:
2021-03-22 00:05:24 +01:00
parent 5a5ca6f208
commit f19f879945
4 changed files with 8 additions and 14 deletions
+2 -8
View File
@@ -53,14 +53,6 @@ renderPicture' pdata rot zoom trans@(tranx,trany) wins@(winx,winy) wallPointsCol
renderWalls pdata wallPointsCol pmat
renderWalls pdata windowPoints pmat
-- hack: the walls are drawn with a continuous depth from 0 to -1
-- the following call is aimed at setting the depth buffer over all the walls to
-- at most -0.9
colorMask $= (Color4 Disabled Disabled Disabled Disabled)
renderFoldable pdata $ picToLTree (Just 3) pic
colorMask $= (Color4 Enabled Enabled Enabled Enabled)
depthFunc $= Just Lequal
@@ -76,6 +68,8 @@ renderPicture' pdata rot zoom trans@(tranx,trany) wins@(winx,winy) wallPointsCol
renderFoldable pdata $ picToLTree (Just 2) pic
renderWalls pdata windowPoints pmat
resetShaderUniforms (map extractProgAndUnis $ _listShaders pdata)
endTicks <- SDL.ticks
return (ticksAfterLighting, endTicks - startTicks)