Last active
July 25, 2020 08:15
-
-
Save omaraflak/4c7bc10beeb8652ec6ad7fff755df80a 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
# ... | |
intersection = origin + min_distance * direction | |
intersection_to_light = normalize(light['position'] - intersection) | |
_, min_distance = nearest_intersected_object(objects, intersection, intersection_to_light) | |
intersection_to_light_distance = np.linalg.norm(light['position'] - intersection) | |
is_shadowed = min_distance < intersection_to_light_distance |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment