Work on transparency of windows/clouds

This commit is contained in:
2025-11-20 12:02:05 +00:00
parent 10dbb238c8
commit 6563d87247
7 changed files with 49 additions and 37 deletions
+10 -2
View File
@@ -4,14 +4,22 @@ layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 1) readonly buffer Pos { PosCol data[]; };
out vec4 vCol;
out vec4 vPos;
int indices[6] = {0,1,3,0,3,2};
out vec2 vScreenPos;
//int indices[6] = {0,1,3,0,3,2};
int indices[6] =
{0,3,1
,0,2,3};
// note reversed compared to walls
void main()
{
vCol = data[gl_VertexID / 6].col;
vec4 pp = data[gl_VertexID / 6].pospos;
int j = indices[gl_VertexID % 6];
float z = (j > 1.5 ? 5000 : 0);
//float z = (j > 1.5 ? 5000 : 0);
float z = (j > 1.5 ? 200 : 0);
vec2 xy = (j % 2 > 0 ? pp.xy : pp.zw);
vPos = vec4( xy, z, 1);
gl_Position = theMat * vPos;
vScreenPos = 0.5 * (vec2(1) + vec2(gl_Position.x / gl_Position.w
,gl_Position.y / gl_Position.w));
}