This commit is contained in:
2025-11-14 10:18:46 +00:00
parent 21c6e3afb4
commit 16eb356e31
3 changed files with 9 additions and 10 deletions
+3 -2
View File
@@ -9,7 +9,8 @@ void main()
{
float d = dot(vControls,vControls);
if (d > 1) {discard;}
//float d = min(dot(vControls,vControls),1);
fCol = vec4(vCol.xyz,vCol.w*(1-d));
fPos = vec4(vPos, vCol.w*(1-d));
fNorm = vec4(-vControls, -0.1 + 0.2 * d ,fPos.w);
fPos = vec4(vPos, fCol.w);
fNorm = vec4(-vControls, -0.1 + 0.2 * d ,fCol.w);
}
+5 -5
View File
@@ -19,9 +19,9 @@ void main()
uint k = gl_VertexID % 6;
vCol = unpackUnorm4x8(data[i].col);
vControls = indices[k];
vec3 vPosx = vec3(data[i].pos.xy + 20*vControls, data[i].pos.z);
gl_Position = theMat * vec4(vPosx,1);
vPos = data[i].pos;
//vPos = vec3(data[i].pos.xy + 20*vControls, data[i].pos.z);
//gl_Position = theMat * vec4(vPos,1);
//vec3 vPosx = vec3(data[i].pos.xy + 20*vControls, data[i].pos.z);
//gl_Position = theMat * vec4(vPosx,1);
//vPos = data[i].pos;
vPos = vec3(data[i].pos.xy + 20*vControls, data[i].pos.z);
gl_Position = theMat * vec4(vPos,1);
}
+1 -3
View File
@@ -253,7 +253,6 @@ doDrawing' win pdata u = do
----render transparency depths
-- glDepthMask GL_TRUE
glDepthFunc GL_ALWAYS
glDisable GL_BLEND
withArray [GL_NONE, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2] $
glNamedFramebufferDrawBuffers (pdata ^. fboCloud . _1 . unFBO) 3
withArray [0, 0, 0, 0] $
@@ -263,7 +262,7 @@ doDrawing' win pdata u = do
glEnable GL_BLEND
-- we sum the positions weighted by alpha, and sum the alpha
glBlendFuncSeparatei 1 GL_SRC_ALPHA GL_ONE GL_ONE GL_ONE
-- we sill divide by the alpha later
-- we divide by the alpha later
-- and sum the normals weighted by alpha
glBlendFunci 2 GL_SRC_ALPHA GL_ONE
glUseProgram (pdata ^. cloudShader)
@@ -319,7 +318,6 @@ doDrawing' win pdata u = do
glDepthMask GL_FALSE
withArray [GL_COLOR_ATTACHMENT0, GL_NONE] $
glNamedFramebufferDrawBuffers (pdata ^. fboCloud . _1 . unFBO) 2
-- $ \ptr -> glDrawBuffers 2 ptr
glDepthFunc GL_ALWAYS
glBindTextureUnit 0 (_unTO . snd $ _fboLighting pdata)
glEnable GL_BLEND