Accuracy of the "refract" instruction

Hi all,

I was wondering if the refract instruction in GLSL is accurate from a physical point of view.
I mean that, is the vectorial approach used to compute the refraction vector in GLSL gives the same result as if we applied the law of Snell-Descartes in Physics ?

If it is an approximation, does someone know its quality ?


Maybe this site would help:'s_law

On teh bottom, there is a derivation for a vector form of the law, just compare it to the one in the GLSL specification.

(A hint: they are the same)

And for a wonderful derivation of this, see Glassner’s classic text, volume 2.

see Glassner’s classic text, volume 2.
The name of this classic text being… what?

Sorry, it’s Andrew Glassner’s Principles of Digital Image Synthesis.

Thanks for your replies, I am going to check these out and I’ll post the answer that I will come to.


This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.