Maya - Maxwell Layered Material

Unlike other render engines which provide several shaders with different characteristics, Maxwell has a unified material model. The parameters and components of this model can be manipulated to obtain any desired look. This model is integrated into Maya as the Maxwell Layered Material node.

The material parameters are explained in depth in the Maxwell Materials section of the main manual. This section will focus only on the features specific to the Maya integration.

Component Tree

A Maxwell material is composed of layers which are blended together like in a 2D painting application. Each layer can contain one or more BSDFs and one emitter component. An optional coating component can be attached to each BSDF. There are also a few global properties which apply to all the layers and an optional displacement component. The material structure is displayed inside the Attribute Editor using a custom tree control:

Selecting a component in the tree updates the bottom part of the Attribute Editor to display the attributes of that component. You can navigate inside the tree using the up, down, home, end, page up and page down keys. The subcomponents of a layer or BSDF can be hidden or shown by clicking the collapse arrows on the left. Pressing the left arrow key moves the selection to the parent of the current component, or collapses the current component if it's expanded and has children. Pressing the right arrow key expands the selected item if it's collapsed, or goes to the first child of the selection, if one exists.

Components can be removed by pressing the delete key or clicking the delete button at the bottom of the tree. Layers and BSDFs can be renamed by double clicking them or pressing the F2 key.

Re-ordering components

You can reorder, reparent, copy and swap components by drag and drop. During the drag operation, a description of the operation which will be performed is displayed at the bottom of the item being dragged. Dropping an item over an item of the same kind will move the first item before or after the second item, depending on the exact mouse position. Dropping an item over a new parent will move the item as the last child of the new parent. Holding down the shift key will make a copy of the item being dragged, instead of moving the original. If the control key is held, you can swap two items by dropping one on top of the other.

Drag and drop to move items

Hold the shift key to copy instead of move

Hold the control key to swap two items

All the operations are undoable.

Solo Layers

When a material contains two or more layers you can use the make solo context menu button to deactivate all layers except the one that is currently selected. This allows you to see only that layer during rendering in order to simplify tweaking specific parts of a layer in a complex material. This setting is available by right clicking any component of the layer and pressing the "Make Solo" button. Pressing "Make Solo" on a layer that is already solo will enable all the layers again. When the material contains only one layer, the Make Solo button has no effect.

Adding components

The first 5 buttons at the bottom of the tree allow you to add new components: D - displacement, L - layer, E - emitter, B - BSDF, C - coating. Some of them will be disabled when the given component cannot be added (because it already exists or cannot be added to the currently selected parent). The "Preview" button refreshes the material swatch when the preview mode is set to "on demand" in the plug-in preferences.

If you graph the Maxwell material in Hypershade, you will see that each component corresponds to a separate node. However, no data flow occurs between the nodes in the regular Maya sense. The connections are only used to represent the hierarchy. There is no point in adding non-Maxwell nodes between the components and doing so will cause the material to be exported incompletely at render time. It is best to use the material tree control to manipulate the structure instead of setting up connections directly in Hypershade.

Textures

Maxwell uses regular Maya texture nodes ("file" nodes) to represent textures. The plug-in takes into account the file path attribute, the image sequence controls, the filter type, the invert flag and the UV repeat and offset settings from the placement node. The image manipulation attributes, such as prefiltering, gain and color remapping are not used and neither are the more advanced UV space manipulation attributes from the placement node, such as coverage, rotation and noise. The only supported repeat modes are wrap and clamp - no mirroring or staggering can be performed.

Texture filtering can only be set to on or off in Maxwell, without the possibility of configuring a filter type. When the Filter Type attribute is set to "Quadratic" or above, filtering is on. Otherwise, it is turned off.

The plug-in adds a set of custom Maxwell controls on the file nodes:

The Use Alpha flag tells Maxwell that the attribute this texture is applied to should use the alpha channel of the image instead of the color information. This is similar to connecting the outAlpha texture attribute to the input of a regular Maya shader, but since Maxwell does not support shading networks internally, that method cannot be used with Maxwell materials.

The UV channel attribute can be used to specify the index of the UV map to use for this texture. Maxwell uses a different UV assignment model compared to Maya, so you cannot pair textures with UV sets using the UV Linking Editor, as you would normally do. The plug-in exports all the UV sets found on meshes in the order in which they were created, and you must specify the UV set index inside the texture node itself.

The Invert, Brightness, Contrast, Saturation and RGB Min/Max controls can be used to perform simple image adjustments at render time. They are particularly useful for textures applied to the reflectance 90 BSDF attribute, since in many cases they are simply brighter versions of the reflectance 0 texture.

The Enable Viewport Override button sets this texture to be displayed in the viewport for the material which contains it. When the texture is set as the viewport override, it changes to Remove Viewport Override and clicking it restores the viewport preview mode of the material to the default.

