Make cloud position only record the central point of the cloud

This commit is contained in:
2025-11-14 09:29:26 +00:00
parent bfd7aa619e
commit 21c6e3afb4
2 changed files with 13 additions and 10 deletions
+8 -8
View File
@@ -1,18 +1,18 @@
#version 450 core
in vec2 vTexPos;
out vec4 fColor;
layout(binding = 0) uniform sampler2D t0;
layout(binding = 1) uniform sampler2D t1;
layout(binding = 2) uniform sampler2D t2;
layout(binding = 3) uniform sampler2D t3;
layout(binding = 0) uniform sampler2D wincol;
layout(binding = 1) uniform sampler2D winpos;
layout(binding = 2) uniform sampler2D cloudcol;
layout(binding = 3) uniform sampler2D cloudpos;
vec4 blend (vec4 src, vec4 dst) {
return src + (1-src.a) * dst;
}
void main() {
//fColor = texture(t0, vTexPos) + texture(t2, vTexPos);
vec4 x = texture(t0, vTexPos);
float xz = texture(t1, vTexPos).z;
vec4 y = texture(t2, vTexPos);
float yz = texture(t3, vTexPos).z;
vec4 x = texture(wincol, vTexPos);
float xz = texture(winpos, vTexPos).z;
vec4 y = texture(cloudcol, vTexPos);
float yz = texture(cloudpos, vTexPos).z;
fColor = ( xz > yz ? blend(x,y) : blend(y,x)) ;
}
+5 -2
View File
@@ -19,6 +19,9 @@ void main()
uint k = gl_VertexID % 6;
vCol = unpackUnorm4x8(data[i].col);
vControls = indices[k];
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);
}