Downsample when blurring bloom

This commit is contained in:
2021-08-20 04:14:59 +02:00
parent 6933d610cd
commit 3707716569
4 changed files with 25 additions and 16 deletions
+7 -5
View File
@@ -104,21 +104,21 @@ doDrawing pdata w = do
renderLayer 5 shadV layerCounts
depthMask $= Enabled
-- this is not ideal if the original is not divisible by 2
viewport $= (Position 0 0
, divideSize (2 * (w ^. config . shadow_resolution)) $ Size (round $ fstV2 wins) (round $ sndV2 wins))
bindFramebuffer Framebuffer $= fst (_fboFourth1 pdata)
--viewport $= (Position 0 0, Size 300 300)
depthFunc $= Just Always
textureBinding Texture2D $= Just (snd $ _fboBloom pdata)
blend $= Disabled
drawShader (_bloomBlurShader pdata) 4
replicateM_ 3 $ pingPongBetween (_fboFourth1 pdata) (_fboFourth2 pdata) (_bloomBlurShader pdata)
-- viewport $= (Position 0 0, Size (round $ fstV2 wins) (round $ sndV2 wins))
blend $= Enabled
viewport $= (Position 0 0
, divideSize (w ^. config . shadow_resolution) $ Size (round $ fstV2 wins) (round $ sndV2 wins))
bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
--viewport $= (Position 0 0
-- , divideSize (w ^. config . shadow_resolution) $ Size (round $ fstV2 wins) (round $ sndV2 wins))
createLightMap pdata lightPoints nWalls nSils nsurfVs
--viewport $= (Position 0 0, Size (round $ fstV2 wins) (round $ sndV2 wins))
colorMask $= Color4 Enabled Enabled Enabled Enabled
clearColor $= Color4 0 0 0 0
@@ -138,8 +138,10 @@ doDrawing pdata w = do
textureBinding Texture2D $= Just (snd $ _fboColor pdata)
drawShader (_colorBlurShader pdata) 4
--textureBinding Texture2D $= Just (snd3 $ _fbo2 pdata)
--blendFunc $= (SrcAlpha, One)
textureBinding Texture2D $= Just (snd $ _fboFourth1 pdata)
drawShader (_fullscreenShader pdata) 4
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
textureBinding Texture2D $= Just (snd $ _fboBloom pdata)
drawShader (_fullscreenShader pdata) 4