The Particle Sampler Info node can be used to provide additional particle shading control in mental ray shaders.
Follow this workflow to use the node with a mental ray shader. This example creates a particle emitter where each particle has a random color and then uses
a node to supply the per particle color information to a mental ray shader.
- Create an emitter.
- Set to 300 and set to 5.
- Play the animation so that particles appear and assign a new mib_illum_lambert material to the particle shape.
- Open the Attribute Editor. Under Render attributes, set to .
- Click the Add Attributes For button.
- Set 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 node.
In the Particle Color Editor window, select and click . The field now appears.
- Right click the field in the section and add a . 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 channel and select from the section under the section of the window.
- Play the animation and preview render with mental ray for Maya. The particles each have a random color assigned to it.