+ All Categories

CS361

Date post: 22-Mar-2016
Category:
Upload: regis
View: 60 times
Download: 0 times
Share this document with a friend
Description:
Week 10 - Thursday. CS361. Last time. What did we talk about last time? Reflections Transmittance Refractions Caustics Global subsurface scattering. Questions?. Project 3. Assignment 4. Radiosity. - PowerPoint PPT Presentation
Popular Tags:
43
CS361 Week 10 - Friday
Transcript
Page 1: CS361

CS361Week 10 - Friday

Page 2: CS361

Last time

What did we talk about last time? Barry Caudill was a guest speaker Reflections Transmittance Refractions

Page 3: CS361

Questions?

Page 4: CS361

Project 3

Page 5: CS361

Caustics

Page 6: CS361

It’s burning!

Light is focused by reflective or refractive surfaces A caustic is the curve or surface of concentrated light The name comes from the Greek for burning

Reflective:

Refractive:

Page 7: CS361

Image space rendering First:

The scene is rendered from the view of light

Track the diversion of light and see which locations are hit

Store the result in an image with Z-buffer values called a photon buffer

Second: Treat each location that received light as

a point object called a splat Transform these to eye viewpoint and

render them to a caustic map Third:

Project the map onto the screen and combine with the shadow map

Page 8: CS361

Object Space Rendering Look at each generator triangle

Those that are specular or refractive Each vertex on each generator triangle has a normal Create a caustic volume like a shadow volume except

that the sides are warped by either reflection or refraction

For receiver pixels in the volume, intensity is computed

Page 9: CS361

Some other examples

Page 10: CS361

Global Subsurface Scattering

Page 11: CS361

Subsurface scattering Subsurface scattering occurs when light

enters an object, bounces around, and exits at a different point

If the exit point is close to the entrance point (in the same pixel), we can use a BRDF

If it spans a larger distance, we need an algorithm to track photon propagation

Page 12: CS361

Subsurface scattering Examples

Pearlescent paint Human skin

▪ Which matters Causes

Foreign Particles (pearls) Discontinuities (air bubbles) Density variations Structural changes

We need to know how long light has traveled through the object

Tracking individual photons is impossible, so all algorithms will be statistical

Page 13: CS361

Blurring normals and lighting Subsurface scattering does not affect specular reflection We often use normal maps to add detail to specular reflection

characteristics Some work suggests that this same normal map should be ignored

for diffuse terms Or the normals can be blurred further since surface direction appears

to change slowly if light from other directions is exiting diffusely More complex models render the diffuse lighting onto a texture and

then selectively blur R, G, and B components for more realism

This texture space diffusion technique was

used in The Matrix Reloaded

for rendering skin

Page 14: CS361

Depth map techniques We could cast rays into objects to see where they

come out, but it's expensive An alternative is to use depth maps to record how

far the light travels through the object which determines how colored by the object it is Refraction when the light enters the object is usually

ignored Only exiting refraction is computed

Page 15: CS361

Student Lecture: Radiosity and Ray Tracing

Page 16: CS361

Radiosity To create a realistic

scene, it is necessary for light to bounce between surfaces many times

This causes subtle effects in how light and shadow interact

This also causes certain lighting effects such as color bleeding (where the color of an object is projected onto nearby surfaces)

Page 17: CS361

Radiosity Radiosity was the first graphics technique

designed to simulate radiance transfer Turn on the light sources and allow the

environmental light to reach equilibrium While the light is in stable state, each

surface may be treated a light source A general simplification is to assume that

all indirect light is emitted from a diffuse surface Radiosity doesn't do specular reflection

Page 18: CS361

Radiosity The outgoing radiance of a diffuse surface is:

where r and E are the reflectance and irradiance

Each surface is represented by a number of patches To get even lighting and soft shadows, it may be

necessary to break polygons down into smaller patches

It's even possible to have fewer patches than polygons

Page 19: CS361

Form factors To create a radiosity solution, we need to create a matrix

of form factors These are geometric values saying what proportion of

light travels directly from one surface to another The form factor between a surface point with differential

area dai and another surface point with daj is

These differentials have to be (numerically) integrated for each patch

Page 20: CS361

Visibility

If the receiving patch faces away from the viewed patch, the form factor is zero

hij is the visibility factor, which ranges from either 0 (not visible) to 1 (visible) It is scaled if the view between the

surfaces is fully or partially blocked

Page 21: CS361

Solving radiosity A common way to solve for the equilibrium

is to form a square matrix with each row formed by the form factors for a given patch times the patch’s reflectivity

Performing Gaussian elimination on the resulting matrix gives the exitance of the patch in question

Much research has focused on how to do this better Though radiosity is no longer a sexy research

topic since it doesn't allow for specular effects

Page 22: CS361

Ray tracing

Radiosity is a great technique for getting soft shadows and many other effects characteristic of diffuse lighting

Specular highlights and reflections are not present

