Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PBRBRDFConfiguration

Plugin that implements the BRDF component of the PBR material

Hierarchy

Index

Constructors

constructor

Properties

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)

useEnergyConservationSearch playground for useEnergyConservation

useEnergyConservation: boolean

Defines if the material uses energy conservation.

useSmithVisibilityHeightCorrelatedSearch playground for useSmithVisibilityHeightCorrelated

useSmithVisibilityHeightCorrelated: boolean

LEGACY Mode set to false Defines if the material uses height smith correlated visibility term. If you intent to not use our default BRDF, you need to load a separate BRDF Texture for the PBR You can either load https://assets.babylonjs.com/environments/uncorrelatedBRDF.png or https://assets.babylonjs.com/environments/uncorrelatedBRDF.dds to have more precision Not relying on height correlated will also disable energy conservation.

useSpecularGlossinessInputEnergyConservationSearch playground for useSpecularGlossinessInputEnergyConservation

useSpecularGlossinessInputEnergyConservation: boolean

Defines if the material uses energy conservation, when the specular workflow is active. If activated, the albedo color is multiplied with (1. - maxChannel(specular color)). If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1. In the deactivated case, the material author has to ensure energy conservation, for a physically plausible rendering.

useSphericalHarmonicsSearch playground for useSphericalHarmonics

useSphericalHarmonics: boolean

LEGACY Mode set to false Defines if the material uses spherical harmonics vs spherical polynomials for the diffuse part of the IBL. The harmonics despite a tiny bigger cost has been proven to provide closer results to the ground truth.

Static DEFAULT_USE_ENERGY_CONSERVATIONSearch playground for DEFAULT_USE_ENERGY_CONSERVATION

DEFAULT_USE_ENERGY_CONSERVATION: boolean

Default value used for the energy conservation. This should only be changed to adapt to the type of texture in scene.environmentBRDFTexture.

Static DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATEDSearch playground for DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED

DEFAULT_USE_SMITH_VISIBILITY_HEIGHT_CORRELATED: boolean

Default value used for the Smith Visibility Height Correlated mode. This should only be changed to adapt to the type of texture in scene.environmentBRDFTexture.

Static DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATIONSearch playground for DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION

DEFAULT_USE_SPECULAR_GLOSSINESS_INPUT_ENERGY_CONSERVATION: boolean

Default value used for activating energy conservation for the specular workflow. If activated, the albedo color is multiplied with (1. - maxChannel(specular color)). If deactivated, a material is only physically plausible, when (albedo color + specular color) < 1.

Static DEFAULT_USE_SPHERICAL_HARMONICSSearch playground for DEFAULT_USE_SPHERICAL_HARMONICS

DEFAULT_USE_SPHERICAL_HARMONICS: boolean

Default value used for the IBL diffuse part. This can help switching back to the polynomials mode globally which is a tiny bit less GPU intensive at the drawback of a lower quality.

Methods

addFallbacksSearch playground for addFallbacks

  • Add fallbacks to the effect fallbacks list.

    Parameters

    • defines: MaterialDefines

      defines the Base texture to use.

    • fallbacks: EffectFallbacks

      defines the current fallback list.

    • currentRank: number

      defines the current fallback rank.

    Returns number

    the new fallback rank.

bindForSubMeshSearch playground for bindForSubMesh

  • Binds the material data.

    Parameters

    • uniformBuffer: UniformBuffer

      defines the Uniform buffer to fill in.

    • scene: Scene

      defines the scene the material belongs to.

    • engine: Engine

      the engine this scene belongs to.

    • subMesh: SubMesh

      the submesh to bind data for

    Returns void

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
  • Disposes the resources of the material.

    Parameters

    • Optional forceDisposeTextures: boolean

      Forces the disposal of all textures.

    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
  • Gets the samplers used by the plugin.

    Parameters

    • samplers: string[]

      list that the sampler names should be added to.

    Returns 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 }
  • 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?: Array<{ name: string; size: number; type: string }>; vertex?: string }

    the description of the uniforms

    • 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

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

    Parameters

    Returns boolean

    • Boolean specifying if a texture is used in the material.

isReadyForSubMeshSearch playground for isReadyForSubMesh

  • Specifies that the submesh is ready to be used.

    Parameters

    • defines: MaterialDefines

      the list of "defines" to update.

    • scene: Scene

      defines the scene the material belongs to.

    • engine: Engine

      the engine this scene belongs to.

    • subMesh: SubMesh

      the submesh to check for readiness

    Returns boolean

    • boolean indicating that the submesh is ready or not.

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: MaterialBRDFDefines): 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