12/02/2017

Applications

 To render realistic looking materials  Applications also in computer vision, optical engineering, Reflection models and radiometry remote sensing, etc.  To understand Advanced Graphics how surfaces reflect light Rafał Mantiuk Computer Laboratory, University of Cambridge

Last year you learned about Phong Applications reflection model

 Many applications require faithful reproduction of material appearance

Source: http://ikea.com/

Good for plastic objects, not very accurate for other materials

Source: http://www.mercedes-benz.co.uk/ Pictures courtasy of MIT, Lecture Notes 6.837

Rendering equation Radiance

 Most rendering methods require solving an (approximation) of  Power of light per unit projected area per unit solid angle the rendering equation: Integral over the  Symbol: 퐿(풙, 흎 ) Incident light 𝑖 hemisphere of 푊 incident light  Units: Steradian 푚2푠푟 퐿푟 흎풓 = 휌 흎풊, 흎풓 퐿𝑖 휔𝑖 푐표푠휃𝑖푑흎풊 Ω BRDF Reflected light

 The solution is trivial for point light sources  Much harder to estimate 흎풓 the contribution of other surfaces 흎풊 = 휙푖, 휃푖

1 12/02/2017

Solid angle Radiance Power of light Angle in 2D Equivalent in 3D Position 푑휙 퐿 풙, 흎 = 풊 푑휔 푑퐴 푐표푠휃 휃 Incoming direction Projected area 퐿 퐴  Power per solid angle per projected surface area 휃 = [푟푎푑] 휔 = [푠푟] 푅 푅2  Invariant along the direction of propagation (in vacuum)  Response of a camera sensor or a human eye is related to radiance  Pixel values in image are related to radiance (projected Full circle = 2π radiance  Full sphere = 4 π steradians along the view direction)

Relation between Irradiance and Irradiance and Exitance Radiance

 Power per unit area  Irradiance is an integral over all incoming rays  Irradiance: H(x) – incident power per unit area  Integration over a hemisphere Ω:  Exitance / radiosity: E(x) – exitant power per unit area 퐻 = 퐿 풙, 흎풊 푐표푠휃 푑휔  Units: 푊 Ω  In the spherical coordinate system, the differential solid angle 푚2 is: Irradiance Exitance / Radiosity 푑휔 = sin 휃푑휃 푑휙  Therefore: 휋 2휋 2 퐻 = 퐿 풙, 흎풊 푐표푠휃 푠𝑖푛휃 푑휃 푑휙 휙=0 휃=0  For constant radiance: 퐻 = 휋퐿

BRDF: Bidirectional Reflectance Distribution Function BRDF of various materials Reflected light

Differential radiance of reflected light Incident light

 푑퐿푟(흎풓) 푑퐿푟(흎풓) The diagrams show 휌 흎풊, 흎풓 = = the distribution of 푑퐻𝑖(흎풊) 퐿𝑖 흎풊 푐표푠휃𝑖푑흎풊 reflected light for the Aluminium; λ=2.0μm Source: Wikipedia given incoming Differential irradiance of incoming light direction  The material samples Aluminium; λ=0.5μm are close but not  BRDF is measured as a ratio of reflected radiance to irradiance accurate matches for the diagrams  Because it is difficult to measure 퐿𝑖 흎풊 , BRDF is not defined as the ratio 퐿푟 흎풓 /퐿𝑖 흎풊 Magnesium alloy; λ=0.5μm

2 12/02/2017

Other material models Sub-surface scattering

Source: Guarnera et al. 2016  Light enters material and is scattered several times before it exits  Examples - human skin: hold a flashlight next to your hand and see the color of the light  The effect is expensive to compute  Bidirectional Scattering Surface Reflectance Distribution F.  But approximate methods exist  Bidirectional Reflectance Distribution Function  Bidirectional Transfer Distribution Function  But also: BTF, SVBRDF, BSDF  In this lecture we will focus on BRDF only

Subsurface scattering - examples BRDF Properties  Helmholtz reciprocity principle  BRDF remains unchanged if incident and reflected directions are interchanged

휌 흎풓, 흎풊 = 휌(흎풊, 흎풓)

 Smooth surface: isotropic BRDF  reflectivity independent of rotation around surface normal  BRDF has only 3 instead of 4 directional degrees of freedom

휌(휃푖, 휃푟, 휙푟 − 휙푖)

BRDF Properties BRDF Measurement

 Characteristics  Gonio-Reflectometer  BRDF units [1/sr]  BRDF measurement  Not intuitive  point light source position (,)  Range of values:  light detector position (o ,o)  From 0 (absorption) to  (reflection, δ -function)  4 directional degrees of freedom  Energy conservation law  BRDF representation 휌 휔푟, 휔푖 푐표푠휃푖푑휔푖 ≤ 1 – m incident direction samples (,) Ω – n outgoing direction samples (o ,o)  No self-emission – m*n reflectance values (large!!!)  Possible absorption

 Reflection only at the point of entry (xi = xr)  No subsurface scattering Stanford light gantry

3 12/02/2017

BRDF Modeling Diffuse Reflection

 It is common to split BRDF into diffuse, mirror and glossy components  Light equally likely to be reflected in any outgoing  Ideal diffuse reflection  Lambert’s law direction (independent of incident direction)  Matte surfaces  Constant BRDF 휌 휔푟, 휔푖 = 푘푑 = 푐표푛푠푡  Ideal specular reflection  Reflection law  Mirror 퐿푟 휔푟 = 푘푑퐿푖 휔푖 푐표푠휃푖푑휔푖 = 푘푑 퐿푖 휔푖 cos 휃푖푑휔푖 = 푘푑퐻  Glossy reflection Ω Ω  Directional diffuse  k : diffuse coefficient, material property [1/sr]  Shiny surfaces d

