Commit before attempt to unify picture rendering
This commit is contained in:
+17
-1
@@ -52,7 +52,7 @@ doDrawing pdata w = do
|
||||
viewFroms@(viewFromx,viewFromy) = _cameraViewFrom w
|
||||
pic = worldPictures w
|
||||
wallPoints = map fst wallPointsCol
|
||||
-- set the coordinate uniforms ready for drawing elements with using world coordinates
|
||||
-- set the coordinate uniforms ready for drawing elements using world coordinates
|
||||
setCommonUniforms pdata rot camzoom trans wins
|
||||
depthFunc $= Just Less
|
||||
pmat <- (newMatrix RowMajor $ perspectiveMatrix rot camzoom trans wins viewFroms)
|
||||
@@ -88,7 +88,22 @@ doDrawing pdata w = do
|
||||
-- render transparent walls
|
||||
-- the ordering between these and transparent clouds perhaps presents a challenge
|
||||
renderBlankWalls pdata windowPoints pmat
|
||||
|
||||
setShaderUniforms rot (camzoom * (1/ 0.9)) trans wins
|
||||
$ map extractProgAndUnis $ _pictureShaders pdata
|
||||
depthFunc $= Just Lequal
|
||||
_ <- renderFoldable pdata $ picToLTree (Just 0) (midgroundPics w)
|
||||
|
||||
--depthMask $= Enabled
|
||||
-- set the coordinate uniforms for the foreground
|
||||
setShaderUniforms rot (camzoom * (1/ 0.8)) trans wins
|
||||
$ map extractProgAndUnis $ _pictureShaders pdata
|
||||
blendFunc $= (One,Zero)
|
||||
depthFunc $= Just Always
|
||||
_ <- renderFoldable pdata $ picToLTree (Just 0) (foregroundPics w)
|
||||
|
||||
depthMask $= Enabled
|
||||
|
||||
-- draw the fbo to the screen
|
||||
-- allows for post-processing
|
||||
-- first, bind the screen fbo
|
||||
@@ -107,6 +122,7 @@ doDrawing pdata w = do
|
||||
bindShaderBuffers [_grayscaleShader pdata] [4]
|
||||
drawShader (_grayscaleShader pdata) 4
|
||||
blend $= Enabled
|
||||
|
||||
-- reset the coordinate uniforms for pictures that are drawn wrt to window
|
||||
-- coordinates
|
||||
resetShaderUniforms (map extractProgAndUnis $ _pictureShaders pdata)
|
||||
|
||||
Reference in New Issue
Block a user