Work on transparency of windows/clouds
This commit is contained in:
+20
-14
@@ -308,7 +308,9 @@ doDrawing' win pdata u = do
|
||||
glDepthFunc GL_LEQUAL
|
||||
glDepthMask GL_FALSE
|
||||
glEnable GL_BLEND
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE
|
||||
--glBlendFunc GL_SRC_ALPHA GL_ONE
|
||||
glBindTextureUnit 3 (pdata ^. fboPos . _2 . unTO)
|
||||
glBlendFunc GL_ONE_MINUS_DST_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
glUseProgram $ pdata ^. windowPullShader
|
||||
glBindVertexArray $ pdata ^. dummyVAO
|
||||
glDrawArrays GL_TRIANGLES 0 (fromIntegral nWins * 6)
|
||||
@@ -327,22 +329,26 @@ doDrawing' win pdata u = do
|
||||
glUseProgram (pdata ^. fullscreenShader)
|
||||
glDrawArrays GL_TRIANGLES 0 6
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
|
||||
-- bind base buffer for drawing clouds and bloom
|
||||
--
|
||||
glBindFramebuffer GL_FRAMEBUFFER (pdata ^. fboBase . _1 . unFBO)
|
||||
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
-- --draw windows onto base buffer
|
||||
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
glBindTextureUnit 0 (pdata ^. fboWindow . _2 . _1 . unTO)
|
||||
glBindTextureUnit 1 (pdata ^. fboWindow . _2 . _2 . unTO)
|
||||
glBindTextureUnit 2 (pdata ^. fboCloud . _2 . _1 . unTO)
|
||||
glBindTextureUnit 3 (pdata ^. fboPos . _2 . unTO)
|
||||
|
||||
--drawShader (_transparencyCompShader pdata) 4
|
||||
glUseProgram (pdata ^. transparencyCompShader)
|
||||
glUseProgram (pdata ^. fullscreenShader)
|
||||
glBindTextureUnit 0 (pdata ^. fboWindow . _2 . _2 . unTO)
|
||||
glDrawArrays GL_TRIANGLES 0 6
|
||||
glBindTextureUnit 0 (pdata ^. fboCloud . _2 . _1 . unTO)
|
||||
glDrawArrays GL_TRIANGLES 0 6
|
||||
glBindTextureUnit 0 (pdata ^. fboWindow . _2 . _1 . unTO)
|
||||
glDrawArrays GL_TRIANGLES 0 6
|
||||
|
||||
-- -- --draw windows onto base buffer
|
||||
-- glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
|
||||
-- glBindTextureUnit 0 (pdata ^. fboWindow . _2 . _1 . unTO)
|
||||
-- glBindTextureUnit 1 (pdata ^. fboWindow . _2 . _2 . unTO)
|
||||
-- glBindTextureUnit 2 (pdata ^. fboCloud . _2 . _1 . unTO)
|
||||
-- glBindTextureUnit 3 (pdata ^. fboPos . _2 . unTO)
|
||||
--
|
||||
-- --drawShader (_transparencyCompShader pdata) 4
|
||||
-- glUseProgram (pdata ^. transparencyCompShader)
|
||||
-- glDrawArrays GL_TRIANGLES 0 6
|
||||
|
||||
--Draw blurred bloom onto base buffer
|
||||
glEnable GL_BLEND
|
||||
|
||||
Reference in New Issue
Block a user