Mask from Curvature

Parent Previous Next

Mask from Curvature by Jens Kafitz







The Mask from Curvature Node is a image processing node designed to give you  edge wear effects based on a baked curvature map.

It works by blending maps together differently much like you could do in a layerstack or nodegraph with some advanced options.



Demo Video



Step-by-Step Setup


The Mask from Curvature Node uses differently blurred Curvature Maps to derive edges from the model.

Since Mari does not have non-destructive blurring a few manual steps are required by the user to get the best

result from the node:




One vs Multiple Curvature Maps


The following process works best when creating multiple blurred copies of the original curvature map as outlined below.


However by changing the Curvature Neutral Point Dropdown to a setting marked with 'Stages from Single Map'

you can instruct the node to try and automatically create different versions of the original curvature map for you.

Depending on the softness of the curvature map used, this may be sufficient to create a quality mask.




1) Bake a Curvature Map for your model.This can be done by using Mari's Modo Bake or externally by tools such as XNormal, Mightybake (has UDIM Support) etc.


The ideal Curvature map uses a Grey (50% linear) midpoint with Concave/Convex surfaces represented in Black and White however different Midpoints

are supported if you do not have access to a map with Concave/Convex separation.

Bring in the curvature map into Mari, importing it into a Paintable Node or using an Image Node and converting to to a Paintable Node via the Nodegraph/Graph Layer.






LINEAR DATA


Curvature Maps should always be evaluated in 'Linear' Colorspace.

When loading in a Map into Mari set the Colorspace field in the File Loader to 'Linear'.


This is very important since many processes such as Contrasting,Blendmodes etc. use a default

midpoint of 0.5 linear.When loading in a curvature map as sRGB its colormanaged mitpoint

is 0.5, however the internal data is converted to a value of 0.21.


If you incorrectly loaded a curvature map as sRGB add a 'sRGB to Linear' Adjustment with the 'Invert' Option

ticked or apply it directly via Menu Filters/sRGB to Linear






2) For best results, copies of the original Paint Node with the Curvature Map need to be made and blurred.





MARI vs PHOTOSHOP vs NUKE


The following process can be done much faster using Nuke or Photoshop Actions but for this walk-through it will be shown inside of MARI



than the original node, indicating that the newly duplicated node is now a bake/paint target.



Set the 'Apply to' Setting in the Filter to 'Current Paint Target' to apply it to the Contents of the Paint Node.









BLUR RADIUS


Mari's Blur Settings operate on absolute Pixel Width Values.

A Gaussian Blur with Radius 50 will always only blur 50 Pixels.


As a result this means that a Gaussian Blur/Radius 50 will result in much wider blur

on a 256x256 Texture than on a 4096x4096 texture.


In order to achieve very wide blurs as are required by the 'Large Blur' and 'Huge Blur'

Settings of the Mask from Curvature Node you will be required to lower the resolution of the maps

for these Paint Nodes if you are using large Maps.


You can lower the Map resolution of a Paintable Node by going to its Node Properties, setting the

Management to SELF and choosing a different Size.

The lower Map resolution are not a problem usually due to the lack of fine details in the heavily blurred textures.


Below: The Node Properties of a Paintable Node



3) Repeat the above steps, applying wider and wider blurs to each duplicate of the last paint node until you have a total of 6 blurred Versions.


For Finer Blurs the standard Mari 'Blur' is usually sufficient, for big blurs the Gaussian Blur is recommended.


For really big blurs it is usually a good idea to lower the resolution of the Paint Node. This does not affect quality in the final node result in a noticeable

way but allows you to apply wider blurs without loss in performance.




4) Attach the different Paint Nodes, containing the different Blur widths to each Handle of the Mask from Curvature Node.

The Mask From Curvature Node is now ready to operate at its best.


Below: A fully setup Mask from Curvature Node with differently blurred Curvatures attached


Options




Node Connections


Attach your original Curvature Map.

If the Curvature Neutral is set to Stages from Single Map this will be the only Handle evaluated.


Attach differently blurred versions of your original sharp curvature map.

The range of blur should be thought of as your 'fine' to 'middle' edge detail range


