Tweak clouds

This commit is contained in:
2023-03-20 22:32:01 +00:00
parent 7d0bb7f229
commit 9bba0a43a4
3 changed files with 46 additions and 44 deletions
+2 -2
View File
@@ -16,7 +16,6 @@ import qualified Data.Vector.Unboxed.Mutable as UMV
import Dodge.Data.Universe
import Dodge.Render.Lights
import Dodge.Render.Picture
import Dodge.Render.Shadow
import Dodge.Render.ShapePicture
import Dodge.Render.Walls
import Foreign
@@ -275,8 +274,9 @@ doDrawing' win pdata u = do
2
ptr
glEnable GL_BLEND
glBlendColor 0.5 0.5 0.5 0.5
-- the idea is to (roughly) get the average position
glBlendFunci 1 GL_ONE_MINUS_DST_ALPHA GL_DST_ALPHA
-- and to sum the normals
glBlendFunci 2 GL_ONE GL_ONE
glUseProgram (pdata ^. cloudShader . shaderUINT)
glBindVertexArray $ pdata ^. cloudShader . shaderVAO . vaoName
+40 -40
View File
@@ -80,23 +80,23 @@ updateFBOTO xsize ysize minfilt magfilt inFormat pdata target = do
newfbo2 <- resizeFBOTO (pdata ^# target) xsize ysize minfilt magfilt inFormat
return $ storing target newfbo2 pdata
updateFBOTO2 ::
Int ->
Int ->
-- | minification filter
GLenum ->
-- | magnification filter
GLenum ->
-- | internal color format texture1
GLenum ->
-- | internal color format texture2
GLenum ->
RenderData ->
ALens' RenderData (FBO, (TO, TO)) ->
IO RenderData
updateFBOTO2 xsize ysize minfilt magfilt inFormat1 inFormat2 pdata target = do
newfbo2 <- resizeFBOTO2 (pdata ^# target) xsize ysize minfilt magfilt inFormat1 inFormat2
return $ storing target newfbo2 pdata
--updateFBOTO2 ::
-- Int ->
-- Int ->
-- -- | minification filter
-- GLenum ->
-- -- | magnification filter
-- GLenum ->
-- -- | internal color format texture1
-- GLenum ->
-- -- | internal color format texture2
-- GLenum ->
-- RenderData ->
-- ALens' RenderData (FBO, (TO, TO)) ->
-- IO RenderData
--updateFBOTO2 xsize ysize minfilt magfilt inFormat1 inFormat2 pdata target = do
-- newfbo2 <- resizeFBOTO2 (pdata ^# target) xsize ysize minfilt magfilt inFormat1 inFormat2
-- return $ storing target newfbo2 pdata
updateFBOTO3 ::
Int ->
@@ -134,29 +134,29 @@ resizeShadowFBO (fbo, (oldto1, oldto2)) x y = do
checkFBO fbo
return (fbo, (TO to1, TO to2))
resizeFBOTO2 ::
(FBO, (TO, TO)) ->
Int ->
Int ->
-- | minification filter
GLenum ->
-- | magnification filter
GLenum ->
-- | internal color format1
GLenum ->
-- | internal color format2
GLenum ->
IO (FBO, (TO, TO))
resizeFBOTO2 (fbo, (toOld1, toOld2)) xsize ysize minfilt magfilt inFormat1 inFormat2 = do
glBindFramebuffer GL_FRAMEBUFFER (_unFBO fbo)
mglDelete glDeleteTextures $ _unTO toOld1
mglDelete glDeleteTextures $ _unTO toOld2
to1 <- initializeTexture2D fbo GL_COLOR_ATTACHMENT0 xsize ysize minfilt magfilt inFormat1
to2 <- initializeTexture2D fbo GL_COLOR_ATTACHMENT1 xsize ysize minfilt magfilt inFormat2
withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1] $ \ptr ->
glNamedFramebufferDrawBuffers (_unFBO fbo) 2 ptr
checkFBO fbo
return (fbo, (TO to1, TO to2))
--resizeFBOTO2 ::
-- (FBO, (TO, TO)) ->
-- Int ->
-- Int ->
-- -- | minification filter
-- GLenum ->
-- -- | magnification filter
-- GLenum ->
-- -- | internal color format1
-- GLenum ->
-- -- | internal color format2
-- GLenum ->
-- IO (FBO, (TO, TO))
--resizeFBOTO2 (fbo, (toOld1, toOld2)) xsize ysize minfilt magfilt inFormat1 inFormat2 = do
-- glBindFramebuffer GL_FRAMEBUFFER (_unFBO fbo)
-- mglDelete glDeleteTextures $ _unTO toOld1
-- mglDelete glDeleteTextures $ _unTO toOld2
-- to1 <- initializeTexture2D fbo GL_COLOR_ATTACHMENT0 xsize ysize minfilt magfilt inFormat1
-- to2 <- initializeTexture2D fbo GL_COLOR_ATTACHMENT1 xsize ysize minfilt magfilt inFormat2
-- withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1] $ \ptr ->
-- glNamedFramebufferDrawBuffers (_unFBO fbo) 2 ptr
-- checkFBO fbo
-- return (fbo, (TO to1, TO to2))
resizeFBOTO3 ::
(FBO, (TO, TO,TO)) ->