Particles and their home in Geometry Shaders Paul Taylor 2010.

Slides:



Advertisements
Similar presentations
FORCES Mrs. Cholak.
Advertisements

Chapter 4 The Laws of Motion.
Force Force is a push or pull on an object The object is called the System Force on a system in motion causes change in velocity = acceleration Force is.
Falling Objects and Gravity. Air Resistance When an object falls, gravity pulls it down. Air resistance works opposite of gravity and opposes the motion.
FORCES. Force is a vector quantity and is measured in newtons (1N) There are different type of forces: – weight – friction force – normal reaction force.
Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012.
Momentum flux across the sea surface
Physics 218: Mechanics Instructor: Dr. Tatiana Erukhimova Sections 818, 819, 820, 821 Lecture 10.
D. Roberts PHYS 121 University of Maryland Physic² 121: Fundament°ls of Phy²ics I October 4, 2006.
Physical Science Chapter 2
Physically Based Animation and Modeling
Cloth Simulation By Chris Szendrovits o based on Jim Adams “Soft Body Mesh” demo.
Modelling and Simulation Dynamics. Dynamics Dynamics is a branch of physics that describes how objects move. Dynamic animation uses rules of physics to.
Physics 111: Mechanics Lecture 13
Forces and Newton’s Laws. Forces Forces are ________ (magnitude and direction) Contact forces result from ________ ________ Field forces act ___ __ __________.
Free-body Diagrams To help us understand why something moves as it does (or why it remains at rest) it is helpful to draw a free-body diagram. The free-body.
Newton’s Laws of Motion 1. If the sum of all external forces on an object is zero, then its speed and direction will not change. Inertia 2. If a nonzero.
Forces in 1 Dimension Chapter Force and Motion Force is push or pull exerted on object Forces change motion –Makes it important to know the forces.
Physically Based Modeling Let physics take over!.
Matrices from HELL Paul Taylor Basic Required Matrices PROJECTION WORLD VIEW.
Mechanics Topic 2.2 Forces and Dynamics. Forces and Free-body Diagrams To a physicist a force is recognised by the effect or effects that it produces.
Chapter 4 Dynamics: Newton’s Laws of Motion
Gravitation. Gravitational Force and Field Newton proposed that a force of attraction exists between any two masses. This force law applies to point masses.
Chapter 2 MOTION. - one of the more common intangible concepts in science - is the act or process of changing position TWO IMPORTANT ASPECTS OF MOTION.
 Scalars are quantities that have magnitude only, such as › position › speed › time › mass  Vectors are quantities that have both magnitude and direction,
