Welcome! Todays Agenda: Introduction Light Sources Materials - - PowerPoint PPT Presentation

welcome today s agenda
SMART_READER_LITE
LIVE PREVIEW

Welcome! Todays Agenda: Introduction Light Sources Materials - - PowerPoint PPT Presentation

INFOGR Computer Graphics J. Bikker - April-July 2015 - Lecture 9 : Shading Models Welcome! Todays Agenda: Introduction Light Sources Materials Sensors Shading INFOGR Lecture 9 Shading


slide-1
SLIDE 1

INFOGR – Computer Graphics

  • J. Bikker - April-July 2015 - Lecture 9: “Shading Models”

Welcome!

slide-2
SLIDE 2

Today’s Agenda:

  • Introduction
  • Light Sources
  • Materials
  • Sensors
  • Shading
slide-3
SLIDE 3

Introduction

INFOGR – Lecture 9 – “Shading Models” 3 The Quest for (Photo-)Realism

  • Objective in modern games
  • Important improvements when using ray tracing

(more in the next lecture, ‘ground truth’) The core algorithms of ray tracing and rasterization model light transport (with or without visibility): Other factors:

  • Material interactions
  • Light models
  • Sensor models

𝑀 𝑞 → 𝑠 = 𝑀𝑓 𝑞 → 𝑠 +

𝑗=1 𝑂𝑀

𝑀 𝑟𝑗 → 𝑞 𝑔

𝑠 𝑟𝑗 → 𝑞 → 𝑠 𝐻(𝑟𝑗 ↔ 𝑞)

slide-4
SLIDE 4

Introduction

INFOGR – Lecture 9 – “Shading Models” 4 Material interactions

slide-5
SLIDE 5

Introduction

INFOGR – Lecture 9 – “Shading Models” 5 Material interactions

slide-6
SLIDE 6

Introduction

INFOGR – Lecture 9 – “Shading Models” 6 Material interactions

slide-7
SLIDE 7

Introduction

INFOGR – Lecture 9 – “Shading Models” 7 Light models

slide-8
SLIDE 8

Introduction

INFOGR – Lecture 9 – “Shading Models” 8 Light models

crepuscular rays

slide-9
SLIDE 9

Introduction

INFOGR – Lecture 9 – “Shading Models” 9 Light models

crepuscular rays

slide-10
SLIDE 10

Introduction

INFOGR – Lecture 9 – “Shading Models” 10 Light models

slide-11
SLIDE 11

Introduction

INFOGR – Lecture 9 – “Shading Models” 11 Light models

slide-12
SLIDE 12

Introduction

INFOGR – Lecture 9 – “Shading Models” 12 Light models

slide-13
SLIDE 13

Introduction

INFOGR – Lecture 9 – “Shading Models” 13 Light models

slide-14
SLIDE 14

Introduction

INFOGR – Lecture 9 – “Shading Models” 14 Light models

slide-15
SLIDE 15

Introduction

INFOGR – Lecture 9 – “Shading Models” 15 Light models

slide-16
SLIDE 16

Introduction

INFOGR – Lecture 9 – “Shading Models” 16 Sensor models

slide-17
SLIDE 17

Introduction

INFOGR – Lecture 9 – “Shading Models” 17

  • 1. Light is emitted by a light source
  • 2. Light interacts with the scene
  • 3. Light is absorbed by a sensor

Absorption Scattering

slide-18
SLIDE 18

Today’s Agenda:

  • Introduction
  • Light Sources
  • Materials
  • Sensors
  • Shading
slide-19
SLIDE 19

Light Sources

INFOGR – Lecture 9 – “Shading Models” Directional lights Directional light, such as the light from the sun: Specified by a normalized, reversed vector 𝑀. Power is specified as energy travelling through a unit surface area, perpendicular to 𝑀. This quantity is called irradiance ; units: 𝑋 𝑛−2𝑡−1. The symbol for irradiance is 𝐹. 19 𝑀 For practical purposes, we will express the energy as RGB vectors. Note that R,G,B can exceed 1, unlike e.g. colors in a painting.

slide-20
SLIDE 20

Light Sources

