Shading and texturing

From Fracture FX
Revision as of 18:35, 26 November 2017 by Craig (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


This is meant to be run after your simulation is done, and the number of meshes under the fragmentGroup is finalised. (There is no automatic update if the contents of the fragmentGroup changes.)


From the menu, choose Fracture -> Shading/texturing [options box]

Shading dialog.png

This gives the option to:

  • Propagate shaders from the unbroken input objects (including per-face attachments) to the fragments produced under the fragmentGroup
  • AutoUV the interior faces of fragments
  • Create a selection set per input object that holds the interior faces of all fragments derived from it

This operates on all meshes under the current selection. If nothing is selected, all fragments will be modified.

It is recommended to assign shaders before breaking and connection to the simulator, but it is still possible to change the unbroken object's shaders and re-propagate after baking.

You can run the shading/texturing process at any stage, after a live-sim, after baking to keys or disk, or after running replace-with-keys. However, if you have already run the shading/texturing process, then subsequently run replace-with-keys, you will have to re-run shading/texturing afterwards.

For scenes created with versions prior to 1.6.0, you will have to delete the fragmentGroup, disconnect and reconnect all input objects, and re-bake the simulation, before shading/texturing will work.

Interior shader

The shader to assign to interior faces is specified under the inputs tab.

Make sure the shader has a shadingGroup of its own, which it may not have if you duplicated it.

Shading interior.png

The widget displays the connection to the fxInteriorShader attribute on the intermediate shape node of the input object. This is also editable from the attribute editor, under Extra Attributes, which allows you to change the interior shader after running replace-with-keys, when the world node will have been removed.

Changing shaders after breaking

Assume you've broken an object, with or without a simulation, and you now want to change the shader(s) on the input object. You can't simply drag-and-drop the shader on to the broken shape, it has to be attached to the unbroken (intermediate) shape.

Shading before.png

The graph for the cube is shown below. The cube has two shapes, a non-intermediate shape polySurfaceShape1 which displays the output of the breakGeo2 node (when you rewind to the start frame), and an intermediate shape pCubeShape1 which holds the original unbroken geometry. It is to that intermediate shape that the shaders were originally attached. You can see exterior faces are assigned the initialShadingGroup and interior faces get blinn1.

Shading graph.png

It is to pCubeShape1 NOT polySurfaceShape1 that you must attach new shaders.

  • Rewind to the start frame
  • Uncheck intermediateObject in the attribute editor for pCubeShape1
  • Assign a new shader (including per-face shaders)
  • Re-check intermediateObject for pCubeShape1

Shading intermediate.png

Now clear your selection and re-run shading/texturing from the menu. Assuming you assigned two phongs to pCubeShape1, they will propagate to the 4 fragment meshes, and in addition to the polySurfaceShape1, which is visible before the break occurs.

Shading after.png

There is a relevant thread about this on the tech support forum here:


As of version 1.6.1, shaders can be reattached to Alembic archives imported into the scene. Use File->Import, not the Pipeline Cache menu.

Face materials and color sets

This example assumes the meshes are not connected to a simulator.

Face material assignments and color sets on the unbroken objects:

Facemtl colorset.png

After breaking using Fracture -> Break selected, the shaders will not automatically appear on the broken mesh. They have to be propagated to it, including after each change to the break node settings, as the number of polygons in the output mesh will change. (Maya keeps track of per-face shader assignments using those face IDs which will be meaningless after changing any attribute on the break node.)

Select it and choose Fracture -> Shading/texturing (option box), then Apply.

Propagate shaders.png

The color sets are automatically propagated and just have to be displayed.

The same automatic process cannot be applied for shaders because Maya plug-in nodes cannot assign shaders to the faces of meshes they produce; shader attachments are represented in Maya using DG connections to the mesh shape node, which is always downstream of the plug-in node that produces the mesh.



If you encounter problems, first make sure you're running the latest version.

Sometimes Maya can get into a mess where it refuses to assign per-face shaders. To start over, set the shading/texturing options to:

Interior face UVs = Remote polyAutoProj nodes
Propagate shaders = Break connections (all layers)

Reset shading.png

Make sure you have nothing selected then click Apply and it will disconnect all the shaders and delete the projection nodes created for the interior faces.

Then re-run it with automatic projection and propagate shaders on.

Personal tools