42
3D Rendering COS 426

3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering

COS 426

Page 2: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Syllabus

I. Image processing

II. Modeling

III. Rendering

IV. Animation

Image Processing (Rusty Coleman, CS426, Fall99)

Modeling (Dennis Zorin, CalTech) Animation

(Angel, Plate 1)

Rendering (Michael Bostock, CS426, Fall99)

Page 3: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

What is 3D Rendering?

• Topics in computer graphics Imaging = representing 2D images

Modeling = representing 3D objects

Rendering = constructing 2D images from 3D models

Animation = simulating changes over time

Page 4: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

What is 3D Rendering?

• Construct image from 3D model

Rendering

Page 5: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Scenario I

• Interactive Images generated in fraction of a second (<1/10)

as user controls rendering parameters (e.g., camera)

• Achieve highest quality possible in given time

• Useful for visualization, games, etc.

meshview

Page 6: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Scenario II

• Offline One image generated with as much quality as possible

for a particular set of rendering parameters

• Take as much time as is needed (minutes)

• Photorealisism: movies, cut scenes, etc.

Avatar

Page 7: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Issues

• What issues must be addressed

by a 3D rendering system?

Page 8: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Example

Pixar

Page 9: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Issues

• What issues must be addressed

by a 3D rendering system?

Page 10: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Issues

• What issues must be addressed

by a 3D rendering system? Camera

Visible surface determinaton

Lights

Reflectance

Shadows

Indirect illumination

Sampling

etc.

Page 11: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Issues

• What issues must be addressed

by a 3D rendering system? Camera

Visible surface determinaton

Lights

Reflectance

Shadows

Indirect illumination

Sampling

etc.

Page 12: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Camera Models

• The most common model is pin-hole camera Light rays arrive along paths toward focal point

No lens effects (e.g., everything in focus)

Other models consider ...

Depth of field

Motion blur

Lens distortion

View plane

Eye position

(focal point)

Page 13: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Camera Parameters

• What are the parameters of a camera?

Page 14: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Pinhole Camera Parameters

• Position Eye position (px, py, pz)

• Orientation View direction (dx, dy, dz) or “look at” point

Up direction (ux, uy, uz)

• Coverage Field of view (fovx, fovy)

• Resolution In x and y

right

back

Up direction

Eye Position

“Look at” Point

Page 15: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

View Plane

View plane

Eye position

Page 16: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Issues

• What issues must be addressed

by a 3D rendering system? Camera

Visible surface determination

Lights

Reflectance

Shadows

Indirect illumination

Sampling

etc.

Page 17: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Visible Surface Determination

• The color of each pixel on the view plane

depends on the radiance (“amount of light”)

emanating from visible surfaces

How find visible surfaces?

Page 18: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (
Page 19: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

In Practice… Brute Force

• Ray tracing (usually offline) for each pixel: determine closest object hit by ray

compute color

• Rasterization (interactive) for each object: enumerate pixels it hits

keep track of color, depth of current-best

surface at each pixel

Page 20: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Ray Casting

• For each sample … Construct ray from eye position through view plane

Find first surface intersected by ray through pixel

Compute color of sample based on surface radiance

Page 21: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Ray Casting

• For each sample … Construct ray from eye position through view plane

Find first surface intersected by ray through pixel

Compute color of sample based on surface radiance

Page 22: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Ray Casting Example

Rays from camera in simple scene

Page 23: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Issues

• What issues must be addressed

by a 3D rendering system? Camera

Visible surface determinaton

Lights

Reflectance

Shadows

Indirect illumination

Sampling

etc.

Page 24: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Lighting Simulation

• Lighting parameters Light source emission

Surface reflectance

Atmospheric attenuation

Camera response

N N

Camera

Surface

Light Source

Page 25: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Lighting Simulation

N

L2

V

Viewer L1

Page 26: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Issues

• What issues must be addressed

by a 3D rendering system? Camera

Visible surface determinaton

Lights

Reflectance

Shadows

Indirect illumination

Sampling

etc.

Page 27: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Shadows

• Occlusions from light sources

Page 28: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Shadows

• Occlusions from light sources Soft shadows with area light source

Moller

Page 29: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Shadows

Herf

Page 30: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Issues

• What issues must be addressed

by a 3D rendering system? Camera

Visible surface determinaton

Lights

Reflectance

Shadows

Indirect illumination

Sampling

etc.

Page 31: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Path Types

Page 32: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Path Types

Jensen

direct diffuse + indirect specular and transmission Henrik Wann Jensen

LD(S|T)*E

Page 33: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Path Types

Jensen

+ soft shadows Henrik Wann Jensen

LD(S|T)*E

Page 34: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Path Types

Jensen

+ caustics Henrik Wann Jensen

LD(S|T)*E +

L(S|T)*DE

Page 35: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Path Types

Jensen

+ indirect diffuse illumination Henrik Wann Jensen

L(D|S|T)*E

Page 36: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Path Types?

Henrik Wann Jensen

LD(S|T)*E

Page 37: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Path Types?

Henrik Wann Jensen

LD(S|T)*E +

L(S|T)*DE

Page 38: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Path Types?

Paul Debevec

LD*E

Page 39: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Path Types

• OpenGL LDE

• Ray tracing LDS*E

• Path tracing L(D|S)*E

• Radiosity LD*E

John Hart

Page 40: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

3D Rendering Issues

• What issues must be addressed

by a 3D rendering system? Camera

Visible surface determinaton

Shadows

Reflectance

Indirect illumination

Sampling

etc.

Page 41: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Sampling

• Scene can be sampled with any ray Rendering is a problem in sampling and reconstruction

Page 42: 3D Rendering - Princeton University Computer Science...3D Rendering Scenario I • Interactive Images generated in fraction of a second (

Summary

• Topics for upcoming lectures Camera

Visible surface determinaton

Shadows

Reflectance

Indirect illumination

Sampling

etc.

Tricycle (James Percy, CS 426, Fall99)

For assignment #3, you will write a ray tracer!