API

Class PBRIridescenceConfiguration

Plugin that implements the iridescence (thin film) component of the PBR material

Hierarchy (View Summary)

Index
doNotSerialize: boolean = false

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

indexOfRefraction: number = PBRIridescenceConfiguration._DefaultIndexOfRefraction

Defines the maximum thickness of the thin-film layer given in nanometers (nm).

intensity: number = 1

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

markAllDefinesAsDirty: () => void

Helper function to mark defines as being dirty.

maximumThickness: number = PBRIridescenceConfiguration._DefaultMaximumThickness

Defines the maximum thickness of the thin-film layer given in nanometers (nm). This will be the thickness used if not thickness texture has been set.

minimumThickness: number = PBRIridescenceConfiguration._DefaultMinimumThickness

Defines the minimum thickness of the thin-film layer given in nanometers (nm).

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.

isEnabled: boolean

Defines if the iridescence is enabled in the material.

Stores the iridescence intensity in a texture (red channel)

thicknessTexture: Nullable<BaseTexture>

Stores the iridescence thickness in a texture (green channel)

  • 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