To openglraw
This commit is contained in:
+13
-13
@@ -156,14 +156,14 @@ doDrawing win pdata u = do
|
||||
--textureBinding Texture2D $= pdata ^? fboLighting . _2 -- Just (snd $ _fboLighting pdata)
|
||||
glBindTexture GL_TEXTURE_2D (pdata ^. fboLighting . _2 . unTO) -- Just (snd $ _fboLighting pdata)
|
||||
glEnable GL_BLEND
|
||||
blendFunc $= (Zero, OneMinusSrcColor)
|
||||
glBlendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
|
||||
drawShader (_fullscreenShader pdata) 4
|
||||
--draw bloom onto bloom buffer
|
||||
--bindFramebuffer Framebuffer $= pdata ^. fboBloom . _1 --fst (_fboBloom pdata)
|
||||
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboBloom . _1 . unFBO)
|
||||
glClear GL_COLOR_BUFFER_BIT
|
||||
glDepthFunc GL_LESS
|
||||
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
glDepthMask GL_FALSE
|
||||
renderLayer BloomNoZWrite shadV layerCounts
|
||||
glDepthMask GL_TRUE
|
||||
@@ -187,10 +187,10 @@ doDrawing win pdata u = do
|
||||
glDepthFunc GL_LEQUAL
|
||||
glDepthMask GL_FALSE
|
||||
glClearColor 0.5 0.5 0.5 0
|
||||
--blendFunc $= (SrcAlphaSaturate,One)
|
||||
--glBlendFunc GL_SRC_ALPHASaturate,One)
|
||||
--blendColor $= Color4 0.5 0.5 0.5 0.5
|
||||
--blendFuncSeparate $= ((SrcAlphaSaturate,One) , (One,OneMinusSrcAlpha))
|
||||
blendFuncSeparate $= ((SrcAlpha, OneMinusSrcAlpha), (One, OneMinusSrcAlpha))
|
||||
--glBlendFuncSeparate GL_SRC_ALPHASaturate,One) , (One,GL_ONE_MINUS_SRC_ALPHA))
|
||||
glBlendFuncSeparate GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA GL_ONE GL_ONE_MINUS_SRC_ALPHA
|
||||
drawBuffers $= [FBOColorAttachment 0, NoBuffers]
|
||||
glClear GL_COLOR_BUFFER_BIT
|
||||
renderLayer MidLayer shadV layerCounts
|
||||
@@ -230,20 +230,20 @@ doDrawing win pdata u = do
|
||||
--textureBinding Texture2D $= Just (snd $ _fboLighting pdata)
|
||||
glBindTexture GL_TEXTURE_2D (_unTO . snd $ _fboLighting pdata)
|
||||
glEnable GL_BLEND
|
||||
--blendFunc $= (Zero, OneMinusSrcAlpha)
|
||||
blendFuncSeparate $= ((Zero, OneMinusSrcColor), (Zero, One))
|
||||
--glBlendFunc GL_ZERO, GL_ONE_MINUS_SRC_ALPHA)
|
||||
glBlendFuncSeparate GL_ZERO GL_ONE_MINUS_SRC_COLOR GL_ZERO GL_ONE
|
||||
drawShader (_fullscreenShader pdata) 4
|
||||
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
-- bind base buffer for drawing bloom then clouds
|
||||
--bindFramebuffer Framebuffer $= fst (_fboBase pdata)
|
||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboBase pdata)))
|
||||
--Draw blurred bloom onto base buffer
|
||||
glEnable GL_BLEND
|
||||
blendFunc $= (SrcAlpha, One)
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE
|
||||
--textureBinding Texture2D $= Just (snd $ _fboHalf1 pdata)
|
||||
glBindTexture GL_TEXTURE_2D (_unTO . snd $ _fboHalf1 pdata)
|
||||
drawShader (_fullscreenShader pdata) 4
|
||||
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
--draw shadowed clouds onto base buffer
|
||||
--textureBinding Texture2D $= Just (fst $ snd $ _fboCloud pdata)
|
||||
glBindTexture GL_TEXTURE_2D (_unTO . fst . snd $ _fboCloud pdata)
|
||||
@@ -251,7 +251,7 @@ doDrawing win pdata u = do
|
||||
--set viewport for radial distortion
|
||||
setViewportSize (round winx) (round winy)
|
||||
glDepthFunc GL_ALWAYS
|
||||
blendFunc $= (One, Zero)
|
||||
glBlendFunc GL_ONE GL_ZERO
|
||||
-- perform any radial distortion
|
||||
case w ^. cWorld . lWorld . distortions of
|
||||
[] -> do
|
||||
@@ -276,13 +276,13 @@ doDrawing win pdata u = do
|
||||
activeTexture $= TextureUnit 0
|
||||
glDepthFunc GL_ALWAYS
|
||||
glEnable GL_BLEND
|
||||
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
renderLayer DebugLayer shadV layerCounts
|
||||
-- draw overlay
|
||||
glDepthFunc GL_ALWAYS
|
||||
glDepthMask GL_FALSE
|
||||
glEnable GL_BLEND
|
||||
blendFunc $= (SrcAlpha, OneMinusSrcAlpha)
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
bufferUBO $ isoMatrix 0 1 (V2 0 0) (V2 2 2)
|
||||
renderLayer FixedCoordLayer shadV layerCounts
|
||||
renderFoldable shadV $ fixedCoordPictures u
|
||||
|
||||
Reference in New Issue
Block a user