Graphic tweaks/cleanup

This commit is contained in:
2025-12-01 12:37:54 +00:00
parent 1635ce0176
commit 25efce7a89
8 changed files with 116 additions and 146 deletions
+16 -43
View File
@@ -5,8 +5,6 @@
-}
module Framebuffer.Update (sizeFBOs) where
import Control.Lens
import Control.Monad
import Data.Preload.Render
import Dodge.Data.Config
import Dodge.WindowSize
@@ -51,14 +49,15 @@ sizeFBOs cfig rdata =
GL_NEAREST
GL_NEAREST
GL_RGBA16F
-- [fboBloom] -- fboPos probably doesn't need the alpha channel
)
>>= foldUpdateFBOTO
_gr_world_res
GL_NEAREST
GL_NEAREST
GL_RGBA8
[fboLighting]
>>= fboLighting
( resizeFBOTO'
(getWindowSize _gr_world_res cfig)
1
GL_NEAREST
GL_NEAREST
GL_RGBA8
)
>>= fboBloom
( resizeFBOTO'
(getWindowSize _gr_world_res cfig)
@@ -82,18 +81,14 @@ sizeFBOs cfig rdata =
GL_LINEAR
GL_RGBA16F
)
-- >>= foldUpdateFBOTO
-- _gr_downsize_res
-- GL_LINEAR_MIPMAP_LINEAR
-- GL_LINEAR
-- GL_RGBA16F
-- [fboHalf]
>>= foldUpdateFBOTO
(const SixteenthRes)
GL_LINEAR_MIPMAP_LINEAR
GL_LINEAR
GL_RGBA16F
[fboQuarter]
>>= fboQuarter
( resizeFBOTO'
(getWindowSize (const SixteenthRes) cfig)
1
GL_LINEAR_MIPMAP_LINEAR
GL_LINEAR
GL_RGBA16F
)
>>= fboWindow
( resizeFBOTO2
(getWindowSize _gr_world_res cfig)
@@ -102,32 +97,10 @@ sizeFBOs cfig rdata =
GL_RGBA8
GL_RGBA8
)
where
updateFBOTO' f = updateFBOTO (getWindowSize f cfig)
foldUpdateFBOTO f minfilt magfilt form =
ffoldM (updateFBOTO' f minfilt magfilt form)
ffoldM :: (Foldable t, Monad m) => (a1 -> a2 -> m a1) -> t a2 -> a1 -> m a1
ffoldM f = flip $ foldM f
resizeRBO :: GLuint -> GLsizei -> GLsizei -> IO ()
resizeRBO rboName = glNamedRenderbufferStorage rboName GL_DEPTH24_STENCIL8
updateFBOTO ::
V2 Int ->
-- | minification filter
GLenum ->
-- | magnification filter
GLenum ->
-- | internal color format
GLenum ->
RenderData ->
ALens' RenderData (FBO, TO) ->
IO RenderData
updateFBOTO wsize minfilt magfilt form pdata target = do
newfbo2 <- resizeFBOTO wsize minfilt magfilt form (pdata ^# target)
return $ storing target newfbo2 pdata
resizeFBOTO2 ::
V2 Int ->
-- | minification filter