Options
All
  • Public
  • Public/Protected
  • All
Menu

Plugin that implements the sheen component of the PBR material.

Hierarchy

Index

Constructors

Properties

albedoScaling: boolean

If true, the sheen effect is layered above the base BRDF with the albedo-scaling technique. It allows the strength of the sheen effect to not depend on the base color of the material, making it easier to setup and tweak the effect

color: Color3

Defines the sheen color.

intensity: number

Defines the sheen intensity.

isEnabled: boolean

Defines if the material uses sheen.

linkSheenWithAlbedo: boolean

Defines if the sheen is linked to the sheen color.

markAllDefinesAsDirty: () => void

Type declaration

    • (): void
    • Helper function to mark defines as being dirty.

      Returns void

name: string

Defines the name of the plugin

priority: number

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

registerForExtraEvents: boolean

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

roughness: Nullable<number>

Defines the sheen roughness. It is not taken into account if linkSheenWithAlbedo is true. To stay backward compatible, material roughness is used instead if sheen roughness = null

Stores the sheen tint values in a texture. rgb is tint a is a intensity or roughness if the roughness property has been defined and useRoughnessFromTexture is true (in that case, textureRoughness won't be used) If the roughness property has been defined and useRoughnessFromTexture is false then the alpha channel is not used to modulate roughness

textureRoughness: Nullable<BaseTexture>

Stores the sheen roughness in a texture. alpha channel is the roughness. This texture won't be used if the texture property is not empty and useRoughnessFromTexture is true

useRoughnessFromMainTexture: boolean

Indicates that the alpha channel of the texture property will be used for roughness. Has no effect if the roughness (and texture!) property is not defined

Methods

  • addFallbacks(defines: MaterialSheenDefines, fallbacks: EffectFallbacks, currentRank: number): number
  • Add fallbacks to the effect fallbacks list.

    Parameters

    Returns number

    the new fallback rank.

  • 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

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

    Parameters

    Returns void

  • dispose(forceDisposeTextures?: boolean): void
  • Disposes the resources of the material.

    Parameters

    • Optional forceDisposeTextures: boolean

    Returns void

  • 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

  • getClassName(): string
  • Gets the current class name useful for serialization or dynamic coding.

    Returns string

    The class name.

  • 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.

  • getSamplers(samplers: string[]): void
  • Gets the samplers used by the plugin.

    Parameters

    • samplers: string[]

    Returns void

  • 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

  • getUniforms(): { fragment?: string; ubo?: { name: string; size: number; type: string }[]; vertex?: string }
  • 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

    • Optional fragment?: string
    • Optional ubo?: { name: string; size: number; type: string }[]
    • Optional vertex?: string
  • 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

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

    Returns boolean

    true if this uses a render target otherwise false.

  • Checks to see if a texture is used in the material.

    Parameters

    Returns boolean

    • Boolean specifying if a texture is used in the material.
  • isReadyForSubMesh(defines: MaterialSheenDefines, scene: Scene): boolean
  • Specifies that the submesh is ready to be used.

    Parameters

    • defines: MaterialSheenDefines
    • scene: Scene

    Returns boolean

    • boolean indicating that the submesh is ready or not.
  • 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

  • prepareDefines(defines: MaterialSheenDefines, scene: Scene): void
  • Sets the defines for the next rendering

    Parameters

    • defines: MaterialSheenDefines
    • scene: Scene

    Returns void

  • Sets the defines for the next rendering. Called before MaterialHelper.PrepareDefinesForAttributes is called.

    Parameters

    • defines: MaterialDefines

      the list of "defines" to update.

    • scene: Scene

      defines the scene to the material belongs to.

    • mesh: AbstractMesh

      the mesh being rendered

    Returns void

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

    Returns any

    • An object with the serialized config.

Legend

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

Settings

Theme