Refactor lighting shaders

This commit is contained in:
2021-06-25 00:44:45 +02:00
parent 6320093473
commit b451953b99
13 changed files with 44 additions and 80 deletions
+4 -7
View File
@@ -51,7 +51,7 @@ doDrawing pdata w = do
wins = (getWindowX w,getWindowY w)
wallPointsCol = wallsPointsAndCols w
windowPoints = wallsWindows w
lightPoints = lightsForGloom' w
lightPoints = lightsForGloom w
viewFroms@(viewFromx,viewFromy) = _cameraViewFrom w
pic = worldPictures w
wallPoints = map fst wallPointsCol
@@ -63,16 +63,13 @@ doDrawing pdata w = do
-- draw the lightmap. Probably changes the bound framebufferObject
createLightMap pdata (w ^. config . shadow_resolution) wallPoints lightPoints viewFroms
(foregroundPics w)
-- draw the background. Assumes that depth testing is not enabled or that
-- the depth buffer is ready to be drawn on
clear [DepthBuffer]
depthFunc $= Just Less
-- set blending to depend upon the alpha level already present
blendFuncSeparate $= ((SrcAlphaSaturate, OneMinusSrcAlpha), (Zero,One))
renderBackground pdata rot camzoom trans wins
_ <- renderShader (_textureArrayShader pdata) (_floorTiles w)
-- draw the walls
depthFunc $= Just Less
if w ^. config . wall_textured
then renderTextureWalls pdata wallPointsCol
else renderBlankWalls pdata wallPointsCol