Rumination on illumination computer graphics COS 116 Spring

  • Slides: 51
Download presentation
Rumination on illumination (computer graphics) COS 116, Spring 2012 Adam Finkelstein

Rumination on illumination (computer graphics) COS 116, Spring 2012 Adam Finkelstein

Applications n n n n Entertainment Computer-aided design Scientific visualization Training Education E-commerce Computer

Applications n n n n Entertainment Computer-aided design Scientific visualization Training Education E-commerce Computer art Inside a Thunderstorm (Bob Wilhelmson, UIUC) Boeing 777 Airplane

Overview I. Images II. Modeling III. Rendering IV. Animation Rendering Image Processing (Rusty Coleman,

Overview I. Images II. Modeling III. Rendering IV. Animation Rendering Image Processing (Rusty Coleman, CS 426, Fall 99) Modeling Animation (Dennis Zorin, Cal. Tech) (Jon Beyer, CS 426, Spring 04) (Michael Bostock, CS 426, Fall 99)

Part 1: Images Q: What is an image?

Part 1: Images Q: What is an image?

Brief history of image capture Camera obscura • Known to Chinese 5 th. C.

Brief history of image capture Camera obscura • Known to Chinese 5 th. C. BC 19 th century: Camera • Hole Lens • Paper Light sensitive Late 20 th century: Digital camera • Light-senstive paper CCD/electronics

Digital images n Rectangular (2 D) array of pixels Continuous image Digital image

Digital images n Rectangular (2 D) array of pixels Continuous image Digital image

Image Display n Re-create continuous function from samples ¨ Example: cathode ray tube (CRT)

Image Display n Re-create continuous function from samples ¨ Example: cathode ray tube (CRT) Image is reconstructed by displaying pixels with finite area of color

LCD Screen

LCD Screen

RGB Color Model Colors are additive Plate II. 3 from Fv. DFH R 0.

RGB Color Model Colors are additive Plate II. 3 from Fv. DFH R 0. 0 1. 0 0. 5 1. 0 0. 5 G 0. 0 1. 0 0. 5 0. 3 B 0. 0 1. 0 0. 5 0. 0 0. 1 Color Black Red Green Blue Yellow Magenta Cyan White ? ?

What is an Image? n Rectangular (2 D) array of pixels Continuous image Digital

What is an Image? n Rectangular (2 D) array of pixels Continuous image Digital image

What is an Image? n (digital audio) Rectangular (2 D) array of pixels A

What is an Image? n (digital audio) Rectangular (2 D) array of pixels A pixel is a sample, not a little square! Continuous image Digital image

Sampling and Reconstruction Sampling (e. g. digital camera) Reconstruction (e. g. CRT)

Sampling and Reconstruction Sampling (e. g. digital camera) Reconstruction (e. g. CRT)

Adjusting Brightness n Simply scale pixel components ¨ Must Original clamp to range (e.

Adjusting Brightness n Simply scale pixel components ¨ Must Original clamp to range (e. g. , 0 to 1) Brighter

Adjusting Contrast n Compute average luminance L for all pixels ¨ n L =

Adjusting Contrast n Compute average luminance L for all pixels ¨ n L = 0. 30*r + 0. 59*g + 0. 11*b Scale deviation from L for each pixel ¨ Must clamp to range (e. g. , 0 to 1) L Original More Contrast

Scaling the image n Resample with fewer or more pixels (mathy theory…) Original 1/4

Scaling the image n Resample with fewer or more pixels (mathy theory…) Original 1/4 X resolution

Image Warping n Move pixels of image (resampling) Warp Source image Destination image

Image Warping n Move pixels of image (resampling) Warp Source image Destination image

[Beier & Neeley] Image Morphing Image 0 Warp 0 Result Image 1 Warp 1

[Beier & Neeley] Image Morphing Image 0 Warp 0 Result Image 1 Warp 1

Image Morphing n Another example, T 2, uses 3 D graphics…

Image Morphing n Another example, T 2, uses 3 D graphics…

Part II: Modeling n How to construct and represent shapes (in 3 D) (Remo

Part II: Modeling n How to construct and represent shapes (in 3 D) (Remo 3 D)

Modeling in Sketch. Up (demo)

Modeling in Sketch. Up (demo)

Model representation n Most common: list of triangles ¨ Three vertices in 3 D

Model representation n Most common: list of triangles ¨ Three vertices in 3 D (x 1, y 1, z 1) (x 2, y 2, z 2) (x 3, y 3, z 3)

Part III: Rendering n Direct illumination ¨ One bounce from light to eye ¨

Part III: Rendering n Direct illumination ¨ One bounce from light to eye ¨ Implemented in graphics cards ¨ Open. GL, Direct. X, … n Global illumination ¨ Many bounces ¨ Ray tracing Ray Tracing (Greg Larson) Direct Illumination (Chi Zhang, CS 426, Fall 99)

Ray Casting n n A (slow) method for computing direct illumination For each sample:

Ray Casting n n A (slow) method for computing direct illumination For each sample: ¨ Construct ray from eye through image plane ¨ Find first surface intersected by ray ¨ Compute color of sample based on surface properties eye

Lighting Simulation n Light Source Lighting parameters ¨ Light source emission ¨ Surface reflectance

Lighting Simulation n Light Source Lighting parameters ¨ Light source emission ¨ Surface reflectance Surface N N eye

Simple Reflectance Model n Simple analytic model: ¨ diffuse reflection + ¨ specular reflection

Simple Reflectance Model n Simple analytic model: ¨ diffuse reflection + ¨ specular reflection + ¨ ambient lighting Based on model proposed by Phong Surface

Diffuse Reflection n Assume surface reflects equally in all directions ¨ Examples: chalk, clay

Diffuse Reflection n Assume surface reflects equally in all directions ¨ Examples: chalk, clay Surface

Specular Reflection n Reflection is strongest near mirror angle ¨ Examples: mirrors, metals N

Specular Reflection n Reflection is strongest near mirror angle ¨ Examples: mirrors, metals N R q q L

Ambient Lighting n Represents reflection of all indirect illumination This is a total cheat

Ambient Lighting n Represents reflection of all indirect illumination This is a total cheat (avoids complexity of global illumination)!

Combine colors of light & surface Light color N Viewer L V Surface color

Combine colors of light & surface Light color N Viewer L V Surface color (possibly in texture)

Sum For Multiple Lights N Viewer L 1 V L 2

Sum For Multiple Lights N Viewer L 1 V L 2

Lighting Simulation n Light Source Direct illumination ¨ Ray casting ¨ Other methods N

Lighting Simulation n Light Source Direct illumination ¨ Ray casting ¨ Other methods N Surface n Global illumination ¨ Ray tracing ¨ Other methods N N Camera

Path Types L = light D = diffuse bounce S = specular bounce E

Path Types L = light D = diffuse bounce S = specular bounce E = eye

Path Types? Henrik Wann Jensen

Path Types? Henrik Wann Jensen

Ray Tracing (note: texture) Henrik Wann Jensen

Ray Tracing (note: texture) Henrik Wann Jensen

Ray Tracing Render. Park

Ray Tracing Render. Park

Ray Tracing Terminator 2

Ray Tracing Terminator 2

Part IV: Animation n Keyframe animation ¨ Articulated n figures Simulation ¨ Particle systems

Part IV: Animation n Keyframe animation ¨ Articulated n figures Simulation ¨ Particle systems Animation (Jon Beyer, CS 426, Spring 04) Simulation

Articulated Figures n Well-suited for humanoid characters Root Chest Neck Head LCollar LShld LHip

Articulated Figures n Well-suited for humanoid characters Root Chest Neck Head LCollar LShld LHip RHip LKnee RKnee LAnkle RAnkle LElbow LWrist Rose et al. `96

Keyframe Animation: Luxo Jr. Pixar

Keyframe Animation: Luxo Jr. Pixar

Keyframe Animation Define character poses at specific times: “keyframes” n “In between” poses found

Keyframe Animation Define character poses at specific times: “keyframes” n “In between” poses found by interpolation n Lasseter `87

Keyframe Animation n Inbetweening: may not be plausible Lasseter `87

Keyframe Animation n Inbetweening: may not be plausible Lasseter `87

Keyframe Animation n Solution: add more keyframes Lasseter `87

Keyframe Animation n Solution: add more keyframes Lasseter `87

Simulation n Animator cannot specify motion for: o Smoke, water, cloth, hair, fire Water

Simulation n Animator cannot specify motion for: o Smoke, water, cloth, hair, fire Water Hot Gases (Foster & Metaxas `97) Cloth (Baraff & Witkin `98)

Particle Systems n n Recall: “Game of Life” For each frame (time step): Create

Particle Systems n n Recall: “Game of Life” For each frame (time step): Create new particles and assign attributes ¨ Delete any expired particles ¨ Update particles based on attributes and physics Newton’s Law: f=ma ¨ Render particles ¨

Particle Systems n A particle is a point mass v ¨ Mass ¨ Position

Particle Systems n A particle is a point mass v ¨ Mass ¨ Position ¨ Velocity ¨ Acceleration p = (x, y, z) ¨ Color ¨ Lifetime n Many particles to model complex phenomena ¨ Keep array of particles

Creating/Deleting Particles n Where to create particles? ¨ Around some center ¨ Along some

Creating/Deleting Particles n Where to create particles? ¨ Around some center ¨ Along some path ¨ Surface of shape ¨ Where particle density is low n When to delete particles? ¨ Areas of high density ¨ Life span ¨ Random This is where person controls animation

Example: Wrath of Khan Reeves

Example: Wrath of Khan Reeves

Example: Wrath of Khan Reeves

Example: Wrath of Khan Reeves

Example: Wrath of Khan Reeves

Example: Wrath of Khan Reeves

Advances in simulation Contact Fluids (Fedkiw)

Advances in simulation Contact Fluids (Fedkiw)