Use vertex pulling for clouds

This commit is contained in:
2025-11-12 19:57:07 +00:00
parent ce1937c78e
commit 409180959c
11 changed files with 202 additions and 107 deletions
+25
View File
@@ -0,0 +1,25 @@
#version 450 core
struct CloudPosCol { vec4 pos; vec4 col; };
layout (std140, binding = 0) uniform TheMat { mat4 theMat; } ;
layout (std430, binding = 6) readonly buffer CPos { CloudPosCol data[]; };
const vec2 indices[6] =
{vec2(-1,-1) // 0 2--3
,vec2( 1,-1) // 1 | |
,vec2( 1, 1) // 3 0--1
,vec2(-1,-1) // 0
,vec2(-1, 1) // 2
,vec2( 1, 1) // 3
};
out vec4 vCol;
out vec2 vControls;
out vec3 vPos;
void main()
{
uint i = gl_VertexID / 6;
uint k = gl_VertexID % 6;
vCol = data[i].col;
// vCol = vec4(1,0.5,0,1);
vControls = indices[k];
vPos = vec3(data[i].pos.xy + 20*vControls, data[i].pos.z);
gl_Position = theMat * vec4(vPos,1);
}