computer graphics (cs 563) 4: advanced computer graphics … · 2012. 2. 8. · microsoft...
TRANSCRIPT
![Page 1: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/1.jpg)
Computer Graphics (CS 563) Lecture 4: Advanced Computer Graphics
Image‐Based Effects: Part 2
Prof Emmanuel Agu
Computer Science Dept.Worcester Polytechnic Institute (WPI)
![Page 2: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/2.jpg)
Image Processing
Graphics concerned with creating artificial scenes from geometry and shading descriptions
Image processing Input is an image Output is a modified version of input image
Image processing operations include altering images, remove noise, super‐impose images
![Page 3: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/3.jpg)
Image Processing Example: Sobel Filter
Original Image Sobel Filter
![Page 4: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/4.jpg)
Image Processing
Image processing the output of graphics rendering is called post‐processing
To post‐process using GPU, rendered output usually written to offscreen buffer (e.g. color image, z‐depth buffer, etc)
Image in offscreen buffer treated as texture, mapped to screen‐filling quadrilateral
Pixel shader invoked on each element of texture
![Page 5: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/5.jpg)
Image Negative
Another example
![Page 6: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/6.jpg)
Image Distortion
![Page 7: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/7.jpg)
Image Sharpening
![Page 8: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/8.jpg)
Embossing
![Page 9: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/9.jpg)
Toon Rendering
![Page 10: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/10.jpg)
Toon Rendering for Non‐Photorealistic Effects
![Page 11: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/11.jpg)
Blurring
For some operations, texture element may be combined with neighboring texture elements (blurring)
With motion blur Without motion blur
![Page 12: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/12.jpg)
Texture Animation using Image Processing
Use GPU to modify textures from frame to frame Animations such as fluid flow can be done this way Example: simulating rain by Tatarchuk et al
![Page 13: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/13.jpg)
Heat Shimmer
![Page 14: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/14.jpg)
Color Correction
Color correction uses a function to convert colors in an image to some other color
Why color correct? Mimic appearance of a type of film Portray a particular mood Convert from one color space to another Example of conversion from RGB to CIE’s XYZ color space
BGR
ZYX
950227.0119193.0019334.0072169.0715160.0212671.0180423.0357580.0412453.0
![Page 15: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/15.jpg)
Color Correction
![Page 16: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/16.jpg)
Color Correction
![Page 17: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/17.jpg)
High Dynamic Range
Sun’s brightness is about 60,000 lumens Dark areas of earth has brightness of 0 lumens Basically, world around us has range of 0 – 60,000 lumens (High Dynamic Range)
However, monitor has ranges of colors between 0 –255 (Low Dynamic Range)
New file formats have been created for HDR images (wider ranges). (E.g. OpenEXR file format)
![Page 18: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/18.jpg)
High Dynamic Range Some scenes contain very bright + very dark areas Using uniform scaling factor to map actual intensity to displayed pixel intensity means: Either some areas are unexposed, or Some areas of picture are overexposed
Under exposure Over exposure
![Page 19: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/19.jpg)
Tone Mapping
Process of scaling intensities in real world images (e.g HDR images) to fit in displayable range
Try to capture feeling of real scene: non‐trivial Example: If coming out of dark tunnel, lights should seem bright
![Page 20: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/20.jpg)
Types of Tone Mapping Operators
Global: Use same scaling factor for all pixels Local: Use different scaling factor for different parts of image
Time‐dependent: Scaling factor changes over time Time independent: Scaling factor does NOT change over time
Real‐time rendering usually does NOT implement local operators due to their complexity
![Page 21: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/21.jpg)
Tone Mapping Operators
![Page 22: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/22.jpg)
Simple (Global) Tone Mapping Methods
![Page 23: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/23.jpg)
Tone Mapping
If range of input values is small, compute average then scale so that average in displayable range
Simple average may cause a few large values to dominate
Reinhard suggested to use logarithm instead when summing pixel values
is the log‐average luminance, avoids log of 0 is the luminance at pixel (x,y)
)),(log(1exp
,yxL
NL w
yxw
wL
),( yxLw
![Page 24: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/24.jpg)
Tone Mapping
Once log‐average luminance is computed, can then define tone mapping operator
is resulting luminance a parameter is key of the scene (a = 0.18 is normal) High key minimizes contrasts and shadows. E.g. a = 0.72 Low key maximizes contrasts between light and dark. E.g. a
= 0.045
),(),( yxLLayxL ww
),( yxL
![Page 25: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/25.jpg)
Tone Mapping: Effects of a
![Page 26: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/26.jpg)
Lens Flare and Bloom
Caused by lens of eye/camera when directed at light Halo – refraction of light by lens Ciliary Corona – Density fluctuations of lens Bloom – Scattering in lens, glow around light
Halo, Bloom, Ciliary Corona – top to bottom
![Page 27: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/27.jpg)
Lens Flare and Bloom
Use set of textures for glare effects Each texture is bill boarded Alpha map – how much to blend Can be given colors for corona Overlap all of them ! Animate – create sparkle
![Page 28: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/28.jpg)
Depth of Field In photographs, a range of pixels in focus Pixels outside this range are out of focus This effect is known as Depth of field
![Page 29: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/29.jpg)
Depth of Field using Accumulation Buffer Jitter view position, add weighted samples to accumulation buffer
After multiple rendering passes, display picture Downside: Multiple rendering passes is expensive
![Page 30: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/30.jpg)
Depth of Field using Scattering
Scatter shading value of each location on a surface to neighboring pixel
Sprites used to represent circles of influence Pixel value is averaged sum of all overlapping circles
![Page 31: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/31.jpg)
Motion Blur Antialiasing is spatial blurring In cameras, caused by exposing film to moving objects Motion blur: Blurring of samples taken over time Makes fast moving scenes appear less jerky 30 fps + motion blur better than 60 fps + no motion blur
![Page 32: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/32.jpg)
Motion Blur Accumulation buffer can be used to create blur Basic idea is to average series of images over time Move object to set of positions occupied in a frame, blend resulting images together
![Page 33: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/33.jpg)
Motion Blur
Can blur moving average of frames. E.g blur 8 images When you render frame 9, subtract frame 1, etc Velocity buffer: blur in screen space using velocity of objects
![Page 34: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/34.jpg)
Fog Fog was part of OpenGL fixed function pipeline Using shaders, fog applied to scene just before display
Shaders can generate more elaborate fog Fog is atmospheric effect A little better realism Help in determining distances
![Page 35: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/35.jpg)
Fog example
Often just a matter of Choosing fog color Choosing fog model Turning it on
![Page 36: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/36.jpg)
Rendering Fog
Color of fog: color of surface: fc sc
]1,0[ )1( fff sfp ccc
How to compute f ? 3 ways: linear, exponential, exponential-squared Linear:
startend
pend
zzzz
f
![Page 37: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/37.jpg)
Fog
Exponential Squared exponential Exponential derived from Beer’s law Beer’s law: intensity of outgoing light diminishes
exponentially with distance
pf zdef 2)( pf zdef
![Page 38: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/38.jpg)
Fog
f values for different depths can be pre‐computed and stored in a table on GPU
Distances used in f calculations are planar Can also use Euclidean distance from viewer or radial distance to create radial fog
![Page 39: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/39.jpg)
Different Atmospheres
More generally, we can simulate better skies
![Page 40: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/40.jpg)
Volume Rendering Volumetric data is represented as volumetric pixels (voxels) Rendering Voxels (CT/MRI) Methods Implicit surface techniques to convert voxel samples into
polygonal surfaces (called isosurfaces)
Voxel Data as set of 2D image slices (Lacroute & Levoy)
Splatting – Voxel represented by alpha blended circular object (splat) , that drops of in opacity at fringes
Volume slices as textured Quads (OpenGL Volumizer API)
![Page 41: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/41.jpg)
Volumetric Texturing
Represent objects as sequence of semi‐transparent textures
Good for rendering fuzzy or hairy objects
![Page 42: Computer Graphics (CS 563) 4: Advanced Computer Graphics … · 2012. 2. 8. · Microsoft PowerPoint - cs563_ibr_wk4_p2.ppt [Compatibility Mode] Author: emmanuel Created Date: 2/7/2012](https://reader033.vdocuments.site/reader033/viewer/2022061000/60afc1e8a784bf29d7469ece/html5/thumbnails/42.jpg)
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