Bringing ICE Data into the Render Tree with Attribute Shaders

 
 
 

The ICE attribute shaders allow you to access ICE attributes that are driven by ICE trees. You can also apply the Attribute shaders to geometry that is used as shape instances on ICE particles.

These shaders allow you to control your shading based on calculations done by an ICE tree, thus creating a link between data in the ICE tree and data in the render tree. To use the attribute shaders, you must first make sure that the object or its components have the appropriate attribute created for it in an ICE tree.

For example, you can control the particle's transparency based on the distance to a surface by writing an ICE tree that sets a DistancetoSurface attribute and then accessing that attribute in the render tree via an attribute shader. Or make smoke dissipate or a color change with a gradient depending on the velocity of the particle.

If the shaders are applied to an object with an ICE tree, only ICE attributes from that object will be shown in the shader's Attribute drop down list.

If they are applied to an object that does not have an ICE tree, then all attributes from all ICE trees in the scene are displayed in the Attribute list for that shader. This is so that instances can choose attributes even if there is no bi-directional link between the Instance Shape node (or the Set Instance Geometry compound) in the ICE tree and the instance object itself.

There is one attribute shader per data type:

For an example of using this shader, see Using the ICE Particle Color in the Render Tree.

For information on each of the Attribute shader parameters, see Data > Attribute.

TipThe Switch shaders (Color, Scalar, and Vector Multi Switch) can be used in conjunction with state systems that you've set up in the point cloud's ICE tree. Attribute shaders are used with these switch shaders to bring the ICE tree data into the render tree so that you can use the state data. See ICE Particles Change Color or Shape Based on State for more information.

Connecting an Attribute Shader

  1. Select an object with ICE attributes.

  2. Open a render tree and click the Update icon or press F6 to display the render tree for the selected object.

  3. In the render tree, drag an appropriate Attribute shader from the Data > Attribute group in the preset manager on the left, or choose a shader from Nodes Data Attribute on the toolbar.

  4. Plug it into any input port on a shader that supports that data type.

    For example, you can plug many of the Attribute shaders as inputs into the Particle Gradient shader to drive the color gradient based on almost any ICE attribute for the particles, such as their velocity, size, orientation, mass, point position, etc.