How does Blender outputs refracted vector from Vector Refraction node?

I’m told that Blender implemented OpenGL’s code as its Vector Refraction function. Here’s the code in mathematical function form: t = μ[i−(ni)n]−√(1−μ²[1−(ni)²])n

I notice that Blender’s output of refracted vector doesn’t make sense at all.

I have:

  • incident vector i = <−2,−2,−2>

ask1ask2

the black dot you see is i = <−2,−2,−2>)

  • normal vector n = <2,2,0>
  • Ratio of IORs: nᵢ/nₜ = 1/1.333 = 0.75

I input those pieces of information into Vector Refraction node like this
3en0kuy24lv91

So, Blender’s refracted vector looks like this:
egyk1wy24lv91

, it approximately is t = <−1.5,−1.5,−1.5> which doesn’t make sense since its magnitude isn’t even equal to the incident vector’s magnitude.

What’s wrong with Blender? Did I do something wrong?

Please help. Thank you!

Hello if that’s not already the case you can ask that question on : https://devtalk.blender.org/
Good luck !

1 Like

Mind share a link for the record?

greetings, Kologe