Attach differently blurred versions of your original sharp curvature map.

The range of blur should be thought of as your your medium to large edge detail range extending

all the way across a surface.


Outputs of Nodes attached to the Jitter Fine will be multiplied against the Sharp / Fine / Soft / Medium Sliders

in the Node by default.


Sharp = JitterFine.red * Sharp Slider

Fine = JitterFine.red * Fine Slider

Soft = JitterFine.green* Soft Slider

Medium = JitterFine.blue * Medium Slider


Outputs of Nodes attached to the Jitter Coarse will be multiplied against the Big / Large / Huge Sliders

in the Node by default.


Big = JitterCoarse.red * Big Slider

Large = JitterCoarse.green * Large Slider

Huge = JitterCoarse.blue * Huge Slider




Node Properties


Curvature Neutral


Defining the correct neutral point for zero curvature is an important element to get the best results from this node.


Defines what kind of Map you are using. The value here should be what represents zero curvature in your maps



A setting of 'Grey' will not modify your maps, all other settings will compensate and re-range your maps to 0-1 with 0.5 Midpoint internally.



The White (Stages from Single Map) Setting is a special option that will try to automatically create different versions of a single curvature map

attached to the Curvature (Sharp) Handle for you, so you don't have to create them manually (as outlined in Step-by-Step Setup).


It works by isolating different ranges of the original map and mapping them to the different slots (Fine, Soft, Medium, Big, Large, Huge).

You can refine the value ranges if you need to by changing the settings under the Advanced Options: Stages from Single Map UI Group.


This works best on maps that already have a large gradient falloff on areas of high curvature such as the one generated by the Curvature Preset

from Modo Bake.



Allows you to define a custom Midpoint off the defined Curvature Neutral Value.

For Example with a Curvature Neutral Value set to Grey (0.5) and an Offset Midpoint Value of 0.1

all attached curvature maps will be evaluated with a midpoint of 0.6.


It is recommended to leave this value at default 0.0 by default and only use it for later tweaking.


Curvature Influence


Inverts the current result on screen (1.0 - Current)


Determines how the attached Curvature Maps are processed


Raw gives a raw view of all your Curvature Maps layered together using a default, non-compressing Blendmode (Overlay).

The Blendmode used can be modified under the Advanced Options via the Raw Blending Setting.


Edges layers your Maps according to the Blendmodes under Curvature Blending and the opacity set in the

Curvature Influence Sliders. Processing of Maps is skewed towards isolating values over 0.5 (edges).


Cavities layers your Maps according to the Blendmodes under Curvature Blending and the opacity set in the

Curvature Influence Sliders. Processing of Maps is skewed towards isolating values below 0.5 (cavities).


Dual layers your Maps according to the Blendmodes under Curvature Blending and the opacity set in the

Curvature Influence Sliders. Processing is done in both 'Edge' and 'Cavities' Mode, then the result is layered together

according to a blendmode. The Blendmode used can be modified under the Advanced Options  Cavity/Edge Blending (Dual) Setting



Determines the percentage each differently blurred Curvature Map should contribute to the Fine-Medium Edge Detail.

The Sliders are multiplied by the Jitter Fine Handle in the Nodegraph if something is attached



Determines the percentage each differently blurred Curvature Map should contribute to the Large Edge Detail.

The Sliders are multiplied by the Jitter Coarse Handle in the Nodegraph if something is attached



Spread / Tightness


The Brightness of the resulting Map


The Contrast of the resulting Map


Curvature Blending


Determines the Blendmode used to combine the unblurred (sharp) Curvature Map over the Neutral Value (usually 0.5)

The Opacity used to blend is determine by the Slider under Curvature Influence



Determines the Blendmode used to combine each blurred Curvature Map over the combined result of all blending operations

before it. The Opacity used to blend is determined by the Sliders under Curvature Influence


Advanced Options: Input Remap


The Advanced Options: Input Remap allows you to contrast the curvature maps you are feeding in before any

processing is done with them:



Allows you to contrast the Maps attached to Nodegraph Handles:



Contrasting is done as the first step before the Node does any procesessing



