Remove unnecessary uniforms
This commit is contained in:
@@ -40,10 +40,10 @@ preloadRender = do
|
||||
lsShad <- makeShader "lighting/floor" [vert,geom,frag] [(0,4)] Points
|
||||
(return . return . flat4)
|
||||
wsShad <- makeShader "lighting/occlude" [vert,geom,frag] [(0,4)] Points pokeWPStrat
|
||||
>>= addUniforms ["lightPos","perpMat","facesToDraw"]
|
||||
>>= addUniforms ["lightPos"]
|
||||
wlLightShad
|
||||
<- makeShader "lighting/wall" [vert,geom,frag] [(0,4)] Points pokeWPStrat
|
||||
>>= addUniforms ["lightPos","perpMat","radLum"]
|
||||
>>= addUniforms ["lightPos","radLum"]
|
||||
-- 2D draw shaders
|
||||
bslist <- makeShader "twoD/basic" [vert,frag] [(0,3),(1,4)] Triangles pokeTriStrat
|
||||
lslist <- makeShader "twoD/basic" [vert,frag] [(0,3),(1,4)] Lines pokeLineStrat
|
||||
@@ -82,12 +82,9 @@ preloadRender = do
|
||||
-- >>= addTexture "data/texture/smudgedDirt.png"
|
||||
-- blank wallShader
|
||||
wlBlank <- makeShader "wall/blank" [vert,geom,frag] [(0,4),(1,4)] Points pokeWPColStrat
|
||||
-- >>= addTexture "data/texture/grayscaleDirt.png"
|
||||
>>= addUniforms ["perpMat"]
|
||||
-- textured wallShader
|
||||
wlTexture <- makeShader "wall/texture" [vert,geom,frag] [(0,4),(1,4)] Points pokeWPColStrat
|
||||
>>= addTexture "data/texture/grayscaleDirt.png"
|
||||
>>= addUniforms ["perpMat"]
|
||||
-- framebuffer for lighting
|
||||
(fbo,fboTO,fboRBO) <- setupFramebufferWithStencil
|
||||
framebuf2 <- setupFramebufferWithStencil
|
||||
|
||||
+7
-10
@@ -38,12 +38,11 @@ setWallDepth pdata wallPoints (viewFromx,viewFromy) pmat = do
|
||||
bindShaderBuffers [_lightingOccludeShader pdata] [nWalls]
|
||||
|
||||
currentProgram $= Just (_shaderProgram $ _lightingOccludeShader pdata)
|
||||
uniform (head $ _shaderCustomUnis $ _lightingOccludeShader pdata)
|
||||
-- reseting this uniform appears to be necessary
|
||||
uniform (head $ _shaderCustomUnis $ _lightingOccludeShader pdata)
|
||||
$= Vector2 viewFromx viewFromy
|
||||
uniform ( (_shaderCustomUnis $ _lightingOccludeShader pdata) !! 1)
|
||||
$= pmat
|
||||
uniform ( (_shaderCustomUnis $ _lightingOccludeShader pdata) !! 2)
|
||||
$= (0 :: Float)
|
||||
-- uniform ( (_shaderMatrixUniform $ _lightingOccludeShader pdata))
|
||||
-- $= pmat
|
||||
-- cullFace $= Just Front
|
||||
drawShader (_lightingOccludeShader pdata) nWalls
|
||||
colorMask $= Color4 Enabled Enabled Enabled Enabled
|
||||
@@ -81,7 +80,7 @@ createLightMap pdata resDiv wallPoints lightPoints (viewFromx,viewFromy) pmat _
|
||||
bindShaderBuffers [_lightingOccludeShader pdata] [nWalls]
|
||||
-- set uniforms for shader that draws lights
|
||||
currentProgram $= Just (_shaderProgram $ _lightingWallShader pdata)
|
||||
uniform ( (_shaderCustomUnis $ _lightingWallShader pdata) !! 1)
|
||||
uniform (_shaderMatrixUniform $ _lightingWallShader pdata)
|
||||
$= pmat
|
||||
-- clear buffer to full alpha and furthest depth
|
||||
clearColor $= Color4 0 0 0 1
|
||||
@@ -93,10 +92,8 @@ createLightMap pdata resDiv wallPoints lightPoints (viewFromx,viewFromy) pmat _
|
||||
currentProgram $= Just (_shaderProgram $ _lightingOccludeShader pdata)
|
||||
uniform (head $ _shaderCustomUnis $ _lightingOccludeShader pdata)
|
||||
$= Vector2 viewFromx viewFromy
|
||||
uniform ( (_shaderCustomUnis $ _lightingOccludeShader pdata) !! 1)
|
||||
uniform ( (_shaderMatrixUniform $ _lightingOccludeShader pdata))
|
||||
$= pmat
|
||||
uniform ( (_shaderCustomUnis $ _lightingOccludeShader pdata) !! 2)
|
||||
$= (0 :: Float)
|
||||
cullFace $= Just Back
|
||||
drawShader (_lightingOccludeShader pdata) nWalls
|
||||
|
||||
@@ -142,7 +139,7 @@ createLightMap pdata resDiv wallPoints lightPoints (viewFromx,viewFromy) pmat _
|
||||
currentProgram $= Just (_shaderProgram $ _lightingWallShader pdata)
|
||||
uniform (head $ _shaderCustomUnis $ _lightingWallShader pdata)
|
||||
$= Vector2 x y
|
||||
uniform ((_shaderCustomUnis $ _lightingWallShader pdata) !! 2)
|
||||
uniform (_shaderCustomUnis (_lightingWallShader pdata) !! 1)
|
||||
$= Vector2 r lum
|
||||
drawShader (_lightingWallShader pdata) nWallLights
|
||||
cullFace $= Nothing
|
||||
|
||||
Reference in New Issue
Block a user