Working shadows on clouds
This commit is contained in:
+37
-30
@@ -101,6 +101,7 @@ doDrawing pdata w = do
|
||||
renderLayer 3 shadV layerCounts
|
||||
depthMask $= Enabled
|
||||
renderLayer 1 shadV layerCounts
|
||||
|
||||
--setup downscale viewport for blurring bloom
|
||||
viewport $= (Position 0 0
|
||||
, divideSize (2 * (w ^. config . shadow_resolution)) $ Size (round $ fstV2 wins) (round $ sndV2 wins))
|
||||
@@ -114,32 +115,52 @@ doDrawing pdata w = do
|
||||
viewport $= (Position 0 0
|
||||
, divideSize (w ^. config . shadow_resolution) $ Size (round $ fstV2 wins) (round $ sndV2 wins))
|
||||
|
||||
--draw lightmap for base buffer
|
||||
bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
|
||||
createLightMap pdata lightPoints nWalls nSils nCaps
|
||||
createLightMap pdata lightPoints nWalls nSils nCaps (snd $ snd $ _fboBase pdata)
|
||||
colorMask $= Color4 Enabled Enabled Enabled Enabled
|
||||
clearColor $= Color4 0 0 0 0
|
||||
|
||||
bindFramebuffer Framebuffer $= fst (_fboColor pdata)
|
||||
--apply lightmap to base buffer
|
||||
bindFramebuffer Framebuffer $= fst (_fboBase pdata)
|
||||
textureBinding Texture2D $= Just (snd $ _fboLighting pdata)
|
||||
blend $= Enabled
|
||||
blendFunc $= (Zero, OneMinusSrcColor)
|
||||
drawShader (_fullscreenShader pdata) 4
|
||||
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
|
||||
|
||||
--draw clouds
|
||||
bindFramebuffer Framebuffer $= fst (_fboCloud pdata)
|
||||
depthFunc $= Just Lequal
|
||||
depthMask $= Disabled
|
||||
--blendFuncSeparate $= ((OneMinusDstAlpha,OneMinusSrcAlpha),(One,OneMinusSrcAlpha))
|
||||
--blendFunc $= (One,OneMinusSrcAlpha)
|
||||
--blendFunc $= (SrcAlpha,One)
|
||||
--blendFunc $= (SrcAlphaSaturate,One)
|
||||
--blendFunc $= (SrcAlphaSaturate,OneMinusSrcAlpha)
|
||||
blendColor $= Color4 1 1 1 0.80
|
||||
blendFuncSeparate $= ((SrcAlphaSaturate,One),(ConstantAlpha,ConstantAlpha))
|
||||
--blendFunc $= (SrcAlphaSaturate,SrcAlphaSaturate)
|
||||
clearColor $= Color4 0.5 0.5 0.5 0
|
||||
clear [ColorBuffer]
|
||||
blendFunc $= (SrcAlpha,OneMinusSrcAlpha)
|
||||
--blendFunc $= (SrcAlphaSaturate,One)
|
||||
blendFuncSeparate $= ((SrcAlpha,OneMinusSrcAlpha),(One,OneMinusSrcAlpha))
|
||||
--blendFuncSeparate $= ((SrcAlphaSaturate,OneMinusSrcAlpha),(One,OneMinusSrcAlpha))
|
||||
drawBuffers $= [FBOColorAttachment 0,NoBuffers]
|
||||
clear [ColorBuffer]
|
||||
renderLayer 2 shadV layerCounts
|
||||
renderWindows pdata windowPoints
|
||||
clearColor $= Color4 0 0 0 0
|
||||
|
||||
----render transparency depths
|
||||
depthMask $= Enabled
|
||||
blend $= Disabled
|
||||
drawBuffers $= [NoBuffers,FBOColorAttachment 1]
|
||||
renderLayer 2 shadV layerCounts
|
||||
renderWindows pdata windowPoints
|
||||
depthMask $= Disabled
|
||||
blend $= Enabled
|
||||
|
||||
----draw lightmap for cloud buffer
|
||||
bindFramebuffer Framebuffer $= fst (_fboLighting pdata)
|
||||
createLightMap pdata lightPoints nWalls nSils nCaps (snd $ snd $ _fboCloud pdata)
|
||||
colorMask $= Color4 Enabled Enabled Enabled Enabled
|
||||
clearColor $= Color4 0 0 0 0
|
||||
|
||||
--apply lightmap to cloud buffer
|
||||
clearColor $= Color4 0 0 0 0
|
||||
bindFramebuffer Framebuffer $= fst (_fboCloud pdata)
|
||||
depthMask $= Disabled
|
||||
drawBuffers $= [FBOColorAttachment 0,NoBuffers]
|
||||
depthFunc $= Just Always
|
||||
textureBinding Texture2D $= Just (snd $ _fboLighting pdata)
|
||||
blend $= Enabled
|
||||
@@ -147,34 +168,20 @@ doDrawing pdata w = do
|
||||
blendFuncSeparate $= ((Zero, OneMinusSrcColor),(Zero, One))
|
||||
drawShader (_fullscreenShader pdata) 4
|
||||
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
|
||||
-- renderLayer 4 shadV layerCounts
|
||||
-- renderLayer 5 shadV layerCounts
|
||||
|
||||
--blend $= Disabled
|
||||
depthMask $= Disabled
|
||||
depthFunc $= Just Always
|
||||
|
||||
--Draw blurred bloom onto base buffer
|
||||
bindFramebuffer Framebuffer $= fst (_fboBase pdata)
|
||||
--drawShader (_fullscreenShader pdata) 4
|
||||
--textureBinding Texture2D $= Just (snd3 $ _fbo2 pdata)
|
||||
textureBinding Texture2D $= Just (snd $ _fboLighting pdata)
|
||||
blend $= Enabled
|
||||
--blendFunc $= (Zero, OneMinusSrcAlpha)
|
||||
blendFunc $= (Zero, OneMinusSrcColor)
|
||||
drawShader (_fullscreenShader pdata) 4
|
||||
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
|
||||
|
||||
--drawShader (_colorBlurShader pdata) 4
|
||||
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
|
||||
|
||||
textureBinding Texture2D $= Just (snd $ _fboColor pdata)
|
||||
textureBinding Texture2D $= Just (fst $ snd $ _fboCloud pdata)
|
||||
drawShader (_fullscreenShader pdata) 4
|
||||
--renderLayer 2 shadV layerCounts
|
||||
depthFunc $= Just Lequal
|
||||
|
||||
viewport $= (Position 0 0, Size (round $ fstV2 wins) (round $ sndV2 wins))
|
||||
|
||||
Reference in New Issue
Block a user