Derivation of the proportionality of velocity and radius for an object in circular motion under a constant centripetal force.
Motion: a change in position, measured by distance and time.
Newton’s Laws Chapter 4 Physics chapter 4.
CSC505 Particle Systems. CSC505 Object Representations So far we have represented (rendered) objects with –Lines –Polygons (triangles) –Curves These techniques.
Dynamics: Newton’s Laws of Motion. Concepts Force Newton’s First Law of Motion Mass Newton’s Second Law of Motion Newton’s Third Law of Motion Weight.
Particle Systems (Motion Machines of 2D Objects with Textures) Matthew K. Bowles Advanced Computer Graphics Spring 2004.
Motion & Forces.
The Laws of Motion. Classical Mechanics Describes the relationship between the motion of objects in our everyday world and the forces acting on them Describes.
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.
Using Newton’s Laws Section 4.2 Page 96. Newton’s 2 nd Law Describes the connection between the cause of a change in an object’s velocity and the resulting.
CSE3AGT – How to fail the Exam Paul Taylor Things to forget: What is Barry? A hamster or a Guinea Pig? The differences between Dx9 and Dx10 What.
1 Applying Newton’s Laws Assumptions Assumptions Objects behave as particles Objects behave as particles can ignore rotational motion (for now) can ignore.
SPH3U – Unit 2 Gravitational Force Near the Earth.
Dynamics!.
Physics Review for the GHSGT. Speed Measure of how quickly an object gets from one place to another.
Emerging Technologies for Games Capability Testing and DirectX10 Features CO3301 Week 6.
Forces and Motion Forces in One Dimension. Force and Motion  Force  Force is a push or pull exerted on an object  Cause objects to speed up, slow down,
1 Equations of Motion September 15 Part Continuum Hypothesis  Assume that macroscopic behavior of fluid is same as if it were perfectly continuous.
Forces Motion and Forces. Forces What is a force? A force is a push or pull. What happens when forces combine? Forces combine to produce a net force.
Motion, Forces and Energy
Gravity Chapter Gravity Law of Universal Gravitation- all objects in the universe attract each other through gravitational force Law of Universal.
Forces and Laws of Motion Force Force is the cause of an acceleration, or the change in an objects motion. This means that force can make an object to.
Chapter 3 Forces & Motion. Newton’s 1 st Law of Motion An object at rest will remain at rest unless acted upon by an unbalanced force. An object in motion.
“Law of Acceleration” Forces can be BALANCED or UNBALANCED Balanced forces are equal in size (magnitude) and opposite in direction UNbalanced.
Test – What to study The test will cover things we have done in class up to Lecture 9 Momentum will NOT be on the test Please look over old test (available.
Topic 2.2 Forces and Dynamics
Net force, F=ma, and friction
Only 25 more lectures after today!!
Motion & Forces.
Motion & Forces.
Particle Systems.
Newton’s Laws of Motion
Newton’s Laws of Motion
Sir Isaac Newton
Dynamics: Newton’s Laws of Motion (Ch. 12)
Connecting Motion with Forces
Forces.
Physically Based Animation and Modeling
Motion and Forces.
Interactive Flashcards: How to Customize the Flashcards
Step 1: Get Organized Draw a picture.
Newton’s Laws of Motion
Newton's Laws Of Motion Teneighah Young.
1st hour Science November Newton’s laws of Motion!
Dynamics: Newton’s Laws of Motion
Presentation transcript:

Particles and their home in Geometry Shaders Paul Taylor 2010

Portal is Free on Steam!!! Till the 24 th May

Polygons are not so hot! Great for representing objects like A Cup A Robot A Pyramid Not so hot for creating Hair Snowflakes Rain Sparks Clouds Lightning Steam

Procedural Methods This is a big Umbrella for creating objects based on procedures (algorithms) With these models Polygons are rendered only as necessary – Necessary is defined as: The Polygon will be visible to the screen & The polygon will be more than 1 pixel in size

Why Use Procedural Methods Limitations on Polygon Rendering are not the only reason – Speed (sometimes) – Realism (a lot of the time) – Special Effects – Physics Systems

4 Procedural Methods Particle Systems Language Based Models Fractal Geometry Procedural Noise

Particle Systems r%20Science/Particle%20Systems/Particle%20System%20Basic.png

Language Based Models Very similar to CSG Constructive Solid Geometry

A fractal system aspx

Fractal Geometry -01/fractal-art-alfred-laing-spiral-fantasy.jpg

Procedural Noise erlin_3d.jpg

Particle Systems In Detail

Particle Systems Particles can be used to represent many objects that are difficult or near impossible to create utilising polygons

This is particle #1 Particles are generally considered to be a point mass – All the mass of particle #1 is located at its infinite centre.

Visually a Particle can be anything A Particle can be just about anything – A Vertex in a Mesh – A Texture – A Billboarded Texture – A Polygon – An Entire Mesh

Independent Particles Independent Particles are the simplest form – Each particle receives input only from the ‘world’ Great for: Clouds Wind Sparks Water Spray

Newtonian Particles Courses/P1050_2009/GodfreyKneller- IsaacNewton-1689.jpg

Newtonian Particles – These guys are not anything really specialised – The only requirement is that they respect Newtons laws of physics 1)Velocity will remain constant when there is no net force 2)The net force is equal to the objects mass multiplied by its acceleration 3)The force A exerts on B is equal and opposite to the force B exerts on A *For Independent Particles we can Ignore the 3 rd rule

