dilevin / computer-graphics-ray-tracing

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

How do we use max_t #48

Closed pjsmith97 closed 4 years ago

pjsmith97 commented 4 years ago

Hey, still working on the assignment due to circumstances.

Exactly what is the purpose of max_t? It might have something to do with the problem I'm having, where part of the sphere isn't getting anything but ambient light.

Here is the diffuse image with just ambient light.

rgb (1)

I do want to stress that I understand what max_t is, but I don't understand what we do with it.

darren-moore commented 4 years ago

Are you taking into account both light sources?

max_t, along with the direction vector can be used to determine the distance from the point to a light source. You'll find it useful in shadow computations. I don't think that's your issue here.

pjsmith97 commented 4 years ago

I do iterate over all the lights (And have point and directional covered). I noticed that in the first instance of finding n dot l (this is the directional light) it's a negative value. I can't tell if it's on the sphere in this instance, but is it possible I'm having sign issues?

pjsmith97 commented 4 years ago

Figured it out. I misunderstood d from directional light. Didn't realize it was the direction from the light, not the scene.