Vertex pull fullscreen lighting texture shader

This commit is contained in:
2025-11-13 10:28:34 +00:00
parent b012d3c41e
commit 8dee93991a
6 changed files with 28 additions and 21 deletions
+16
View File
@@ -44,6 +44,12 @@ preloadRender = do
glNamedBufferStorage lightubo 32 nullPtr GL_DYNAMIC_STORAGE_BIT
glBindBufferBase GL_UNIFORM_BUFFER 1 lightubo
fulltexbo <- mglCreate glCreateBuffers
let ftsize = fromIntegral $ sizeOf (0::Float) * 6 * 4
withArray cornerList' $ \ptr ->
glNamedBufferStorage fulltexbo ftsize ptr 0
glBindBufferBase GL_UNIFORM_BUFFER 2 fulltexbo
winssbo <- mglCreate glCreateBuffers
let winssbosize = sizeOf (0 :: Float) * 8 * 1024
glNamedBufferStorage winssbo (fromIntegral winssbosize) nullPtr GL_DYNAMIC_STORAGE_BIT
@@ -248,6 +254,16 @@ cornerList =
, [1, 1, 1, 1]
, [1, -1, 1, 0]
]
cornerList' :: [Float]
cornerList' = concat
[ bl, br, tl
, tl, br, tr
]
where
bl = [-1, -1, 0, 0]
br = [ 1, -1, 1, 0]
tl = [-1, 1, 0, 1]
tr = [ 1, 1, 1, 1]
--cornerListForTriangles :: [[Float]]
--cornerListForTriangles =
+1 -7
View File
@@ -201,13 +201,7 @@ renderShadows shadrendertype nWalls nSils nCaps positiontexture normaltexture li
glColorMask GL_TRUE GL_TRUE GL_TRUE GL_FALSE
glStencilFunc GL_EQUAL 0 255
glUseProgram (ltextShad ^. shaderUINT)
glUniform3f 0 x y z
glUniform4f 1 r g b rad
glBindVertexArray $ ltextShad ^. shaderVAO . vaoName
glDrawArrays
(_unPrimitiveMode (_shaderPrimitive ltextShad))
0
(fromIntegral (4 :: Int))
glDrawArrays GL_TRIANGLES 0 6
--cleanup: may not be necessary, depending on what comes after...
-- glDisable GL_STENCIL_TEST
-- glDisable GL_SCISSOR_TEST