Graphics for Games Particle Systems CO2301 Games Development 1 Week 23.

Slides:



Advertisements
Similar presentations
How to Study the Universe
Advertisements

4.9. P ARTICLE E FFECTS Use of particle effects within games.
Modelling - Module 1 Lecture 1 Modelling - Module 1 Lecture 1 David Godfrey.
UFCFX5-15-3Mobile Device Development Particle Systems.
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”
UFCEKU-20-3Web Games Programming Game Physics for Collisions and Reactions.
1cs426-winter-2008 Notes. 2 Velocity fields  Velocity field could be a combination of pre-designed velocity elements E.g. explosions, vortices, …  Or.
Games Development Practices Semester 2 Overview CO2301 Games Development 1 Week 14.
Motions and Forces. How is speed calculated? The speed of an object can be calculated using this equation: distance travelled time taken speed =
 Calculate the acceleration that this object experiences 30 kg 150 N.
P3 Spaced learning Forces for transport. Speed Speed = Average Distance/Time KM x 1000 = M M / 1000 = KM Average Speed Cameras Takes two photos, a certain.
Motion. There are four sections to this…. 1. Speed and Acceleration 2. Forces 3. Work 4. Power Click on the section you want.
Games Development 2 Entity / Architecture Review CO3301 Week
Physically Based Animation and Modeling
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Modelling and Simulation Dynamics. Dynamics Dynamics is a branch of physics that describes how objects move. Dynamic animation uses rules of physics to.
Newtonian Gravitation and Orbits
CS559: Computer Graphics Lecture 38: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
Computer Graphics World, View and Projection Matrices CO2409 Computer Graphics Week 8.
Define forces as pushes or pulls which can cause objects to ; speed up, slow down, change direction.
Newton’s 1 st Law of Mechanics A particle will continue is a straight line at constant speed unless acted upon by a net push or pull (i.e. force). The.
Maths and Technologies for Games Quaternions CO3303 Week 1.
TERRAIN SET09115 Intro to Graphics Programming. Breakdown  Basics  What do we mean by terrain?  How terrain rendering works  Generating terrain 
Chapter 3 Vectors and Two-Dimensional Motion Vectors and Scalars A scalar is a quantity that is completely specified by a positive or negative number.
1 CO Games Concepts Week 20 Matrices continued Gareth Bellaby.
9.3. P ARTICLE S YSTEMS Development of a particle system.
LAWS OF MOTION Biomechanics.
Emerging Technologies for Games Alpha Sorting and “Soft” Particles CO3303 Week 15.
 The creation of moving pictures one frame at a time Literally 'to bring to life' e.g. make a sequence of drawings on paper, in which a character's position.
Physics Quantities Scalars and Vectors.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Maths & Technologies for Games Linear Dynamics Particle Based Physics CO3303 Week
CSC505 Particle Systems. CSC505 Object Representations So far we have represented (rendered) objects with –Lines –Polygons (triangles) –Curves These techniques.
11 Lecture 3 Particle Effects References: [1] Gregory Junker, Pro OGRE 3D Programming, Apress, 2006 [2] Ogre Tutorials – Ogre Wiki
Maths & Technologies for Games Animation: Practicalities CO3303 Week 3.
Forces & Motion “Trust the Force Luke” Forces Forces.
Particle Systems (Motion Machines of 2D Objects with Textures) Matthew K. Bowles Advanced Computer Graphics Spring 2004.
Games Development Game Architecture: Entities CO2301 Games Development 1 Week 22.
Games Development 2 Entity Update & Rendering CO3301 Week 2, Part 1.
Point Sprites Course Information CVG: Programming 4 My Name: Mark Walsh Website: Recommended.
Emerging Technologies for Games Deferred Rendering CO3303 Week 22.
Computer Graphics Blending CO2409 Computer Graphics Week 14.
Force and motion Objectives When you have competed it, you should
1 Uniform Circular Motion SP1. Students will analyze the relationships between force, mass, gravity, and the motion of objects. g. Measure and calculate.
Games Development 1 Review / Revision CO2301 Games Development 1 Semester 2.
Computer Graphics Matrix Hierarchies / Animation
Maths & Technologies for Games Graphics Optimisation - Batching CO3303 Week 5.
Computer Graphics Matrices
Advanced Games Development Game Physics CO2301 Games Development 1 Week 19.
Vectors and scalars. weight and mass We have seen that weight is a force that results from the attraction of a mass towards another mass (eg the Earth).
The Stingray Example Program CMT3311. Stingray - an example 2D game May be useful as a simple case study Most 2D games need to solve generic problems.
TABLE OF CONTENTS SECTION 1 : WORK, POWER, AND MACHINES SECTION 2 : SIMPLE MACHINES SECTION 3 : WHAT IS ENERGY? SECTION 4 : CONSERVATION OF ENERGY Chapter.
11.1 Distance and Displacement
Motion and Forces.
Force and motion Revise the following: Distance time graphs
Procedural Animation Lecture 8: Particle systems
Find the velocity of a particle with the given position function
CO1301: Games Concepts Lecture 22 Particle Systems
What is Motion? Motion: A change in position of an object compared to a reference point Motion can be measured in the following ways:
Games Development Practices Semester 2 Overview
CO1301: Games Concepts Lecture 21 Timing + Quads + Numbers
Advanced Games Development Game Physics
Aim: How do we explain Newton’s first two laws of motion?
CO Games Concepts Week 22 Particle systems
Kinematics: Displacement and Velocity
Use of particle effects within games
Computer Graphics Matrix Hierarchies / Animation
Emerging Technologies for Games Review & Revision Strategy
Games Development 2 Entity / Architecture Review
Presentation transcript:

Graphics for Games Particle Systems CO2301 Games Development 1 Week 23

Lecture Contents 1.Particle System Examples 2.Types of Particle 3.Particle Data and External Forces 4.Particle Update 5.Emitters and Other Features 6.Technical Considerations

Particle Systems A particle system is a collection of sprites or models: –Usually each is small –May be a large number –Each follows a simple motion Combined they create complex visual effects Used for: –Fire, smoke –Water –Special effects, etc.

Types of Particle Each particle may be a 3D model, e.g.: –Rocks coming from a volcano –Leaves falling from a tree More commonly, each particle is a sprite –Typically the sprite is made to always face the camera –And scale with distance –i.e. It appears to be 3D –E.g. Use a flare sprite for a firework particle system

Core Particle Data We store a list of particles –Typically use a simple structure for performance –There may be a very lot of particles, so performance is key Typical data required for each particle: –Position in space, a 3D point –Velocity, a 3D vector Not just speed, as we need direction of travel too –Life, a float: Particles in most systems don’t last forever The life value is a countdown clock When it reaches 0, particle is destroyed Important to keep number of particles under control

External Forces Each particle’s velocity must change, or it will only move in a straight line –A change in velocity is called an Acceleration –Acceleration caused by external Force on particle –So we’re interested in the forces on the particle. Gravity is the most common force, but also wind, explosions or artificial effects Define all the forces affecting the particle –Sum all the forces to get the overall force How to convert force to acceleration? –Newtonian physics: F = ma –m is the mass of the particle, often assumed to be 1 for particle systems, i.e. we can use force value for acceleration

Particle Update This is sufficient information to update the particle system each frame: –Go through the list of particles –Find overall force acting on each one E.g. gravity + wind –Turn this to an acceleration Take account of particle mass or not (usually not) –Add acceleration to velocity –Add velocity to position –Decrease life –If life <= 0, remove particle from system

Particle Update Example

Frame Timing This is simple physics, velocities and accelerations are measured in physical units –Velocity: metres per second ( ms -1 ) –Acceleration: metres per second per second ( ms -2 ) –Force: kilogram metres per second per second ( kg ms -2, or N ) We update particles every frame, not once per second –But the physical units are convenient and intuitive So take account of time taken for each frame when applying acceleration / velocity: –Measure frame time –Multiply velocity and acceleration by frame-time Same as game loop timing

Emitters –Emitters have various settings: Location, size, etc. Time period between emitting each particles Initial particle data, e.g. starting velocity for particles –Common for these settings to be somewhat randomised, e.g. time period is 1s ±0.2s Have seen how to update and destroy particles particles –Simple physics and life countdown But how are particles created? We might initialise the system with some particles. But also many particle systems contain an emitter –Point, area or volume that spawns particles

More Advanced Features These are the most basic elements of a particle system, we can add many more features: –Particle rotation / spin –Scaling, particles get bigger / smaller over time –Particle colour (and colour change) –Transparency (particles fade out) –Emitter movement –Repulsors & Attractors – create forces –Combined systems (multiple particle types / behaviour to create effect, e.g. fire + smoke)

Technical Considerations We can store / render a simple list of models for a basic particle system However, systems may manage over 1,000,000 particles in real-time –Iterating through so many objects will be too slow Need optimisation and specialised techniques: –Efficient structures for particles (little OO) –Instancing, hardware supported technique to render many models in one draw call –DirectX10+ has geometry shaders and stream-out functionality, which can be leveraged –Will cover all this in the third year…