GPUSprites Type Data

Choose your OS:

GPUSprites.png

The GPUSprite type data module supports simulating particles on the GPU. Traditional CPU systems allow for thousands of particles in a frame. GPU simulation allows for hundreds of thousands of particles to be simulated and rendered efficiently.

GPU particles do not support all of the features available to traditional CPU particles, but they offer greater efficiency as well as a few unique features. Emission of particles still happens on the CPU to determine where, when, and how many particles to spawn. The CPU may also assign initial attributes such as size and velocity using methods available to traditional CPU particles.

GPU particle sprites are authored in Cascade by adding the "GPU Sprites" type data module to an emitter. As with other effects authored in Cascade, the parameters of the simulation are modified by adding and editing modules on the emitter. The simulation updates in real time as properties change.

Properties

Property

Description

Beam

Camera Motion Blur Amount

How much to stretch sprites based on camera's motion blur.

Supported Attributes

The following attributes are supported with GPU particles:

Initial Location
  • Determined at spawn time.

  • Supports most methods available to CPU particles.

Initial Velocity
  • Determined at spawn time.

  • May inherit velocity from the movement of the spawn source.

Acceleration
  • Constant for all particles and across the lifetime of the emitter.

Drag
  • Initial drag coefficient is determined at spawn time and may vary per-particle.

  • May be scaled over the life of the particle by a curve. The curve is shared among all particles.

Lifetime
  • Determined at spawn time and may vary per-particle.

Color
  • Initial color determined at spawn time. This color is the same for all particles.

  • May be scaled over life by a curve. The curve is shared among all particles.

Size
  • Initial size is determined at spawn time and may vary per-particle.

  • May be scaled over life by a curve. The curve is shared among all particles.

Rotation
  • Initial rotation is determined at spawn time and may vary per-particle.

RotationRate
  • The rotation rate is determined at spawn time and may vary per-particle.

SubImageIndex
  • The sub-image index varies over the life of a particle as defined by a curve.

  • The curve is shared among all particles.

Critical Concepts

It is important to understand the following key concepts when using GPU particles in your scene.

Motion

Particle motion is governed by simple Newtonian dynamics. At each time step, a particle's position and velocity are integrated forward based on its current position, current velocity, a constant acceleration, and force due to drag.

GPU particles also support orbit, though the details differ from that provided for traditional CPU particles. Conceptually, the particle moves as if the sprite is orbiting around the actual location of the particle offset by a varying amount. Orbit can be used to add additional detail motion to particles.

Vector Fields

The most interesting feature of GPU particles, aside from their efficiency, is vector fields. A vector field is a uniform grid of vectors that influences the motion of particles. Vector fields are placed in the world as Actors (Global Vector Field) and can be translated, rotated, and scaled like any other Actor. They are dynamic and may be moved at any time. A field may also be placed within Cascade (Local Vector Field), limiting its influence to the emitter with which it is associated. When a particle enters the bounds of the vector field, its motion will be influenced by it and when a particle leaves the bounds, the influence of the field will fade out.

By default, vector fields impart a force on particles within them. Vector fields also have a "tightness" parameter. This parameter controls how directly particles follow the vectors in the field. When tightness is set to 1, particles read their velocity directly from the field and thus follow the field exactly.

Static vector fields are those in which the grid of vectors never changes. These fields can be exported from Maya and imported as a volume texture. Static fields are very cheap and can be used to add interesting motion to particles, especially by animating the motion of the field itself.

Additionally, vector fields may be reconstructed from a 2D image. In this case, an image much like a normal map can be imported and used to reconstruct a volume texture by extruding or revolving it around a volume. A static vector field may be added on top of this reconstruction to introduce some noise and randomness. Further, the 2D images may be animated by storing individual frames in an atlas texture. Doing so allows you to perform a fluid simulation offline and reconstruct the motion in real-time at very little cost.

Performance

The CPU cost of GPU particles is dominated by the spawning of particles. Because particles are spawned on the CPU using the same methods as traditional CPU particles, the performance characteristics are similar.

The GPU cost of particles is primarily determined by the number of particles. Few features add additional cost to GPU particles above the fixed cost that already exists. The majority of the GPU cost can be attributed to sorting and rendering. Sorting is optional and should be enabled only when required for a particular emitter. Rendering is often dominated by fill rate. Reducing the size of particles, the number of instructions on a particle's material and the total number of particles can all help. In some cases when the particles are very small, rendering is dominated by vertex cost in which case reducing the number of particles is the only way to reduce cost.

Simulation cost does scale with the number of vector fields that overlap an emitter, so reducing the number of overlapping vector fields can help in reducing simulation cost.

GPU Sprites on Mobile Devices

GPUSprites_&_Vector_Fields.png

GPU particles and Vector Fields can now be used on mobile devices. However, because this feature requires that the mobile device support 32-bit floating point render targets with MRT support, this feature will only work on the following mobile devices.

Manfaturacture Name

Device Class

Device Name

Apple

A8+

iPhone 6, iPad Air 2, iPad Mini 4, and newer.

Android

6.0 devices with Adreno 4xx and Mali-T7xx GPUs

Galaxy Note 4, Note 5, S6, S7, Nexus 6P and others.

To enabled your particles to utilize this feature all you will need to do is make sure that your particles have the following type data added to them.

GPUSprites_VFXC_Setup.png

  • GPU Sprites type data

  • Global Vector Fields type data

Also, make sure that you supply your particle system with a Vector Field either by adding one to the particle system or by placing one in the level.

GPU Sprites on Mobile Devices Limitations

When using GPU sprites on mobile devices please keep the following limitations in mind.

  • Vector Field Interaction: As with Vector Fields on the PC, mobile GPU sprites can only be influenced by a maximum of four Vector Fields at the same time. This breaks down into one Local Vector Field and up to three Vector Fields placed in the world.

  • GPU Particle Collision: Mobile GPU sprite do not support any collision options like collide with scene or mesh distance fields as they are not supported on mobile devices.

Tags