Setup multiple target basic shaders
This commit is contained in:
+16
-14
@@ -35,20 +35,22 @@ createLightMap pdata lightPoints nWalls nSils nsurfVs = do
|
||||
-- clear buffer to full alpha and furthest depth
|
||||
-- clearColor is specified in preloadRender
|
||||
clearColor $= Color4 1 1 1 1
|
||||
clear [ColorBuffer,DepthBuffer]
|
||||
--colorMask $= Color4 Disabled Disabled Disabled Disabled
|
||||
cullFace $= Just Back
|
||||
cullFace $= Nothing
|
||||
-- we assume that the camera position uniforms have been correctly set elsewhere
|
||||
-- draw wall surfaces from the camera's point of view in order to set z buffer
|
||||
drawShader (_lightingWallShader pdata) nWalls
|
||||
-- draw foreground elements the camera's your point of view to set z buffer
|
||||
drawShader (_lightingSurfaceShader pdata) nsurfVs
|
||||
-- draw wall occlusions from the camera's point of view
|
||||
drawShader (_lightingOccludeShader pdata) nWalls
|
||||
--hypothesis: the above three draw calls only work because the
|
||||
--uniform was set to your position, that being the last light source in the list
|
||||
--if this hypothesis is correct, then the code is brittle and should be changed
|
||||
clear [ColorBuffer]
|
||||
-- we assume that the renderbuffer's depth has been correctly set elsewhere
|
||||
-- clear [ColorBuffer,DepthBuffer]
|
||||
-- --colorMask $= Color4 Disabled Disabled Disabled Disabled
|
||||
-- cullFace $= Just Back
|
||||
-- cullFace $= Nothing
|
||||
-- -- we assume that the camera position uniforms have been correctly set elsewhere
|
||||
-- -- draw wall surfaces from the camera's point of view in order to set z buffer
|
||||
-- drawShader (_lightingWallShader pdata) nWalls
|
||||
-- -- draw foreground elements the camera's your point of view to set z buffer
|
||||
-- drawShader (_lightingSurfaceShader pdata) nsurfVs
|
||||
-- -- draw wall occlusions from the camera's point of view
|
||||
-- drawShader (_lightingOccludeShader pdata) nWalls
|
||||
-- --hypothesis: the above three draw calls only work because the
|
||||
-- --uniform was set to your position, that being the last light source in the list
|
||||
-- --if this hypothesis is correct, then the code is brittle and should be changed
|
||||
|
||||
-- for each of the lights:
|
||||
-- stencil out the walls from this light's point of view
|
||||
|
||||
Reference in New Issue
Block a user