+ All Categories
Home > Documents > Global Illumination

Global Illumination

Date post: 19-Mar-2016
Category:
Upload: rock
View: 55 times
Download: 1 times
Share this document with a friend
Description:
Global Illumination. Direct Illumination vs. Global Illumination. reflected, scattered and focused light (not discreet). physical-based light transport calculations modeled around bidirectional reflective distribution functions (BRDFs). discreet light source. - PowerPoint PPT Presentation
Popular Tags:
62
Global Illumination
Transcript
Page 1: Global Illumination

Global Illumination

Page 2: Global Illumination

Direct Illumination vs. Global Illumination

reflected, scattered and focused light (not discreet).

physical-based light transport calculations modeled around bidirectional reflective distribution functions (BRDFs).

discreet light source. efficient lighting calculations

based on light and surface vectors (i.e. fast cheats).

Page 3: Global Illumination

Indirect Illumination

Color Bleeding

Page 4: Global Illumination

Contact Shadows

Notice the surface just under the sphere. The shadow gets much darker where the direct illumination as well as most of the indirect illumination is occluded. That dark contact shadow helps enormously in “sitting” the sphere in scene. Contact shadows are difficult to fake, even with area lights.

Page 5: Global Illumination

Caustics Focused and reflected

light, or caustics, are another feature of the real world that we lack in direct illumination.

Page 6: Global Illumination

Global illumination rendered images

Caustics are a striking and unique feature of Global Illumination.

Page 7: Global Illumination

BRDF

BRDF really just means “the way light bounces off of something.” Specular reflection: some of the light bounces right off of the surface along

the angle of reflection without really changing color much. Diffuse reflection: some of the light gets refracted into the plastic and

bounced around between red particles of pigment. Most of the green and the blue light is absorbed and only the red light makes it’s way back out of the surface. The red light bounced back is scattered every which way with fairly equal probability.

Page 8: Global Illumination

Rendering Equation

L is the radiance from a point on a surface in a given direction ω E is the emitted radiance from a point: E is non-zero only if x’ is emissive V is the visibility term: 1 when the surfaces are unobstructed along the direction ω, 0 otherwise G is the geometry term, which depends on the geometric relationship between the two surfaces x and x’ It includes contributions from light bounded many times off surfaces f is the BRDF

( , ) ( , ) ( , , ) ( , ) ( , ) ( , )rL E f G V L dA x x x x x x x x

Page 9: Global Illumination

Light Emitted from a Surface Radiance (L): Power per

unit area per unit solid angle Measured in W/m2sr dA is projected area –

perpendicular to given direction

Radiosity (B): Radiance integrated over all directions

Power from per unit area, measured in W/m2

