Implement textures on walls, windows don't look great yet

This commit is contained in:
jgk
2021-03-21 22:21:29 +01:00
parent e6c76da6b3
commit abd7cd7ea9
5 changed files with 29 additions and 11 deletions
+5 -4
View File
@@ -41,10 +41,10 @@ setCommonUniforms pdata rot zoom (tranx,trany) (winx,winy) = do
: (map extractProgAndUnis $ _listShaders pdata)
)
renderPicture' :: RenderData -> Float -> Float -> (Float,Float) -> (Float,Float) ->
[((Point2,Point2),Point4)] -> [Point4] ->
renderPicture' :: RenderData -> Float -> Float -> Point2 -> Point2 ->
[((Point2,Point2),Point4)] -> [((Point2,Point2),Point4)] -> [Point4] ->
(Float,Float) -> Picture -> IO (Word32,Word32)
renderPicture' pdata rot zoom trans@(tranx,trany) wins@(winx,winy) wallPointsCol lightPoints
renderPicture' pdata rot zoom trans@(tranx,trany) wins@(winx,winy) wallPointsCol windowPoints lightPoints
viewFroms@(viewFromx,viewFromy) pic = do
let wallPoints = map fst wallPointsCol
startTicks <- SDL.ticks
@@ -67,6 +67,8 @@ renderPicture' pdata rot zoom trans@(tranx,trany) wins@(winx,winy) wallPointsCol
renderWalls pdata wallPointsCol pmat
renderWalls pdata windowPoints pmat
-- reset blend so that light map doesn't apply
blendFunc $= (SrcAlpha,OneMinusSrcAlpha)
renderFoldable pdata $ picToLTree (Just 1) pic
@@ -120,7 +122,6 @@ createLightMap pdata rot zoom (tranx,trany) (winx,winy) wallPoints lightPoints
uniform ( (fromJust $ _shaderCustomUnis $ _wallShadowShader pdata) !! 2)
$= (0 :: Float)
cullFace $= Just Back
cullFace $= Nothing
drawShader (_wallShadowShader pdata) nWalls