Particle System Design. The Challenge Particle systems vary so much But want some code reuse Option 1: parameterization Option 2: inheritance Option 3:

Slides:



Advertisements
Similar presentations
Stupid OpenGL Shader Tricks
Advertisements

What is Projectile Motion?
4.9. P ARTICLE E FFECTS Use of particle effects within games.
INNER WORKINGS OF UNITY 3D. WHAT WE ARE GOING TO COVER Intro to Unity Physics & Game Objects Cameras & Lighting Textures & Materials Quaternions and Rotation.
Parametric Equations Here are some examples of trigonometric functions used in parametric equations.
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”
Computer Science – Game DesignUC Santa Cruz Today Publish/Subscribe Design Pattern Delegates Sprite movement Particles.
Mechanical Engineering Dept.
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.
Trajectory Generation How do I get there? This way!
Particle Systems GPU Graphics. Sample Particle System Fire and SmokeWater.
Particle Kinematics: Circular Motion. Circular Motion.
1cs533d-term Notes  list Even if you’re just auditing!
Cornell CS 468Andrew Butts 1 Implementing Particle Systems CS 468 Spring 2004 Andrew Butts.
Dakota Humphries (Project Lead) Thomas Impellitteri (Tech Lead) Daryl McGhee II (Design Lead) Keith Rosier (Asset Lead)
Physically Based Animation and Modeling
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Antigone Engine Kevin Kassing – Period
Cloth Simulation By Chris Szendrovits o based on Jim Adams “Soft Body Mesh” demo.
Constrained Motion of Connected Particles
Final Project Presentation& Demo Zhi Dong Real Time FEM of Elasto-Plastic Simulation.
ME 2304: 3D Geometry & Vector Calculus Dr. Faraz Junejo Line Integrals.
1 Game Physics. 2 Introduction to Game Physics Traditional Game Physics Traditional Game Physics –Particle system –Rigid body dynamics –Flexible body.
CSE 380 – Computer Game Programming Box2D Box2D TestBed.
CS559: Computer Graphics Lecture 38: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
Chapter 10: Graphics MATLAB for Scientist and Engineers Using Symbolic Toolbox.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Particle Systems Simulation for special effects.
Section 17.2 Position, Velocity, and Acceleration.
Computer Science Term 1, 2006 Tutorial 3 Assignment 4 – Special Effects.
Copyright © 2007 Pearson Education, Inc. Slide 10-1 Parametric Equations Here are some examples of trigonometric functions used in parametric equations.
6.3 Parametric Equations and Motion
Geometric Modeling. Volumetric o Collection device obtains regular grid of measurement values Examples: CT, MRI, PET, Ultrasound o Values are interpreted/visualized.
Circular Motion. Uniform Circular Motion Motion of an object at constant speed along a circular path.
CSC505 Particle Systems. CSC505 Object Representations So far we have represented (rendered) objects with –Lines –Polygons (triangles) –Curves These techniques.
Introduction to Procedural Methods, Particles Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Monday, March.
1 Manage Mesh Data Chapter 8. 2 How to manage Mesh data The most important two objects of mesh are VertexBuffer and IndexBuffer, which can obtained by.
Particle Systems (Motion Machines of 2D Objects with Textures) Matthew K. Bowles Advanced Computer Graphics Spring 2004.
Particle A particle is an object having a non zero mass and the shape of a point (zero size and no internal structure). In various situations we approximate.
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.
Point Sprites Course Information CVG: Programming 4 My Name: Mark Walsh Website: Recommended.
Paint Effects.  Uses: paint brush strokes paint particle effects Traditional paint program ○ paint images on a canvas ○ paint repeatable textures that.
Particle Systems Using and Creating Copyright © 2015 Curt Hill.
CSE 381 – Advanced Game Programming GLSL. Rendering Revisited.
Particle Systems Derived from Steve Rotenberg, UCSD.
Particles and their home in Geometry Shaders Paul Taylor 2010.
More on Particles Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, March 24, 2004.
Driving Land Vehicle Game Programming Fall Content Kinematic maneuver Dynamic maneuver.
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.
Ctrl + Z Sucheta Bhatawadekar Sucheta Bhatawadekar Dan L'Hommedieu Dan L'Hommedieu John Scott John Scott Jonathan Perkins Jonathan Perkins Aaron Cardwell.
EE 495 Modern Navigation Systems Kalman Filtering – Part II Mon, April 4 EE 495 Modern Navigation Systems Slide 1 of 23.
GLSL Review Monday, Nov OpenGL pipeline Command Stream Vertex Processing Geometry processing Rasterization Fragment processing Fragment Ops/Blending.
Particle Animation and Rendering Using Data Parallel Computation Karl Sims Optomystic Thinking Machines Corporation Presentation ©2001 Brenden Schubert.
Lecture Rendering pipeline, shaders and effects 1Elias Holmlid.
2. Motion 2.1. Position and path Motion or rest is relative.
Visualization Shading
Chapter 6 GPU, Shaders, and Shading Languages
What is Projectile Motion?
Manipulator Dynamics 2 Instructor: Jacob Rosen
Find the velocity of a particle with the given position function
Animation Lecture 17 Wed, Oct 3, 2007.
CO1301: Games Concepts Lecture 22 Particle Systems
Computer Graphics Lecture 15.
CO Games Concepts Week 22 Particle systems
12.5: Vector PVA.
Use of particle effects within games
Presentation transcript:

