API

Class PBRClearCoatConfiguration

Plugin that implements the clear coat component of the PBR material

Hierarchy (View Summary)

Index
doNotSerialize: boolean = false

Specifies if the material plugin should be serialized, true to skip serialization

intensity: number = 1

Defines the clear coat layer strength (between 0 and 1) it defaults to 1.

markAllDefinesAsDirty: () => void

Helper function to mark defines as being dirty.

name: string

Defines the name of the plugin

priority: number = 500

Defines the priority of the plugin. Lower numbers run first.

registerForExtraEvents: boolean = false

Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)

resolveIncludes: boolean = false

Indicates that any #include directive in the plugin code must be replaced by the corresponding code.

roughness: number = 0

Defines the clear coat layer roughness.

tintColor: Color3 = ...

Defines the clear coat tint of the material. This is only use if tint is enabled

tintColorAtDistance: number = 1

Defines the distance at which the tint color should be found in the clear coat media. This is only use if tint is enabled

tintThickness: number = 1

Defines the clear coat layer thickness. This is only use if tint is enabled

bumpTexture: Nullable<BaseTexture>

Define the clear coat specific bump texture.

indexOfRefraction: number

Defines the index of refraction of the clear coat. This defaults to 1.5 corresponding to a 0.04 f0 or a 4% reflectance at normal incidence The default fits with a polyurethane material. Changing the default value is more performance intensive.

isEnabled: boolean

Defines if the clear coat is enabled in the material.

isTintEnabled: boolean

Defines if the clear coat tint is enabled in the material.

remapF0OnInterfaceChange: boolean

Defines if the F0 value should be remapped to account for the interface change in the material.

Stores the clear coat values in a texture (red channel is intensity and green channel is roughness) If useRoughnessFromMainTexture is false, the green channel of texture is not used and the green channel of textureRoughness is used instead if textureRoughness is not empty, else no texture roughness is used

textureRoughness: Nullable<BaseTexture>

Stores the clear coat roughness in a texture (green channel) Not used if useRoughnessFromMainTexture is true

tintTexture: Nullable<BaseTexture>

Stores the clear tint values in a texture. rgb is tint a is a thickness factor

useRoughnessFromMainTexture: boolean

Indicates that the green channel of the texture property will be used for roughness (default: true) If false, the green channel from textureRoughness is used for roughness

  • Returns a list of custom shader code fragments to customize the shader.

    Parameters

    • _shaderType: string

      "vertex" or "fragment"

    • _shaderLanguage: ShaderLanguage = ShaderLanguage.GLSL

      The shader language to use.

    Returns Nullable<{ [pointName: string]: string }>

    null if no code to be added, or a list of pointName => code. Note that pointName can also be a regular expression if it starts with a !. In that case, the string found by the regular expression (if any) will be replaced by the code provided.

  • Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)

    Returns {
        fragment?: string;
        ubo?: { name: string; size: number; type: string }[];
        vertex?: string;
    }

    the description of the uniforms