Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you calculate the Angle of Incidence?

I'm working on a raytracer for a large side project, with the goal being to produce realistic renders without worrying about CPU time. Basically pre-rendering, so I'm going for accuracy over speed.

I'm having some trouble wrapping my head around some of the more advanced math going on in the lighting aspects of things. Basically, I have a point for my light. Assuming no distance falloff, I should be able to use the point on the polygon I've found, and compare the normal at that point to the angle of incidence on the light to figure out my illumination value. So given a point on a plane, the normal for that plane, and the point light, how would I go about figuring out that angle?

The reason I ask is that I can't seem to find any reference on finding the angle of incidence. I can find lots of references detailing what to do once you've got it, but nothing telling me how to get it in the first place. I imagine it's something simple, but I just can't logic it out.

Thanks

like image 398
Nicholas Flynt Avatar asked Feb 28 '23 23:02

Nicholas Flynt


1 Answers

The dot product of the surface normal vector and the incident light vector will give you the cosine of the angle of incidence, if you've normalised your vectors.

like image 66
Ian Hopkinson Avatar answered Mar 12 '23 08:03

Ian Hopkinson