vertex_shader_v5.glsl Diff
vertex_shader_v5.glsl
--- /home/docs/checkouts/readthedocs.org/user_builds/arcade-library/checkouts/latest/doc/tutorials/gpu_particle_burst/vertex_shader_v4.glsl
+++ /home/docs/checkouts/readthedocs.org/user_builds/arcade-library/checkouts/latest/doc/tutorials/gpu_particle_burst/vertex_shader_v5.glsl
@@ -27,8 +27,12 @@
// Set the RGBA color
color = vec4(in_color[0], in_color[1], in_color[2], alpha);
+ // Adjust velocity based on gravity
+ vec2 new_vel = in_vel;
+ new_vel[1] -= time * 1.1;
+
// Calculate a new position
- vec2 new_pos = in_pos + (time * in_vel);
+ vec2 new_pos = in_pos + (time * new_vel);
// Set the position. (x, y, z, w)
gl_Position = vec4(new_pos, 0.0, 1);