zoukankan      html  css  js  c++  java
  • “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并没有处理这些情况。

  • 相关阅读:
    vue项目使用async await 封装 axios
    vue实现预览功能(包括doc,pdf,图片,视频)
    vue中实现下载文件功能
    vue项目中加入拖放排序功能
    Vue项目中生成二维码
    position跟display、overflow、float这些特性相互叠加后会怎么样?
    localStorage使用注意
    webpack 使用总结
    cookie作用域
    语法糖的理解
  • 原文地址:https://www.cnblogs.com/Jedimaster/p/2195965.html
Copyright © 2011-2022 走看看