Allows you to contrast the Maps attached to Nodegraph Handles:



Contrasting is done as the first step before the Node does any procesessing



Advanced Options: Blending


The Advanced Options: Blending allows you to modify some node internal blending defaults for the edge modes

raw, cavity and dual.


The Blendmode used for all Map Blending when the Raw Mode is chosen


When in Mode Cavities or Dual this value controls how much of the Neutral Color (usually 0.5) is blended back in the computation.

using the Blendmodes 'Cavity #1 Blending (Cavity)' or 'Cavity #1 Blending (Dual)' found below the sliders.


When in Mode Cavities this is the blendmode used to blend the Neutral Color (usually 0.5) back into the Computation.

The Amount of Blending (Mix) can be set using the Cavity Weight #1 Slider found above.


When in Mode Dual this is the blendmode used to blend the Neutral Color (usually 0.5) back into the Computation.

The Amount of Blending (Mix) can be set using the Cavity Weight #1 Slider found above.


When in Mode Cavities or Dual this value controls how much of the Neutral Color (usually 0.5) is blended back in the computation.

using the Blendmodes 'Cavity #2 Blending (Cavity)' or 'Cavity #2 Blending (Dual)' found below the sliders.


When in Mode Cavities this is the blendmode used to blend the Neutral Color (usually 0.5) back into the Computation.

The Amount of Blending (Mix) can be set using the Cavity Weight #2 Slider found above.


When in Mode Dual this is the blendmode used to blend the Neutral Color (usually 0.5) back into the Computation.

The Amount of Blending (Mix) can be set using the Cavity Weight #2 Slider found above.


When in Mode Dual both Modes - Cavities and Edges - are calculated and then blended together.

This Slider determines the Mix Value at which the result of the Cavities and Edges Calculation are blended.


When in Mode Dual both Modes - Cavities and Edges - are calculated and then blended together.

This setting determined the Blendmode used to Blend both results together.



Advanced Options: Jitter


The Advanced Options: Jitter allows you to modify the node defaults for how any Input connections attached to the

Jitter Fine and Jitter Coarse Handles are mapped to each Curvature Slot


You can assign any Color Channel (R, G or B) of the Jitter Connection to any Curvature slot.

The Jitter is usually multiplied against the Curvature Influence Sliders.



  • Ignore Jitter

Nothing will be multiplied against the specified Influence Slider



  • Jitter Fine RED

The RED Channel of the Node(s) feeding into the Jitter Fine Handle will be multiplied with the specified Influence Slider

  • Jitter Fine GREEN

The GREEN Channel of the Node(s) feeding into the Jitter Fine Handle will be multiplied with the specified Influence Slider

  • Jitter Fine BLUE

The BLUE Channel of the Node(s) feeding into the Jitter Fine Handle will be multiplied with the specified Influence Slider



  • Attenuated Jitter Fine RED

The RED Channel of the Node(s) feeding into the Jitter Fine Handle will be multiplied with the Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(JitterFine.red * CurvatureMapSharp) * CurvatureSharpInfluenceSlider

  • Attenuated Jitter Fine GREEN

The GREEN Channel of the Node(s) feeding into the Jitter Fine Handle will be multiplied with the Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(JitterFine.green * CurvatureMapSharp) * CurvatureSharpInfluenceSlider

  • Attenuated Jitter Fine BLUE

The BLUE Channel of the Node(s) feeding into the Jitter Fine Handle will be multiplied with the Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(JitterFine.blue * CurvatureSharp) * CurvatureSharpInfluenceSlider



  • Inverse Attenuated Jitter Fine RED

The RED Channel of the Node(s) feeding into the Jitter Fine Handle will be multiplied with the inverted Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(  (1.0 - CurvatureMapSharp) * JitterFine.red ) * CurvatureSharpInfluenceSlider

  • Inverse Attenuated Jitter Fine GREEN

The GREEN Channel of the Node(s) feeding into the Jitter Fine Handle will be multiplied with the inverted Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(  (1.0 - CurvatureMapSharp) * JitterFine.green ) * CurvatureSharpInfluenceSlider

  • Inverse Attenuated Jitter Fine BLUE

