Cleanup doDrawing a bit
This commit is contained in:
+17
-22
@@ -76,7 +76,6 @@ doDrawing pdata w = do
|
|||||||
clearColor $= Color4 0 0 0 0
|
clearColor $= Color4 0 0 0 0
|
||||||
clear [ColorBuffer,DepthBuffer]
|
clear [ColorBuffer,DepthBuffer]
|
||||||
depthFunc $= Just Less
|
depthFunc $= Just Less
|
||||||
|
|
||||||
-- draw wall occlusions from the camera's point of view
|
-- draw wall occlusions from the camera's point of view
|
||||||
currentProgram $= Just (_shaderProgram $ _lightingSurfaceShader pdata)
|
currentProgram $= Just (_shaderProgram $ _lightingSurfaceShader pdata)
|
||||||
uniform (head $ _shaderCustomUnis $ _lightingSurfaceShader pdata)
|
uniform (head $ _shaderCustomUnis $ _lightingSurfaceShader pdata)
|
||||||
@@ -88,44 +87,29 @@ doDrawing pdata w = do
|
|||||||
uniform (head $ _shaderCustomUnis $ _lightingWallShader pdata)
|
uniform (head $ _shaderCustomUnis $ _lightingWallShader pdata)
|
||||||
$= viewFrom3d
|
$= viewFrom3d
|
||||||
drawShader (_lightingOccludeShader pdata) nWalls
|
drawShader (_lightingOccludeShader pdata) nWalls
|
||||||
-- this might only work because the uniform has been correctly set
|
--draw walls onto base buffer
|
||||||
-- elsewhere, beware
|
|
||||||
-- indeed this is the case: this needs fixing
|
|
||||||
|
|
||||||
if w ^. config . wall_textured
|
if w ^. config . wall_textured
|
||||||
then renderTextureWalls pdata nWalls
|
then renderTextureWalls pdata nWalls
|
||||||
else renderBlankWalls pdata nWalls
|
else renderBlankWalls pdata nWalls
|
||||||
|
---draw foreground geometry onto base buffer
|
||||||
|
|
||||||
renderFoldable shadV $ polysToPic $ foregroundPics w
|
renderFoldable shadV $ polysToPic $ foregroundPics w
|
||||||
|
--draw objects onto base buffer
|
||||||
layerCounts <- UMV.replicate (6*6) 0
|
layerCounts <- UMV.replicate (6*6) 0
|
||||||
pokeBindFoldableLayer shadV layerCounts $ worldPictures w
|
pokeBindFoldableLayer shadV layerCounts $ worldPictures w
|
||||||
renderLayer 0 shadV layerCounts
|
renderLayer 0 shadV layerCounts
|
||||||
|
--draw floor onto base buffer
|
||||||
nTextArrayVs <- pokePoint33s (shadVBOptr $ _textureArrayShader pdata) (_floorTiles w)
|
nTextArrayVs <- pokePoint33s (shadVBOptr $ _textureArrayShader pdata) (_floorTiles w)
|
||||||
bindShaderBuffers [_textureArrayShader pdata] [nTextArrayVs]
|
bindShaderBuffers [_textureArrayShader pdata] [nTextArrayVs]
|
||||||
drawShader (_textureArrayShader pdata) nTextArrayVs
|
drawShader (_textureArrayShader pdata) nTextArrayVs
|
||||||
|
--draw bloom onto bloom buffer
|
||||||
bindFramebuffer Framebuffer $= fst (_fboBloom pdata)
|
bindFramebuffer Framebuffer $= fst (_fboBloom pdata)
|
||||||
clear [ColorBuffer]
|
clear [ColorBuffer]
|
||||||
--blendFunc $= (SrcAlpha,OneMinusSrcAlpha)
|
|
||||||
blendFunc $= (SrcAlpha,OneMinusSrcAlpha)
|
blendFunc $= (SrcAlpha,OneMinusSrcAlpha)
|
||||||
--blendEquation $= Max
|
|
||||||
depthMask $= Disabled
|
depthMask $= Disabled
|
||||||
renderLayer 3 shadV layerCounts
|
renderLayer 3 shadV layerCounts
|
||||||
depthMask $= Enabled
|
depthMask $= Enabled
|
||||||
renderLayer 1 shadV layerCounts
|
renderLayer 1 shadV layerCounts
|
||||||
-- bindFramebuffer Framebuffer $= fst (_fboColor pdata)
|
--setup downscale viewport for blurring bloom
|
||||||
-- clear [ColorBuffer]
|
|
||||||
-- depthMask $= Disabled
|
|
||||||
-- blendEquation $= FuncAdd
|
|
||||||
-- renderLayer 3 shadV layerCounts
|
|
||||||
-- renderLayer 4 shadV layerCounts
|
|
||||||
-- renderLayer 5 shadV layerCounts
|
|
||||||
--
|
|
||||||
-- depthMask $= Enabled
|
|
||||||
-- this is not ideal if the original is not divisible by 2
|
|
||||||
viewport $= (Position 0 0
|
viewport $= (Position 0 0
|
||||||
, divideSize (2 * (w ^. config . shadow_resolution)) $ Size (round $ fstV2 wins) (round $ sndV2 wins))
|
, divideSize (2 * (w ^. config . shadow_resolution)) $ Size (round $ fstV2 wins) (round $ sndV2 wins))
|
||||||
bindFramebuffer Framebuffer $= fst (_fboFourth1 pdata)
|
bindFramebuffer Framebuffer $= fst (_fboFourth1 pdata)
|
||||||
@@ -138,6 +122,17 @@ doDrawing pdata w = do
|
|||||||
viewport $= (Position 0 0
|
viewport $= (Position 0 0
|
||||||
, divideSize (w ^. config . shadow_resolution) $ Size (round $ fstV2 wins) (round $ sndV2 wins))
|
, divideSize (w ^. config . shadow_resolution) $ Size (round $ fstV2 wins) (round $ sndV2 wins))
|
||||||
|
|
||||||
|
-- bindFramebuffer Framebuffer $= fst (_fboColor pdata)
|
||||||
|
-- clear [ColorBuffer]
|
||||||
|
-- depthMask $= Disabled
|
||||||
|
-- blendEquation $= FuncAdd
|
||||||
|
-- renderLayer 3 shadV layerCounts
|
||||||
|
-- renderLayer 4 shadV layerCounts
|
||||||
|
-- renderLayer 5 shadV layerCounts
|
||||||
|
--
|
||||||
|
-- depthMask $= Enabled
|
||||||
|
-- this is not ideal if the original is not divisible by 2
|
||||||
|
|
||||||
bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
|
bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
|
||||||
createLightMap pdata lightPoints nWalls nSils nsurfVs
|
createLightMap pdata lightPoints nWalls nSils nsurfVs
|
||||||
colorMask $= Color4 Enabled Enabled Enabled Enabled
|
colorMask $= Color4 Enabled Enabled Enabled Enabled
|
||||||
|
|||||||
Reference in New Issue
Block a user