Work on cloud/window transparency

This commit is contained in:
2025-11-09 11:00:12 +00:00
parent 7c62479f30
commit e9ffeeaea7
16 changed files with 221 additions and 168 deletions
+2
View File
@@ -11,6 +11,8 @@ void main()
if (d > 1) {discard;}
fCol = vec4(vCol.xyz,vCol.w*(1-d));
fPos = vec4(vPosID.xyz, vCol.w*(1-d));
//fPos = vec4(vPosID.xy,vPosID.z*0.5, vCol.w*(1-d));
fNorm = vec4(-vControls.xy, -0.1 + 0.2 * d ,fPos.w);
//fNorm = vec4(-vControls.xy, -0.1 + 2 * d ,vCol.w * (1.01-(d*d*d)));
//fNorm = vec4(-vControls.xy, -0.1 + d , fPos.w);
}
+18
View File
@@ -0,0 +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;
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;
fColor = ( xz > yz ? blend(x,y) : blend(y,x)) ;
}
+8
View File
@@ -0,0 +1,8 @@
#version 450 core
layout(location = 0) in vec2 pos;
layout(location = 1) in vec2 texPos;
out vec2 vTexPos;
void main() {
gl_Position = vec4(pos, 0.0, 1.0);
vTexPos = texPos;
}
+2 -1
View File
@@ -9,6 +9,7 @@ void main()
fCol = gColor;
//fPos = gPos;// + vec4(0,0,50,0);
//fNorm = vec4 (0,0,10,10);
fPos = vec4(0,0,50,1);
//fPos = vec4(0,0,50,1);
fPos = gPos;
fNorm = vec4 (0,0,10,10);
}