28 lines
640 B
GLSL
28 lines
640 B
GLSL
#version 120
|
|
|
|
uniform mat4 trans; // local space to clip space
|
|
uniform vec3 dx; // "right" change of basis vector
|
|
uniform vec3 dy; // "up" change of basis vector
|
|
uniform vec3 particle_position;
|
|
uniform float scale;
|
|
|
|
|
|
attribute vec2 quad_texture;
|
|
attribute float age;
|
|
|
|
void main()
|
|
{
|
|
// calculate unit quad position coordinates from texture coordinates
|
|
vec2 quad_position = quad_texture * 2 + 1;
|
|
|
|
vec3 position = particle_position;
|
|
position += position.xxx * dx;
|
|
position += position.yyy * dy;
|
|
position *= scale;
|
|
|
|
position = trans * position;
|
|
|
|
gl_Position = vec4(position, 1);
|
|
gl_TexCoord[0] = vec4(quad_texture, 0, age);
|
|
}
|