These Maxwell-specific attributes are implemented in the same way as the custom camera attributes, so they share the same restrictions. See this section of the documentation for details on how to set keys, apply layer overrides or access them from MEL.

Maxwell does not support procedural textures. If you wish to render such nodes, you will have to bake them to texture files first.

Viewport Display

When the viewport is set to shaded mode, the Maxwell material is displayed using the color of the first active emitter or BSDF found in the material. MXI emitters and BSDFs where the reflectance 0 attribute is textured are skipped. This color can be overridden by checking the Specify Shaded Color box in the "Global Parameters" section of the material and using the Shaded Color control.

In the textured and lit viewport modes, the plug-in uses the BSDF reflectance 0 colors and textures and the layer masks and opacity values to compute a blended display texture. The resolution of this texture can be specified in the plug-in settings or changed for each material by using the Bake Texture Size control. You can select a single texture to be displayed in the viewport either by clicking the Enable Viewport Override button on the file node, as described above, or by using the Viewport Override Texture dropdown in the "Global Parameters" group on the material itself.

When using the blended display texture and editing the UV map of an object, the viewport will show incorrect results. This is due to a limitation in the Maya API, as the material doesn't know it has to recompute the display texture. It is better to use an override texture while editing the UVs, so that you can see exactly how the changes affect the mapping. After you are done editing, you can switch back to blended mode and the preview texture will be correctly refreshed.

The following screenshots show a material similar to the one used in the Stacking Layers example. The material has 3 layers: a painted ceramic layer at the bottom, a gold layer using a mask over the paint and the yellow symbols on top of everything. The image on the left shows the blended layers in the viewport, while on the right the ceramic paint texture was selected as an override, so it's displayed by itself.

Blended textures

Single texture override

The plug-in offers a few more advanced display modes which are accessible if you switch to a Maxwell viewport by going to the Panels -> Maxwell menu. The submenu which opens shows a list of cameras, just like the Perspective menu, but also has 3 quality settings:

  • Normal Shading: specular highlights are computed based on the sun direction (if the sun is enabled in the environment settings). If a normal map is applied in the global material parameters, it is also rendered. Speculars are applied everywhere, regardless of material roughness.
  • Advanced Shading: also takes into account the image-based environment, reflectance 90, Nd and roughness parameters to produce a preview which is as close as possible to the rendered look. This mode does not support emitters and does not compute shadows.
  • Interactive Rendering: uses Maxwell FIRE to render the viewport.

Normal Shading - specular highlights and normal map

Advanced Shading - IBL and roughness play an important part

Interactive Rendering - FIRE in the Maya viewport

Final rendered result, for comparison

The Advanced Shading mode performs complex calculations which can significantly slow down the viewport. It has become somewhat obsolete with the introduction of Maxwell FIRE.

When the Viewport 2.0 renderer is used, the materials are displayed in the same way as in the Normal Shading mode of the Maxwell viewport.

Importing and Exporting Materials

Materials can be imported and exported in the MXM file format by using the corresponding buttons above the material tree. When you export a material, you are offered the option to also copy all the material resources (textures, IES files, IOR files) next to the MXM file.

Library

The Library button opens MXED (Maxwell Renders standalone material editor) in library browsing mode, so that you can import materials from the collection which is installed together with Maxwell, or browse to any folder which contains MXM files.

The Gallery button allows you to browse Maxwell's online material gallery which contains hundreds of high quality materials made by Maxwell users. When you click the Import button, the corresponding MXM file and all its dependencies are copied to the sourceimages subdirectory of the current Maya project and the material settings are imported.

 

You will need to create a free user account to access the online gallery. Once you have your login credentials, open standalone MXED, go to File -> Preferences -> MXM gallery and input the user name and password in the corresponding fields. Note that it is not enough to make these settings inside Maxwell Studio, as standalone MXED (which is used to browse the gallery from Maya) has separate settings.

Wizard

The Wizard button allows you to create common material types by providing only a few parameters. These presets are a good way to start learning about creating materials.



Merging materials

The Merge button allows you to merge two existing materials from the scene:

By default, the layers from the selected material will be placed on top of any existing layers in the current material. This can be changed by checking the box on the bottom-right. When Create New Material is on, the operation will create a new material and leave the current material untouched.

Swatches

Material swatches can be updated automatically, whenever a material attribute is changed, or on demand by pressing the Preview button below the material tree. You can select the update mode in the plug-in preferences, along with the preview scene and quality settings. Depending on the hardware configuration, material complexity and number of materials in the scene, updating the swatches can become a time consuming operation, especially when opening Hypershade, which tries to display many materials at once. In that case, switch to on demand updating. The swatch images are saved to disk when saving the scene, so in on demand mode they don't need to be recomputed every time they need to be displayed.