Tweak clouds
This commit is contained in:
@@ -10,10 +10,12 @@ void main()
|
||||
{
|
||||
float d = dot(vControls,vControls);
|
||||
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);
|
||||
vec3 fn1 = (1-d)*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);
|
||||
}
|
||||
|
||||
+2
-2
@@ -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
@@ -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)) ->
|
||||
|
||||
Reference in New Issue
Block a user