Photorealistic Rendering
Wanho Choi
fxwano@gmail.com
Radiometry
The science of measuring light
• Time / position / direction
Photometry is also the science of measuring light, but it is based on sensitivity of human eyes rather than physical model. PBR only deals with radiometry exclusively.
However, the visual response can be added as a post-process. This is referred to as tone mapping.
Radiometry uses solid angle in the various radiometry equations.
Solid Angle
𝝎 𝑠𝑡𝑒𝑟𝑎𝑑𝑖𝑎𝑛𝑠The projected area on a unit sphere Max. value: 4𝜋 (for hemisphere: 2𝜋)
If you are at the origin, and I look out, The solid angle tells you
Why Solid Angle?
We need to consider light propagation in a cone.
light source sensor (eye or camera) Infinitesimal area of a surface surface normal infinitesimal hemisphere
Infinitesimal Solid Angle
Differential solid angle(𝑑𝝎) in spherical coordtes
𝑑𝝎 = 𝑠𝑖𝑛𝜃𝑑𝜃𝑑𝜙 r𝑑𝜃 𝑟𝑠𝑖𝑛𝜃𝑑𝜙 𝑠𝑖𝑛𝜃𝑑𝜃 𝜋 0 2𝜋 0 𝑑𝜙 = −𝑐𝑜𝑠𝜋 − 𝑐𝑜𝑠0 2𝜋 0 𝑑𝜙 = 2 2𝜋 0 𝑑𝜙 = 4𝜋
Finite solid angle
Frequently Asked Integral Calculus 2
Integrals over a hemisphere𝑐𝑜𝑠𝑛𝜃 2𝜋 𝑑𝜔 = 𝑐𝑜𝑠𝑛𝜃𝑠𝑖𝑛𝜃𝑑𝜃 𝜋/2 0 2𝜋 0 𝑑𝜙 = 𝑑𝜙 2𝜋 0 𝑐𝑜𝑠𝑛𝜃𝑠𝑖𝑛𝜃𝑑𝜃 𝜋/2 0 = 2𝜋 𝑢𝑛𝑑𝑢 1 0 = 2𝜋 𝑢 𝑛+1 𝑛 + 1 0 1 = 2𝜋 𝑛 + 1
Radiometric Quantities
𝑄: energy [J]• A count of photons
𝛷: flux [𝑊]
• Radiant energy per time
𝐸, 𝐵: flux density [𝑊𝑚−2]
• 𝐸 : arriving density (=irradiance) • 𝐵 : radiant density (=radiosity)
𝐿: radiance [𝑊𝑚−2𝑠𝑟−1]
• 𝑑𝝎⊥ = 𝑐𝑜𝑠𝜃𝑑𝝎 = 𝒏 ⋅ 𝝎 𝑑𝝎
(projected solid angle)
𝑄 = 𝑄
𝜆𝑑𝜆
∞ 0𝛷 =
𝑑𝑄
𝑑𝑡
𝐸 =
𝑑𝛷
𝑑𝑨
⊥𝐿 =
𝑑𝐸
𝑑𝝎
differentiation integration differentiation integration differentiation integrationUniformly spread flux
Point Light Source
𝐸 = Φ 4𝜋𝑟2 Φ[𝑊] 𝜃 𝐸′ = Φ𝑐𝑜𝑠𝜃 4𝜋𝑟2 𝐸′ = 𝐸𝑐𝑜𝑠𝜃
Radiance
Radiance is the most important quantity for ray tracing. The response of a sensor (cameras, human eyes)
is proportional to radiance.
• In this moment, we are seeing the radiance of the world.
The flux per unit solid angle per unit projected area
Radiance
𝒙 𝒅𝐴 𝒅𝐴⊥ 𝜽 𝝎 𝒏 𝐿 𝒙, 𝝎 = 𝑑𝐸 𝑑𝝎 = 𝑑 𝑑𝝎 𝑑𝛷 𝑑𝐴⊥ = 𝑑2𝛷 𝑑𝐴⊥𝑑𝝎 = 𝑑2𝛷 𝑑𝐴𝑐𝑜𝑠𝜃𝑑𝝎 = 𝑑2𝛷 𝑑𝐴(𝒏 ⋅ 𝝎)𝑑𝝎Sometimes, radiance can be thought as the intensity of light at a given point in a given direction.
Radiance
𝒙
𝝎
Radiance
Radiance is constant as it propagates along a ray.
• Radiance doesn’t change with distance.
• Exception: participating media
(∵ 𝑑𝝎1 = 𝑑𝝎2 & 𝑑𝐴1 = 𝑑𝐴2) ⟺ 𝐿1𝑑𝝎1𝑑𝐴1 = 𝐿2𝑑𝝎2𝑑𝐴2
∴ 𝐿1 = 𝐿2 𝑑Φ1 = 𝑑Φ2
Total incoming radiance at 𝒙 = the irradiance at 𝒙
Radiance
𝐸(𝒙) = 𝑑𝐸 𝛺 = 𝐿(𝒙, 𝝎)(𝒏 ⋅ 𝝎)𝑑𝝎 𝛺 𝜴: hemispherefrom other light sources (direct illumination) from other objects (indirect illumination)
𝒙
Bidirectional Reflectance Distribution Function
How much light coming in from direction 𝝎𝑖 is reflected out in direction 𝝎𝑜 at surface point 𝒙.
Reflection Equation
𝐿𝑜 𝒙, 𝝎𝑜 = 𝑓𝑟 𝒙, 𝝎𝑖, 𝝎𝑜 𝐿𝑖(𝒙, 𝝎𝑖)(𝒏 ∙ 𝝎𝑖)𝒅𝝎𝑖 Ω BRDF 𝒙 𝒏 𝑑𝝎𝑜 𝜴: hemisphereBRDF
Bidirectional Reflectance Distribution Function
• The amount of light that is scattered in each outgoing angle for
each incoming angle
• How much light coming in from direction 𝝎𝑖 is reflected out in
direction 𝝎𝑜 at surface point 𝒙.
• The relative distribution of the surface reflection of light from 𝝎𝑖 at
point 𝒙. 𝑓𝑟 𝒙, 𝝎𝑖, 𝝎𝑜 = 𝑑𝐿𝑜(𝒙,𝝎𝑜) 𝑑𝐸𝑖(𝒙) = 𝑑𝐿𝑜(𝒙,𝝎𝑜) 𝐿𝑖(𝒙,𝝎𝑖)(𝒏∙𝝎𝑖)𝒅𝝎𝑖 𝑠𝑟 −1
• 𝒙: the interesting point
• 𝒏: the unit surface normal at 𝒙
• 𝝎𝑖: solid angle from 𝒙 to the incoming direction
BRDF Visualization
LobeProperties of BRDF
Reciprocity (bidirectionality, symmetry)
• 𝑓𝑟 𝒙, 𝝎𝑖, 𝝎𝑜 = 𝑓𝑟 𝒙, 𝝎𝑜, 𝝎𝑖
• Light paths can be traced in the opposite direction that light would
normally travel.
Linearity
• When using multiple BRDFs, the total reflected radiance at a
surface point is sum of the reflected radiance from each BRDF.
Energy conservation
• 𝑓𝛺 𝑟 𝒙, 𝝎𝑖, 𝝎𝑜 (𝒏 ∙ 𝝎𝑖)𝒅𝝎𝑖 ≤ 1
Reflectance (𝝆)
Albedo: 𝜌 𝒙 = 𝐵 𝒙 𝐸 𝒙 = 𝐿𝛺 𝑜 𝒏⋅𝝎 𝑑𝝎 𝐸 𝒙 0 ≤ 𝜌 𝒙 ≤ 1Ideal diffuse reflection (Lambertian)
• 𝐿𝑜 𝒙 is identical in all directions. (constant)
• 𝜌𝑑 𝒙 = 𝐿𝑜 𝒙
𝐸 𝒙 𝝅 ⇔ 𝑓𝑟,𝑑 𝒙 =
𝜌𝑑 𝒙 𝝅
Ideal specular reflection (mirrorlike)
• 𝐿𝑜 𝒙 is non-zero only in the mirror direction.
• 𝜌𝑠 𝒙 = 𝐿𝑜 𝒙
𝐸 𝒙
1
Rendering Equation
BRDF does not consider fluoresce or emitting surfaces. 𝐿 𝒙, 𝝎𝑜 = 𝐿𝑒 𝒙, 𝝎𝑜 + 𝑓𝑟 𝒙, 𝝎𝑖, 𝝎𝑜 𝐿 𝒙, 𝝎𝑖 𝒏 ⋅ 𝝎𝑖 𝑑𝝎𝑖
Ω
No analytic solution Very difficult to solve
radiance at 𝒙 in 𝝎𝑜
radiance emitted from surface radiance reflected by surface