Move towards attaching a position texture to base framebuffer

This commit is contained in:
2021-08-31 22:25:37 +01:00
parent cf77163b3f
commit 2d139adc8f
5 changed files with 69 additions and 11 deletions
+6 -4
View File
@@ -19,6 +19,7 @@ import Shader.Data
import MatrixHelper
--import Polyhedra.Data
import Polyhedra
import Tuple
import Foreign
--import Control.Applicative
@@ -59,8 +60,9 @@ doDrawing pdata w = do
-- poke foreground geometry and floor
let addC (V2 xx yy) = V3 xx yy 0
nsurfVs <- pokePoint3s (shadVBOptr $ _lightingSurfaceShader pdata)
$ youBox w
++ concatMap polyToGeoRender (foregroundPics w)
$
--youBox w ++
concatMap polyToGeoRender (foregroundPics w)
++ polyToTris (map addC $ screenPolygon w)
-- bind wall points, silhouette data, surface geometry
uncurry bindShaderBuffers $ unzip
@@ -187,7 +189,7 @@ doDrawing pdata w = do
-- perform any radial distortion
case _radDistortion w of
[] -> do
bindTO $ snd $ _fboBase pdata
bindTO $ fst $ snd $ _fboBase pdata
bindFramebuffer Framebuffer $= defaultFramebufferObject
--bufferUBO $ perspectiveMatrixb rot camzoom trans wins viewFroms
drawShader (_fullscreenShader pdata) 4
@@ -200,7 +202,7 @@ doDrawing pdata w = do
drawShader (_barrelShader pdata) 1
fboList = take (length rds - 1) (concat (repeat [fst $ _fbo2 pdata,fst $ _fbo3 pdata]))
++ [defaultFramebufferObject]
toList = snd (_fboBase pdata) : concat (repeat [snd $ _fbo2 pdata,snd $ _fbo3 pdata])
toList = fst (snd (_fboBase pdata)) : concat (repeat [snd $ _fbo2 pdata,snd $ _fbo3 pdata])
bindings = zipWith (>>) (map bindFBO fboList) (map bindTO toList)
activeTexture $= TextureUnit 1
zipWithM_ (>>) bindings $ map bindDrawDist rds