• BRDF


    Q  radiant energy:      J        

    Φ  radiant flux:       W        dQ/dt

    E  irradiance:        W/m2      dΦ/dA

    I  radiant intersity:     W/sr        dΦ/dω

    L  radiance:         W/(m2sr)    d2Φ/dAproj

    BRDF 双向反射分布函数

    f_{	ext{r}}(omega _{	ext{i}},\,omega _{	ext{r}})\,=\,{frac {operatorname {d} L_{	ext{r}}(omega _{	ext{r}})}{operatorname {d} E_{	ext{i}}(omega _{	ext{i}})}}\,=\,{frac {operatorname {d} L_{	ext{r}}(omega _{	ext{r}})}{L_{	ext{i}}(omega _{	ext{i}})cos 	heta _{	ext{i}}\,operatorname {d} omega _{	ext{i}}}}

    ω入射光= fi(θ,φ)

    ωo 出射光 = fo(θ,φ)

     azimuth angle φ and zenith angle θ

    所以BRDF 是一个四维函数。

     https://en.wikipedia.org/wiki/Bidirectional_reflectance_distribution_function

    渲染方程:

    L_{{{	ext{o}}}}({mathbf  x},\,omega _{{{	ext{o}}}},\,lambda ,\,t)\,=\,L_{e}({mathbf  x},\,omega _{{{	ext{o}}}},\,lambda ,\,t) +\,int _{Omega }f_{r}({mathbf  x},\,omega _{{{	ext{i}}}},\,omega _{{{	ext{o}}}},\,lambda ,\,t)\,L_{{{	ext{i}}}}({mathbf  x},\,omega _{{{	ext{i}}}},\,lambda ,\,t)\,(omega _{{{	ext{i}}}}\,cdot \,{mathbf  n})\,operatorname domega _{{{	ext{i}}}}

    dω = sinθdθdφ

    推导:

        --PBR,From Theory to Impllementation

    Microfacet Theory

    f = D()G()R()

    Microfacet Distrbution Function,D

    Shadowing-Masking Function,G 

      Beckmann Distribution with width parameter b:

      Phong Distribution with exponent parameter ,p:

      GGX Distribution with width parameter ,g:

    Fresnel reflectance Function,R

    Schlick

    Local Subsurface scattering :Diffuse

    https://en.wikipedia.org/wiki/Diffuse_reflection

    Normalized BRDF 的推导

    Lambert

    Phong

    Directional hemispherical reflectance

    R(l) <=1

     ===========================================

    unity的 BRDF1_Unity_PBS

    // Main Physically Based BRDF
    // Derived from Disney work and based on Torrance-Sparrow micro-facet model
    //
    // BRDF = kD / pi + kS * (D * V * F) / 4
    // I = BRDF * NdotL
    //
    // * NDF (depending on UNITY_BRDF_GGX):
    // a) Normalized BlinnPhong
    // b) GGX
    // * Smith for Visiblity term
    // * Schlick approximation for Fresnel

    BRDF = kD/pi + kS *(D*V*F)/4

    I = BRDF * NdotL

    • NDF (depending on UNITY_BRDF_GGX):
         a) Normalized BlinnPhong
         b) GGX
    • V -Visiblity term -Smith
    • Schlick approximaation for Fresnel --specular比例

    color =  diffuseColor* (gi.diffuse + light.color * diffuseTerm)

        + light.color * specularTerm * FresnelTerm

        + surfaceReduction *gi.specular * FresnelLerp

    // Based on Minimalist CookTorrance BRDF
    // Implementation is slightly different from original derivation: http://www.thetenthplanet.de/archives/255
    //
    // * NDF (depending on UNITY_BRDF_GGX):
    // a) BlinnPhong
    // b) [Modified] GGX
    // * Modified Kelemen and Szirmay-​Kalos for Visibility term
    // * Fresnel approximated with 1/LdotH
     
    half3 color = (diffColor + specularTerm * specColor) * light.color * nl
    + gi.diffuse * diffColor
    + surfaceReduction * gi.specular * FresnelLerpFast (specColor, grazingTerm, nv);
     
    // Old school, not microfacet based Modified Normalized Blinn-Phong BRDF
    // Implementation uses Lookup texture for performance
    //
    // * Normalized BlinnPhong in RDF form
    // * Implicit Visibility term
    // * No Fresnel term
     
     
    GI 
    gi.diffuse
    gi.specular
  • 相关阅读:
    23.Java函数
    22.java中的break和continue关键字
    21.Java中for循环
    20.java中的while循环
    19.java中选择判断语句(switch)
    18.java中判断(if…else)
    17.java运算符的优先级与结合性
    16.Java三元运算符
    数组去重
    数组 字符串 对象 常用方法
  • 原文地址:https://www.cnblogs.com/minggoddess/p/6093982.html
Copyright © 2020-2023  润新知