Emerging Technologies for Games Alpha Sorting and “Soft” Particles CO3303 Week 15.

Slides:



Advertisements
Similar presentations
15.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 15 – Visible Surfaces and Shadows.
Advertisements

8.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 8 Polygon Rendering.
Exploration of advanced lighting and shading techniques
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Exploration of bump, parallax, relief and displacement mapping
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
03/12/02 (c) 2002 University of Wisconsin, CS559 Last Time Some Visibility (Hidden Surface Removal) algorithms –Painter’s Draw in some order Things drawn.
Lecture Fall 2001 Visibility Back-Face Culling Painter’s Algorithm.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
Hank Childs, University of Oregon November 15 th, 2013 Volume Rendering, Part 2.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Hidden Line Removal Adopted from U Strathclyde’s course page.
Visible-surface Detection Computer Graphics Seminar MUM
1 Lecture 11 Scene Modeling. 2 Multiple Orthographic Views The easiest way is to project the scene with parallel orthographic projections. Fast rendering.
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Non-Photorealistic Rendering - This is the attempt to make a realistic scene or object look as if it were hand drawn.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Beyond Meshes Spring 2012.
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
Hidden Surface Removal
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
Maths and Technologies for Games Water Rendering CO3303 Week 22.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
4.7. I NSTANCING Introduction to geometry instancing.
Computer Graphics Texture Mapping
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Computer Graphics Bitmaps & Sprites CO2409 Computer Graphics Week 3.
Multi-pass Rendering. © 2002 James K. Hahn, N.H. Baek2 Multi-pass Rendering Repeat: image  Rendering pass  result imageRepeat: image  Rendering pass.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
CS-378: Game Technology Lecture #2.2: Clipping and Hidden Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney,
Shader Study 이동현. Vision engine   Games Helldorado The Show Warlord.
Games Development 1 Camera Projection / Picking CO3301 Week 8.
1Computer Graphics Implementation II Lecture 16 John Shearer Culture Lab – space 2
Implementation II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Computer Graphics Basic 3D Geometry CO2409 Computer Graphics Week 5-1.
CS 325 Introduction to Computer Graphics 03 / 22 / 2010 Instructor: Michael Eckmann.
Implementation II.
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
Emerging Technologies for Games Deferred Rendering CO3303 Week 22.
Computer Graphics Blending CO2409 Computer Graphics Week 14.
Hank Childs, University of Oregon Volume Rendering, pt 1.
Maths & Technologies for Games Advanced Graphics: Scene Post-Processing CO3303 Week
Maths & Technologies for Games Graphics Optimisation - Batching CO3303 Week 5.
Computer Graphics I, Fall 2010 Implementation II.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Graphics for Games Particle Systems CO2301 Games Development 1 Week 23.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
Visible surface determination. Problem outline Given a set of 3D objects and a viewing specification, we wish to determine which lines or surfaces are.
Introduction to Game Programming & Design III Lecture III.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Visible-Surface Detection Methods. To identify those parts of a scene that are visible from a chosen viewing position. Surfaces which are obscured by.
Maths and Technologies for Games Water Rendering
Computer Graphics Implementation II
Week 7 - Monday CS361.
Hidden Surface Removal
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
© University of Wisconsin, CS559 Fall 2004
CSCE 441: Computer Graphics Hidden Surface Removal
Implementation II Ed Angel Professor Emeritus of Computer Science
Introduction to Computer Graphics with WebGL
Computer Graphics Material Colours and Lighting
Implementation II Ed Angel Professor Emeritus of Computer Science
Emerging Technologies for Games Review & Revision Strategy
Presentation transcript:

Emerging Technologies for Games Alpha Sorting and “Soft” Particles CO3303 Week 15

Today’s Lecture 1.Alpha Sorting Problems 2.Run-time Depth Sorting 3.Hard Flat Particles 4.Depth Particles 5.Soft Particles 6.Depth-Soft Particles 7.Further Possibilities

Alpha Sorting Problems Problem is depth buffer ignores transparency –Transparent pixels drawn in nearby polygons “obscure” distant polygons drawn later Avoid problem by drawing polygons from back to front Saw alpha blending in the second year –A very attractive blending technique However, it causes sorting issues –Without resolving these, method is not very useful

Run-time Depth Sorting 1 One solution is to sort all alpha blended polys in back-to-front order –Every frame (can be slow) If all polygons face camera (e.g. a particle system): –Sort polygons based on camera-space z distance –Camera space z = CP●Z C CP is vector from camera to poly, Z C is camera z-axis

Run-time Depth Sorting 2 Might think to sort on camera-space z again –But distance to which point on the polygon? –Nearest? –Furthest? –Average? Will any of these work? How to sort polys that face in any direction? No, a more complex approach is needed

Run-time Depth Sorting 3 First, assume that polygons don’t intersect Then, given two polygons, one of them will be entirely on one side of the plane of the other Identify this polygon, and see if it is on the side nearer the camera or not First step is to get a face normal for each polygon –Reverse normal if it faces away from the camera –Do this prior to sorting

Run-time Depth Sorting 4 Join either point of polygon 2 to each of the points of polygon 1 Calculate dot products of these vectors with normal of polygon 2: –Results all +ve: poly 1 is nearer –Results all -ve: poly 1 is further –Results mixed: poly 1 is split by plane of poly 2. So repeat test the other way round (2 nd diagram) –If split both ways, then the polygons are intersecting

Run-time Sorting Practicalities Must ensure this sorting is efficient as possible –Sort pointers to polygons not polygon data itself (less to sort) –Retain previous sorting and use a sort algorithm that is good with almost sorted data (e.g. insertion sort) –Don’t sort every frame, only every two or three –Run the sorting concurrently –Reduce density of particle systems based on distance –Use partitions to help: Sort partitions from back to from, then particles in one partition at a time – reducing number polygons in each sort In practice, another technique (not covered here), alpha-to-coverage is often used as an alternative

Hard Flat Particles Alpha blending is as useful as other blending methods once the polygons are sorted –Note: just like other blending (additive, multiplicative etc.), we need to render all the opaque polygons first However, all blending methods exhibit hard edges if they intersect other polygons –Makes dense particle systems look poor –Particularly large particles like smoke (indoors is particularly bad)

Depth Particles A simple improvement is to give alpha blended particles some depth –Simulated bumpiness, like normal / parallax mapping –Store it in the alpha channel of the texture Adjust the depth used for the depth-buffer by this value –Improves hard edges by making them bumpy Must hand calculate depth value in shader –Not done this before

Soft Particles To improve further, note that visual problems mainly occur when a particle intersects with an opaque object We know the opaque objects have already been drawn… –So they are already in depth buffer Can compare depth of particle with depth already in buffer Fade pixels out when the difference is small –Adjust alpha towards 0

Depth-Soft Particles This method can be combined with the depth particles idea presented earlier –Or can just be used on flat particles We must do some detailed work with depth buffer –Rather unfamiliar But almost completely removes hard edges where alpha particles intersect solid objects –Can work with other blending modes too

Further Possibilities The SoftParticles DirectX10 sample in the DirectX SDK takes this idea a little further –Explores volumetric particles - consider the volume of particle that camera is looking through