Flair Shader

Table of contents
  1. Painterly Shading
    1. Cangiante
    2. Cangiante Wrap
    3. Custom Light
    4. Custom Light Wrap
    5. Custom Light Color
    6. Diffuse Factor
    7. Custom Shade
    8. Custom Shade Wrap
    9. Custom Shade Color
    10. Shadow Color Offset
  2. Shading
    1. Shading
    2. Color Tint
    3. Albedo
    4. Normal Map
    5. Bump Depth
  3. Settings
    1. Toon Shaded
      1. Toon Shade Color
      2. Toon Shade Wrap
      3. Toon Shade Blur
      4. Toon Mid Color
      5. Toon Mid Wrap
      6. Toon Mid Blur
      7. Toon Light Color
      8. Toon Smooth Lighting
    2. Animated
    3. Lighting
      1. Light Linking
      2. Light Map
        1. Light Map File
        2. Shade in Light Map
      3. Specularity
        1. Specular Model
        2. Roll Offs
        3. Specular Diffusion
        4. Specular Transparency
        5. Specular Map
      4. Rim light
        1. Rim Light Intensity
        2. Rim Light Wrap
        3. Rim Light Color
      5. Highlight
        1. Highlight Roll Off
        2. Highlight Diffusion
        3. Highlight Transparency
      6. Final Color
    4. Features
      1. Transparent
        1. Transparency Map
        2. Transparency
        3. Blend FX
        4. Blend AOVs
          1. AOV Blend
        5. Alpha Mask
        6. Alpha Mask Cutoff
      2. VertexFX
      3. Velocity
      4. Feature Noise
      5. NoiseFX
      6. Offsets
        1. Depth Threshold Offset
        2. Flow Threshold Offset
        3. Color Threshold Offset
        4. Depth Bias
    5. Geometry
      1. Displacement
        1. Displacement Map
        2. Displacement Multiplier
        3. Displacement Offset
        4. Tessellation Factor
      2. Wobble
        1. Wobble Frequency
        2. Wobble Amplitude
        3. Wobble Phase
        4. Wobble Blur
        5. Wobble Blur Layers
        6. Wobble Motion
      3. Flip Back Faces
      4. Culling
  4. Advanced
    1. Modifying the shader source code

The Flair Shader material was developed to meet most painterly shading requirements, support art-direction and render the necessary AOVs (Arbitrary Object Values i.e., normals, motion vectors…) in real-time. Built from scratch using the Maya API, it was conceived for artists, offering features only when needed.

A Flair Shader material has two types of ‘attributes’: Settings and normal Attributes.

Flair Shader material node attributes
The default Flair Shader material in the Attribute Editor.

The first section of a Flair Shader material within the attribute editor, provides the Settings that allow to enable/disable what features the material should have. Therefore, we document the default material Attributes first.

Painterly Shading

Painterly shading attributes focus on bringing colors into the foreground of shading control and work differently than most attributes found in PBR materials. This doesn’t mean that they can’t be combined with normal Shading parameters, but they require 3D artists to go back to thinking in terms of colors and light. The first group of attributes control the color in the lit parts of objects, whereas the second group of attributes (from Diffuse Factor onwards) control the color in the shade of objects.

Painterly shading attributes are baked onto albedo AOVs and can’t be separated for compositing purposes.

Cangiante

Cangiante illumination changes the hue of the lit area towards a brighter and saturated related color. This attributes can also be used to enhance the color of any applied Albedo.

Cangiante illumination (0...2.0)

Cangiante Wrap

Cangiante Wrap defines the area of effect for the Cangiante illumination attribute.

Cangiante Wrap (0...1.0)

Custom Light

Custom Light changes the color of the lit area towards the Custom Light Color.

Custom Light (0...1.0)

Custom Light Wrap

Custom Light Wrap defines the area of effect for the Custom Light attribute.

Custom Light Wrap (0...1.0)

Custom Light Color

Custom Light Color defines a custom color used by the Custom Light and Highlight attributes.

Different custom light colors

Diffuse Factor

Diffuse Factor defines the amount of diffuse shading within the material. 0 will be flat shading (entirely lit), 1 will be completely diffuse.

Diffuse Factor (0...1.0)

For scenes that require strong contrasts in shading (e.g., at night), keep the Diffuse Factor close to 1.

Custom Shade

Custom Shade changes the color of the shade area towards the Custom Shade Color.

Custom Shade (0...1.0)

Custom Shade Wrap

Custom Shade Wrap defines the area of effect for the Custom Shade attribute. It behaves like the Custom Light Wrap, but for the shade of an object.

Custom Shade Wrap (0...1.0)

Custom Shade Color

Custom Shade Color defines a custom color used by the Custom Shade and Shadow Color Offset attributes.

Different custom shade colors showcased with the Shadow Color Offset enabled

Shadow Color Offset

Shadow Color Offset offsets the shadow color of a light to the Custom Shade Color.

Shadow Color Offset on/off

Shading

Shading attributes focus on common attributes found in materials, including various uses of texture mapping for different shading effects.

Shading

Shading defines the amount of shading within the material. 0 will be flat shading (entirely unlit), 1 will be shaded. It’s the opposite of Diffuse Factor and won’t affect lighting from Light Maps.

Shading (0...1.0)

Color Tint

Color Tint defines a custom tint color. It is especially useful when mixing an additional color to the albedo color or textures. The color tint will multiply with the albedo to tint it accordingly. So, leave the color tint white if you only want the color of the albedo texture.

Different tint colors showcased with a Diffuse Factor of 0.6

Albedo

Albedo contains the raw colors of the object, without any lighting information. Use a plain color or click on the checkerboard icon to select a texture.

Albedo Texture with different tint colors and a Diffuse Factor of 0.85

Albedo textures with an alpha channel will only show transparency if the Transparent setting is activated. Any albedo transparency will be overriden if you specify a custom transparency map or alpha mask.

Normal Map

Normal Map is a texture which contains normal inclination deviations of the surface in the red and green channels, adding geometric detail without using polygons. Click on the checkerboard icon to select a texture.

Bump Depth

Defines the intensity of the normal inclinations in the Normal Map.

Normal Map with Bump Depth (0...3.0)


Settings

Additional material attributes for optional features can be created on-demand by enabling different settings.

Setting attributes are found in the first section of the Attribute Editor. Most settings are disabled by default, as to avoid unnecessary computations and clutter for artists. When needed, enabling settings will show the necessary attributes in the Attribute Editor, any copied tabs thereof, and in the Property Editor of the Hypershade window.


Toon Shaded

The Toon Shaded setting activates toon/cell shading. Toon shading within Flair separates the reflectance of light into three regions i.e., shade, mid and light region. Each region can be controlled through the toon shading attributes in the Attribute Editor.

Toon Shading attributes in the Attribute Editor
The Toon Shading section in the Attribute Editor.

Toon Shade Color

The Toon Shade Color defines the color of the shade toon region.

Different toon shade colors

Toon Shade Wrap

The Toon Shade Wrap defines the area of effect for the toon shade region.

Toon shade wrap (0...1)

Toon Shade Blur

The Toon Shade Blur defines the softness between the shade and mid toon regions.

Toon shade blur (0...1)

Toon region blur can also be controlled locally with VertexFX and NoiseFX, by enabling the Toon Toolset: Fair Toolbox -> Toon Settings -> Toon Toolset.

Toon Mid Color

The Toon Mid Color defines the color of the mid toon region.

Different toon mid colors

Toon Mid Wrap

The Toon Mid Wrap defines the area of effect for the toon mid region.

Toon mid wrap (0.6...0...1)

You can use the Toon Mid Wrap attribute to reduce toon shading to only two regions instead of three.

Toon Mid Blur

The Toon Mid Blur defines the softness between the mid and light toon regions.

