Experiment with bloom

This commit is contained in:
jgk
2021-07-05 19:39:34 +02:00
parent 2d94e50e3a
commit 77d93fabeb
6 changed files with 93 additions and 10 deletions
+17 -2
View File
@@ -77,8 +77,22 @@ doDrawing pdata w = do
_ <- renderFoldable pdata $ picToLTree (Just 3) pic
_ <- renderFoldable pdata $ picToLTree (Just 4) pic
_ <- renderFoldable pdata $ picToLTree (Just 5) pic
depthMask $= Enabled
bindFramebuffer Framebuffer $= (fst3 $ _fbo3 pdata)
clear [ColorBuffer]
bindFramebuffer Framebuffer $= (fst3 $ _fbo2 pdata)
depthFunc $= Just Always
--blend $= Disabled
textureBinding Texture2D $= Just (snd $ _fboBloom pdata)
clear [ColorBuffer]
--blendFunc $= (SrcAlpha,OneMinusSrcAlpha)
blendFunc $= (One,Zero)
bindShaderBuffers [_boxBlurShader pdata] [4]
drawShader (_boxBlurShader pdata) 4
pingPongBlur pdata
--blend $= Enabled
blendFunc $= (SrcAlpha,OneMinusSrcAlpha)
bindFramebuffer Framebuffer $= (fst $ _fboLighting pdata)
let scPol = screenPolygon w
@@ -106,7 +120,8 @@ doDrawing pdata w = do
blendFunc $= (Zero, OneMinusSrcAlpha)
drawShader (_fullscreenShader pdata) 4
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
textureBinding Texture2D $= Just (snd $ _fboBloom pdata)
--textureBinding Texture2D $= Just (snd $ _fboBloom pdata)
textureBinding Texture2D $= Just (snd3 $ _fbo2 pdata)
drawShader (_fullscreenShader pdata) 4
depthFunc $= Just Lequal