Grayscale post processing
This commit is contained in:
+11
-6
@@ -141,7 +141,10 @@ createLightMap pdata resDiv wallPoints lightPoints (viewFromx,viewFromy) pmat =
|
||||
-- always want to draw lightmap
|
||||
depthFunc $= Just Always
|
||||
-- draw the lightmap on a full size fbo
|
||||
-- bindFramebuffer Framebuffer $= fst (_fbo3 pdata)
|
||||
-- clear [ColorBuffer,DepthBuffer]
|
||||
bindFramebuffer Framebuffer $= fst (_fbo2 pdata)
|
||||
-- clear [ColorBuffer,DepthBuffer]
|
||||
colorMask $= Color4 Disabled Disabled Disabled Enabled
|
||||
bindShaderBuffers [_boxBlurShader pdata] [4]
|
||||
textureBinding Texture2D $= Just (_fboTexture pdata)
|
||||
@@ -154,12 +157,14 @@ createLightMap pdata resDiv wallPoints lightPoints (viewFromx,viewFromy) pmat =
|
||||
-- ping pong blur between the two buffers as many times as desired
|
||||
replicateM_ 3 $ pingPongBlur pdata
|
||||
|
||||
-- draw the lightmap to the screen
|
||||
bindFramebuffer Framebuffer $= defaultFramebufferObject
|
||||
textureBinding Texture2D $= Just (snd $ _fbo2 pdata)
|
||||
textureFilter Texture2D $= ((Linear',Just Linear') , Linear')
|
||||
generateMipmap' Texture2D
|
||||
drawShader (_boxBlurShader pdata) 4
|
||||
---- draw the lightmap to the screen
|
||||
-- bindFramebuffer Framebuffer $= defaultFramebufferObject
|
||||
-- clear [DepthBuffer]
|
||||
-- textureBinding Texture2D $= Just (snd $ _fbo2 pdata)
|
||||
-- textureFilter Texture2D $= ((Linear',Just Linear') , Linear')
|
||||
-- generateMipmap' Texture2D
|
||||
-- bindShaderBuffers [_fullscreenShader pdata] [4]
|
||||
-- drawShader (_fullscreenShader pdata) 4
|
||||
|
||||
colorMask $= Color4 Enabled Enabled Enabled Enabled
|
||||
depthMask $= Enabled
|
||||
|
||||
Reference in New Issue
Block a user