diff options
| author | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-01-16 23:02:32 +0100 |
|---|---|---|
| committer | Thomas Guillermo Albers Raviola <thomas@thomaslabs.org> | 2026-01-16 23:02:32 +0100 |
| commit | 6b8af9cf83851c075c6c9514b1deaa931c2b19a4 (patch) | |
| tree | 428986b49c32e21d3f7a3c2dfa41858ae0153209 /09-september/resources/shaders/particlesShader.vert | |
Initial commit
Diffstat (limited to '09-september/resources/shaders/particlesShader.vert')
| -rw-r--r-- | 09-september/resources/shaders/particlesShader.vert | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/09-september/resources/shaders/particlesShader.vert b/09-september/resources/shaders/particlesShader.vert new file mode 100644 index 0000000..2b1ad60 --- /dev/null +++ b/09-september/resources/shaders/particlesShader.vert @@ -0,0 +1,18 @@ +#version 420 + +in layout(location=0) vec3 position; /* vertex position in model coordinates */ +in layout(location=1) vec2 offset; /* xy coordinates offset for atlases */ +in layout(location=2) mat4 M_MVP; + +out vec2 Fragment_UV; /* UV coordinates for the fragment */ + +uniform float number_of_rows; /* For texture atlases */ + +void main() +{ + gl_Position = M_MVP * vec4(position, 1.0); + + Fragment_UV = position.xy + vec2(0.5, 0.5); + Fragment_UV.y = 1.0 - Fragment_UV.y; + Fragment_UV = (Fragment_UV / number_of_rows ) + offset; +} |
