When you use sprites, you can use any textured image file or animated sequence and apply it to the particle type so that the particles look like that image. For example, you can use any of the sample sprite images from the XSI installation\Data\XSI_Samples\Pictures\Sprites folder that’s installed by default, as shown below.
After you’ve selected a sprite image sequence for the particle type, you attach the Sprite shader to your particle type and render with it.
Using a Single Sprite Image
You should use the Sprite shader only if you are using a sprite image sequence for the particles. If you are using a single image, you can select a Texture > Image shader in the render tree and select the sprite image there. Then connect the Image shader directly to the Billboard shader’s Color node.
Selecting a Sprite Image Sequence
To load a sprite image sequence for the particle shape
1. In the Particle Type property editor, click the Sprite tab.
2. Do one of the following:
- Select a sprite image sequence from the list and click Edit to change its settings.
or
- Click New to load a new sprite image sequence from source or file.
3. Select the Animation Control as described in Animating the Sprites.
4. Render the particles using the Sprite shader (see Rendering with the Sprite Shader).
Using the Animation Control on the Particle Type > Sprite page, you can also control the sprite sequence’s animation the same way as you can for any of the other particle type parameters using the Birth, Age, Absolute, and Age% controls.
For example, this means that you can map image sequences to the particle’s lifetime using the Age control. See Animating Particle Type Parameters for more information on these controls.
• Using the Random animation control, a sprite image from the sequence is assigned to the particle at random. This sprite image is assigned to the particle at its birth, and it remains with it for the particle’s lifetime.
• The Var is a variance parameter, as found for other parameters (see Adding Variation to Particles).
• Render Time lets you control the sprite sequence’s animation when it’s rendered with the Sprite shader. With this option, XSI stops trying to optimize which frames are sent to mental ray (such as any unused frames), and makes them all available at render time.
Then you can texture the sprite using another shader plugged into the Sprite shader’s Start Sequence % input (see Rendering Sprite Image Sequences) to control where in the sprite sequence mental ray should evaluate. For example, you can procedurally control the lookup of the frame index using another shader, such as the Particle Scalar shader, which extracts scalar type data on the particle being rendered.
|
Viewing the particles in the Textured display mode won’t show the correct sprite since the lookup is done at render time. |
Rendering with the Sprite Shader
The Sprite shader is designed to be used if you have sprites attached to the particle type. Sprites won’t be rendered if you don’t use this shader. And if you use this shader with no sprite attached, the particle’s color is displayed instead.
To connect the Sprite shader
1. Do one of the following:
- Select a sprite image sequence from the Sprite page in the Particle Type property editor (see Selecting a Sprite Image Sequence).
or
- If you don’t have a sprite defined for the particle type, you can also select a Texture > Image shader in the render tree and select the sprite image there. Then connect the Image shader to the Sprite shader’s Input node, as shown here, or directly to the Billboard shader’s Color node.
2. Connect the Sprite shader to the Color node of the Billboard shader, or directly to the Particle Type Renderer node (if you have a basic render type shader attached to the particle cloud’s Material node).
The Billboard shader creates the 2D surface for the Sprite to be applied. If you apply the Sprite shader to the Blob or Sphere shaders (which are 3D), the sprite images are projected onto them as a texture.
Setting the Sprite Color and Alpha
To set the sprite color
• Select Output Color From Sprite in the Sprite shader’s property editor. This uses the color from the sprite image you have attached to the particle type.
• If you deselect this option, the color is taken from whatever shader is connect to the Sprite shader’s Input node. In this case, you can attach an Image shader with the sprite image to the Sprite shader’s Input node.
• If nothing is connected to the Sprite shader’s Input with this option off, then the particle type’s color is used.
To modulate the particle’s alpha values
• Select one of the Alpha Modulation options in the Sprite shader’s property editor. This multiplies the alpha channel by the sprite’s alpha channel or RGB intensity, or nothing at all.
• Select Inverted to invert the alpha calculated from the sprite before multiplying with the incoming alpha. For example, if the sprite appears with a border around it, toggling this option usually gets rid of it.

Rendering Sprite Image Sequences
If you have attached a sprite sequence, you can decide how the sprite is animated using the animation controls on the Particle Type > Sprite property page (Animating the Sprites).
Then you can set up how the sprite sequence is rendered in the Sprite shader.
To render the sprite sequence
• Set the Start Sequence (%) value in the Sprite shader’s property editor. This percentage value is where in the sprite sequence you want to evaluate the frame. It uses the value 0 to mean the beginning of the sequence and 1 to mean the end of the sequence. This option is useful to set when you have the Render Time option set in the sprite’s animation controls (see Animating the Sprites).
• Select or deselect Looping to determine how the Start Sequence % values are marked:
- With Looping on, the fractional value of Start Sequence % indicates the frame. This means that if, for example, you animate the value to go from 0 to 5 over 100 frames, you will see the sprite animation looped five times over those 100 frames.
A whole number (integer value) always marks the first frame, and the last frame is the number just before the next whole number.
- With Looping off, values less than or equal to 0 mark the first frame, and values equal to or greater than 1 mark the last frame.
This means that any values outside the range are clipped to the start/end point for less than 0 and greater than 1 respectively.
• Select an Image Sampling method (Bilinear or Nearest Neighbor) which is the type of sampling method to read pixel values from the sprite image.
• Select Frame Interpolation to interpolate between frames if the frame number is fractional. For example, if a sprite is at frame 1.5, the shader interpolates frames 1 and 2 at 50%.
SOFTIMAGE|XSI v.6.01