Add hard edge to non-visible areas

This commit is contained in:
2021-06-30 13:52:14 +02:00
parent 1cfd1663d1
commit 532f491327
10 changed files with 68 additions and 56 deletions
+9 -1
View File
@@ -11,7 +11,7 @@ import Dodge.Base
--import Dodge.Render.MenuScreen
import Dodge.Render.Picture
--import Dodge.Render.PerspectiveMatrix
import Geometry
--import Geometry
import Geometry.Data
--import Picture
import Render
@@ -67,6 +67,14 @@ doDrawing pdata w = do
createLightMap pdata (w ^. config . shadow_resolution) wallPoints lightPoints viewFroms
(foregroundPics w) scPol
clear [DepthBuffer]
nWalls <- F.foldM (pokeShader $ _lightingOccludeShader pdata) (map Render22 wallPoints)
bindShaderBuffers [_lightingOccludeShader pdata] [nWalls]
currentProgram $= Just (_shaderProgram $ _lightingOccludeShader pdata)
uniform (head $ _shaderCustomUnis $ _lightingOccludeShader pdata)
$= Vector2 viewFromx viewFromy
drawShader (_lightingOccludeShader pdata) nWalls
depthFunc $= Just Less
-- set blending to depend upon the alpha level already present
blendFuncSeparate $= ((SrcAlphaSaturate, OneMinusSrcAlpha), (Zero,One))