“Correct” Glass in AR

Glass Planes

As we know, almost the all ray-tracers are based on Backward Ray-Tracing, cast rays from camera, sample the lights, not emit photon from light sources. So to the important reflection and refraction results, we must choose a right chain of ray paths.

When hit front side, the traced refraction result should be attenuated by distance in media and color, the Fresnel coefficient should be consider the refracted direction as the V if you’re using classic Schlick’s approximation, at the same time, reflection should be also considered the transmitted Fresnel coefficient.

When hit back side, the N must be flipped to calculate reflected and refracted direction, the reflection result should be attenuated but the refraction result. Because we cast refraction ray to external and when hit again, the result will be attenuated by the “front”.

I’m sure I’m right, indeed, the built-in shader of mental ray does not deal with these conditions.

我们都知道如今大部分渲染器是后向的不是前向的。从摄影机发射光线,命中物体后采样。于是乎,对于拥有折射反射的物体,我们必须要考虑正确的光路。

当命中到物体的正面,返回的折射结果需要衰减,同事需要考虑菲涅尔系数。如果你使用的Schlick的那个经典的菲涅尔近似,那么V就等同于折射光线。反射的光线来自于外部,也需要考虑菲涅尔系数。

当命中到物体的背面,物体的法线N需要被反转,以反转后的N计算折射和反射方向。在这里,折射的结果无需衰减而反射的需要。因为反射的可能依旧在物体内部发生(譬如全反射),而折射出去的光线则取决于外部的计算结果。折射反射也都要考虑菲涅尔贡献。

我确信我是对的,事实上mental ray内置的Shader并没有处理这些情况。

原文地址:https://www.cnblogs.com/Jedimaster/p/2195965.html