Mathematical formula of Vector Refraction?

…there’s even an incidence angle past which the refracted ray ceases to exist…

I remember this! It’s Critical Angle. Once go past this angle, there’ll only be Total Internal Reflection, as you said.

…formula for the direction of the reflected ray (a very simple one)…

Just want to add that it is: r = i−2[(in)n] with n has already been normalized. I vaguely remember that Blender automatically normalizes n.

…Fresnel coefficients…

I think I will pass this haha. Its math and its theories looks scary. Luckily I’m not having any application for it.


The light simulation site certainly is very useful.


…but this is a forum meant for blender development topics…

Thank you. The Total Internal Reflection was the last thing I needed your help with, I’ve had all my questions answered by you. I will chat with you on Blender.chat when I need your help in the future, hope you don’t mind.


It seems like the developers aren’t planning to implement your codes, they only care about performance, they seem to want to keep it that way. But your patch is still there and they acknowledge it though.
I really appreciate what you’ve done.
I’m lucky to receive help from you. Have a good day!

1 Like

Feel free to hit me up on blender.chat, it’ll be my pleasure!

About the patch, Brecht said that while the “refraction function” shouldn’t be changed — as it is used internally by Blender in other places, and they need the performance — it would be a good idea to write a second, “user-friendly” refraction function, to be used in the node; that way we can have our cake and eat it too. I might go about figuring out how to do that in the weekend.
The Blender devs are very reasonable people, I’d be quite surprised if they refused to change the user-facing node.

1 Like