User liquidificador solved the problem.
Hi everyone,
The only Vector Refraction formula I could find online is:
t = √(1−μ²[1−(n•i)²])n+μ[i−(n•i)n]
, such that t is the refracted vector, n is the normal vector, i is the incident vector and μ = nᵢ/nₜ
Is this the formula that was implemented into Blender which is used to find the refracted vector?
- If it’s not, then what is? This is the only formula I could find online and it works pretty well too.
- If it is, please check out the following question:
I made a mathematical example here and compared it to Blender. And Blender’s Vector Refraction didn’t output the same refracted vector as the above formula:
(Figure 1)
Description:
The wall of numbers at the top is my detailed calculation of finding the refracted vector. The 2 sketches at the bottom is the comparison between my output and Blender’s output, and they are different.
- The left screenshot is a (2,2,2) cube before being applied with Vector Refraction node, the corner nearest to your eyes is i = <2,2,2> which I intended to apply the formula onto. (Also, the blue cube is the original (1,1,1) cube).
- The right screenshot is after applying n = <2,2,0> and μ = nᵢ/nₜ = 1/1.333 = 0.75 into the node. You can see that i = <2,2,2> doesn’t flip to point in the opposite direction and down, like in my expectation. It only flipped but didn’t point down.
What are your thoughts on this?
Thank you. Any help is greatly appreciated!