Toon mid blur (0...1)

Toon Light Color

The Toon Light Color defines the color of the light toon region.

Different toon light colors

Toon Smooth Lighting

The Toon Smooth Lighting smoothly interpolates toon lighting of various light sources

Toon smooth lighting (0.005...1)

Animated

The Animated setting bakes the current position of vertices so that the effects that rely on the 3D position of objects can stay in place when objects are deformed/animated. If this setting is not enabled, features like NoiseFX or FeatureNoise would float around in 3D space and not move with the objects.

NoiseFX without the Animated setting.
NoiseFX with the Animated setting.

Lighting

This group contains all settings affecting lighting within the material.

Light Linking

The Light Linking setting toggles the ability to link lights within the material. This will allow Windows->Relationship Editors->Light Linking to work within the viewport. Keep in mind that allowing this on all materials can impact performance depending on how many lights you have in the scene.

Light Map

The Light Map setting activates the use of light maps within the material and toggles light map attributes in the Attribute Editor.

Light Map attributes
The Light Map section in the Attribute Editor.
Light Map File

Light maps are grayscale texture maps that add light to the material (white is light). These can be baked from offline renderers, painted with VertexFX or assigned procedurally through NoiseFX. Click on the checkerboard icon to select a texture.

Shade in Light Map

If this attribute is enabled, Light Maps will add both light and shade to the object. White 1.0 will add light, neutral grey 0.5 won’t add anything, black 0 will add shade to the object.

Light map used in video
Light Map supporting Shade in Light Map.
Light Map applied.

Specularity

The Specularity setting activates the use of specular reflectance models within the material and toggles the attributes in the Specularity section.

Blinn specularity attributes
Blinn specularity attributes.
Specular Model

The specularModel setting defines the shading algorithm used by the Flair Shader material for specularity (shininess). A shading algorithm dictates how light is reflected along the surface of the object.

Blinn Anisotropic
Available specular reflectance models: Blinn and Anisotropic.

Depending on the specular model, different attributes will appear in the Specularity section.

Anisotropic specularity attributes
Anisotropic specularity attributes.
Roll Offs

Specular Roll Off, Horizontal Roll Off and Vertical Roll Off define the size of the specular highlight.

Blinn: Roll Off (0...1.0).
Anisotropic: Horizontal Roll Off (0...0.5).
Anisotropic: Vertical Roll Off (0...0.5).
Specular Diffusion

Specular Deffusion defines how diffuse or sharp a specular highlight is.

Specular Diffusion (0...1.0).
Specular Transparency

Specular Transparency defines the transparency of the specular highlight.

Specular Transparency (0...1.0).
Specular Map

Specular Maps are greyscale texture maps which mask the specularity within the material. Otherwise, the specularity will be even throughout the material.Click on the checkerboard icon to select a texture.

(1) without specularity; (2) with specularity; (3) with specularity and a Specular Map.

The specularity within the specular map is encoded within the intensity (white values) of the texture. White is specular, grey is semi-specular, black is diffuse.


Rim light

The Rim Light settings activates the the use of 3D rim lighting effect around the silhouette of objects on areas facing the light or opposite to it.

Rim light attributes in the Attribute Editor
Rim light attributes.
Rim Light Intensity

Rim Light controls the intensity of the rim light. Positive values adds the rim light, whereas negative values subtracts it.

Rim Light (-1,5...1,5).
Rim Light Wrap

Rim Light Wrap defines the area of effect of the rim light in either the lit or shaded areas of the object.

Rim Light Wrap (-1...1).
Rim Light Color

Controls the color of the rim light. The color is additively blended on top of the underlaying shading.

Varying the hue of the rim light color.

Highlight

The Highlight setting activates the use of highlights to generate a sharp highlight with the Custom-Light Color.

Highlight attributes
The highlight attributes.
Highlight Roll Off

Highlight Roll Off defines the size of the highlight in the lit area of objects.

