particles.ppt

Download Report

Transcript particles.ppt

Particle Animation and Rendering Using
Data Parallel Computation
Karl Sims
Optomystic
Thinking Machines Corporation
Presentation ©2001
Brenden Schubert
How many processors?
• The Thinking Machines Corporation
Connection Machine CM-2
•4,000-64,000 processors
•512 MB memory
•Nodes arranged in
hypercube
• TMC filed chapter 11 in
1994
Particles
•
•
•
•
Head Position
Tail Position (motion blur)
Velocity
Optional Characteristics:
•Type
•Opacity
•Mass
•Size
•Age
•Age to die at
•Color
•Whatever the simulation needs
Initialization of
• Position
– Randomly distributed
within a solid or sphere
– Randomly distributed on
surface of a solid or sphere
– One particle on each vertex
of a polygonal model
– Randomly on surface of a
polygonal model
– 3D Transformation from
given coordinates
• Velocity
– Constant Direction
(including 0)
– Randomly distributed
within a solid or sphere
– Randomly distributed on
surface of a sphere
Applying Velocity
• Changes position parameter of particle,
doesn’t change velocity parameter
• Examples:
– Constant translation/rotation/scaling
– Random translation/rotation/scaling
– The Vortex
• Rotation proportional to distance from vortex axis
Applying Acceleration
• Changes velocity parameter of particle
• Examples:
–
–
–
–
–
–
Constant acceleration (gravity)
Random acceleration
Orbit around a point or axis
Spiral around a point or axis
Damping/Undamping
Bounce off of a plane/sphere/other object
Bouncing
• Crude method
– Particles can penetrate surface of object
– Particles reappear as if they travelled within object
• The better method
– Interpolate to find intersection with object surface
– Update velocity after hit to reflect friction and
resilience parameters
– Update positions to account for bounce
– Bring tail position up to surface of object (if needed)
Particle Rendering
• What is a particle?
– Particles occupy an area in which the opacity
falls off from 1 at center to 0 at edges
– Function determines rate of opacity falloff (e.g.
Linear or Gaussian)
• Motion Blur
– Render particle as streak, linearly interpolating
all parameters between the head and tail
positions
Slicing and Dicing
• What is a fragment?
– Contribution of a particle to a pixel
– Attributes: color, opacity, depth
•Fragment Generation
–Slice each particle
horizontally into spans
–Dice each span vertically
into fragments
•For each pixel
–Sort fragments by depth
–Calculate final pixel color
Patches
• Data parallel programming paradigm says
that each object occupies a processor
• But the total number of fragments is often
more than the number of processors
• Solution:
– Split image into patches such that all objects for
each patch can fit onto the processors
– Render patches in sequence
Pseudocode
–Set tails to previous heads
–For each simulation time increment
•Select subset of particles
–Perform operations
• Create
Particles
• Initialize
Particles
•For each frame:
•Update positions using velocities
•Select subset of particles
–Perform bounce operations
–Adjust tails for motion blur shutter speed
–Transform to screen coordinates
–For each horizontal patch
•Determine effective patch height
•Dice particles into spans
•For each vertical patch
–Determine effective patch width
–Dice spans into fragments
–Sort fragments by pixel and depth
–Perform hidden surface calculation
–Send colors to pixels
–Add background color
–Swap buffers
Results: Snow and Wind
Results: Falling Water
Results: Waterfall
Results: Fire
Results: other
In Conclusion
• Future (at least in 1990)
work
– Allow particle-particle
interaction
• Collisions
• Gravity
– Interaction with polygonal objects
• Comparison to large-scale particle simulation on a
serial computer
• Applicable to distributed computing