|On this page|
The Material node assigns a material to a list or group of primitives (faces) or points.
This node lets you override individual parameters on the material, allowing you to apply per-primitive customizations of a base material (see the help for the Local parameters option below).
Under the hood, the node either creates attributes named
shop_materialpath (setting it to the pathname of the material) and
material_override (if any Local overrides are set), or a
material_stylesheet attribute if Create style sheet attribute is enabled. Mantra uses all of these attributes, but the scene viewer only supports
The level at which to assign the materials. You should usually leave this set to Primitive attributes.
Assign the material at the point level instead of the primitive (face) level. This is only useful for point instancing. The objects instanced to the points will pick up the material assigned to the point.
Assign the material at the primitive (face) level. This is the default and the normal setting.
Assign the material at the detail (entire geometry) level. Unless you are creating a material style sheet attribute, this is not normally useful and you should not use this setting unless you're doing something custom and weird. When used with the creation of a material style sheet attribute, this option causes all the material assignments and overrides in this SOP to be combined into a single style sheet stored in a detail attribute. The Group fields are stored directly into the style sheet targeting information to be evaluated by mantra at render time.
Create style sheet attribute
material_stylesheet attribute instead of
material_override attributes. The style sheet attribute will contain a material style sheet that describes the requested shading to be applied to the points, primitives, or the whole detail.
Number of materials
The number of materials to assign. This is useful for assigning materials to various groups of primitives. You cannot layer materials – if you assign multiple materials to the same primitive, the last material will override the previous ones.
The node creates tabs for the Number of materials you set. To insert an additional material, click the Add button. To remove a material, click its tab, then click the Delete button.
A list of primitives (or points, if Attributes is set to Point attributes), or the name of a group, to assign the material to.
The path of the material to assign. Click the chooser icon to choose the material from a list.
Overrides use local variables
Turn this on if:
You are using local parameters (such as
$PT) to override parameters on the material (see below).
You need to use local variables in the values of the local parameter overrides.
Controls the number of local overrides of parameters on the material. This lets you make local changes to the parameters of the material that only apply to the selected primitives.
To set up an override:
Click the Add button next to the Local parameters number to add overrides.
If you already have an override, you can also click the Add button next to it.
Use the Choose parameter menu to choose which parameter on the material you want to override.
Use the Integer, Float, String, Color, or Vector fields (depending on the type of parameter you're overriding) to set the value of the overridden parameter.
To remove an override, click the Delete button next to it.
The following examples include this node.
This example shows how to create an atmosphere shader with volumetric shadows. The atmosphere object has a vex lit fog shader attached to it, and the spotlight has deep shadows enabled. The objects in the scene have a matte shader attached to them.
This is an example file showing an object made up of two quads, one with a bump map, the other with true displacement. This object is duplicated, and the second copy uses a style sheet to reverse the material assignments on the two quads.
This example demonstrates how to blend attributes using the Attribute Composite SOP.
The AttribCreate SOP can be used to provide various object-specific attributes by allowing both a label and a value to be given to the newly created attribute.
In this example, the AttribCreate SOP is used to control the width of a curve at rendertime. There are two versions, chosen by a Switch SOP.
One AttribCreate SOP gives a constant width attribute in the X axis.
The other uses an expression to control the thickness of the curve to create a tapering effect.
The attribute is used by Mantra at render time. To see the results, right-click on the render icon in the viewport, and choose "render_example".
This example demonstrates how to use the Attrib String Edit SOP to modify String primitive attributes and randomize the colours on a grid on a per-primitive basis.
This example shows how to create a trimmed NURBS or Bezier surface using the Convert SOP.
There are four examples contained that compare how a trimmed surface handles a texture.
Grid Surface a simple texture map on a grid.
Trimmed Circle Using the Trim SOP the conventional way of creating a trimmed surface using a Project SOP and a Trim SOP.
Trimmed Circle Using the Convert SOP creates a trimmed surface using a Convert SOP.
NURBS Surface Using the Convert SOP shows how a texture is parametrized over a surface that is not trimmed.
To get a better sense of the parameterization of the texture, turn on points and toggle between wireframe and shaded modes.
This is an example of the Extrude SOP. It illustrates how volume and geometry are created from flat primitives.
It also demonstrates how to separate parts of the geometry into groups, and how to apply different shaders to each group.
This example demonstrates how to use a texturemap to color fur.
This example demonstrates the use of the layer SOP to layer multiple textures onto a single object.
This example demonstrates how to have multiple shading layers with different uv sets using the Layer SOP and the VEX Layered Surface SHOP.
This is a demonstration of how the Point SOP can be used to add Normals to geometry.
It also shows how the Point Normals affect the orientation of copied geometry and the appearance of shaders.
The Rest Position SOP creates an attribute based on the surface normals that allows a shader to stick to a deforming surface.
All primitives support the rest attribute, but, in the case of quadric primitives (circle, tube, sphere and metaball primitives), the rest position is only translational. This means that rest normals will not work correctly for these primitive types either.
Use the Rest Position SOP only when you are deforming your geometry and you are assigning volumetric or solid materials/patterns in your shader.
Rest normals are required if feathering is used on polygons and meshes in Mantra. NURBs/Beziers will use the rest position to compute the correct resting normals.
It will be necessary to render the setup in order to see the effect.
This example shows how to blend point attributes using a Sequence Blend SOP.
This example shows how to blend primitive attributes using a Sequence Blend SOP.
This example shows how to blend vertex attributes using a Sequence Blend SOP.
This example demonstrates the various projection types supported by the uvproject SOP.
Animate the rotation of texture coordinates using the UV Transform SOP with a soft falloff.
Press Play to see the animation.
This example demonstrates the how the Visibility SOP can hide or expose selected primitives in the 2D or 3D view ports.
This example demonstrates a simple ray traced shader using a vop vex network. To modify the shader properties, create a properties shader in the material and connect it to the output shaders node. You can then add rendering parameters to the properties node. For example to control the number of reflection bounces, you would add the reflect limit parameter.