Cleanup shaders

This commit is contained in:
2025-11-13 17:52:01 +00:00
parent 0ea7af4bdd
commit a7a11ccc03
12 changed files with 142 additions and 205 deletions
+33 -21
View File
@@ -20,20 +20,29 @@ import Unsafe.Coerce
sizeFBOs :: Config -> RenderData -> IO RenderData
sizeFBOs cfig rdata =
uncurry (resizeRBO (_rboBaseBloom rdata)) (getWindowSize _gr_world_res cfig)
>> foldM
( uncurry
updateFBOTO3
(getWindowSize _gr_world_res cfig)
GL_NEAREST
GL_NEAREST
GL_RGBA8
GL_RGBA16F -- could possibly recover using depth in a clever way
-- but probably not, because the projection matrix is
-- not always on-center
GL_RGBA16F -- make this smaller?
)
>> uncurry
updateFBOTO3
(getWindowSize _gr_world_res cfig)
GL_NEAREST
GL_NEAREST
GL_RGBA8
GL_RGBA16F -- could possibly recover using depth in a clever way
-- but probably not, because the projection matrix is
-- not always on-center
GL_RGBA16F -- make this smaller?
rdata
[fboBase, fboCloud]
fboBase
>>= flip
( uncurry
updateFBOTO3
(getWindowSize _gr_world_res cfig)
GL_NEAREST
GL_NEAREST
GL_RGBA8
GL_RGBA16F
GL_RGBA16F
)
fboCloud
>>= foldUpdateFBOTO
_gr_world_res
GL_NEAREST
@@ -58,12 +67,15 @@ sizeFBOs cfig rdata =
GL_LINEAR
GL_RGBA16F
[fboHalf1, fboHalf2]
>>= flip (uncurry updateFBOTO2
(getWindowSize _gr_world_res cfig)
GL_NEAREST
GL_NEAREST
GL_RGBA8
GL_RGBA16F)
>>= flip
( uncurry
updateFBOTO2
(getWindowSize _gr_world_res cfig)
GL_NEAREST
GL_NEAREST
GL_RGBA8
GL_RGBA16F
)
fboWindow
where
updateFBOTO' f = uncurry updateFBOTO (getWindowSize f cfig)
@@ -202,8 +214,8 @@ resizeFBOTO (fbo, oldto) xsize ysize minfilt magfilt form = do
checkFBO fbo
return (fbo, TO to1)
initializeTexture2D
:: FBO -> GLenum -> Int -> Int -> GLenum -> GLenum -> GLenum -> IO GLuint
initializeTexture2D ::
FBO -> GLenum -> Int -> Int -> GLenum -> GLenum -> GLenum -> IO GLuint
initializeTexture2D fbo attachpoint x y minfilt magfilt form = do
let xsize' = fromIntegral x
ysize' = fromIntegral y