Transform State

 
 
 

Render Tree Usage

Category: Data > Shading State

Shader Family: Texture

Output: Matrix, Boolean

This shader makes the transformation parameters from the scene element (miInstance) you choose available in the transform state structure as a transform matrix.

You can also make the transformation parameters for the element available in the transform state structure as a motion transform matrix for creating motion-blurred geometry.

This node is intended for shader developers who require low-level information during the rendering process. You should have some shader-writing knowledge in mental ray in order to use this tool properly.

Scene Item

Type of element in the scene to set as the current instance (miInstance) geometry: Object (geometric), Light, or Camera.

Transform

Lets you choose one of the following transform parameters:

Closed Shutter gets the transform matrix for the transform of the instance element.

  • Global to Local (Closed Shutter) -- inst->tf.global_to_local: The transform matrix establishes the transformation from the parent coordinate space to the object space of the instanced element.

  • Local to Global (Closed Shutter) -- inst->tf.local_to_global: The inverse matrix function after the tf.global_to_local matrix is returned.

Open Shutter gets the motion transform matrix for creating motion blur on the instance element.

  • Global to Local (Open Shutter) -- inst->motion_transform: The motion transform matrix establishes the transformation from the parent coordinate space to the object space of the instanced element.

  • Local to Global (Open Shutter) -- mi_matrix_invert( inst->motion_transform ): The inverse matrix of the global-to-local motion transform matrix.

Render Tree Usage

You can use this shader to get the transform data from any element and then use it on another scene element. In this example, the object's planar texture projection is transformed using the object's transformation matrix: the translation of the object is used to create the motion blur with the two mixed textures projected on the planar texture support to give the impression of a moving film strip or train tracks.