ray-tracer
ray-tracer copied to clipboard
Shadows!
@w23 do shadows require anything special to implement? I thought they gonna naturally emerge from the ray tracing itself. Like if a ray never hits an area it's just black. Please correct me if I'm wrong.
They kind of appear naturally in path-tracing. For other methods, however, where you're stuck with enumerating all light sources to account for each light influence, you do need to check that the light is not obstructed. That usually involves casting a ray into each light's direction and checking whether it has hit anything opaque or not. As it is basically a boolean yes/no check, this will give you hard shadows. There are various ways to approximate soft shadows, but that will come later.