The Particle
Sampler Info node can be used to provide additional particle shading
control in mental ray shaders.
Although mental ray for
Maya can render many types of particles (including hardware particles
like Streak, Point, Sphere, and so forth) it is only able to use
the Particle Sampler Info node with the following particle types.
- Blobby Surface (s/w)
- Cloud (s/w)
- Tube (s/w)
The particle type can
be set via the
Particle Render Type attribute
under the
Render attributes section
in the particleShape Attribute
Editor.
Only the following subset
of attributes on the particleSamplerInfo node are available
for use with mental ray shaders:
- outUvCoord
- outColor
- outTransparency
- outIncandescence
- particleId
- age
Follow this workflow
to use the particleSamplerInfo node with
a mental ray shader. This example creates a particle emitter where
each particle has a random color and then uses a particleSamplerInfo node
to supply the per particle color information to a mental ray shader.
- Create an emitter.
- Set Rate (Particles/Sec) to
300 and set Speed to 5.
- Play the animation so that particles
appear and assign a new
mib_illum_lambert material
to the particle shape.
- Open the particleShape Attribute
Editor. Under
Render attributes,
set Particle Render Type to Blobby
Surface (s/w).
- Click the
Add Attributes For Current
Render Type button.
- Set Radius to
0.2.
- In order to access per particle color
data, you must add the rgbPP attribute to the particle shape. The
rgbPP attribute is exposed through the outColor attribute on the particleSamplerInfo node.
In the Particle Color
Editor window, select Add Per Particle Attribute and click Add
Attribute. The RGB PP field
now appears.
- Right click the RGB
PP field in the Per Particle (Array)
Attributes section and add a Runtime Expression Before
Dynamics. Enter particleShape1.rgbPP
= sphrand(1) for the expression and click Create.
- Open the Attribute Editor for the
mib_illum_lambert shader.
- Click the map button for the Diffuse channel
and select Particle Sampler from the Utilities section
under the Maya section of the Create
Render Node window.
- Play the animation and preview render
with mental ray for Maya. The particles each have a random color
assigned to it.