折射向量(光线追踪) [英] Refraction Vector (Ray tracing)

查看:557
本文介绍了折射向量(光线追踪)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做光线追踪和我用下面的关系光线的折射(我从PDF格式被称为重新FL ections和折射的光线跟踪得到了它):

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"):

不过,我已经看到它在其他PDF如下:

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?

感谢

推荐答案

假设你的载体实际上是某某三胞胎:

Assuming that your vectors are actually xyz triplets:

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

这篇关于折射向量(光线追踪)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