Highlight Roll Off with an orange Light Color (0...1.0)
Highlight Diffusion

Highlight Diffusion defines how diffuse (blurred) the highlight should be.

Highlight Diffusion (0...1.0)
Highlight Transparency

Highlight Transparency defines the transparency of the highlight.

Highlight Transparency (0...1.0).

Final Color

The Final Color setting makes the albedo its final color. Objects assigned to a final color material are not affected by lighting or the Atmosphere Color attribute that is set in the globals node. This allows you to use just the color, disregarding what is happening around them.


Features

This group aggregates various features affecting the type of data that the material renders.

Transparent

The Transparent setting activates the use of transparency and alpha masks in the material and toggles the attributes in the Attribute Editor.

Transparency and alpha masking attributes
Transparency and alpha masking section in the Attribute Editor.
Transparency Map

Transparency Map is a greyscale texture which embeds the semi-transparency of the material. Click on the checkerboard icon to select a texture.

Transparency Map, featuring semi-transparency.

As with Alpha Masks: white is opaque, grey values are semi-transparent, black is transparent. The darker the value of the Transparency Map, the more transparent the material will be.

Transparency

Transparency defines the overall semi-transparency of the material.

Transparency (0...1.0)
Blend FX

Blend FX defines if the control masks of effects (NoiseFX, VertexFX) should blend with transparency or not.

Blend AOVs

Blend AOVs defines if AOVs (depth and normals) should blend with transparency or not. This attribute also shows the AOV Blend attribute, which helps to blend AOVs further so that effects can look better on semi-transparent objects.

AOV Blend

AOV Blend, which only appears appears once Blend AOVs is enabled, defines how much the AOVs should blend. A value of 0 will make the AOVs (depth and normals) of the material dissapear, while a value of 1 will blend AOVs as much as the color.

Alpha Mask

Alpha Mask is a black and white image which embeds the alpha of the material. Alpha masks are binary and can only distinguish between opaque or fully transparent (white is opaque, black is transparent). Click on the checkerboard icon to select a texture.

Use the alpha masks if you want cast shadows to respect the transparency.

Alpha Mask Cutoff

The grayscale value at which the Alpha Mask is transparent. Defines the threshold/boundary of the alpha mask in case there are grey values.

Alpha Mask with Alpha Mask Cutoff (0.1...0.9).

VertexFX

The VertexFX setting toggles the control of stylization effects through the vertex colors. The attribute is automatically enabled by Flair and is toggled as soon as you start painting with the VertexFX tool.


Velocity

The Velocity setting activates the calculation and rendering of motion vectors by the material. However, velocity will only be calculated if the VelocityPV global is enabled.

Velocity is enabled by default, but it can be deactivated per material if motion vectors are not required.


Feature Noise

The Feature Noise setting activates the fractalized 3D noise that is used for shader styles such as hatching, cat and sketch. Fractalized noise will always be the same pixel size, no matter how close or far the camera is from objects. This makes it ideal to recreate 2D effects which also preserve the pixel size on a canvas.


NoiseFX

The NoiseFX setting toggles the use of NoiseFX in the material and enables the NoiseFX section within the bottom of the Attribute Editor. This attribute is generally toggled automatically when the NoiseFX tool is used and allows you to key and animate NoiseFX attributes when needed.

Stylization (procedural) attributes
The beginning of the NoiseFX attributes

Offsets

The Offsets setting toggles the available offsets per material and the respective section within the Attribute Editor. The effects of these attributes will only be visible on effects and styles that work with thresholds and depth i.e., lines (toon and sketch).

Stylization (procedural) attributes
The beginning of the NoiseFX attributes
Depth Threshold Offset

Depth Threshold Offset modifies the global depth threshold for this material

Flow Threshold Offset

Flow Threshold Offset modifies the global flow (normals) threshold for this material

Color Threshold Offset

Color Threshold Offset modifies the global color threshold for this material

Depth Bias

