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_{\text{r}}(\omega _{\text{i}},\,\omega _{\text{r}})\,=\,{\frac {\operatorname {d} L_{\text{r}}(\omega _{\text{r}})}{\operatorname {d} E_{\text{i}}(\omega _{\text{i}})}}\,=\,{\frac {\operatorname {d} L_{\text{r}}(\omega _{\text{r}})}{L_{\text{i}}(\omega _{\text{i}})\cos \theta _{\text{i}}\,\operatorname {d} \omega _{\text{i}}}}

 

ω入射光= fi(θ,φ)

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

 azimuth angle φ and zenith angle θ

 

所以BRDF 是一个四维函数。

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

 

渲染方程:

L_{{{\text{o}}}}({\mathbf  x},\,\omega _{{{\text{o}}}},\,\lambda ,\,t)\,=\,L_{e}({\mathbf  x},\,\omega _{{{\text{o}}}},\,\lambda ,\,t)\ +\,\int _{\Omega }f_{r}({\mathbf  x},\,\omega _{{{\text{i}}}},\,\omega _{{{\text{o}}}},\,\lambda ,\,t)\,L_{{{\text{i}}}}({\mathbf  x},\,\omega _{{{\text{i}}}},\,\lambda ,\,t)\,(\omega _{{{\text{i}}}}\,\cdot \,{\mathbf  n})\,\operatorname d\omega _{{{\text{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
posted on 2016-11-23 15:52  minggoddess  阅读(1573)  评论(0编辑  收藏  举报