     //}
 
 	// Do ray trace
-    float xsamples = 1;
-    float ysamples = 1;
-
-    float dx = 1.0 / xsamples;
-    float dy = 1.0 / xsamples;
+    float dx = 1.0 / SAMPLES_X;
+    float dy = 1.0 / SAMPLES_X;
 
     for (float x = 0; x < 1.0; x += dx)
     for (float y = 0; y < 1.0; y += dy)
     {
-        SAMPLES++;
-
         float weight = 1.0;
         vec3 origin = ray_pos_world;
         vec3 dir = ray_dir_world;

#version 330 core

#define MAX_BOUNCES 4

uniform float in_time;
uniform vec3 in_position;


void main()
{
    vec2 rng_state = vec2(vertex_pos.x + 7.0 * in_time, vertex_pos.y + 13.0 * in_time);

    out_colour = vec4(0);
