From a2ad7c23ff7e158695afd6516a194fa24314d075 Mon Sep 17 00:00:00 2001 From: justin Date: Sun, 23 Apr 2023 15:18:48 +0100 Subject: [PATCH] Remove old instancing framebuffer --- src/Data/Preload/Render.hs | 2 +- src/Framebuffer/Update.hs | 40 -------------------------------------- src/Preload/Render.hs | 7 ++----- 3 files changed, 3 insertions(+), 46 deletions(-) diff --git a/src/Data/Preload/Render.hs b/src/Data/Preload/Render.hs index 5a7c679d0..08eb228d3 100644 --- a/src/Data/Preload/Render.hs +++ b/src/Data/Preload/Render.hs @@ -35,7 +35,7 @@ data RenderData = RenderData , _fboBloom :: (FBO, TO) , _fboPos :: (FBO, TO) , _fboLighting :: (FBO, TO) - , _fboShadow :: (FBO, (TO, TO)) +-- , _fboShadow :: (FBO, (TO, TO)) , _rboBaseBloom :: GLuint -- RenderbufferObject id , _matUBO :: GLuint -- BufferObject id -- , _orthonormalMatUBO :: GLuint -- BufferObject id diff --git a/src/Framebuffer/Update.hs b/src/Framebuffer/Update.hs index 6e9378a56..c8c080569 100644 --- a/src/Framebuffer/Update.hs +++ b/src/Framebuffer/Update.hs @@ -61,7 +61,6 @@ sizeFBOs cfig rdata = GL_LINEAR GL_RGBA16F [fboHalf1, fboHalf2] - >>= resizeShadowFBO' cfig where updateFBOTO' f = uncurry @@ -149,33 +148,6 @@ updateFBOTO3 xsize ysize minfilt magfilt inFormat1 inFormat2 inFormat3 pdata tar newfbo2 <- resizeFBOTO3 (pdata ^# target) xsize ysize minfilt magfilt inFormat1 inFormat2 inFormat3 return $ storing target newfbo2 pdata -resizeShadowFBO' :: Configuration -> RenderData -> IO RenderData -resizeShadowFBO' cfig = fboShadow (uncurry resizeShadowFBO (getWindowSize _graphics_world_resolution cfig)) - --- note we only really "change" the texture objects -resizeShadowFBO :: - Int -> - Int -> - (FBO, (TO, TO)) -> - IO (FBO, (TO, TO)) -resizeShadowFBO x y (fbo, (oldto1, oldto2)) = do - glBindFramebuffer GL_FRAMEBUFFER (_unFBO fbo) - mglDelete glDeleteTextures $ _unTO oldto1 - mglDelete glDeleteTextures $ _unTO oldto2 - to1 <- initializeTexture2DArray fbo GL_COLOR_ATTACHMENT0 x y 20 GL_NEAREST GL_NEAREST GL_RGBA8 - to2 <- - initializeTexture2DArray - fbo - GL_DEPTH_STENCIL_ATTACHMENT - x - y - 20 - GL_NEAREST - GL_NEAREST - GL_DEPTH24_STENCIL8 - checkFBO fbo - return (fbo, (TO to1, TO to2)) - --resizeFBOTO2 :: -- (FBO, (TO, TO)) -> -- Int -> @@ -257,18 +229,6 @@ initializeTexture2D fbo attachpoint x y minfilt magfilt informat = do glNamedFramebufferTexture (_unFBO fbo) attachpoint to1 0 return to1 -initializeTexture2DArray :: FBO -> GLenum -> Int -> Int -> Int -> GLenum -> GLenum -> GLenum -> IO GLuint -initializeTexture2DArray fbo attachpoint x y z minfilt magfilt informat = do - let xsize = fromIntegral x - ysize = fromIntegral y - zsize = fromIntegral z - to1 <- mglCreate (glCreateTextures GL_TEXTURE_2D_ARRAY) - glTextureStorage3D to1 1 informat xsize ysize zsize - glTextureParameteri to1 GL_TEXTURE_MIN_FILTER (unsafeCoerce minfilt) - glTextureParameteri to1 GL_TEXTURE_MAG_FILTER (unsafeCoerce magfilt) - glNamedFramebufferTexture (_unFBO fbo) attachpoint to1 0 - return to1 - --getWindowSize :: Integral a => (Configuration -> ResFactor) -> Configuration -> (a, a) --getWindowSize f cfig = (g _windowX, g _windowY) -- where diff --git a/src/Preload/Render.hs b/src/Preload/Render.hs index 8ba52be29..edd55624f 100644 --- a/src/Preload/Render.hs +++ b/src/Preload/Render.hs @@ -149,8 +149,6 @@ preloadRender = do fboPosName <- setupFramebufferGivenStencil rboBaseBloomName fboLightingName <- setupFramebufferGivenStencil rboBaseBloomName - fboShadowName <- setupShadowFramebuffer - fboHalf1Name <- newTextureFramebuffer fboHalf2Name <- newTextureFramebuffer @@ -191,15 +189,14 @@ preloadRender = do , _fboHalf1 = fboHalf1Name , _fboHalf2 = fboHalf2Name , _fboLighting = fboLightingName - , _fboShadow = fboShadowName +-- , _fboShadow = fboShadowName , _fboBase = fboBaseName , _fboCloud = fboCloudName , _fboBloom = fboBloomName , _fboPos = fboPosName , _rboBaseBloom = rboBaseBloomName , _matUBO = theUBO - , -- , _orthonormalMatUBO = orthonormalUBO - _lightsUBO = lightsubo + , _lightsUBO = lightsubo , _vboWindows = winvbo , _vboShapes = shVBO , _floorVBO = floorvbo