real-time rendering speacial effects lecture 03 marina gavrilova
Post on 18-Dec-2015
221 views
TRANSCRIPT
![Page 1: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/1.jpg)
Real-Time Rendering
SPEACIAL EFFECTS
Lecture 03Marina Gavrilova
![Page 2: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/2.jpg)
Brief Outline Image based Rendering Lens Effects Billboarding Particle Effects Reflection Shadow mapping Edge Effects Volumetric rendering
![Page 3: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/3.jpg)
The Rendering Spectrum Effects can be produced by manipulation of
images or geometry or both
![Page 4: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/4.jpg)
Image Based Rendering Early games used sprites (image object) Move/scale and draw sprite on screen Animated texture animated sprite
Layered Rendering with transparency Assign depth to sprite Render sprites in particular order Use transparency
Talisman architecture renders objects into layers and composite them for several frames
Lumigraph rendering Render using image interpolation
![Page 5: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/5.jpg)
Billboarding Create complex objects using
texture and simple geometry
Used extensively in particle rendering systems
Use faceted quads normal of the quad equals camera direction
Used frequently in games
High performance
![Page 6: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/6.jpg)
Types of billboarding
Screen-aligned billboard Facted quads/sprites Flare/glow/smoke
World aligned billboard Aligned facing camera Has it’s own up vector Scenery/complex objects
Axial Billboard One rotation axis Tree/objects on terrain
![Page 7: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/7.jpg)
Particle system Point based sprites Additive or other
blending Physically based
modeling Realistic volumetric
effect
![Page 8: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/8.jpg)
Lenz Effects
Effects that makes a scene natural
By mimicking physical properties of eye/camera
![Page 9: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/9.jpg)
Lens Flare Glow of light source Halo around the source Streaks and bloom formed around
the source Secondary lens effects (internal
reflection and refraction)
![Page 10: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/10.jpg)
Motion Blur Use accumulation buffer to render
object with interpolated coordinate Requires several rendering passes Realistic effect Slow
Texture based motion blur Other pseudo motion blur techniques
are used in games
![Page 11: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/11.jpg)
Reflection Method 1: Use
Environment mapping
Method 2: Flat mirror Render scene from
mirrors point of view Darken the scene Use that as a texture
![Page 12: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/12.jpg)
Exposure control Method 1: render multiple scene and blend with exposure
parameter
Method 2: Define per texture luminance Render using High Dynamic Range luminance (HDR)
![Page 13: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/13.jpg)
Depth of Field Hold camera target
stationery Vary camera source Render several pass Accumulate scene
![Page 14: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/14.jpg)
Shadow mapping
Without darkness, light cannot exist
Shadow mapping makes a scene significantly more
realistic
![Page 15: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/15.jpg)
Sh
ad
ow
in
a
scen
e
![Page 16: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/16.jpg)
Planar Shadow When occluders cast
shadow on planar objects (i.e. floor)
Fully shadowed region: umbra
Partially shadowed region: Penumbra
Hard shadow Projection algorithm
Soft shadow Shadow mapping
![Page 17: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/17.jpg)
Projection Shadow Project the vertices of an
object on a plane Render the transformed
object with dark color (without lighting)
Assume light source=l, vertex projected=v, projected vertex=p
In matrix form for plane y=0 (p=Mv):
For any arbitrary plane:
Matrix M=
![Page 18: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/18.jpg)
Problems with projective shadow Hard edge Less realistic Rendering on a plane tricky:
Offset from the plane to avoid z buffer overlap Different offset for different view angle
Anti-shadow problem:
![Page 19: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/19.jpg)
Soft Projective Shadow Generate a texture (render
into texture) Render the texture as a
plain Only recompute texture if
light source changes Method 1: Render into
accumulation buffer with varying light source
Use perspective projection on a plane
Light source = a Receiver parallelogram:
one vertex b and edge ex,ey
Advantage: Free from Anti-shadows and false shadows
![Page 20: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/20.jpg)
Soft Projective Shadow Method 2: Use spherical
light source Less expensive
computationally Looks better Problem: Visual artifact
when object touching the plane
Hard
Soft
![Page 21: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/21.jpg)
Shadow on arbitrary object: Shadow Volume Uses the stencil buffer Extend a pyramid from a light source through vertices of a
triangle Shadow Volume: volume under the pyramid Consider a ray from a pixel to an object: if number of
times intersecting front face of shadow volume>0 then vertex is under shadow
![Page 22: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/22.jpg)
Shadow Volume Technique Render the scene with ambient and emission Compute the faces of shadow volume Clear the stencil buffer and set to increment Render the front faces of shadow volumes
into stencil Set Stencil to decrement Render the back faces of shadow volumes
into stencil Render the scene with light only where
stencil=0 Shadow volume is slow for complex
geometry
![Page 23: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/23.jpg)
Shadow Volume
![Page 24: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/24.jpg)
Shadow Mapping Render the z-buffer from the lights point
of view Shadow map = content of this z-buffer Render scene using viewer
If distance between a rendered point and light is greater than projected z value then it is under shadow
Use texture mapping hardware
![Page 25: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/25.jpg)
Shadow Mapping Using Texture
First generate the shadow map Render from viewer using ambient
lighting only Convert shadow map z value to
viewers coordinate system Shadow test: Test z values of point
with z values in the shadow map
![Page 26: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/26.jpg)
Shadow mapping steps…
Shadow mapping for a complex scene
the pointthe pointlight sourcelight source
![Page 27: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/27.jpg)
Shadow mapping steps… Scene from light’s point of view
![Page 28: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/28.jpg)
Shadow mapping steps… Scene from light’s point of view
![Page 29: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/29.jpg)
Shadow mapping steps… Scene from viewer with shadow map (z values)
![Page 30: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/30.jpg)
Shadow mapping steps… Test Shadows: non green areas
are shadows
![Page 31: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/31.jpg)
Shadow mapping steps… Finally the scene can be rendered with the
shadow
![Page 32: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/32.jpg)
Other Rendering Concerns
Edge highlighting: Draw edge in different color (engineering app)
Polygon Edge rendering: Render the filled polygon (all buffer
active) with z buffer replacement=off Render the polygon edges (all active) Render the polygon only to the z
buffer
![Page 33: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/33.jpg)
Other Rendering Concerns
Hidden line rendering: Draw filled polygon to z-buffer and lines only on the color buffer (no hidden lines drawn)
Haloing: front-face lines halo the back faced lines
Height field and volumetric rendering: Use of voxels and 3D textures
![Page 34: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/34.jpg)
Height fields and volumes
![Page 35: Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova](https://reader036.vdocuments.site/reader036/viewer/2022062515/56649d225503460f949f890f/html5/thumbnails/35.jpg)
End of Lecture 03
Questions?