computer graphics (cs 563) 4: advanced ... - computer scienceemmanuel/courses/cs563/s12/... ·...

21
Computer Graphics (CS 563) Lecture 4: Advanced Computer Graphics ImageBased Effects: Part 1 Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI)

Upload: others

Post on 06-Oct-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Computer Graphics (CS 563) Lecture 4: Advanced Computer Graphics

Image‐Based Effects: Part 1

Prof Emmanuel Agu

Computer Science Dept.Worcester Polytechnic Institute (WPI)

Page 2: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Image‐Based Effects Three main types of image‐based effects

a. Image‐Based Rendering: Texturing to improve RT performance so that algorithms run at 30 FPS. Examples: billboards, sprites

b. Image Processing Post‐process:  Used to add effects to rendered imagesExamples:  High Dynamic Range (HDR), tone mapping, motion blur

c. Volumetric effects: atmospheric effects

Page 3: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Image‐Based Effects Image‐based rendering: A spectrum of IBR techniques proposed by J. Lengyel

More camera controlSlower rendering

Less camera controlFaster rendering

Page 4: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Fixed View Effects If viewpoint is fixed, can increase image quality Example: Few moving foreground elements in complex scene Render and store background rendering information         

(z‐buffer, color buffer, etc)

Page 5: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Relighting

Starting from image, figure out light parameters used  Re‐render image again with different lighting

Page 6: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Skyboxes Distant objects positions (mountains, sun, sky) don’t change much or suffer from parallax

Skybox: use a environment map to render distant elements

Page 7: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Light Fields Render object from many angles, store images in data 

structure At run time, interpolate to render intermediate positions

t

s

v

u

Page 8: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Sprites, Billboards, and Impostors Sprites:

Pure 2D image No warping, or projection (Example: mouse cursor)

Billboards: Sprite applied to a polygon Alpha channel usually employed Uses texture mapping for acceleration

Impostors: Billboards created on the fly. Can represent complex models Error metric associated w/ changed views

Page 9: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Layered Sprites Scene as a series of Layers Each layer has depth associated Render Back‐to‐front (avoid Z buffer) Camera movement restricted: only perpendicular scene

Page 10: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Billboards IBR: pre‐render geometry onto images/textures Map textures onto polygons, place in scene Rendering at runtime involves simple lookups, fast Orienting polygon based on View Direction Billboarding + Alpha + Animation = free forms 

(smoke, fire, explosions, clouds etc.)

Real time cloud rendering, Mark J. Harris

Page 11: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Types of Billboards Three vectors of interest: up vector, normal and rotation vector (perp to up and normal)

Screen Aligned Billboard:  Image always parallel to screen with constant up vector Up vector = camera’s up vector

Page 12: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

World Aligned Billboard

Rendered object usually has orientation in space Use object’s up vector to orient billboard

For small  sprites, just align with view plane Otherwise orient with viewer position

Page 13: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Axial Billboards Cylindrical Symmetry ( trees, laser beams etc) Does not face straight‐on towards viewer Rotate around some world space axis, align to face user as 

much as possible Up vector fixed, view point direction is adjustable vector Tree example

Single billboard v/s solid surface tree Up vector along tree trunk

Page 14: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Particle Systems Set of separate small objects set into motion using an 

algorithm Method of animation – not rendering Simulating Fire, smoke, explosions, water flow, trees, galaxies Representation – Points, lines … Can be billboards too  Idea: controls for creating, moving,

changing and deleting particles

http://en.wikipedia.org/wiki/Particle_system

Page 15: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Imposters

Created on fly Render a complex object into image texture Texture mapped onto Billboard Can reuse imposter for a few frames to boost performance before update

Page 16: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Why Create Imposters?

Fast to draw 

Closely resemble the object

Reuse for several viewpoints located close together

Best for static and distant objects

Movement of object diminishes with distance from viewer

Overcome low LOD constraints, since a high quality imposter can be created

Page 17: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Imposters

Impostors Made Easy – William Damon, Intel

No Impostors

With Impostors

Page 18: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Billboard Clouds

Billboard Clouds, Decoret, Durand et al [SIGGRAPH‘03] Render complex mesh onto cloud of billboards Billboard inclined at different viewpoints Models with tens of thousands of trianges can be represented 

convincingly with less than 100 textured billboards

Page 19: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

Depth Sprite aka Nailboard Give depth to image ! Each texel as RGBΔ ‐ Δ (transparency) is depth parameter Set Δ based on depth of actual geometry Superior to imposters because better visibility when penetrate 

closeby objects Accuracy varies with no. of bits to represent Δ

2 bits 4 bits 8 bits

http://zeus.gup.uni-linz.ac.at/~gs/research/nailbord/

Page 20: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

IBR: Pros and Cons

Pros Simplifies computation of complex scenes Rendering cost independent of scene complexity

Cons Static scene geometry Fixed lighting Fixed look‐from or look‐at point

Page 21: Computer Graphics (CS 563) 4: Advanced ... - Computer Scienceemmanuel/courses/cs563/S12/... · Examples: billboards, sprites b. Image Processing Post‐process: Used to add effects

References Kutulakos K, CSC 2530H: Visual Modeling, course slides

UIUC CS 319, Advanced Computer Graphics Course slides

David Luebke, CS 446, U. of Virginia, slides Chapter 2 of RT Rendering Suman Nadella, CS 563 slides, Spring 2005