karansher / computer-graphics-ray-tracing

Computer Graphics Assignment about Ray Tracing
0 stars 0 forks source link

Shading of Spheres Packing #6

Closed JanardanS closed 1 year ago

JanardanS commented 1 year ago

Spheres and two spheres on planes have shading on the plane. However, packing spheres for some reason doesn't shade the plane black. Everything else works, and I am not sure what's wrong with it.

image

Macdeini commented 1 year ago

I'm having the same issue, where the floor shadows for sphere packing arent appearing, but im getting the proper results for sphere-and-plane image image

JanardanS commented 1 year ago

I just fixed the issue. The problem I had was I normalized the vector light direction before calling hit, when I never normalized point lights. So you can normalize all directions in your code and stay constistent, that should fix it, or you normalize right before calculating colours.