stk-code_catmod/data/shaders/pointemitter.vert
vincentlj 1d3a33bf8e GPUParticles: Use quad instead of POINT_SPRITE
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14861 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-12-31 20:39:00 +00:00

25 lines
760 B
GLSL

#version 130
uniform int dt;
uniform mat4 sourcematrix;
in vec3 particle_position_initial;
in float lifetime_initial;
in vec4 particle_velocity_initial;
in vec3 particle_position;
in float lifetime;
in vec4 particle_velocity;
out vec3 new_particle_position;
out float new_lifetime;
out vec4 new_particle_velocity;
void main(void)
{
vec4 initialposition = sourcematrix * vec4(particle_position_initial, 1.0);
new_particle_position = (lifetime < 1.) ? particle_position + particle_velocity.xyz * float(dt) : initialposition.xyz;
new_lifetime = (lifetime < 1.) ? lifetime + (float(dt)/lifetime_initial) : 0.;
new_particle_velocity = (lifetime < 1.) ? particle_velocity : particle_velocity_initial;
gl_Position = vec4(0.);
}