Created
November 19, 2016 01:36
-
-
Save Vatyx/8c3f9b063e731d0e9737d54e4fcfe499 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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