Depth Bias offsets the depth of objects assigned to the material to help fix potential depth-based artifacts with overlapping geometries.


Geometry

This group contains all attributes changing the geometry of the material.

Displacement

The Displacement setting activates the use of displacement within the material and toggles the attributes in the Attribute Editor.

Displacement section
The Displacement section in the Attribute Editor.
Displacement Map

Displacement Map is a greyscale texture which embeds the displacement in the form of a heightmap. Click on the checkerboard icon to select a texture.

Displacement Multiplier

Displacement Multiplier defines the amount of displacement to use. The higher the value, the more displacement there will be.

Displacement Multiplier (0...0.5).
Displacement Offset

Displacement Offset offsets the displacement inward, so that displacement can be inside and outside of the object.

Displacement Offset (0...1.0).
Tessellation Factor

Tessellation Factor defines the amount of subdivision within each polygon. The higher the factor, the more polygons are subdivided, giving more points to displace. There is no magic number, so you will need to find out how much tessellation is enough for your displacement purposes depending on the topology of each model.

Displacement with different Tesselation Factors (1.0...10.0).

Wobble

The Wobble setting activates the use of wobble offsets within the material and toggles its attributes in the Attribute Editor. These material attributes offset the global wobble values set in the globals node, so make sure to enable and set the wobble effect globally first.

Different types of wobble noise can be specified for different results

  • None - No wobble is applied
  • Simple - Default simplex wobble noise
  • Cloud - More detailed fractalized wobble noise resembling the “cloud” noise in Photoshop (better appreciated higher polygon count).
  • Custom - Custom noise, which can be written in glsl flair/maya/shaders/material/include/noise.glsl [customNoise3(vec4 v)].
Wobble offsets section
The Wobble Offsets section in the Attribute Editor.

Once the wobble attribute has been enabled globally, material presets will default as wobbled (Simple).

Wobble Frequency

Offsets the regularity of the wobble. A higher frequency will make the wobble more “irregular”, whereas a lower frequency will make it more “regular”. The frequency is directly linked to the global World Scale.

Wobble Frequency (0...5).
Wobble Amplitude

Defines the amount of wobble. A higher amplitude will deform more than a lower amplitude. The amplitude is directly linked to the global World Scale.

Wobble Amplitude (0...2.5).
Wobble Phase

Defines the form of the wobble. Useful when you want a different wobble deformation or want to vary the wobble on a frame-by-frame basis.

Wobble Phase (0...3).

As wobble is generated from noise in 3D, make sure to toggle the deformed attribute in materials if they are animated/deformed so that the wobble is baked in place.

Wobble Blur

Defines the amount wobble blur for TAA samples, generating a soft edge by avaraging different wobble positions as layers.

Wobble Blur (0...1).
Wobble Blur Layers

Defines the amount of wobble blur layers i.e., the amount of wobbled positions to use during the wobble blur.

Wobble Blur Layers (32...1).

With a low layer amount, you can use Wobble Blur to achieve a layered watercolor look!

Wobble Motion

Defines the amount of motion offset of the wobble, generating streaks of motion under animation. For this attribute to show it’s effect, make sure that velocity is enabled in the Globals node and in the material.

Wobble motion at 0.5 and 2.5.

Flip Back Faces

The Flip Back Faces setting flips the normals of faces that are pointing away from the camera view. This is useful to obtain better results from single polygon objects like tree leaves.


Culling

The Culling setting defines which faces should be culled within the material.

  • None - No culling, all objects with the material are rendered as double sided.
  • Front - The front-facing faces are going to be culled, only rendering the back faces.
  • Back - The back-facing faces are going to be culled, only rendering front-faces. This can help performance on objects with many polygons.


Advanced

Modifying the shader source code

You may edit the source code of the material should you need to. The GLSL source files can be found in the Flair directory under /maya/shader/material. Please reach out on Discord to guide you further and learn what was missing for you. Maybe we can also help implement things for you.