     float angle = kTwoPi * curand_uniform(curand_state);
     float distance =
         camera.aperture_radius * sqrt(curand_uniform(curand_state));
-
     float2 coord = make_float2(cos(angle) * distance, sin(angle) * distance);
-
     origin += x_axis * coord.x + y_axis * coord.y;
   }
 
   rays[idx].origin = origin;
   rays[idx].direction = normalize(point - origin);
-  rays[idx].color = make_float3(light);
+  rays[idx].color = make_float3(intensity);
 }
 
 __global__ void PathTraceKernel(const Triangle* triangles,

  thrust::device_vector<Ray> rays(num_pixels);
  Ray* const rays_ptr = thrust::raw_pointer_cast(rays.data());

  thrust::device_vector<curandState> curand_states(num_pixels);
  curandState* const curand_states_ptr =
      thrust::raw_pointer_cast(curand_states.data());

  thrust::device_vector<size_t> indices(num_pixels);
  size_t* indices_ptr = thrust::raw_pointer_cast(indices.data());


  /* compute size and center position of image plane
   * according to focal distance and fov */
  float3 center = camera.position + camera.view;
  float2 half_size = make_float2(tan((camera.fov.x / 2) * kArcPerAngle),
                                 tan((camera.fov.y / 2) * kArcPerAngle));

  /* compute the jittered point position on image plane */
  float2 jitter = make_float2(curand_uniform(curand_state) - 0.5,
                              curand_uniform(curand_state) - 0.5);
  float2 distances = make_float2(make_uint2(x, y)) + jitter;
  distances /= (make_float2(camera.resolution) - 1);
  distances = (2 * distances - 1) * half_size;

  float3 point = center + x_axis * distances.x + y_axis * distances.y;
  point = camera.position + (point - camera.position) * camera.focal_distance;

  /* compute origin of the ray */
  float3 origin = camera.position;