F = m * a Force = mass x acceleration

Position, Velocity and Acceleration The Derivative (Gradient) of Position is Velocity The Derivative (Gradient) of Velocity is Acceleration All three components can be defined using just position, time and current velocity * You could do away with velocity and use just Position and Time but then we would need to store previous position and previous time-step to calculate the new position.

Given a Point Mass We only need Position, and Velocity to define a Newtonian Particle Position {x, y, z} Velocity {Vx, Vy, Vz} To calculate the motion of the Particle we need one more value, Time deltaTime (Change in time)

Calculating Movement On an Independent Particle System of Q Particles – For each of Q Particles Compute the Forces Applied to the Particle Given mass doesn’t change generate the new velocity vector using currentPosition, currentVelocity, and force Display the particle This gives an algorithmic complexity of 1(Q)

In Practice Particle at Pos 0,0,0 with velocity 1,0,0 We shall use a force vector of gravity (0,- 9.8m/s/s,0) V = Vi + acceleration(deltaTime) V = {0,0,0} + {0,-9.8,0} (deltaTime) So for a 1 second timestep V = {1,0,0} + {0,-9.8,0} (1) 1 st step: V = {1,-9.8,0} 2 nd step: V = {1,-19.6, 0}

Adding Frictional Forces Adding a term that is proportional to velocity will simulate friction on the particles (such as air and water)

Particle Emitters

Particle Emitters Typically of high importance in video games Used to efficiently generate many of the effects (Eye Candy) Generate Newtonian Particles with an applied randomness

Dependant Particles Dependent Particles are connected together by a mesh, as strings or a even a theoretical mesh Great for: -Water -Fluids -Deformable Objects -Reactive Surfaces -Hair -Fur rid.png

Particle Meshes In the most complex form each particle may receive input from every other particle in the mesh (A complexity of N 2 ) More typically we will only allow input from each of the adjacent particles in the mesh, requiring only 4N calculations.

Forces on Particle Meshes There are many ways to calculate the forces between particles in a Mesh or String One of the most common is utilising Spring Forces When created a spring has a length, spring Constant, and a dampening Term (drag)

Spring Equations The Basic Spring from a to b F = -springConstant * distanceStretched With Dampening F = -springConstant * distanceStretched * dampeningTerm

Attractive and Repulsive Particles Spring Forces are used to keep particles together Repulsive and Attractive Forces can be used to make Objects interact – Functions such as gravity, and inverse-square-law are typical Computational Complexity again goes out to N 2

Force Fields These can be used to replace many point-to- point force calculations An example is using the gravity field of Earth – Without this force field, we would need to do the calculations between each particle and the centre of the earth

Utilising the Geometry Shader There are two excellent uses for the Geometry Shader 1)Rendering your Geometry 2)Moving your Particles (Updating Positions)

The Render Pass This will use an updated Shader Technique: Old: technique10 Render { pass P0 { SetVertexShader( CompileShader( vs_4_0, VS() ) ); SetGeometryShader( NULL ); SetPixelShader( CompileShader( ps_4_0, PS() ) ); } New: technique10 UpdateParticles { pass P0 { SetVertexShader( CompileShader( vs_4_0, VS() ) ); SetGeometryShader( CompileShader( gs_4_0, GS() ) ); SetPixelShader( NULL ); }

So what work does our GS do? It takes in Points or triangles, and generates extra vertices In the simplest form we can use it for billboarding In a more complex way we can use it to create dynamic particle effects, which exist only on the GPU These particles live out their lives on the GPU dying before they every see the CPU

The Update Pass We only need to utilise the Geometry Shader – However we still need to set the pass for each stage of the pipeline This can also be done utilising a Compute Shader – Supported officially in Dx11 – Some Dx10 (Including the GTX260) support Compute Shader version 4.0 and 4.1 – It’s not a requirement for Dx10 cards

A Null Vertex Shader VSParticleIn VSPassThroughmain(VSParticleIn input) { return input; }

To be continued... With Compute Shaders

The End ial_5:_Geometry_Shader#Effect