dilevin / computer-graphics-ray-tracing

Computer Graphics Assignment about Ray Tracing
1 stars 5 forks source link

inside-a-sphere shadow problems #36

Closed ginkxo closed 4 years ago

ginkxo commented 4 years ago
verydark

this might be a bit hard to see, but the planes and sphere are showing up, however they are extremely dark as you can see. I'm trying to understand why this might be the case. So far, the other ones I've tested (everything except mirror.json and bunny.json) are working fine. Also, the interior sphere appears "solid" rather than seeing the interior of it.

I tried to turn off the shadow generating code and I got what I would expect to get without the shadows. This image is identical regardless of whether or not I turn off the recursive calls for the reflection:

verydark3

So I suspect the problem is in how I implement my shadows.

I attempted to follow the textbook algorithm as close as I could (p. 86):

textalgo

Let me know if anything seems off?

darren-moore commented 4 years ago

Awesome start, narrowing it down to the shadows. Draw a picture of a plane casting a shadow on a point. Now move the light closer to the point. Is it still in shadow? Make sure you're taking into account the distance between the point and the light.

ginkxo commented 4 years ago

Thanks very much, totally forgot to take into account the point-light distance when comparing to the respective one with the shadow in the checks.