Refraction vector (ray tracing)

I do ray tracing and I do ray refraction using the following relation (I got it from a PDF called Reflexes and Refractions in Ray Tracing):

enter image description here

enter image description here

But I saw this in another PDF as follows: enter image description here

Could you explain to me why?

And how can I assure that my refractive vector, which I calculated, is correct?

thanks

+1
source share
1 answer

Assuming your vectors are actually xyz triplets:

float3 reflect( float3 i, float3 n ) { return i - 2.0 * n * dot(n,i); } 
0
source

Source: https://habr.com/ru/post/944591/


All Articles