Particle System Design

The Challenge Particle systems vary so much But want some code reuse Option 1: parameterization Option 2: inheritance Option 3: subroutine library Let’s look at actual systems

Look for Custom Code: Motion Rendering Orientation Interparticle Force Color Spawning Emitters Any of these could use custom code

Parameterization Simply not general enough

Inheritance Inheritance is usually helpful for code reuse. But in the case of particles, want to inherit motion from here, want to inherit rendering from there, want to inherit spawning from that, Inheritance doesn’t work that way.

Subroutine Library Each system is its own module, however, Library provides: routines for rendering routines for calculating motion routines for spawning etc Let’s design this library

Rendering Routines Render camera-aligned quads pos, size, color, tex, theta, blend Render soft trails ie, for jet engine exhaust or, for sparks from a grinder Render each particle as 3D model

Soft Trails For each point along trail generate two “side-points.”

Soft Trails For each point along trail generate two “side-points.”

Soft Trails For each point along trail generate two “side-points.” for each point P: eye = vector from cam to P lineseg1 = one of two segments connected to P lineseg2 = two of two segments connected to P v1 = cross(lineseg1,eye) v2 = cross(lineseg2,eye) if (dot(v1,v2) < 0) { v2= -v2; } v = normalize(average(v1,v2)) sidepoint1 = P + v sidepoint2 = P – v

Particle Motion Two ways to do it: Option 1: Timestep simulation. Calculate acceleration Position += Velocity Velocity += Acceleration Option 2: Closed form equations. Particle.X = f(t) Particle.Y = g(t) Why not always use timesteps?

Why closed form I Can be hardware accelerated. Example: simple fountain. struct vertex { float3 startpos; float3 initialvelocity; float lifespan; }; vertex shader globals { float3 gravity; float currentTime; };

Why closed form II Can use prerecorded paths. float positionX[1024]; float positionY[1024]; Can add several prerecorded paths multiple circles wiggle + parabola Can transform prerecorded path smoke example Library should contain many paths.

Why Timestepped Particles that “bounce.” or, interact with world in other ways. simply can’t do this in closed form. Decouple frame rate from renderer. This should be a class in your library. ps.elapsed = GetClock() – ps.createtime timesteps = (int)(ps.elapsed / ps.framerate) while (timesteps > ps.timesteps) { ps.update(); ps.timesteps += 1; }

Data Structures Every particle system needs some form of particle list. But, it seems every system has different particle attributes. pos, vel, accel, theta, direction, age, history, color, rand seed, opacity, lifespan, size, texture, 3D mesh, quat, etc, etc... My solution: class particlearray { int array_size; int array_fill; float3 *pos; float3 *vel; float3 *accel;...