Particle Systems GPU Graphics. Sample Particle System Fire and SmokeWater.

Slides:



Advertisements
Similar presentations
Reactive and Potential Field Planners
Advertisements

CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
Simulation of Fluids using the Navier-Stokes Equations Kartik Ramakrishnan.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Aero-Hydrodynamic Characteristics
The Art and Technology Behind Bioshock’s Special Effects
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
1Notes  Textbook: matchmove 6.7.2, B.9. 2 Match Move  For combining CG effects with real footage, need to match synthetic camera to real camera: “matchmove”
Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012.
Particle Systems and Fuzzy Shapes Presented by Dan Cogswell.
Modeling Fluid Phenomena -Vinay Bondhugula (25 th & 27 th April 2006)
The programmable pipeline Lecture 10 Slide Courtesy to Dr. Suresh Venkatasubramanian.
Cornell CS 468Andrew Butts 1 Implementing Particle Systems CS 468 Spring 2004 Andrew Butts.
Paper by Alexander Keller
< BackNext >PreviewMain Forces and Motion Preview Section 1 Gravity and MotionGravity and Motion Section 2 Newton’s Laws of MotionNewton’s Laws of Motion.
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.
Motion of mass on a parachute  Falling objects increase their speed as they fall.  This is due to their weight (the force of gravity) that pulls them.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Fluids.
Physically Based Animation and Modeling
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Procedural Methods (with a focus on particle systems) Angel, Chapter 11 slides from AW, open courseware, etc. CSCI 6360/4360.
Forces Gravity and Newton's 2nd Law. Mass = how much matter is in an object 1. More mass = greater __________ (harder to move or stop) 2. The platinum.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CS559: Computer Graphics Lecture 38: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
Interactive Time-Dependent Tone Mapping Using Programmable Graphics Hardware Nolan GoodnightGreg HumphreysCliff WoolleyRui Wang University of Virginia.
Particle Systems – Technique for Modeling a Class of Fuzzy Objects Craig Schroeder Computer Graphics I April 22, 2004.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
Particle Systems Simulation for special effects.
Advanced 3D Computer Graphics Behzad akbari Professor Burton Ma CSE 4431, Winter 2011 PARTICLE SYSTEMS.
Computer Science Term 1, 2006 Tutorial 3 Assignment 4 – Special Effects.
3D Graphics for Game Programming Chapter IV Fragment Processing and Output Merging.
Parachute Investigation. Velocity Definition: The constant maximum velocity reached by a body falling through the atmosphere under the attraction of gravity.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Tone Mapping on GPUs Cliff Woolley University of Virginia Slides courtesy Nolan Goodnight.
CSC505 Particle Systems. CSC505 Object Representations So far we have represented (rendered) objects with –Lines –Polygons (triangles) –Curves These techniques.
Detail-Preserving Fluid Control N. Th ű rey R. Keiser M. Pauly U. R ű de SCA 2006.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Particle Systems (Motion Machines of 2D Objects with Textures) Matthew K. Bowles Advanced Computer Graphics Spring 2004.
Goal: To projectile motions Objectives: 1)To understand freefall motions in 1 D 2)To understand freefall motions in 2D 3)To understand air drag and terminal.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Physics for Games Spring 2012.
1 by: Ilya Melamed Supervised by: Eyal Sarfati High Speed Digital Systems Lab.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Particles Paul Taylor Polygons are not so hot! Good for representing objects like A Cup A Robot A Pyramid Not so hot for creating Hair Snowflakes.
Chipmunk Physics Remember that we talked about this a bit when we did collision handlers for the space ship integration task (SpritesActionsPhysicsSound).
Chapter 20 Forces and Motion Preview Section 1 Gravity and MotionGravity and Motion Section 2 Newton’s Laws of MotionNewton’s Laws of Motion Section 3.
Unit 1 Physics on the go Topic 2 Materials: Viscosity.
GPU Based Sound Simulation and Visualization Torbjorn Loken, Torbjorn Loken, Sergiu M. Dascalu, and Frederick C Harris, Jr. Department of Computer Science.
Multimedia Programming 21: Particle Animation Departments of Digital Contents Sang Il Park.
MSIM 842 VISUALIZATION II INSTRUCTOR: JESSICA R. CROUCH 1 A Particle System for Interactive Visualization of 3D Flows Jens Krüger Peter Kipfer.
Maths & Technologies for Games Graphics Optimisation - Batching CO3303 Week 5.
Graphics Lecture 17: Slide 1 Interactive Computer Graphics Lecture 17: Fire.
Smoothed Particle Hydrodynamics Matthew Zhu CSCI 5551 — Fall 2015.
Particles and their home in Geometry Shaders Paul Taylor 2010.
Portal & Particle. Index Portal Particles Portal Room-Portal visibility system  Determine which room is shown at this time  Determine which object.
Game Technology Animation V Generate motion of objects using numerical simulation methods Physically Based Animation.
Particle Systems Reference: Reeves W.: "Particle Systems -- A Technique for Modelling a Class of Fuzzy Objets", Computer Graphics, 17(3), pp ,
Graphics for Games Particle Systems CO2301 Games Development 1 Week 23.
< BackNext >PreviewMain Gravity and Falling Objects Gravity and Acceleration Objects fall to the ground at the same rate because the acceleration due to.
Computer Graphics Imaging Ying Zhu Georgia State University Lecture 26 Hair and fur.
Particle Animation and Rendering Using Data Parallel Computation Karl Sims Optomystic Thinking Machines Corporation Presentation ©2001 Brenden Schubert.
Gravitational Force  Gravity= a force of attraction between objects, “pulls” objects toward each other  Law of universal gravitation= all objects in.
Deferred Lighting.
© University of Wisconsin, CS559 Fall 2004
ATCM 6317Procedural Animation
Procedural Animation Lecture 8: Particle systems
Physically Based Animation and Modeling
Plants from Images CS 658.
CO1301: Games Concepts Lecture 22 Particle Systems
Particle Systems - A Technique for Modeling a Class of Fuzzy Objects
CO Games Concepts Week 22 Particle systems
Presentation transcript:

