First pass at using UBO

This commit is contained in:
jgk
2021-06-24 16:17:43 +02:00
parent d534f08064
commit 9c94ec93bd
6 changed files with 115 additions and 12 deletions
-9
View File
@@ -38,10 +38,6 @@ setWallDepth pdata wallPoints (viewFromx,viewFromy) = do
-- reseting this uniform appears to be necessary
uniform (head $ _shaderCustomUnis $ _lightingOccludeShader pdata)
$= Vector2 viewFromx viewFromy
-- the following uniform, however, was probably already set by
-- createLightMap
-- uniform ( (_shaderMatrixUniform $ _lightingOccludeShader pdata))
-- $= pmat
-- cullFace $= Just Front
drawShader (_lightingOccludeShader pdata) nWalls
colorMask $= Color4 Enabled Enabled Enabled Enabled
@@ -76,10 +72,6 @@ createLightMap pdata resDiv wallPoints lightPoints (viewFromx,viewFromy) _ = do
bindShaderBuffers [_lightingWallShader pdata] [nWallLights]
nWalls <- F.foldM (pokeShader $ _lightingOccludeShader pdata) (map Render22 wallPoints)
bindShaderBuffers [_lightingOccludeShader pdata] [nWalls]
-- set uniforms for shader that draws lights
-- currentProgram $= Just (_shaderProgram $ _lightingWallShader pdata)
-- uniform (_shaderMatrixUniform $ _lightingWallShader pdata)
-- $= pmat
-- clear buffer to full alpha and furthest depth
clearColor $= Color4 0 0 0 1
clearDepth $= 1
@@ -90,7 +82,6 @@ createLightMap pdata resDiv wallPoints lightPoints (viewFromx,viewFromy) _ = do
currentProgram $= Just (_shaderProgram $ _lightingOccludeShader pdata)
uniform (head $ _shaderCustomUnis $ _lightingOccludeShader pdata)
$= Vector2 viewFromx viewFromy
-- uniform (_shaderMatrixUniform $ _lightingOccludeShader pdata) $= pmat
cullFace $= Just Back
drawShader (_lightingOccludeShader pdata) nWalls