Implement foreground correctly, not with shadows though

This commit is contained in:
2021-06-10 13:53:03 +02:00
parent 21a4393ad9
commit aa30f6b969
7 changed files with 34 additions and 74 deletions
+6 -14
View File
@@ -11,17 +11,19 @@ import Dodge.Base
--import Dodge.Render.HUD
--import Dodge.Render.MenuScreen
import Dodge.Render.Picture
import Dodge.Render.PerspectiveMatrix
--import Dodge.Render.PerspectiveMatrix
import Geometry
--import Picture
import Picture.Render
import Picture.Preload
import Shader
import MatrixHelper
import Foreign (Word32)
--import Control.Applicative
--import Control.Monad.State
import Control.Lens
import Control.Monad
import qualified Control.Foldl as F
import Data.Tuple.Extra
import Data.Maybe
@@ -89,20 +91,10 @@ doDrawing pdata w = do
-- 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
forM_ (_pictureShaders pdata) $ setPerpMatUniform rot camzoom trans wins viewFroms
depthFunc $= Just Lequal
_ <- renderFoldable pdata $ picToLTree (Just 0) (foregroundPics w)
-- draw the fbo to the screen
-- allows for post-processing