Add MatrixHelper folder

This commit is contained in:
jgk
2021-03-19 21:54:34 +01:00
parent bd7a5c3533
commit 598061d277
3 changed files with 81 additions and 34 deletions
+7 -7
View File
@@ -76,10 +76,12 @@ renderPicture' pdata rot zoom (tranx,trany) (winx,winy) wallPoints lightPoints
) :: IO (GLmatrix GLfloat)
uniform ( (fromJust $ _shaderCustomUnis $ _wallShadowShader pdata) !! 1)
$= pmat
cullFace $= Just Back
drawShader (_wallShadowShader pdata) nWalls
depthMask $= Disabled
blendFuncSeparate $= ((Zero,Zero),(Zero, OneMinusSrcAlpha))
blendFunc $= (Zero, OneMinusSrcAlpha)
-- blendFuncSeparate $= ((Zero,Zero),(Zero, OneMinusSrcAlpha))
stencilTest $= Enabled
forM_ lightPoints $ \(x,y,r,lum) -> do
-- depthFunc $= Just Less
@@ -91,13 +93,13 @@ renderPicture' pdata rot zoom (tranx,trany) (winx,winy) wallPoints lightPoints
-- currentProgram does get called twice: here and inside drawShader below
currentProgram $= Just (_shaderProgram $ _wallShadowShader pdata)
uniform (head $ fromJust $ _shaderCustomUnis $ _wallShadowShader pdata)
$= Vector2 (x) (y)
$= Vector2 x y
-- blendFunc $= (Zero,One)
drawShader (_wallShadowShader pdata) nWalls
cullFace $= Just Front
stencilOp $= (OpKeep,OpKeep,OpDecr)
drawShader (_wallShadowShader pdata) nWalls
-- cullFace $= Just Front
-- stencilOp $= (OpKeep,OpKeep,OpDecr)
-- drawShader (_wallShadowShader pdata) nWalls
cullFace $= Nothing
@@ -107,9 +109,7 @@ renderPicture' pdata rot zoom (tranx,trany) (winx,winy) wallPoints lightPoints
zTran (a,b) = (a*2*zoom / winx, b*2*zoom / winy)
pokeFourOff lightPtr 0 (x',y',r,lum)
bindShaderBuffers [_lightSourceShader pdata] [1]
stencilFunc $= (Equal, 0, 255)
-- depthFunc $= Just Always
drawShader (_lightSourceShader pdata) 1
-- currentProgram $= Just (_shaderProgram $ _wallLightShader pdata)