Tweak clouds
This commit is contained in:
@@ -10,10 +10,12 @@ void main()
|
|||||||
{
|
{
|
||||||
float d = dot(vControls,vControls);
|
float d = dot(vControls,vControls);
|
||||||
if (d > 1) {discard;}
|
if (d > 1) {discard;}
|
||||||
fCol = vCol;
|
//fCol = vCol;
|
||||||
|
fCol = vec4(vCol.xyz,vCol.w*(1-d));
|
||||||
fPos = vec4(vPosID.xy, vPosID.z + (1-d) * vCenterSize.w, 0.5);
|
fPos = vec4(vPosID.xy, vPosID.z + (1-d) * vCenterSize.w, 0.5);
|
||||||
vec3 fn1 = (1-d)*vec3(vCenterSize.xyz - fPos.xyz);
|
vec3 fn1 = (1-d)*vec3(vCenterSize.xyz - fPos.xyz);
|
||||||
//vec3 fn1 = vec3(vCenterSize.xyz - fPos.xyz);
|
//vec3 fn1 = vec3(vCenterSize.xyz - fPos.xyz);
|
||||||
fNorm = vec4(0.3*fn1.xy,fn1.z, 0.5);
|
//fNorm = vec4(0.5*fn1.xy,fn1.z, 0.5);
|
||||||
|
fNorm = vec4(fn1.xyz, 0.5);
|
||||||
//fNorm = vec4(0,0,1, 1);
|
//fNorm = vec4(0,0,1, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -16,7 +16,6 @@ import qualified Data.Vector.Unboxed.Mutable as UMV
|
|||||||
import Dodge.Data.Universe
|
import Dodge.Data.Universe
|
||||||
import Dodge.Render.Lights
|
import Dodge.Render.Lights
|
||||||
import Dodge.Render.Picture
|
import Dodge.Render.Picture
|
||||||
import Dodge.Render.Shadow
|
|
||||||
import Dodge.Render.ShapePicture
|
import Dodge.Render.ShapePicture
|
||||||
import Dodge.Render.Walls
|
import Dodge.Render.Walls
|
||||||
import Foreign
|
import Foreign
|
||||||
@@ -275,8 +274,9 @@ doDrawing' win pdata u = do
|
|||||||
2
|
2
|
||||||
ptr
|
ptr
|
||||||
glEnable GL_BLEND
|
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
|
glBlendFunci 1 GL_ONE_MINUS_DST_ALPHA GL_DST_ALPHA
|
||||||
|
-- and to sum the normals
|
||||||
glBlendFunci 2 GL_ONE GL_ONE
|
glBlendFunci 2 GL_ONE GL_ONE
|
||||||
glUseProgram (pdata ^. cloudShader . shaderUINT)
|
glUseProgram (pdata ^. cloudShader . shaderUINT)
|
||||||
glBindVertexArray $ pdata ^. cloudShader . shaderVAO . vaoName
|
glBindVertexArray $ pdata ^. cloudShader . shaderVAO . vaoName
|
||||||
|
|||||||
+40
-40
@@ -80,23 +80,23 @@ updateFBOTO xsize ysize minfilt magfilt inFormat pdata target = do
|
|||||||
newfbo2 <- resizeFBOTO (pdata ^# target) xsize ysize minfilt magfilt inFormat
|
newfbo2 <- resizeFBOTO (pdata ^# target) xsize ysize minfilt magfilt inFormat
|
||||||
return $ storing target newfbo2 pdata
|
return $ storing target newfbo2 pdata
|
||||||
|
|
||||||
updateFBOTO2 ::
|
--updateFBOTO2 ::
|
||||||
Int ->
|
-- Int ->
|
||||||
Int ->
|
-- Int ->
|
||||||
-- | minification filter
|
-- -- | minification filter
|
||||||
GLenum ->
|
-- GLenum ->
|
||||||
-- | magnification filter
|
-- -- | magnification filter
|
||||||
GLenum ->
|
-- GLenum ->
|
||||||
-- | internal color format texture1
|
-- -- | internal color format texture1
|
||||||
GLenum ->
|
-- GLenum ->
|
||||||
-- | internal color format texture2
|
-- -- | internal color format texture2
|
||||||
GLenum ->
|
-- GLenum ->
|
||||||
RenderData ->
|
-- RenderData ->
|
||||||
ALens' RenderData (FBO, (TO, TO)) ->
|
-- ALens' RenderData (FBO, (TO, TO)) ->
|
||||||
IO RenderData
|
-- IO RenderData
|
||||||
updateFBOTO2 xsize ysize minfilt magfilt inFormat1 inFormat2 pdata target = do
|
--updateFBOTO2 xsize ysize minfilt magfilt inFormat1 inFormat2 pdata target = do
|
||||||
newfbo2 <- resizeFBOTO2 (pdata ^# target) xsize ysize minfilt magfilt inFormat1 inFormat2
|
-- newfbo2 <- resizeFBOTO2 (pdata ^# target) xsize ysize minfilt magfilt inFormat1 inFormat2
|
||||||
return $ storing target newfbo2 pdata
|
-- return $ storing target newfbo2 pdata
|
||||||
|
|
||||||
updateFBOTO3 ::
|
updateFBOTO3 ::
|
||||||
Int ->
|
Int ->
|
||||||
@@ -134,29 +134,29 @@ resizeShadowFBO (fbo, (oldto1, oldto2)) x y = do
|
|||||||
checkFBO fbo
|
checkFBO fbo
|
||||||
return (fbo, (TO to1, TO to2))
|
return (fbo, (TO to1, TO to2))
|
||||||
|
|
||||||
resizeFBOTO2 ::
|
--resizeFBOTO2 ::
|
||||||
(FBO, (TO, TO)) ->
|
-- (FBO, (TO, TO)) ->
|
||||||
Int ->
|
-- Int ->
|
||||||
Int ->
|
-- Int ->
|
||||||
-- | minification filter
|
-- -- | minification filter
|
||||||
GLenum ->
|
-- GLenum ->
|
||||||
-- | magnification filter
|
-- -- | magnification filter
|
||||||
GLenum ->
|
-- GLenum ->
|
||||||
-- | internal color format1
|
-- -- | internal color format1
|
||||||
GLenum ->
|
-- GLenum ->
|
||||||
-- | internal color format2
|
-- -- | internal color format2
|
||||||
GLenum ->
|
-- GLenum ->
|
||||||
IO (FBO, (TO, TO))
|
-- IO (FBO, (TO, TO))
|
||||||
resizeFBOTO2 (fbo, (toOld1, toOld2)) xsize ysize minfilt magfilt inFormat1 inFormat2 = do
|
--resizeFBOTO2 (fbo, (toOld1, toOld2)) xsize ysize minfilt magfilt inFormat1 inFormat2 = do
|
||||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO fbo)
|
-- glBindFramebuffer GL_FRAMEBUFFER (_unFBO fbo)
|
||||||
mglDelete glDeleteTextures $ _unTO toOld1
|
-- mglDelete glDeleteTextures $ _unTO toOld1
|
||||||
mglDelete glDeleteTextures $ _unTO toOld2
|
-- mglDelete glDeleteTextures $ _unTO toOld2
|
||||||
to1 <- initializeTexture2D fbo GL_COLOR_ATTACHMENT0 xsize ysize minfilt magfilt inFormat1
|
-- to1 <- initializeTexture2D fbo GL_COLOR_ATTACHMENT0 xsize ysize minfilt magfilt inFormat1
|
||||||
to2 <- initializeTexture2D fbo GL_COLOR_ATTACHMENT1 xsize ysize minfilt magfilt inFormat2
|
-- to2 <- initializeTexture2D fbo GL_COLOR_ATTACHMENT1 xsize ysize minfilt magfilt inFormat2
|
||||||
withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1] $ \ptr ->
|
-- withArray [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1] $ \ptr ->
|
||||||
glNamedFramebufferDrawBuffers (_unFBO fbo) 2 ptr
|
-- glNamedFramebufferDrawBuffers (_unFBO fbo) 2 ptr
|
||||||
checkFBO fbo
|
-- checkFBO fbo
|
||||||
return (fbo, (TO to1, TO to2))
|
-- return (fbo, (TO to1, TO to2))
|
||||||
|
|
||||||
resizeFBOTO3 ::
|
resizeFBOTO3 ::
|
||||||
(FBO, (TO, TO,TO)) ->
|
(FBO, (TO, TO,TO)) ->
|
||||||
|
|||||||
Reference in New Issue
Block a user