问题
I am doing ray tracing and I do the refraction of the ray using the following relation (I got it from PDF called "Reflections and Refractions in Ray Tracing"):
But I have seen it in another PDF as follows:
Could you please explain for me why?
And how can I reassure that my refraction vector that I calculated is correct?
Thanks
回答1:
Assuming that your vectors are actually xyz triplets:
float3 reflect( float3 i, float3 n )
{
return i - 2.0 * n * dot(n,i);
}
来源:https://stackoverflow.com/questions/19548384/refraction-vector-ray-tracing