mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-08 19:50:23 -04:00

* Move to glslang's convention for shader file suffix * Update ci.yml * Oops, a mistake in the shader, how could that happen? * Does the command error on its own? * Update ci.yml * Revert "Oops, a mistake in the shader, how could that happen?" This reverts commit 869c3323f3d3b5fa607b40e7847c389a12b01f33. * Update ci.yml
26 lines
620 B
GLSL
26 lines
620 B
GLSL
#version 460
|
|
|
|
//in pixel
|
|
layout(location = 0) uniform vec2 start;
|
|
layout(location = 1) uniform vec2 dimension;
|
|
layout(location = 2) uniform vec2 screen;
|
|
layout(location = 3) uniform int points;
|
|
layout(location = 4) uniform int offset;
|
|
|
|
layout(std430, binding = 5) buffer _data
|
|
{
|
|
float data[];
|
|
};
|
|
|
|
|
|
void main() {
|
|
float x = gl_VertexID;
|
|
float y = -data[(gl_VertexID+offset)%points];
|
|
// Convert to opengl coordinates:
|
|
vec2 position_percentage = (start + dimension*vec2(x/points, y))/screen;
|
|
|
|
vec2 position = vec2(position_percentage.x, -position_percentage.y)*2 + vec2(-1, 1);
|
|
|
|
gl_Position = vec4(position, 0, 1);
|
|
}
|