Currently, we don't have any explicit support for different types of lights. Our first render implicitly uses a point light, but there are some drawbacks to only supporting point lights, as discussed in The Ray Tracer Challenge (chapter 17). For some motivation for implementing these different types of lights, as well a short explanation of how they work, read that chapter.
What to do
- Read chapter 17 of The Ray Tracer Challenge (the possible improvements which discuss area lights, soft shadows, and spotlights).
a) Read chapter 14 of Ray Tracing from the Ground Up, to see how they implemented lights.
- Implement a base class for lights called
Light, with pure virtual functions called get_direction, which returns the direction of the incoming light at a hit point and L, which returns the incident radiance at a hit point.
- Implement ambient lights, directional lights, and point lights, similar to the way the book does it.
- Implement area lights. You can use this online addendum to the Ray Tracer Challenge as a reference.
- Implement spotlights. You can see other people's implementations, like this one for reference. You can find how he modified the ray tracing algorithm to use spot lights here.
Addendum
This is a slightly bigger task than the previous issues. To complete this task, you should break it up over multiple PRs. Do not send one massive PR because that makes it very difficult to review effectively. As such, a reasonable break down would be:
Assignee: @Inferno2401
Currently, we don't have any explicit support for different types of lights. Our first render implicitly uses a point light, but there are some drawbacks to only supporting point lights, as discussed in The Ray Tracer Challenge (chapter 17). For some motivation for implementing these different types of lights, as well a short explanation of how they work, read that chapter.
What to do
a) Read chapter 14 of Ray Tracing from the Ground Up, to see how they implemented lights.
Light, with pure virtual functions calledget_direction, which returns the direction of the incoming light at a hit point andL, which returns the incident radiance at a hit point.Addendum
This is a slightly bigger task than the previous issues. To complete this task, you should break it up over multiple PRs. Do not send one massive PR because that makes it very difficult to review effectively. As such, a reasonable break down would be:
Light.Assignee: @Inferno2401