2. Contents
• Physically based rendering
• Rendering equation
• Bidirectional Reflectance Distribution Function
• Normalized Lambert
• Cook-Torrance Model
• Image based lighting
• Spherical Coordinates
• Monte Carlo method
• Importance sampling
• Low-discrepancy sequence
• Tone Mapping
• Result
• Running in Unity3D
這是 Kajiya, James T. 於 1986 在 Siggraph提出的論文,也是現代電腦渲染的基礎。
剛看到可能會對這個算式感到複雜而無法理解,但是可以嘗試簡化這個算式,方便去理解數式內容
Kajiya, James T., The rendering equation (PDF), Siggraph 1986, 1986: 143–150, ISBN 978-0-89791-196-2, doi:10.1145/15922.15902Immel, David S.; Cohen, Michael F.; Greenberg, Donald P., A radiosity method for non-diffuse environments (PDF), Siggraph 1986, 1986: 133, ISBN 978-0-89791-196-2, doi:10.1145/15922.15901
假設 x 是渲染物體的某個位置,這個物體表面可能不是很平滑。
用顯微鏡放大 x 點,會發現 x 在一 個平面上(不論這個物體表面多崎嶇)。
半球積分就是考慮 x 點的所有受光影響。
簡化後的渲染方程式只考慮到單一方向來源光的反射。
BRDF 是計算反射光行為的一個機率統計函式。
Li 是光源的 radiant(輻射度),可想像成光的能量。
當入射光源和平面不是垂直時,光的能量不會完全作用在平面上,因此需要計算和平面的法線夾角。
Reflectance 是垂直反射率,在渲染計算上習慣用 F0 表示
n 為 material 的 index of Refraction (折射率, 簡稱 IOR) 。
光線的 Reflectance 是根據傳輸的兩個 material 間的 IOR 來計算
- K.E.Torrance & E.M.Sparrow, "Theory for Off-Specular Reflection From Roughened Surfaces", 1966
- James F. Blinn, "Models of Light Reflection for Computer Synthesized Pictures", 1977
- Robert L. Cook&Kenneth E. Torrance, "A Reflectance Model for Computer Graphics", 1982
- Walter et al. 2007, "Microfacet Models for Refraction through Rough Surfaces"
Burley, B., 2012. Physically-based shading at Disney. http://selfshadow.com/s2012-shading/.
Walter et al. 2007, "Microfacet Models for Refraction through Rough Surfaces"
- [SMITH, B. 1967] Geometrical shadowing of a random rough surface. IEEE Trans. on Antennas and Propagation 15, 668–671.
- Christophe Schlick, "An Inexpensive BRDF Model for Physically based Rendering", 1994
因為光線接觸到其他物體產生間接光,所以單一方向光源的渲染很難接近真實效果。
Brian Karis, "Real Shading in Unreal Engine 4" SIGGRAPH 2013
這裡的三維座標(x,y,z)是在 tangent-space
Wojciech Jarosz‘s Dissertation Appendix A ,https://www.cs.dartmouth.edu/~wjarosz/publications/dissertation/appendixA.pdf
mdf = marginal density function
cdf = cumulative distribution function
由於 ξ1 和 ξ2 的範圍都在 0 ~ 1 之間,因此我可以用一個 2 維的參數 (ξ1 , ξ2) 來取得一個 GGX 分布的法線向量。