Use ssbo/vertex pulling for lighting cap shader

Not yet sure whether the colour vector is correctly input into the ssbo
This commit is contained in:
2025-11-11 14:15:42 +00:00
parent a65a1cab93
commit 219c574931
11 changed files with 90 additions and 85 deletions
+23 -11
View File
@@ -116,16 +116,28 @@ doDrawing' win pdata u = do
glNamedBufferSubData (pdata ^. wallSSBO) 0
(fromIntegral $ trueNWalls * sizeOf (0::Float) * 8)
(pdata ^. wallVBO . vboPtr)
-- withArray
-- [V4 0 0 0 (1:: Float)
-- ,V4 0 0 0 0
-- ,V4 0 0 0 0
-- ,V4 1 1 0 1
-- ,V4 0 0 0 0
-- ,V4 0 0 0 0
-- ,V4 0 1 0 1
-- ,V4 0 0 0 0
-- ,V4 0 0 0 0
-- ]
-- $ glNamedBufferSubData (pdata ^. shapeSSBO) 0
-- (fromIntegral $ 9 * (sizeOf (0::Float)*12))
-- withArray [0::GLuint,1,2] $
-- glNamedBufferSubData (pdata ^. ishapeSSBO) 0
-- (fromIntegral $ 3 * (sizeOf (0::GLuint)))
glNamedBufferSubData (pdata ^. shapeSSBO) 0
-- (fromIntegral $ nShapeVs * (sizeOf (0::Float)*8 + sizeOf (0::Word8)*4))
(fromIntegral $ nShapeVs * (sizeOf (0::Float)*12))
(pdata ^. vboShapes . vboPtr)
withArray [0::GLuint,1,2] $
glNamedBufferSubData (pdata ^. ishapeSSBO) 0
(fromIntegral $ 3 * (sizeOf (0::GLuint)))
-- glNamedBufferSubData (pdata ^. ishapeSSBO) 0
-- (fromIntegral $ nIndices * (sizeOf (0::GLushort)))
-- (pdata ^. shapeEBO . eboPtr)
glNamedBufferSubData (pdata ^. ishapeSSBO) 0
(fromIntegral $ nIndices * (sizeOf (0::GLuint)))
(pdata ^. shapeEBO . eboPtr)
setViewport _gr_world_res cfig
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboBase . _1 . unFBO)
glDepthMask GL_TRUE
@@ -185,7 +197,7 @@ doDrawing' win pdata u = do
glDrawElements
(_unPrimitiveMode $ _shaderPrimitive fs)
(fromIntegral nIndices)
GL_UNSIGNED_SHORT
GL_UNSIGNED_INT
nullPtr
-- draw chasm shader blocking floor
glUseProgram (pdata ^. chasmShader . shaderUINT)
@@ -263,7 +275,7 @@ doDrawing' win pdata u = do
glDrawElements
(pdata ^. cloudShader . shaderPrimitive . unPrimitiveMode)
(fromIntegral nCloudIs)
GL_UNSIGNED_SHORT
GL_UNSIGNED_INT
nullPtr
glDepthMask GL_TRUE
@@ -307,7 +319,7 @@ doDrawing' win pdata u = do
glDrawElements
(pdata ^. cloudShader . shaderPrimitive . unPrimitiveMode)
(fromIntegral nCloudIs)
GL_UNSIGNED_SHORT
GL_UNSIGNED_INT
nullPtr
-- glEnable GL_CULL_FACE
-- glEnable GL_DEPTH_CLAMP
@@ -339,7 +351,7 @@ doDrawing' win pdata u = do
glDrawElements
(pdata ^. cloudShader . shaderPrimitive . unPrimitiveMode)
(fromIntegral nCloudIs)
GL_UNSIGNED_SHORT
GL_UNSIGNED_INT
nullPtr
---
-- glEnable GL_CULL_FACE