Possible fix for the missing shadows
- Dominant language
- Python
- Stars
- 20
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
Try inserting the following statements to the RenderEngine class color_at() method after line 125 of the engine.py module:
# Test if to_light ray hits another object before reaching the light.
(dist, hit) = self.find_nearest(to_light, scene)
if hit is None or (dist > (light.position - hit_pos).magnitude()):
and indent the subsequent "Diffuse and Specular shading" code blocks underneath the newly inserted if statement.
ref: "Shadow Rays" slides in https://www.inf.ed.ac.uk/teaching/courses/cg/lectures/slides10.pdf
Contributor guide
No contributing guide indexed for this repository
Research direction
Open engine.py and inspect RenderEngine.color_at() around line 125, along with find_nearest() and the surrounding Diffuse and Specular shading blocks. Use the linked Shadow Rays slides for context. Done means the renderer accounts for objects between a surface point and the light when producing shadows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100