IntegratedQuantum 9898db654b Specify the location of all shader in/out parameters.
also normalized the version and layout formatting
progress towards #1376
2025-05-02 14:53:57 +02:00

30 lines
626 B
GLSL

#version 460
struct star {
vec4 vertexPositions[3];
vec3 pos;
float padding1;
vec3 color;
float padding2;
};
layout (std430, binding = 12) buffer _starBuffer {
star starData[];
};
uniform mat4 mvp;
uniform float starOpacity;
layout(location = 0) out vec3 pos;
layout(location = 1) out flat vec3 centerPos;
layout(location = 2) out flat vec3 color;
void main() {
gl_Position = mvp*vec4(starData[gl_VertexID/3].vertexPositions[gl_VertexID%3].xyz, 1);
pos = starData[gl_VertexID/3].vertexPositions[gl_VertexID%3].xyz;
centerPos = starData[gl_VertexID/3].pos;
color = starData[gl_VertexID/3].color*starOpacity;
}