Writing Material Plug-ins
To write a material plug-in you would derive the class from the Material class. The parameters of the material, if they are to support editing by the user, should be stored in attributes. You need to override the following methods of Material:
- Material::Activate() - Sets the material parameters prior to render.
- Material::Deactivate() - Should call clean up function after the render, but before the swap.
- Node::OnNodeEvent() - Mudbox will call this function when any attributes associated with the material are modified.
- Material::IsTCNeeded() - Returns true if the material requires Mudbox to generate texture coordinate information in the mesh.
For an example of a material plug-in see the examples /examples/FixedFunctionMaterial and /examples/ToonMaterial.
Writing Material Plug-ins
To write a material plug-in you would derive the class from the Material class. The parameters of the material, if they are to support editing by the user, should be stored in attributes. You need to override the following methods of Material:
- Material::Activate() - Sets the material parameters prior to render.
- Material::Deactivate() - Should call clean up function after the render, but before the swap.
- Node::OnNodeEvent() - Mudbox will call this function when any attributes associated with the material are modified.
- Material::IsTCNeeded() - Returns true if the material requires Mudbox to generate texture coordinate information in the mesh.
For an example of a material plug-in see the examples /examples/FixedFunctionMaterial and /examples/ToonMaterial.