Skip to content

Custom Vertex Streams and Custom Data Auto Setup

If you are more of a visual learner there’s also a video tutorial:

Some effects can use the Particle System Custom Data to control them. Those effects are both Fades, Texture Offset Custom Stream and Shape Weights Custom Stream. By using the Custom Data curves we have fine control over how much we want the particles to fade over time or scroll over time.

Let’s first see how to setup the effects and then we’ll take a look at how to use the Custom Data.

To use this features on Fade From Noise Texture or Fade From Final Shape effects we’ll need to check the Fade Amount Driven By Vertex Stream? Custom1.y (See Docs) toggle, which only appears when the selected object has a Particle System:

Fade From Noise Texture on a Particle System with the Fade Amount Driven By Vertex Stream toggle

As the toggle says when this is set to true the Custom Data of the Particle System will be responsible of changing the Fade Amount over time. If the toggle is set to false the particle’s color alpha (Start Color and Color over Lifetime) will drive the Fade Amount.

The Procedural Dissolve works just the same:

Fade From Final Shape on a Particle System with the same toggle
One particle dissolving over its life, with Custom1.y falling from 1 to 0 and with Custom1.y holding before it falls

The Texture Offset effect will only be visible on Materials that are on a Particle System and will only show the shapes that are enabled, in this case all 3 shapes are enabled:

Texture Offset Custom Stream with Shape 1, 2 and 3 Offset Mult

We’ll then choose how much each shape gets affected by changing the multiplier property of each shape. But on the Custom Data we’ll have only one X and one Y value shared by all 3 shapes, the only way of having the offset be different for each shape is by changing the multiplier properties.

One particle with Custom2.x at 0 and its texture still, and with Custom2.x going from 0 to 1 and its texture scrolling across the particle over its life

The Shape Weights Custom Stream is similar to the Texture Offset one that we just saw. It will only appear in the Material Inspector when used on Particle Systems and also will only show Shapes that are enabled:

Shape Weights Custom Stream with Shape 1, 2 and 3 Blend Offset

Negative values will make the corresponding Shape less visible while positive values will make the corresponding Shape more visible. This can be used to fade partial parts of the particles in and out.

One particle with two shapes: with Custom2.z at 0 it stays the first shape, with Custom2.z from 0 to 1 it crosses over to the second

To set the Custom Data that you need for any particular Material you can use the Particle System Helper Component and press the “Custom Data Auto Setup” button to automatically add the needed vertex stream channels. It reads the material when you press it, so press it again after changing effects, and it replaces the renderer’s whole list of vertex streams:

The Particle System Helper component with its Generic Helpers and its numbered sections closed

After pressing the button the Custom Data setup of the Particle System will look like this (if a row is missing it means that the effect that uses it is disabled. The exception is rows 3 and 4, which stay at their default when Shape Weights is on and Texture Offset is off):

The Particle System Custom Data after the Auto Setup, with Custom1 X and Y and Custom2 X, Y and Z numbered 1 to 5

The row numbered with a red number 1 is the random timing seed explained in the Random Seed section.

The row numbered with a red number 2 is the Fade Amount of both Fade effects (it’s shared, but you’ll be using one or the other, not both at the same time).

The row numbered with a red number 3 and 4 are the Texture Offset amount in the X and Y axis respectively. This effect is very useful to scroll a particle texture in a very controlled way, for example for a sword slash. Remember to use the Texture Offset mult properties to choose how much each shape gets affected by these values.

Finally, row 5 corresponds to the Shape Weight Offset. This value will be added to the Shape Weights that you can find in the Shape Result part of the Material Inspector (it will only appear when 2 or more Shapes are present):

The Shape Result block with Split Color And Alpha, Add Shape Results, the RGB and A weight sliders and the final shape calculation

Use the Shape N Blend Offset properties to choose how much each Shape will get affected by the values on row 5.