dLB cos),(

Page 10: Global Illumination

Radiosity Concept Radiosity of each surface

depends on radiosity of all other surfaces Treat global illumination as

a linear system Need constant BRDF

(diffuse) Solve rendering equation

as a matrix problem Process

Mesh into patches Calculate form factors Solve radiosity Display patches

Cornell Program of Computer Graphics

Page 11: Global Illumination

Radiosity Equation

( , ) ( , ) ( , , ) ( , ) ( , ) ( , )rL E f G V L dA x x x x x x x x

( , , ) ( )r rf x f x

( , ) ( , ) ( ) ( , ) ( , ) ( , )rL x E x f x L x G x x V x x dA

Assume only diffuse reflection

Convert to radiosity

( , ) ( , ) ( ) ( , ) ( , ) ( , )e rB x B x f x B x G x x V x x dA

Page 12: Global Illumination

Radiosity Approximations

1

n

i i i ji jj

B E F B

2

cos cos1

i j

ij i jij j i

i A A

VF dA dA

A r

Discretize the surface into patches

The form factor

Fii = 0 (patches are flat)Fij = 0 if occludedFij is dimensionless

Page 13: Global Illumination

Radiosity Matrix

1

2

n

BB

B

1

2

n

EE

E

1 11 1 12 1 1

2 21 2 22

1

11

1

n

n n n nn

F F FF F

F F

iBiB1

1

1

( )

n

i i i ji jj

n

i i i ji jj

n

i ij i ji jj

B E F B

E B F B

E F B

Such an equation exists for each patch, and in a closed environment, a set of n Simultaneous equations in n unknown Bi values is obtained:

A solution yields a single radiosity value Bi for each patch in the environment – a view-independent solution. The Bi values can be used in a standard renderer and a particular view of the environment constructed from the radiosity solution.

Page 14: Global Illumination

Intuition

Page 15: Global Illumination

Form Factor Intuition

2

cos cosij i jdi dj i j

VF dAdA

r

2

cos cos1

i j

ij i jij j i

i A A

VF dA dA

A r

Page 16: Global Illumination

Hemicube Compute form factor with image-space precision

Render scene from centroid of Ai Use z-buffer to determine visibility of other surfaces Count “pixels” to determine projected areas

Page 17: Global Illumination

Monte Carlo Sampling Compute form factor by random sampling

Select random points on elements Intersect line segment to evaluate Vij

Evaluate Fij by Monte Carlo integration

Page 18: Global Illumination

Solving the Radiosity Equations Solution methods:

Invert the matrix – O(n3) Iterative methods – O(n2) Hierarchical methods – O(n)

1

2

n

BB

B

1

2

n

EE

E

1 11 1 12 1 1

2 21 2 22

1

11

1

n

n n n nn

F F FF F

F F

iBiB

Page 19: Global Illumination

Examples

Museum simulation. Program of Computer Graphics, Cornell University.50,000 patches. Note indirect lighting from ceiling.

Page 20: Global Illumination

Gauss-Siedel Iteration method1. For all i

Bi = Ei2. While not converged

For each i in turn

3. Display the image using Bi as the intensity of patch i

i i i ij jj i

B E F B

Page 21: Global Illumination

Interpretation of Iteration Iteratively gather radiosity to elements

Page 22: Global Illumination

Progressive Radiosity

Page 23: Global Illumination

Progressive Radiosity Interpretation:

Iteratively shoot “unshot” radiosity from elements Select shooters in order of unshot radiosity

Page 24: Global Illumination

Progressive Radiosity

Page 25: Global Illumination

Adaptive Meshing Refine mesh in areas of

large errors

Page 26: Global Illumination

Adaptive Meshing

Uniform Meshing Adaptive Meshing

Page 27: Global Illumination

Hierarchical Radiosity Refine elements

hierarchically: Compute energy

exchange at different element granularity

satisfying a user-specified error tolerance

Page 28: Global Illumination

Hierarchical Radiosity

Page 29: Global Illumination

Hierarchical Radiosity

Page 30: Global Illumination

Displaying RadiosityUsually Gouraud Shading

Computed Rendered

Page 31: Global Illumination

Radiosity Constrained by the resolution of your

subdivision patches. Have to calculate all of the geometry before

you rendered an image. No reflections or specular component.

Page 32: Global Illumination

Path Types OpenGL

L(D|S)E Ray Tracing

LDS*E Radiosity

LD*E Path Tracing

attempts to trace“all rays” in a scene

Page 33: Global Illumination

Ray Tracing LDS*E Paths Rays cast from eye into scene

Why? Because most rays cast from light wouldn’t reach eye

Shadow rays cast at each intersectionWhy? Because most rays

wouldn’t reach the light source Workload badly distributed

Why? Because # of rays grows exponentially, and their result becomes less influential

objects lights

Page 34: Global Illumination

Tough Cases Caustics

Light focuses through a specular surface onto a diffuse surface

LSDE Which direction should

secondary rays be cast to detect caustic?

Bleeding Color of diffuse surface

reflected in another diffuse surface

LDDE Which direction should

secondary rays be cast to detect bleeding?

Page 35: Global Illumination

Path Tracing Kajiya, SIGGRAPH 86 Diffuse reflection spawns

infinite rays Pick one ray at random Cuts a path through the

dense ray tree Still cast an extra shadow

ray toward light source at each step in path

Trace > 40 paths per pixel

objects lights

Page 36: Global Illumination

Monte Carlo Path Tracing Integrate radiance for

each pixel by sampling paths randomly

( , ) ( , ) ( , , ) ( , ) ( , ) ( , )rL E f G V L dA x x x x x x x x

Page 37: Global Illumination

Basic Monte Carlo Path Tracer1. Choose a ray (x, y), t; weight = 12. race ray to find intersection with nearest surface3. Randomly decide whether to compute emitted or

reflected light1. Step 3a: If emitted,

return weight * Le1. Step 3b: If reflected,

weight *= reflectanceGenerate ray in random directionGo to step 2

Page 38: Global Illumination

Bi-directional Path Tracing Role of source and receiver can be switched, flux

does not change

Page 39: Global Illumination

Bi-directional Path Tracing

Page 40: Global Illumination

Tracing from eye

Page 41: Global Illumination

Tracing from light

Page 42: Global Illumination

Monte Carlo Path Tracing Advantages

Any type of geometry (procedural, curved, ...)

Any type of BRDF (specular, glossy, diffuse, ...)

Samples all types of paths (L(SD)*E)

Accurate control at pixel level

Low memory consumption Disadvantages

Slow convergence Noise in the final image

Page 43: Global Illumination

Monte Carlo path tracing

1000 path / pixel

Page 44: Global Illumination

Monte Carlo Ray Tracing

It’s worse when you have small light sources (e.g. the sun) or lots of light and dark variation (i.e. high-frequency) in your environment.

Page 45: Global Illumination

Monte Carlo Integration

That’s why you always see “overcast” lighting like this.

Page 46: Global Illumination

Noise Filtering

van Jensen, Stanford

Unfiltered filtered

Page 47: Global Illumination

Photon Mapping Monte Carlo path tracing relies on lots of

camera rays to “find” the bright areas in a scene. Small bright areas can be a real problem. (Hence the typical “overcast” lighting).

Why not start from the light sources themselves, scatter light into the environment, and keep track of where the light goes?

Page 48: Global Illumination

Photon Mapping Jensen EGRW 95, 96 Simulates the transport of individual photons Photons emitted from source Photons deposited on diffuse surfaces Photons reflected from surfaces to other

surfaces Photons collected by rendering

Page 49: Global Illumination

What is a Photon? A photon p is a particle of

light that carries flux p(xp, p) Power: p – magnitude (in

Watts) and color of the flux it carries, stored as an RGB triple

Position: xp – location of the photon

Direction: p – the incident direction i used to compute irradiance

Photons vs. rays Photons propagate flux Rays gather radiance

p

p

xp

Page 50: Global Illumination

Sources Point source

Photons emitted uniformly in all directions

Power of source (W) distributed evenly among photons

Flux of each photon equal to source power divided by total # of photons

For example, a 60W light bulb would send out a total of 100K photons, each carrying a flux of 0.6 mW

Photons sent out once per simulation, not continuously as in radiosity

Page 51: Global Illumination

Russian Roulette Arvo & Kirk, Particle Transport and Image

Synthesis, SIGGRAPH 90, pp. 63-66. Reflected flux only a fraction of incident

flux After several reflections, spending a lot of

time keeping track of very little flux Instead, absorb some photons and reflect

the rest at full power Spend time tracing fewer full power

photons Probability of reflectance is the

reflectance Probability of absorption is 1 – .

?

Page 52: Global Illumination

Mixed Surfaces Surfaces have specular and diffuse components

d – diffuse reflectance s – specular reflectance d + s < 1 (conservation of energy)

Let be a uniform random value from 0 to 1 If < d then reflect diffuse Else if < d + s then reflect specular Otherwise absorb

Page 53: Global Illumination

Photon Mapping

Direct illumination Photon Map

Page 54: Global Illumination

Rendering Photons in photon map are collected by eye

rays cast by a distributed ray tracer Multiple photon maps

Indirect irradiance map Caustic map

Rays use the radiance constructed from reflected flux density from nearest neighbor photons

Page 55: Global Illumination

Photon Mapping Rendering Ray Tracing At each hit:

Ray trace further if the contribution > threshold (more accurate)

Use photon map approximation otherwise

Caustics rendered directly

A = r2

Page 56: Global Illumination

Caustic photon map The caustics photon

map is used only to store photons corresponding to caustics.

It is created by emitting photons towards the specular objects in the scene and storing these as they hit diffuse surfaces.

Page 57: Global Illumination

Caustic illumination

Page 58: Global Illumination

Global Photon Map The global photon map is

used as a rough approximation of the light/flux within the scene

It is created by emitting photons towards all objects.

It is not visualized directly and therefore it does not require the same precision as the caustics photon map.

Page 59: Global Illumination

Indirect Illumination

Page 60: Global Illumination

Example

224,316 caustic photons, 3095 global photons

Page 61: Global Illumination

Example

Page 62: Global Illumination

Readings Textbook 16.13 Distribution Ray Tracing: Theory and Practice

 Shirley and  Wang. Proceedings of the 3rd Eurographics Rendering Workshop 1992

Global Illumination using Photon Maps Henrik Wann Jensen, Rendering Techniques '96


Recommended