Graphic tweaks/cleanup

This commit is contained in:
2025-12-01 12:37:54 +00:00
parent 1635ce0176
commit 25efce7a89
8 changed files with 116 additions and 146 deletions
+11 -17
View File
@@ -62,11 +62,7 @@ doDrawing' win pdata u = do
((nWins, trueNWalls), (nShapeVs, nIndices, nSilIndices)) <-
MP.liftM3
(\_ a b -> (a, b))
( pokeLayVerxs
shadV
pokeCounts
wp
)
( pokeLayVerxs shadV pokeCounts wp)
( pokeWallsWindows
(pdata ^. winVBO . vboPtr)
(pdata ^. wallVBO . vboPtr)
@@ -81,7 +77,7 @@ doDrawing' win pdata u = do
(0, 0, 0)
ws
)
nCloudVs' <-
nCloudVs' <- -- foldM (pokeCloud $ pdata ^. cloudVBO . vboPtr) 0 (w ^. cWorld . lWorld . clouds)
V.foldM'
(pokeCloud (pdata ^. cloudVBO . vboPtr))
0
@@ -162,9 +158,9 @@ doDrawing' win pdata u = do
(pdata ^. fboBase . _2 . _3)
lightPoints
pdata
-- no longer need base positions/normals
withArray [GL_COLOR_ATTACHMENT1,GL_COLOR_ATTACHMENT2] $
glInvalidateNamedFramebufferData (pdata ^. fboBase . _1 . unFBO) 2
-- -- no longer need base positions/normals
-- withArray [GL_COLOR_ATTACHMENT1,GL_COLOR_ATTACHMENT2] $
-- glInvalidateNamedFramebufferData (pdata ^. fboBase . _1 . unFBO) 2
glColorMask GL_TRUE GL_TRUE GL_TRUE GL_TRUE
--apply lightmap to base buffer
glDepthFunc GL_ALWAYS
@@ -177,8 +173,8 @@ doDrawing' win pdata u = do
--glDrawArrays GL_TRIANGLES 0 6
glDrawArrays GL_TRIANGLES 0 3
-- no longer need lighting texture
with GL_COLOR_ATTACHMENT0 $
glInvalidateNamedFramebufferData (pdata ^. fboLighting . _1 . unFBO) 1
-- with GL_COLOR_ATTACHMENT0 $
-- glInvalidateNamedFramebufferData (pdata ^. fboLighting . _1 . unFBO) 1
--draw bloom onto bloom buffer
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboBloom . _1 . unFBO)
withArray [0, 0, 0, 0] $
@@ -255,6 +251,7 @@ doDrawing' win pdata u = do
when (_gr_cloud_shadows cfig) $ do
----render transparency depths
-- glDepthMask GL_TRUE
-- glDepthMask GL_TRUE
glDepthFunc GL_ALWAYS
withArray [GL_NONE, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2] $
glNamedFramebufferDrawBuffers (pdata ^. fboCloud . _1 . unFBO) 3
@@ -272,10 +269,7 @@ doDrawing' win pdata u = do
glDrawArrays GL_TRIANGLES 0 (fromIntegral nCloudVs * 6)
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboPos . _1 . unFBO)
withArray [0, 0, 0, 0] $
glClearNamedFramebufferfv
(pdata ^. fboPos . _1 . unFBO)
GL_COLOR
0
glClearNamedFramebufferfv (pdata ^. fboPos . _1 . unFBO) GL_COLOR 0
glBindTextureUnit 0 (pdata ^. fboCloud . _2 . _2 . unTO)
glDepthMask GL_FALSE
glUseProgram (pdata ^. alphaDivideShader)
@@ -285,7 +279,7 @@ doDrawing' win pdata u = do
glDepthMask GL_TRUE
glDepthFunc GL_LESS
glEnable GL_BLEND
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboLighting pdata)))
glBindFramebuffer GL_FRAMEBUFFER $ pdata ^. fboLighting . _1 . unFBO
createLightMap
True
(w ^. wCam)
@@ -333,7 +327,7 @@ doDrawing' win pdata u = do
withArray [GL_COLOR_ATTACHMENT0, GL_NONE] $
glNamedFramebufferDrawBuffers (pdata ^. fboCloud . _1 . unFBO) 2
glDepthFunc GL_ALWAYS
glBindTextureUnit 0 (_unTO . snd $ _fboLighting pdata)
glBindTextureUnit 0 (pdata ^. fboLighting . _2 . unTO)
glEnable GL_BLEND
glBlendFuncSeparate GL_ZERO GL_ONE_MINUS_SRC_COLOR GL_ZERO GL_ONE
glUseProgram (pdata ^. fullscreenShader)