Tweak clouds

This commit is contained in:
2025-11-06 22:01:24 +00:00
parent 05c530eeb1
commit 7c62479f30
5 changed files with 48 additions and 37 deletions
+9
View File
@@ -262,6 +262,14 @@ doDrawing' win pdata u = do
glDepthFunc GL_ALWAYS
glBindTextureUnit 0 (pdata ^. fboBloom . _2 . unTO)
glDisable GL_BLEND
-- this all needs more tuning + more thought
-- a fade effect would be cool, so not to fully reset last frames bloom
-- buffers...
-- withArray [0, 0, 0, 0] $
-- glClearNamedFramebufferfv (pdata ^. fboHalf1 . _1 . unFBO) GL_COLOR 0
-- withArray [0, 0, 0, 0] $
-- glClearNamedFramebufferfv (pdata ^. fboHalf2 . _1 . unFBO) GL_COLOR 0
-- glBlendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
drawShader (_bloomBlurShader pdata) 4
when (cfig ^. graphics_bloom) $ do
replicateM_ 2 $ pingPongBetween
@@ -377,6 +385,7 @@ doDrawing' win pdata u = do
--Draw blurred bloom onto base buffer
glEnable GL_BLEND
glBlendFunc GL_SRC_ALPHA GL_ONE
--glBlendFunc GL_ONE GL_ONE
glBindTextureUnit 0 (_unTO . snd $ _fboHalf1 pdata)
drawShader (_fullscreenShader pdata) 4
glBlendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
+1
View File
@@ -54,6 +54,7 @@ lmt :: V4 (V4 a) -> V4 (V4 a)
lmt = Linear.Matrix.transpose
vToL :: V4 a -> [a]
{-# INLINE vToL #-}
vToL (V4 a b c d) = [a, b, c, d]
perMat :: Float -> V4 (V4 Float)
+1 -1
View File
@@ -44,7 +44,7 @@ pokeCloudLikeVerx ptr (V3 cx cy cz, V4 r g b a) nv i (dx, dy) =
UV.imapM_ (pokeCloudFloat ptr (nv + i)) $
UV.fromList [x, y, cz, 1, r, g, b, a, dx, dy, 0, 0]
where
V2 x y = V2 cx cy - 20 *^ V2 dx dy
V2 x y = V2 cx cy + 20 *^ V2 dx dy
clColor :: CloudType -> Color
clColor = \case