Material Regions - Managing Complexity by Jens Kafitz
Material Regions allow you to easily add visual complexity to your objects while keeping material attributes correct & in sync.
But depending on the required complexity you might hit the limits of interactive painting at one point or even the limit of your GPU
resulting in a 'Shader Error' Screen.
A Mari Shader Error Viewport Screen, which might
indicate that your Network is complexer than your GPU can handle
This chapter tries to outline different approaches to managing the material regions in a way that allows for interactive painting
even past your systems available resources.
Material Region chains work by layering all materials on top of each other by individual masks.
In reality that means that each material exists - either visible or not - on your entire object.
However not all parts of your object might require the ability to expose any material in a chain.
Let's look at an example:
We can immediately identify at least 4 different materials that do not need to interact with each other:
Brass, Wood, Silver/Chrome & Vinyl.
Dirt types such as Dust on the other hand need to be able to be applied to all materials.
Subsequently we can treat the main materials in different region chains and then use Region Merge Nodes
to layer the different chains together, then applying Dust & Dirt Regions to the combined result:
You can then use a Region Output Node plugged into a shader and attach it to any of the main material branches to only
work on parts of the object, without having to evaluate other parts of the model:
If GPU Memory or maximum number of instructions your Video Card can perform is a bottleneck on your System caching of nodes will help alleviate it.
Nodes can be cached by going to the Node Properties and opening the 'Node' Attribute Group and pressing 'Cache'.
The current Node and all nodes feeding into the Node will be cached.
If a node is not directly associated to a channel Mari will use the default cache settings found under PREFERENCES / DATA / CHANNEL CACHE.
An alternative approach is to attach 'dot' nodes to each output of a Material Region and Cache from there (requires Mari 3.0v2 or higher).
This approach has the benefit that you can cache and uncache specific outputs based on the Data Mapping of
each Material Region.
A live representation of combined Region Height/Bump or Normal effects in a shader is the most expensive operation for Mari.
If you are happy with the overall height or normal map that a region chain gives you it can speed calculation up a lot to bake
the 'Height' or 'Normal' Output of the Region Output into a Paintable Node that is then attached to the Shader
and only return to the live Height/Normal Output of the Regions when changes are required.
On complex Region chains it can help to insert 'Cache Points' such as the one shown below:
The purpose of this is to be able to temporary bake the output a region chain at one point into a texture without
loosing the input and flexibility that the region chain gives you.
FASTER CHANNEL EXPORT
Creating 'Bake Points' is a good practice to reduce the Baking Time for Final Texture Output as
well. By effectively 'locking' down a part of a region chain and creating texture maps for it
Mari does not need to evaluate the ''locked' Region Chain when Baking the entire channel(s) for export.
A 'Cache Point' can for example utilizes the Node 'Empty with Skip'.
Alternatively you can build a Cache Point using the 'Bake Visible to Selected Paint' Node System.
1) Create one EmptyWithSkip Node per connection between two material regions ('Input A' , 'Input B' etc.)
2) Attach the Region Node on the left side to the first Connection of the EmptyWithSkip Node
3) Attach th Output of the EmptyWithSkip Node to the next Region Node.
4) Right click on the EmptyWithSkip Node and choose 'Bake to paint Node'
5) Attach the previous left side connection to the 'Skip' Connection
5) Attach the resulting Paint Node to the now open first connection on the EmptyWIthSkip Node
You have now effectively inserted a computational stopgap into the region chain. The Regions to the left
of the EmptyWithSkip Node will not be evaluated, instead the attached Paint Node will be.
If you wish to return to the live view of the region simply select the EmptyWithSkip Node and press CTRL+D
or RIghtMouse Click / Edit / Bypass until the 'Skip' connection is active the and connection attached to the Paint
Node is crossed out.
You are then viewing the live region and no longer the baked texture
Utilize 'Bake Visible to Selected Paint Node' to update Paintable Nodes
To update a Paintable Node after you made a change to a region chain you can use
the 'Bake Visible To Selected Paint' Node together with the 'EmptyWithSkip System
Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator