Skip to content

Instantly share code, notes, and snippets.

@Vatyx
Created November 19, 2016 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vatyx/8c3f9b063e731d0e9737d54e4fcfe499 to your computer and use it in GitHub Desktop.
Save Vatyx/8c3f9b063e731d0e9737d54e4fcfe499 to your computer and use it in GitHub Desktop.
if (depth < 6)
{
auto V = -r.dir;
auto R = 2 * dot(V, norm) * norm - V;
R.make_unit_vector();
auto ray = Ray(point + 0.001 * norm, R);
if (surface->gamma_e != 0) {
auto recurredLight = trace(ray, ++depth);
light = light + inter.first->gamma_e * recurredLight;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment