mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 03:06:55 -04:00
30 lines
626 B
GLSL
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;
|
|
}
|