Updated compute shader particle system with point sprites and gradient coloring

This commit is contained in:
saschawillems 2016-05-14 23:09:17 +02:00
parent 72af27a49a
commit 3ae4f26901
9 changed files with 131 additions and 77 deletions

View file

@ -7,6 +7,7 @@ struct Particle
{
vec2 pos;
vec2 vel;
vec4 gradientPos;
};
// Binding 0 : Position storage buffer
@ -71,5 +72,8 @@ void main()
// Write back
particles[index].vel.xy = vVel;
particles[index].gradientPos.x += 0.02 * ubo.deltaT;
if (particles[index].gradientPos.x > 1.0)
particles[index].gradientPos.x -= 1.0;
}