Shading attributes

IntermediateArtistProgrammer shading attributes define the color characteristics of the material and how it reacts to light.

Note

To display a material, you need to select at least one shading model (diffuse, specular or emissive model) in the model attributes.

Diffuse

diffuse is the basic color of the material. A pure diffuse material is completely non-reflective and “flat” in appearance. The final diffuse contribution is calculated like this:

  • diffuse defines the color used by the diffuse model
  • diffuse model defines which shading model is used for rendering the diffuse component (see below) diffuse map.

    Diffuse model

    diffuse model determines how the diffuse material reacts to light. You can use the Lambert or cel-shading.

    Lambert model

    Under the Lambert model, light is reflected equally in all directions with an intensity following a cosine angular distribution (angle between the normal and the light):
    Note
    A pure Lambertian material doesn’t exist in reality. A material always has a little specular reflection. This effect is more visible at grazing angles (a mostly diffuse surface becomes shiny at grazing angle).

    Specular

    specular is a point of light reflected in a material. The specular color can be defined using a metalness map (which uses the diffuse color as a base color), or a specular map (the specular color is defined separately from the diffuse color).

    Metalness map

    metalness map simplifies parametrization between the diffuse and specular color. By taking into into account the fact that almost all materials always have some “metalness”/reflectance in them, using the metalness map provides realistic materials with minimal parametrization. The final specular color is calculated by mixing a fixed low-reflection color and the diffuse color.
  • 0.0, the effective specular color is equal to 0.02, while the diffuse color is unchanged. The material is not metal but exhibits some reflectance and is sensitive to the Fresnel effect.
  • 1.0, the effective specular color is equal to the diffuse color, and the diffuse color is set to 0. The material is considered a pure metal. The screenshots below show the result of the metalness factor on a material with the following attributes:
  • 0.8
  • #848484, Lambert -

    Specular map

    The specular map provides more control over the actual specular color, but requires you to modify the diffuse color accordingly. Unlike the metalness workflow, this lets you have a different specular color from the diffuse color even in low-reflection scenarios, allowing for materials with special behavior.
    Note
    layers.

    Specular model

    microfacet model, also known as Cook-Torrance (academic paper). The microfacet is defined by the following formula, where Rs is the resulting specular reflectance:

    Emissive

    emissive material is a surface that emits light. bloom post-processing effect, we can see the influence of an emissive material:

    See also

  • Geometry attributes
  • Misc attributes
  • Material maps
  • Material layers
  • Materials for developers
  • Custom shaders