An alternative global illumination model is ray tracing which shoots single rays through the scene and computes their colors

Page 23: CS361

Classical ray tracing Rays are traced from the camera through the screen to

the closest object, called the intersection point For each intersection point:

Trace a ray to each light source If the object is shiny, trace a reflection ray If the object is not opaque, trace a refraction ray

Opaque objects can block the rays, while transparent objects attenuate the light

Page 24: CS361

Pros and cons

Pros Classical ray tracing is relatively fast

(only a few rays are traced per pixel) Good for direct lighting and specular

surfaces Cons

Not good for environmental lighting Does not handle glossy and diffuse

interreflections Only makes hard shadows

Page 25: CS361

Monte Carlo ray tracing

Page 26: CS361

Monte Carlo ray tracing

Ray directions are randomly chosen, weighted by the BRDF Called importance sampling Usually it means tracing more rays along

the specular reflection path There are two main types of Monte

Carlo ray tracing: Path tracing Distribution ray tracing

Page 27: CS361

Ray tracing Path tracing

A single ray is reflected or refracted throughout the scene, changing direction at each surface intersection

Good sampling requires millions of rays or more per pixel

Distribution ray tracing Spawns random rays from every surface

intersection Starts with fewer rays through each pixel than

path tracing, but ends up with lots at each surface

Page 28: CS361

Pros and cons

Pros Very realistic

Cons Tons of computational power is

necessary Not good for real-time rendering with

many objects

Page 29: CS361

Precomputed lighting Full global illumination

algorithms are expensive

Some results can be pre-computed Those results can be

used in real-time rendering

Scene and light sources must remain static The majority of scenes

are only partially static

Page 30: CS361

Simple surface prelighting

Lighting on smooth, Lambertian surfaces is simple Single RGB value giving irradiance

Dynamic lights can simply be added on top Irradiance can be stored in vertices if there is a lot of

geometric detail Or texture maps (which could change depending on situation) Cannot be used with glossy or specular surfaces

Irradiance maps have no directionality Can’t be used with high frequency normal maps

Page 31: CS361

Directional surface prelighting Can be used with specular and glossy surfaces,

and high frequency normal maps Additional directional data must be stored

How irradiance changes with surface normal Storing irradiance environment map at each

surface location

Page 32: CS361

Volume prelighting Indirect light illuminates dynamic objects Multiple methods:

1. Interpolate irradiance values from closest environment maps (Valve)

2. Use the prelighting on adjacent surfaces (Racing games)

3. Store average irradiances at each point (Little Big Planet)

Little has been done for specular and glossy surfaces

Page 33: CS361

Precomputed occlusion

Global illumination algorithms precompute quantities other than lighting

Often, a measure of how much parts of a scene block light are computed Bent normal, occlusion factor

These precomputed occlusion quantities can be applied to changing light in a scene

Creates a more realistic appearance than precomputing lighting alone

Page 34: CS361

Precomputed ambient occlusion Cast rays over hemisphere around

each surface location or vertex Cast rays may be restricted to a set

distance Usually involves a cosine weighting

factor Most efficient way is importance

sampling Instead of casting rays uniformly over

hemisphere, distribution of ray directions is cosine-weighted around surface normal

Page 35: CS361

Precomputed ambient occlusion Precomputed ambient occlusion factors

are only valid on stationary objects Example: a racetrack

For moving objects (like a car), ambient occlusion can be computed on a large flat plane

This works for rigid objects, but deformable objects would need many precomputed poses Like a human

Page 36: CS361

Precomputed directional occlusion Horizon mapping is used to

determine self-occlusion on a height field surface

For each point of the surface, the altitude angle of the horizon is determined

Soft shadowing can be supported by tracking the angular extents of the light source

Page 37: CS361

Precomputed directional occlusion An alternative technique is to use

volume textures to store horizon angles

This is useful for a light source that travels along some predetermined path Like the sun

Multiple occluded angle intervals are stored, rather than one horizon angle

This enables modeling non-height field geometry

Page 38: CS361

Precomputed directional occlusion

Page 39: CS361

Spherical harmonics Spherical harmonics

are the angular portion of a set of solutions to Laplace's equation

The spherical harmonics that we're interested in form an orthogonal system that gives us an organized way to refer to more and more complicated coverage of an object from different directions

Page 40: CS361

Precomputed radiance transfer

We can record the effects on a point from many different sources of irradiance

These effects can be stored as spherical harmonics coefficients

The final result gets the dynamic irradiance from the same spherical harmonics directions and combines the effects

Wavelets can be used instead of spherical harmonics with better effects

These techniques are best suited for diffuse (low frequency) lighting

Page 41: CS361

Upcoming

Page 42: CS361

Next time…

Image based effects Skyboxes Sprites Billboarding Particle systems

Page 43: CS361

Reminders

Keep working on Project 3 Due next Friday by midnight

Read Chapter 10


Recommended