stk-code_catmod/data/shaders/pointemitter.vert
vincentlj 4c725ac8f4 GPUParticles: Got PointEmitter to draw something at last.
Still WIP, uses a #ifdef to disable it but I wanted to keep a working commit
somewhere in case I mess up somewhere.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14829 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-12-29 18:23:36 +00:00

21 lines
540 B
GLSL

#version 130
uniform int dt;
uniform vec3 source;
uniform int duration;
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)
{
new_particle_position = (lifetime > 0.) ? particle_position + particle_velocity.xyz * float(dt) : vec3(0., 0., 0.);
new_lifetime = (lifetime > 0.) ? lifetime - float(dt) : float(duration);
new_particle_velocity = particle_velocity;
gl_Position = vec4(0.);
}