Fix remote camera bug

This commit is contained in:
2021-08-27 12:45:52 +01:00
parent 3ff04576ab
commit 832232fef6
7 changed files with 70 additions and 21 deletions
+13 -2
View File
@@ -45,7 +45,8 @@ doDrawing pdata w = do
wins = V2 (getWindowX w) (getWindowY w)
(wallPointsCol,windowPoints) = wallsAndWindows w
lightPoints = lightsForGloom w
viewFroms = _cameraViewFrom w
viewFroms@(V2 vfx vfy) = _cameraViewFrom w
viewFrom3d = Vector3 vfx vfy 20
shadV = _pictureShaders pdata
-- bind as much data into vbos as feasible at this point
-- poke wall points and colors
@@ -72,10 +73,20 @@ doDrawing pdata w = do
clear [ColorBuffer,DepthBuffer]
depthFunc $= Just Less
-- draw wall occlusions from your point of view
-- draw wall occlusions from the camera's point of view
currentProgram $= Just (_shaderProgram $ _lightingSurfaceShader pdata)
uniform (head $ _shaderCustomUnis $ _lightingSurfaceShader pdata)
$= viewFrom3d
currentProgram $= Just (_shaderProgram $ _lightingOccludeShader pdata)
uniform (head $ _shaderCustomUnis $ _lightingOccludeShader pdata)
$= viewFrom3d
currentProgram $= Just (_shaderProgram $ _lightingWallShader pdata)
uniform (head $ _shaderCustomUnis $ _lightingWallShader pdata)
$= viewFrom3d
drawShader (_lightingOccludeShader pdata) nWalls
-- this might only work because the uniform has been correctly set
-- elsewhere, beware
-- indeed this is the case: this needs fixing
if w ^. config . wall_textured
then renderTextureWalls pdata nWalls