Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PBRClearCoatConfiguration

Plugin that implements the clear coat component of the PBR material

Hierarchy

Index

Constructors

constructor

Properties

bumpTextureSearch playground for bumpTexture

bumpTexture: Nullable<BaseTexture>

Define the clear coat specific bump texture.

indexOfRefractionSearch playground for indexOfRefraction

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.

intensitySearch playground for intensity

intensity: number

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

isEnabledSearch playground for isEnabled

isEnabled: boolean

Defines if the clear coat is enabled in the material.

isTintEnabledSearch playground for isTintEnabled

isTintEnabled: boolean

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

Readonly markAllDefinesAsDirtySearch playground for markAllDefinesAsDirty

markAllDefinesAsDirty: () => void

Helper function to mark defines as being dirty.

Type declaration

    • (): void
    • Returns void

nameSearch playground for name

name: string

Defines the name of the plugin

prioritySearch playground for priority

priority: number

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

registerForExtraEventsSearch playground for registerForExtraEvents

registerForExtraEvents: boolean

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

remapF0OnInterfaceChangeSearch playground for remapF0OnInterfaceChange

remapF0OnInterfaceChange: boolean

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

roughnessSearch playground for roughness

roughness: number

Defines the clear coat layer roughness.

textureSearch playground for texture

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

textureRoughnessSearch playground for textureRoughness

textureRoughness: Nullable<BaseTexture>

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

tintColorSearch playground for tintColor

tintColor: Color3

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

tintColorAtDistanceSearch playground for tintColorAtDistance

tintColorAtDistance: number

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

tintTextureSearch playground for tintTexture

tintTexture: Nullable<BaseTexture>

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

tintThicknessSearch playground for tintThickness

tintThickness: number

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

useRoughnessFromMainTextureSearch playground for useRoughnessFromMainTexture

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

Methods

addFallbacksSearch playground for addFallbacks

  • addFallbacks(defines: MaterialClearCoatDefines, fallbacks: EffectFallbacks, currentRank: number): number

bindForSubMeshSearch playground for bindForSubMesh

collectDefinesSearch playground for collectDefines

  • collectDefines(defines: {}): void
  • Collects all defines.

    Parameters

    • defines: {}

      The object to append to.

      • [name: string]: { default: any; type: string }
        • default: any
        • type: string

    Returns void

copyToSearch playground for copyTo

  • Makes a duplicate of the current configuration into another one.

    Parameters

    Returns void

disposeSearch playground for dispose

  • dispose(forceDisposeTextures?: boolean): void
  • Parameters

    • Optional forceDisposeTextures: boolean

    Returns void

fillRenderTargetTexturesSearch playground for fillRenderTargetTextures

getActiveTexturesSearch playground for getActiveTextures

  • getActiveTextures(activeTextures: BaseTexture[]): void

getAnimatablesSearch playground for getAnimatables

getAttributesSearch playground for getAttributes

  • Gets the attributes used by the plugin.

    Parameters

    • attributes: string[]

      list that the attribute names should be added to.

    • scene: Scene

      the scene that the material belongs to.

    • mesh: AbstractMesh

      the mesh being rendered.

    Returns void

getClassNameSearch playground for getClassName

  • getClassName(): string

getCustomCodeSearch playground for getCustomCode

  • getCustomCode(shaderType: string): Nullable<{}>
  • Returns a list of custom shader code fragments to customize the shader.

    Parameters

    • shaderType: string

      "vertex" or "fragment"

    Returns Nullable<{}>

    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.

getSamplersSearch playground for getSamplers

  • getSamplers(samplers: string[]): void

getUniformBuffersNamesSearch playground for getUniformBuffersNames

  • getUniformBuffersNames(ubos: string[]): void
  • Gets the uniform buffers names added by the plugin.

    Parameters

    • ubos: string[]

      list that the ubo names should be added to.

    Returns void

getUniformsSearch playground for getUniforms

  • getUniforms(): { fragment?: string; ubo?: Array<{ name: string; size: number; type: string }>; vertex?: string }
  • Returns { fragment?: string; ubo?: Array<{ name: string; size: number; type: string }>; vertex?: string }

    • Optional fragment?: string
    • Optional ubo?: Array<{ name: string; size: number; type: string }>
    • Optional vertex?: string

hardBindForSubMeshSearch playground for hardBindForSubMesh

  • Binds the material data (this function is called even if mustRebind() returns false)

    Parameters

    • uniformBuffer: UniformBuffer

      defines the Uniform buffer to fill in.

    • scene: Scene

      defines the scene the material belongs to.

    • engine: Engine

      defines the engine the material belongs to.

    • subMesh: SubMesh

      the submesh to bind data for

    Returns void

hasRenderTargetTexturesSearch playground for hasRenderTargetTextures

  • hasRenderTargetTextures(): boolean
  • Gets a boolean indicating that current material needs to register RTT

    Returns boolean

    true if this uses a render target otherwise false.

hasTextureSearch playground for hasTexture

isReadyForSubMeshSearch playground for isReadyForSubMesh

  • isReadyForSubMesh(defines: MaterialClearCoatDefines, scene: Scene, engine: Engine): boolean

parseSearch playground for parse

  • parse(source: any, scene: Scene, rootUrl: string): void
  • Parses a anisotropy Configuration from a serialized object.

    Parameters

    • source: any

      Serialized object.

    • scene: Scene

      Defines the scene we are parsing for

    • rootUrl: string

      Defines the rootUrl to load from

    Returns void

prepareDefinesSearch playground for prepareDefines

  • prepareDefines(defines: MaterialClearCoatDefines, scene: Scene): void

prepareDefinesBeforeAttributesSearch playground for prepareDefinesBeforeAttributes

serializeSearch playground for serialize

  • serialize(): any
  • Serializes this clear coat configuration.

    Returns any

    • An object with the serialized config.

Legend

  • Constructor
  • Property
  • Method
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method