grakopro/cw_8/shaders/part.vert

24 lines
546 B
GLSL
Raw Normal View History

2024-02-04 23:39:37 +01:00
#version 430 core
layout (location = 0) in vec3 vertex;
layout (location = 1) in vec2 texCoords;
out vec2 TexCoords;
out vec4 ParticleColor;
uniform mat4 transformation;
uniform vec3 position;
uniform vec4 color;
2024-02-08 16:18:39 +01:00
uniform float engPow;
2024-02-04 23:39:37 +01:00
uniform vec3 cameraUp;
uniform vec3 cameraSide;
void main()
{
2024-02-08 16:18:39 +01:00
float scale = 0.05f + engPow/20;
2024-02-04 23:39:37 +01:00
TexCoords = texCoords;
ParticleColor = color;
vec3 worldspacePos = cameraSide*vertex.x + cameraUp*vertex.y;
gl_Position = transformation * vec4((worldspacePos.xyz * scale) + position, 1.0);
}