gpu_particle_burst_06.py Diff

gpu_particle_burst_06.py
--- C:\Users\craven\Desktop\WebServer\arcade\doc\tutorials\gpu_particle_burst\gpu_particle_burst_05.py
+++ C:\Users\craven\Desktop\WebServer\arcade\doc\tutorials\gpu_particle_burst\gpu_particle_burst_06.py
@@ -30,7 +30,7 @@
 
         # Program to visualize the points
         self.program = self.ctx.load_program(
-            vertex_shader="vertex_shader_v2.glsl",
+            vertex_shader="vertex_shader_v3.glsl",
             fragment_shader="fragment_shader.glsl",
         )
 
@@ -66,10 +66,16 @@
                 speed = abs(random.gauss(0, 1)) * .5
                 dx = math.sin(angle) * speed
                 dy = math.cos(angle) * speed
+                red = random.uniform(0.5, 1.0)
+                green = random.uniform(0, red)
+                blue = 0
                 yield initial_x
                 yield initial_y
                 yield dx
                 yield dy
+                yield red
+                yield green
+                yield blue
 
         # Recalculate the coordinates from pixels to the OpenGL system with
         # 0, 0 at the center.
@@ -84,8 +90,8 @@
 
         # Create a buffer description that says how the buffer data is formatted.
         buffer_description = arcade.gl.BufferDescription(buffer,
-                                                         '2f 2f',
-                                                         ['in_pos', 'in_vel'])
+                                                         '2f 2f 3f',
+                                                         ['in_pos', 'in_vel', 'in_color'])
         # Create our Vertex Attribute Object
         vao = self.ctx.geometry([buffer_description])