INFOGR – Lecture 9 – “Shading Models” Directional lights When illuminating a surface, we need to know how much light arrives at a unit area on the surface, i.e. how much light passes through a unit surface area perpendicular to 𝑂. For this, we multiply by the cosine of the angle between 𝑂 and 𝑀, i.e. 𝑂 ∙ 𝑀. Note that the cosine is clamped to 0, to prevent negative contributions from light arriving from the backside of the surface. 20 𝑀 𝑂 𝐹 = 𝐹𝑀𝑑𝑝𝑡𝜄𝑗 𝐹 = 𝐹𝑀max(𝑂 ∙ 𝑀, 0)

slide-21
SLIDE 21

Light Sources

INFOGR – Lecture 9 – “Shading Models” Irradiance The unit surface may receive light from many

  • directions. For multiple lights, irradiance is

additive, and represents the energy arriving

  • ver the hemisphere:

𝐹 = 𝑙=1

𝑜

𝐹𝑀𝑙 𝑑𝑝𝑡 𝜄𝑗𝑙

21 𝑂

slide-22
SLIDE 22

Today’s Agenda:

  • Introduction
  • Light Sources
  • Materials
  • Sensors
  • Shading
slide-23
SLIDE 23

Materials

INFOGR – Lecture 9 – “Shading Models” Material properties:

  • Texture + detail texture
  • Shader
  • Normal map
  • Specular map
  • Color

Used to simulate the interaction of light with a material. Interaction:

  • Absorption
  • Scattering

23

slide-24
SLIDE 24

Materials

INFOGR – Lecture 9 – “Shading Models” Absorption: Happens on ‘optical discontinuities’. Light energy is converted in other forms of energy (typically heat), and disappears from

  • ur simulation.

Materials typically absorb light with a certain wavelength, altering the color of the scattered

  • light. This is how we perceive material color.

24

slide-25
SLIDE 25

Materials

INFOGR – Lecture 9 – “Shading Models” Scattering Happens on ‘optical discontinuities’. Scattering causes light to change direction. Note that the amount of energy does not change due to scattering. Light leaving the hemisphere can never exceed light entering the hemisphere, unless the material is emissive. 25

slide-26
SLIDE 26

Materials

INFOGR – Lecture 9 – “Shading Models” Light / surface interaction In: irradiance (𝐹), from all directions over the hemisphere. Out: exitance (𝑁), in all directions over the hemisphere. The relation between 𝐹 and 𝑁 is linear: doubling irradiance doubles exitance.

𝑁 𝐹 must be in the range 0..1.

26

slide-27
SLIDE 27

Today’s Agenda:

  • Introduction
  • Light Sources
  • Materials
  • Sensors
  • Shading
slide-28
SLIDE 28

Sensors

INFOGR – Lecture 9 – “Shading Models” Sensors typically consists of many small sensors:

  • Rods and cones in the eye
  • Dye particles in the film
  • Pixel elements in a CCD
  • A ray in a ray tracer
  • A fragment in a rasterizer

Note that we cannot use irradiance to generate an image: irradiance is a measure for light arriving from all directions. 28 𝑂

slide-29
SLIDE 29

Sensors

INFOGR – Lecture 9 – “Shading Models” Pinhole camera To capture light from a specific direction, we use a camera with a small opening (the aperture), so that each sensor can ‘see’ a small set of incoming directions. 29

slide-30
SLIDE 30

Sensors

INFOGR – Lecture 9 – “Shading Models” Radiance Using a pinhole camera, the sensors become directionally specific: they average light over a small area, and a small set of incoming directions. This is referred to as radiance : The density of light flow per area per incoming direction. Units: 𝑋 𝑛−2𝑡𝑠−1𝑡−1. Symbol: 𝑀 30 2𝜌

Radians: length of arc

  • n unit circle

Steradians: area of surface

  • n unit sphere

4𝜌

slide-31
SLIDE 31

Sensors

INFOGR – Lecture 9 – “Shading Models” Summing it up:

  • Light arrives from all light sources on point 𝑄;
  • The energy flow per unit area, perpendicular to 𝑀 is projected on a

surface perpendicular to 𝑂. This is irradiance, or: 𝐹.

  • Exitant light 𝑁 is scattered over all directions on the hemisphere.
  • Light scattered towards the eye arrives at a sensor.
  • The sensor detects radiance: light from a specific set of directions.

31 P 𝑀 𝑂 𝜄 𝑊

