240 likes | 449 Views
Special Image Effects. Particle Systems Fog Lens Flares Shadows Programmable Shaders. Particle Systems. Each particle is a point, line, or textured polygons (with transparency). Polygons can be oriented to always face the viewpoint (fire, water spray, explosions, weapon fire, etc.)
E N D
Special Image Effects • Particle Systems • Fog • Lens Flares • Shadows • Programmable Shaders
Particle Systems • Each particle is a point, line, or textured polygons (with transparency). • Polygons can be oriented to always face the viewpoint (fire, water spray, explosions, weapon fire, etc.) • Or textured onto surfaces (splats) • Usually thousands of particles are used
Particle Systems • Particle Source • Particle Attributes (can be static or functional) • Position • Velocity (speed and direction) • Color • Lifetime • Age • Shape • Size • Transparency Point Shape
Particle Systems • Simple concept, simple to implement… • However, a good implementation requires some careful thought and consideration since you need to dynamically manage thousands of objects.
Particle Systems • Some links • Particle Systems by Allen Martin • http://www.cs.wpi.edu/~matt/courses/cs563/talks/psys.html • Gammasutra: Building an Advanced Particle System • http://www.gamasutra.com/features/20000623/vanderburg_01.htm • Particle Systems API • http://www.cs.unc.edu/~davemc/Particle/ • (demo taken from here)
Fog • Function of distance from the camera (linear or exponential) • as distance increases, bring colors to grey • Can be done just with Z-buffer • Also can be used to reduce scene complexity • Same idea can be used to fade far objects in and out (prevents flickering)
MechWarrior 4: Mercenaries Fog example 1
Red Faction 3 - PC Billboard objects • Textured polygons that rotate to stay flat towards the eye. • Used often for trees, trees, clouds, smoke, explosions, lens effects, etc. Another way to do trees, bushes, telephone poles, etc. without reorienting polygons each frame
Lens Effects • Billboards at varying levels of depth. • Usually rendered last. • Sometimes just an overlay on the screen. From http://www.geocities.com/SiliconValley/Lakes/1434/lenseffects.html
Lens Effects – Asheron’s Call 2 Asheron’s Call 2
Shadows • Projected shadows on flat surfaces (project polygon onto surface)
Soft Shadows • Multiple light sources or area sources give soft shadows (umbra, penumbra) umbra umbra penumbra penumbra
Soft Shadows From http://www.stereopsis.com/shadow/
Programmable Shaders • Renderman was the first programmable shading language • DirectX 8 featured vertex and pixel shaders • Nvidia and ATI boards now have programmable shading capabilities
Shaders • Vertex Shaders: • procedural geometry deformation • range-based or radial fog effects • camera lens effects including fish eye, wide angle, and water refraction effects. • Pixel Shaders: • per-pixel reflections • per-pixel lighting using Phong-style shading or DOT3 effects • procedural textures
Fog Cg Vertex Shader Examples Anisotropic Lighting
Refract Reflect Demo Stencil Shadow Volumes Cg Vertex Shader Examples
Hardware Shadow Maps Soft Stencil Shadows Cg Pixel Shader Examples
Flare Cg Pixel Shader Examples Water Interaction
Cg Shader Examples Shadow volumes w/fog http://www.cgshaders.org/shaders/show.php?id=49 Fire http://www.cgshaders.org/shaders/show.php?id=39