The BLUE Channel of the Node(s) feeding into the Jitter Fine Handle will be multiplied with the inverted Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(  (1.0 - CurvatureMapSharp) * JitterFine.blue ) * CurvatureSharpInfluenceSlider



  • Jitter Coarse RED

The RED Channel of the Node(s) feeding into the Jitter Coarse Handle will be multiplied with the specified Influence Slider

  • Jitter Coarse GREEN

The GREEN Channel of the Node(s) feeding into the Jitter Coarse Handle will be multiplied with the specified Influence Slider

  • Jitter Coarse BLUE

The BLUE Channel of the Node(s) feeding into the Jitter Coarse Handle will be multiplied with the specified Influence Slider



  • Attenuated Jitter Coarse RED

The RED Channel of the Node(s) feeding into the Jitter Coarse Handle will be multiplied with the Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(JitterCoarse.red * CurvatureMapSharp) * CurvatureSharpInfluenceSlider

  • Attenuated Jitter Coarse GREEN

The GREEN Channel of the Node(s) feeding into the Jitter Coarse Handle will be multiplied with the Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(JitterCoarse.green * CurvatureMapSharp) * CurvatureSharpInfluenceSlider

  • Attenuated Jitter Coarse BLUE

The BLUE Channel of the Node(s) feeding into the Jitter Coarse Handle will be multiplied with the Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(JitterCoarse.blue * CurvatureMapSharp) * CurvatureSharpInfluenceSlider



  • Inverse Attenuated Jitter Coarse RED

The RED Channel of the Node(s) feeding into the Jitter Coarse Handle will be multiplied with the inverted Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(  (1.0 - CurvatureMapSharp) * JitterCoarse.red ) * CurvatureSharpInfluenceSlider

  • Inverse Attenuated Jitter Coarse GREEN

The GREEN Channel of the Node(s) feeding into the Jitter Coarse Handle will be multiplied with the inverted Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(  (1.0 - CurvatureMapSharp) * JitterCoarse.green ) * CurvatureSharpInfluenceSlider

  • Inverse Attenuated Jitter Coarse BLUE

The BLUE Channel of the Node(s) feeding into the Jitter Coarse Handle will be multiplied with the inverted Curvature Map of the specified Slot, then multiplied against the specified Influence Slider


For example:

(  (1.0 - CurvatureMapSharp) * JitterCoarse.blue ) * CurvatureSharpInfluenceSlider



The Attenuation Value (usually set to 0.5)


For example a sample of Attenuated Jitter Coarse RED selected in the Sharp Drowpdown results in the following Calculation:


 ( (CurvatureSharp - Attenuation) * JitterCoarse.red ) * CurvatureSharpInfluenceSlider


For example a sample of Inverse Attenuated Jitter Coarse RED selected in the Sharp Drowpdown results in the following Calculation:


 (  (1.0 - CurvatureSharp) + Attenuation) * JitterCoarse.red ) * CurvatureSharpInfluenceSlider



Advanced Options: Stages from Single Map


The Advanced Options: Stages from Single Map Settings allow you to control how the node tries to derive the different curvature stages for

Sharp,Fine,Soft,Medium, Big, Large and Huge when only one map is attached in the Nodegraph (no blurred versions available) and the

Curvature Neutral is set to Stages from Single Map.


In this case the Node utilizes Thresholding to create the different maps.



Will reverse the Positions of the Sliders set below for the Sharp,Fine,Soft,Medium, Large & Huge Setting.

So a original slider value of 0.2 will become 0.8, 0.6 will become 0.4 etc.



The Gradient Width is used to soften the thresholding, it defines the Upper+Lower Bound of the Threshold

For example with a Threshold Value set to 0.5 and a Gradient Width Value of 0.1, incoming values lower than 0.4

will be black and incoming values higher than 0.6 will be white. Between 0.4 and 0.6 will be a soft gradient.



The Threshold Value used for each stage.

For example with a Threshold Value set to 0.5 and a Gradient Width Value of 0.1, incoming values lower than 0.4

will be black and incoming values higher than 0.6 will be white. Between 0.4 and 0.6 will be a soft gradient.





Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1 single source