To openglraw

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