Mask from Curvature by Jens Kafitz


  • Where to find it: (This Node is available in the Nodegraph only)


    • NodeGraph / Right Mouse Click / Add Nodes / Layer / Extension Pack /





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.



Video



Step-by-Step Setup


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), Substance Designer 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






Node Overview




Node Ports


  • Curvature

Attach your original Curvature Map.


  • Fine / Soft / Medium Curvature

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


  • Big / Large / Huge Curvature

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.


  • Jitter Fine

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


  • Jitter Coarse

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


MAIN TAB


Curvature Influence


  • Mode

Determines how the attached Curvature Maps are processed


    • Raw

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

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

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

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



  • Sharp / Fine / Soft / Medium

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



  • Big / Large / Huge

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


Edge/Cavity


  • Cavity Intensity

Increases the intensity of the calculated Cavity


  • Edge Intensity

Increases the intensity of the calculated edges


Adjustment


  • Contrast

Adjusts the Contrast of the calculated result


  • Bias

Adjusts the Bias of the calculated result


  • Gain

Adjusts the Gain of the calculated result


  • Invert Result

Inverts the computed result (1.0 - Current)





ADVANCED OPTIONS TAB



Curvature Midpoint


  • Offset Midpoint

Allows you to offset the assumed midpoint of your curvature maps.

By default the node assumed the natural midpoint of your curvature map is 0.5.

By tweaking this value you can add or subtract a value from this 0.5 midpoint


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



Curvature Blending


  • Blend Sharp

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



  • Blend Fine / Soft / Medium / Big / Large / Huge

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


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:


  • Remap Curvature(s)

Allows the individual tweaking of contrast and levels of the supplied Curvatures on the different Curvature Ports.

The curve is applied before any processing inside the node



Blending


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

raw, cavity and dual.


  • Raw Mode Curvature Blending

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


  • Edge Mode Cavity Blending

The Blendmode used to combine Cavities and Edges Blending when the Edge Mode is chosen


  • Edge Mode Cavity Opacity

The Opacity of the Cavities when the Edge Mode is chosen


  • Edge Mode Value Addition

A value that can be added or subtracted from the Edge Pass when the Edge Mode is chosen.

Usually this should stay at 0.


  • Cavity Mode Value Addition

A value that can be added or subtracted from the Cavity Pass when the Cavities Mode is chosen.

Usually this should stay at 0.


  • Dual Mode Cavity Blending

When the Dual is chosen, this determines the Blendmode used, to combine the Cavities Pass with the Edge Pas


  • Dual Mode Cavity Opacity

When the Dual is chosen, this determines the Opacity used, to combine the Cavities Pass with the Edge Pas


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.


  • Sharp x, Fine x, Soft x, Medium x, Big x, Large x, Huge x


  • 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



  • Attenuation

The Attenuation Value (usually set to 0.5)

    • is subtracted from a Curvature Map before it is used in multiplication when one of the Attenuated Modes is selected from the Dropdown
    • added to the Curvature Map when one of the Inverse Attenuated Modes is selected.


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




Jitter Overrides


The Jitter Overrides allow you to globally override the Jitter Options defined under the  Jitter Group


  • Use Jitter Fine for All

Maps the Jittering for all Curvatures (Sharp,Fine,Medium,Big,Large,Huge) to use the Jitter Fine supplied via the Nodegraph Port


  • Use Jitter Coarse for All

Maps the Jittering for all Curvatures (Sharp,Fine,Medium,Big,Large,Huge) to use the Jitter Coarse supplied via the Nodegraph Port