Particle Systems GPU Graphics

Sample Particle System Fire and SmokeWater

What is a particle system? One of the original uses was in the movie Star Trek II William Reeves (implementor) Particle system from Star Trek II: Wrath of Khan Each Particle Had: Position Velocity Color Lifetime Age Shape Size Transparency

Types of Particle Systems  Stateless Particle System – A particle data is computed from birth to death by a closed form function defined by a set of start values and a current time. (does not react to dynamic environment)  State Preserving Particle System – Uses numerical iterative integration methods to compute particle data from previous values and changing environmental descriptions.

Stateless Particle Systems on GPU  Stateless Simulation – Computed particle data by closed form functions No reaction on dynamically changing environment! No Storage of varying data (sim. in vertex prog) Particle Birth Upload time of birth & initial Values to dynamic vertex buffer Rendering Set global function parameter as vertex program constants Render point sprites/triangles/quads With particle system vertex program

Particle Life Cycle  Generation – Particles are generated randomly within a predetermined location  Particle Dynamics – The attributes of a particle may vary over time. Based upon equations depending on attribute.  Extinction Age – Time the particle has been alive Lifetime – Maximum amount of time the particle can live.  Premature Extinction: Running out of bounds Hitting an object (ground) Attribute reaches a threshold (particle becomes transparent)

Rendering  Rendered as a graphics primitive (blob)  Particles that map to the same pixels are additive Sum the colors together No hidden surface removal Motion blur is rendered by streaking based on the particles position and velocity

Issues with Particle Systems on the CPU  CPU based particle systems are limited to about 10,000 particles per frame in most game applications  Limiting Factor is CPU-GPU communication PCI Express transfer rate is about 3 gigabytes/sec

State Preserving Algorithm: Rendering Passes:  Process Birth and Deaths  Update Velocities  Update Positions  Sort Particles (optional, takes multiple passes)  Transfer particle positions from pixel to vertex memory  Render particles

Data Storage:  Two Textures (position and velocity) Each holds an x,y,z component Conceptually a 1d array Stored in a 2d texture (why)  Use texture pair and double buffering to compute new data from previous data Total number of textures needed ?  Storage Types Velocity can be stored using 16bit floats  Size, Color, Opacity, etc. Simple attributes, can be added later, usually computed using the stateless method

Birth and Death  Birth = allocation of a particle Associate new data with an available index in the attributes textures Serial process – offloaded to CPU Initial particle data determined on CPU also  Death = deallocation of a particle Must be processed on CPU and GPU  CPU – frees the index associated with particle  GPU – extra pass to move any dead particles to unseen areas (i.e. infinity, or behind the camera)  In practice particles fade out or fall out of view (Clean-up rarely needs to be done)

Allocation on CPU Stack Heap Easier! Better! Optimize heap to always return smallest available index Why? 6 33

Update Velocities Velocity Operations  Global Forces Wind Gravity  Local Forces Attraction Repulsion  Velocity Damping  Collision Detection F = Σ f0... fn F = ma a = F/m If m = 1 F = a

Local Force – Flow Field Stokes Law of drag force on a sphere F d = 6Πηr(v-v fl ) η = viscosity r = radius of sphere C = 6Πηr (constant) v = particle velocity v fl = flow velocity Sample Flow Field

Other velocity operations  Damping Imitates viscous materials or air resistance Implement by downward scaling velocity  Un-damping Self-propelled objects (bee swarms) Implement by upward scaling velocity

Collisions  Collisions against simple objects Walls Bounding Spheres  Collision against complex objects Terrain Complex objects Terrain is usually modeled as a texture-based height field

Collision Reaction v n = (v bc * n)v bc v t = v bc – v n v bc = velocity before collision v n = normal component of velocity v t = tangental component of velocity V = (1-μ)v t – εv n μ = dynamic friction (affects tangent velocity) ε = resilience (affects normal velocity) V VtVt VnVn

Update Positions  Euler Integration p = p prev + v * Δt For simple velocity updates  Verlet p i+1 = p i + (p i – p i-1 ) + a * Δt 2

Sorting for Alpha Blending  Odd-even merge sort Good for GPU because it always runs in constant time for a given data size  Inefficient to check whether sort is done on GPU Guarantees that with each iteration sortedness never decreases  Full sort can be distributed over frames so it doesn’t slow down system too much (acceptable visual errors) Sorting will be covered in lecture 8

Questions?