Commit before static wall overhaul

This commit is contained in:
2021-07-19 01:33:52 +02:00
parent e657d8e852
commit 6905c6f154
17 changed files with 58 additions and 51 deletions
+9 -6
View File
@@ -54,19 +54,22 @@ doDrawing pdata w = do
viewFroms = _cameraViewFrom w
pic = worldPictures w
-- bind as much data into vbos as feasible at this point
-- bind wall points and colors to vbo
-- poke wall points and colors
nWalls <- F.foldM (pokeShader $ _wallTextureShader pdata) (map Render22x4 wallPointsCol)
bindShaderBuffers [_wallTextureShader pdata] [nWalls]
-- store foreground silhouette geometry into buffer
-- poke silhouette vertex data
nSils <- F.foldM (pokeShader $ _lightingLineShadowShader pdata)
(concatMap polyToRender (foregroundPics w))
bindShaderBuffers [_lightingLineShadowShader pdata] [nSils]
-- store foreground geometry and floor into buffer
-- poke foreground geometry and floor
let addC (xx,yy) = (xx,yy,0)
nsurfVs <- F.foldM (pokeShader (_lightingSurfaceShader pdata))
$ (Render3 $ polyToTris $ map addC $ screenPolygon w)
: concatMap polyToGeoRender (foregroundPics w)
bindShaderBuffers [_lightingSurfaceShader pdata] [nsurfVs]
-- bind wall points, silhouette data, surface geometry
uncurry bindShaderBuffers $ unzip
[ ( _wallTextureShader pdata, nWalls)
, (_lightingLineShadowShader pdata, nSils)
, (_lightingSurfaceShader pdata, nsurfVs)
]
-- set the coordinate uniform ready for drawing elements using world coordinates
bufferUBO $ perspectiveMatrixb rot camzoom trans wins viewFroms
bindFramebuffer Framebuffer $= fst (_fboBase pdata)