         // Jitter over pixel
         vec2 pixelj = pixel + (-0.5 + vec2(rand(rnd), rand(rnd)));
         vec3 primaryStart, primaryDir;
-#ifdef HAS_CUSTOM_CAMERA
-        CONSTRUCT_PRIMARY_RAY(pixelj, rnd, primaryStart, primaryDir);
-#else
         constructPrimaryRay(pixelj, rnd, primaryStart, primaryDir);
-#endif
 
         // Raycast to first hit point
         vec3 pW;


#define M_PI 3.1415926535897932384626433832795

/// GLSL floating point pseudorandom number generator, from
/// "Implementing a Photorealistic Rendering System using GLSL", Toshiya Hachisuka
/// http://arxiv.org/pdf/1505.06022.pdf

    return fract(dot(rnd/m, vec4(1.0, -1.0, 1.0, -1.0)));
}

////////////////////////////////////////////////////////////////////////////////
// Light sampling
////////////////////////////////////////////////////////////////////////////////
