Add num_shadow_casters graphics parameter, allow cycle down enum options

This commit is contained in:
2023-02-26 23:38:58 +00:00
parent bf1bd5bb0b
commit 6b0f78d4eb
9 changed files with 203 additions and 151 deletions
+3 -3
View File
@@ -63,14 +63,14 @@ createLightMap pdata lightPoints nWalls nSils nCaps drawObjShads toPos drawCPUSh
-- to consider: adding normals/a "material" for each fragment
blendFunc $= (Zero, OneMinusSrcColor)
stencilTest $= Enabled
stencilOpSeparate Front $= (OpKeep, OpKeep, OpIncrWrap)
stencilOpSeparate Back $= (OpKeep, OpKeep, OpDecrWrap)
flip VFSM.mapM_ (VFSM.fromList lightPoints) $ \(V3 x y z, rad, V3 r g b) -> do
depthFunc $= Just Less
-- setup stencil
colorMask $= Color4 Disabled Disabled Disabled Disabled
clear [StencilBuffer]
cullFace $= Nothing
stencilOpSeparate Front $= (OpKeep, OpKeep, OpIncrWrap)
stencilOpSeparate Back $= (OpKeep, OpKeep, OpDecrWrap)
stencilFunc $= (Always, 0, 255)
--draw wall shadows
currentProgram $= Just (_shadProg lwallShad)
@@ -110,7 +110,7 @@ createLightMap pdata lightPoints nWalls nSils nCaps drawObjShads toPos drawCPUSh
-- bind world position texture
bindTO toPos
colorMask $= Color4 Enabled Enabled Enabled Enabled
stencilOp $= (OpKeep, OpKeep, OpKeep)
--stencilOp $= (OpKeep, OpKeep, OpKeep)
stencilFunc $= (Equal, 0, 255)
currentProgram $= ltextShad ^? shadProg --Just (_shadProg ltextShad)
uniform (_shadUnis ltextShad V.! 0) $= Vector3 x y z