Play around with alpha blending

This commit is contained in:
2025-11-04 10:42:18 +00:00
parent 833d4562e2
commit 05c530eeb1
4 changed files with 30 additions and 36 deletions
+6 -2
View File
@@ -231,7 +231,9 @@ doDrawing' win pdata u = do
withArray [0, 0, 0, 0] $
glClearNamedFramebufferfv (pdata ^. fboBloom . _1 . unFBO) GL_COLOR 0
glDepthFunc GL_LESS
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
--glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
--glBlendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
glBlendFunc GL_ONE GL_ONE
glDepthMask GL_FALSE
renderLayer BloomNoZWrite shadV pokeCounts
glDepthMask GL_TRUE
@@ -271,6 +273,7 @@ doDrawing' win pdata u = do
glDepthFunc GL_LEQUAL
glDepthMask GL_FALSE
glBlendFuncSeparatei 0 GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA GL_ONE_MINUS_DST_ALPHA GL_ONE
--glBlendFunci 0 GL_ONE GL_ONE_MINUS_SRC_ALPHA
--withArray [GL_COLOR_ATTACHMENT0, GL_NONE] $
withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1] $
glNamedFramebufferDrawBuffers (pdata ^. fboCloud . _1 . unFBO) 2
@@ -408,7 +411,8 @@ doDrawing' win pdata u = do
glDepthFunc GL_ALWAYS
glDepthMask GL_FALSE
glEnable GL_BLEND
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
--glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
glBlendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA -- assume premultiplied alpha
renderLayer DebugLayer shadV pokeCounts
glBindBufferBase GL_UNIFORM_BUFFER 0 (pdata ^. matUBO)
withArray (scaleMatrix (2 / windowXFloat cfig) (2 / windowYFloat cfig)) $