I N Lr= const

Diffuse reflection Reflection Geometry N  Cosine term  Direction vectors (all normalized): -(I•N)N R(I)  The surface receives  N: surface normal less light per unit area  I: vector to the light source I -(I•N)N at steep angles of  V: viewpoint direction vector incidence  H: halfway vector H= (I + V) / |I + V| I  Rough, irregular  R(I): reflection vector R(I)= I - 2(I•N)N Top view surface results in R(V) diffuse reflection  Tangential surface: local plane H N  Light is reflected in N R(I) I R(I) random direction I R(V)  (this is just a model, V V light interaction is H more complicated)

Glossy Reflection Glossy Reflection

 Due to surface roughness  Empirical models  Phong  Blinn-Phong  Physical models  Blinn  Cook & Torrance

4 12/02/2017

Phong Reflection Model Phong Exponent ke 푘푒  Cosine power lobe 휌 휔푟, 휔푖 = 푘푠 푅 ∙ 푉

푘푒 휌 휔푟, 휔푖 = 푘푠 푅 ∙ 푉  Determines the size of highlight

 Dot product & power  Not energy conserving/reciprocal  Plastic-like appearance

N R(I) I

V

Blinn-Phong Reflection Model Phong Illumination Model

 Blinn-Phong reflection model  Extended light sources: l point light sources

푘푒 휌 휔푟, 휔푖 = 푘푠 퐻 ∙ 푁

ke  LightLr source,kaLi, aviewerkd farL awayl(IlN)ksLl(R(Il)V)(Phong) l l  I, R constant: H constant ke  Colour of specular reflection equal to light source H lessLr expensivekaLi,a tok computedLl(IlN)ksLl(HlN)(Blinn) l l  Heuristic model  Contradicts physics H N  Purely local illumination I  Only direct light from the light sources V  No further reflection on other surfaces  Constant ambient term  Often: light sources & viewer assumed to be far away

Micro-facet model Ward Reflection Model

 We can assume that at small scale materials  BRDF ∠(퐻, 푁) are made up of small facets exp − tan2 푘푑 1 휎2 휌 = + 푘푠  Facets can be described by the distribution of 휋 (퐼 ∙ 푁)(푉 ∙ 푁) 2휋휎2 their sizes and directions D Rendering of glittery materials  Some facets are occluded by other, hence there is [Jakob et al. 2014] also a geometrical attenuation term G   standard deviation (RMS) of surface slope  And we need to account for Fresnel reflection (see next slides)  Simple expansion to anisotropic model (x, y) 퐷 ∙ 퐺 ∙ 퐹  Empirical, not physics-based 휌 휔 , 휔 = 푖 푟 4 cos 휃 휃 푖 푟  Inspired by notion of reflecting microfacets  Convincing results  Good match to measured data

5 12/02/2017

Cook-Torrance model Fresnel term

 Can model metals and dielectrics  Sum of diffuse and specular components

휌 휔푖, 휔푟 = 휌푑 휔푖 + 휌푠(휔푖, 휔푟)

 Specular component: 퐷 ℎ 퐺 휔푖, 휔푟 퐹(휔푖) 휌 휔푖, 휔푟 = 휋 cos 휃푖 cos 휃푟 훼 2 −  Distribution of microfacet orientations: 퐷 ℎ = cos 휃푟 푒 푚  The light is more likely to be Example from: https://www.scratchapixel.com/lessons/3d- basic-rendering/introduction-to-/reflection-refraction- Roughness reflected rather than fresnel  Geometrical attenuation factor parameter transmitted near grazing angles  To account to self-masking and shadowning  The effect is modelled by Fresnel equation: it gives the 2(푛 ∙ ℎ)(푛 ∙ 휔푟) 2(푛 ∙ ℎ)(푛 ∙ 휔푖) probability that a photon is reflected rather than 퐺 휔푖, 휔푟 = 푚𝑖푛 1, , 휔푟 ∙ ℎ 휔푟 ∙ ℎ transmitted (or absorbed)

Fresnel equations Fresnel term

 Reflectance for s-polarized light:  In the Fresnel equation is approximated by Schlick’s formula [Schlick, 94]:

5 푅 휃, 휆 = 푅0 휆 + 1 − 푅0 휆 1 − 푐표푠휃  Reflectance for p-polarized light:

 where 푅0 휆 is reflectance at normal incidence and 휆 is the wavelength of light  For dielectrics (such as glass): 2 푛 휆 − 1 푅 휆 = 0 푛 휆 + 1

Which one is Phong / Cook-Torrance ? Image based lighting (IBL)

1. Capture an HDR image of a light probe

2. Create an 3. Use the illumination illumination (cube) map map as a The scene is source of light surrounded by a in the scene cube map

36 Source: Image-based lighting, Paul Debevec, HDR Symposium 2009

6 12/02/2017

37 38

Blender monkeys + IBL (path tracing)

39

Further reading

 A. Watt, 3D Computer Graphics  Chapter 7: Simulating light-object interaction: local reflection models  Eurographics 2016 tutorial  D. Guarnera, G. C. Guarnera, A. Ghosh, C. Denk, and M. Glencross  BRDF Representation and Acquisition  DOI: 10.1111/cgf.12867

 Some slides have been borrowed from Computer Graphics lecture by Hendrik Lensch  http://resources.mpi- inf.mpg.de/departments/d4/teaching/ws200708/cg/slides/CG07-Brdf+Texture.pdf

7