stk-code_catmod/data/shaders/particle.vert
2014-03-15 13:35:51 -04:00

27 lines
548 B
GLSL

uniform mat4 ProjectionMatrix;
uniform mat4 ViewMatrix;
uniform vec3 color_from;
uniform vec3 color_to;
in vec2 quadcorner;
in vec2 texcoord;
in vec3 position;
in float lifetime;
in float size;
out float lf;
out vec2 tc;
out vec3 pc;
void main(void)
{
tc = texcoord;
lf = lifetime;
pc = color_from + (color_to - color_from) * lifetime;
vec3 newposition = position;
vec4 viewpos = ViewMatrix * vec4(newposition, 1.0);
viewpos += size * vec4(quadcorner, 0., 0.);
gl_Position = ProjectionMatrix * viewpos;
}