slide-32
SLIDE 32

Today’s Agenda:

  • Introduction
  • Light Sources
  • Materials
  • Sensors
  • Shading
slide-33
SLIDE 33

Shading

INFOGR – Lecture 9 – “Shading Models” Definition Shading: the process of using an equation to compute the outgoing radiance 𝑀𝑝 along the view ray 𝑊, based on material properties and light sources. 33 Diffuse or Lambert BRDF, also called “N dot L shading”

slide-34
SLIDE 34

Shading

INFOGR – Lecture 9 – “Shading Models” Lambert shading model The diffuse shading model is: 𝑁𝑒𝑗𝑔𝑔 = 𝑑𝑒𝑗𝑔𝑔 𝜌 𝐹𝑀𝑗𝑑𝑝𝑡𝜄𝑗 This takes into account:

  • Projection of the directional light on the normal;
  • Absorption due to material color 𝑑𝑒𝑗𝑔𝑔.

Distance attenuation is represented in 𝐹𝑀𝑗 (for directional lights, this is not applicable) 34

slide-35
SLIDE 35

Shading

INFOGR – Lecture 9 – “Shading Models” Phong shading model The Phong shading model combines a diffuse reflection with a glossy one, and adds an ambient factor. 𝑁𝑞ℎ𝑝𝑜𝑕 = 𝑑𝑏𝑛𝑐𝑗𝑓𝑜𝑢 + 𝑑𝑒𝑗𝑔𝑔 𝑂 ∙ 𝑀 𝑀𝑒𝑗𝑔𝑔 + 𝑑𝑡𝑞𝑓𝑑(𝑊 ∙ 𝑆)𝑇𝑀𝑡𝑞𝑓𝑑 The Phong shading model is an ‘empirical model’, and has many problems:

  • It doesn’t guarantee that 𝑁 ≤ 𝐹;
  • It doesn’t take irradiance as input;
  • It requires many (unnatural) parameters;
  • That ambient factor…

35

𝑶 𝑴 𝑺

slide-36
SLIDE 36

Shading

INFOGR – Lecture 9 – “Shading Models” BRDF – Bidirectional Reflectance Distribution Function Defines the relation between irradiance and radiance. Or, more accurately: The BRDF represents the ratio of reflected radiance exiting along 𝑊, to the irradiance incident on the surface from direction 𝑀. 36

𝑔

𝑠 𝑀, 𝑊 = 𝑒𝑀𝑠(𝑊)

𝑒𝐹𝑗(𝑀)

Note that the BRDF takes two parameters: an incoming and an

  • utgoing direction.
slide-37
SLIDE 37

Shading

INFOGR – Lecture 9 – “Shading Models” BRDF – Bidirectional Reflectance Distribution Function BRDFs formalize the interaction of light / surface interaction, and allow us to do so in a physically correct way. Games are switching to physically based models rapidly:

  • To increase realism;
  • To reduce the number of parameters in shaders;
  • To have uniform shaders for varying lighting conditions.

More on this in Advanced Graphics! 37

slide-38
SLIDE 38

Shading

INFOGR – Lecture 9 – “Shading Models” 38

slide-39
SLIDE 39

Shading

INFOGR – Lecture 9 – “Shading Models” 39 “Moving Frostbite to PBR”

http://www.frostbite.com/wp-content/uploads/2014/11/s2014_pbs_frostbite_slides.pdf

slide-40
SLIDE 40

Shading

INFOGR – Lecture 9 – “Shading Models” 40 “Lighting Killzone : Shadow Fall”

http://www.guerrilla-games.com/presentations/Drobot_Lighting_of_Killzone_Shadow_Fall.pdf

slide-41
SLIDE 41

Shading

INFOGR – Lecture 9 – “Shading Models” 41 “Physically Based Shading in Unity”

http://aras-p.info/texts/files/201403-GDC_UnityPhysicallyBasedShading_notes.pdf

slide-42
SLIDE 42

Today’s Agenda:

  • Introduction
  • Light Sources
  • Materials
  • Sensors
  • Shading
slide-43
SLIDE 43

INFOGR – Computer Graphics

  • J. Bikker - April-July 2015 - Lecture 9: “Shading Models”

END of “Shading Models”

next lecture: “Ground Truth”