PBRBaseMaterial

The Physically based material base class of BJS.

This offers the main features of a standard PBR material. For more information, please refer to the documentation : http://doc.babylonjs.com/extensions/Physically_Based_Rendering

Hierarchy

Implements

Index

Constructors

constructor

Properties

alpha

alpha: number

Gets the alpha value of the material

alphaMode

alphaMode: number

Gets the value of the alpha mode

animations

animations: Array<Animation>

Stores the animations for the material

backFaceCulling

backFaceCulling: boolean

Gets the back-face culling state

checkReadyOnEveryCall

checkReadyOnEveryCall: boolean

Specifies if the ready state should be checked on each call

checkReadyOnlyOnce

checkReadyOnlyOnce: boolean

Specifies if the ready state should be checked once

disableDepthWrite

disableDepthWrite: boolean

Specifies if depth writing should be disabled

doNotSerialize

doNotSerialize: boolean

Specifies if the material should be serialized

fillMode

fillMode: number

Sets the material fill mode

fogEnabled

fogEnabled: boolean

Gets the value of the fog enabled state

forceDepthWrite

forceDepthWrite: boolean

Specifies if depth writing should be forced

getRenderTargetTextures

getRenderTargetTextures: function

Callback triggered to get the render target textures

id

id: string

The ID of the material

isFrozen

isFrozen: boolean

Specifies if updates for the material been locked

name

name: string

The name of the material

needDepthPrePass

needDepthPrePass: boolean

Gets the depth pre-pass value

onBind

onBind: function

Called during a bind event

Type declaration

onBindObservable

onBindObservable: Observable<AbstractMesh>

An event triggered when the material is bound

onCompiled

onCompiled: function

Callback triggered when the material is compiled

Type declaration

    • Parameters

      Returns void

onDispose

onDispose: function

Called during a dispose event

Type declaration

    • (): void
    • Returns void

onDisposeObservable

onDisposeObservable: Observable<Material>

An event triggered when the material is disposed

onError

onError: function

Callback triggered when an error occurs

Type declaration

    • (effect: Effect, errors: string): void
    • Parameters

      • effect: Effect
      • errors: string

      Returns void

onUnBindObservable

onUnBindObservable: Observable<Material>

An event triggered when the material is unbound

pointSize

pointSize: number

Stores the size of points

pointsCloud

pointsCloud: boolean

Sets the state of point cloud mode

separateCullingPass

separateCullingPass: boolean

Specifies if there should be a separate pass for culling

sideOrientation

sideOrientation: number

Stores the value for side orientation

state

state: string

The state of the material

storeEffectOnSubMeshes

storeEffectOnSubMeshes: boolean

Specifies if the effect should be stored on sub meshes

transparencyMode

transparencyMode: Nullable<number>

Sets the transparency mode of the material.

Value Type Description
0 OPAQUE
1 ALPHATEST
2 ALPHABLEND
3 ALPHATESTANDBLEND

uniqueId

uniqueId: number

Gets or sets the unique id of the material

useLogarithmicDepth

useLogarithmicDepth: boolean

Enabled the use of logarithmic depth buffers, which is good for wide depth buffers.

wireframe

wireframe: boolean

Sets the state of wireframe mode

zOffset

zOffset: number

Stores the z offset value

Static AttributesDirtyFlag

AttributesDirtyFlag: number

Returns the dirty attributes flag value

Static ClockWiseSideOrientation

ClockWiseSideOrientation: number

Returns the clock-wise side orientation

Static CounterClockWiseSideOrientation

CounterClockWiseSideOrientation: number

Returns the counter clock-wise side orientation

Static FresnelDirtyFlag

FresnelDirtyFlag: number

Returns the dirty fresnel flag value

Static LIGHTFALLOFF_GLTF

LIGHTFALLOFF_GLTF: number

PBRMaterialLightFalloff gltf: light is falling off as described in the gltf moving to PBR document to enhance interoperability with other engines.

Static LIGHTFALLOFF_PHYSICAL

LIGHTFALLOFF_PHYSICAL: number

PBRMaterialLightFalloff Physical: light is falling off following the inverse squared distance law.

Static LIGHTFALLOFF_STANDARD

LIGHTFALLOFF_STANDARD: number

PBRMaterialLightFalloff Standard: light is falling off like in the standard material to enhance interoperability with other materials.

Static LightDirtyFlag

LightDirtyFlag: number

Returns the dirty light flag value

Static LineListDrawMode

LineListDrawMode: number

Returns the line list draw mode

Static LineLoopDrawMode

LineLoopDrawMode: number

Returns the line loop draw mode

Static LineStripDrawMode

LineStripDrawMode: number

Returns the line strip draw mode

Static MiscDirtyFlag

MiscDirtyFlag: number

Returns the dirty misc flag value

Static PointFillMode

PointFillMode: number

Returns the point fill mode

Static PointListDrawMode

PointListDrawMode: number

Returns the point list draw mode

Static TextureDirtyFlag

TextureDirtyFlag: number

Returns the dirty texture flag value

Static TriangleFanDrawMode

TriangleFanDrawMode: number

Returns the triangle fan draw mode

Static TriangleFillMode

TriangleFillMode: number

Returns the triangle fill mode

Static TriangleStripDrawMode

TriangleStripDrawMode: number

Returns the triangle strip draw mode

Static WireFrameFillMode

WireFrameFillMode: number

Returns the wireframe mode

Methods

bind

bindForSubMesh

bindOnlyNormalMatrix

  • bindOnlyNormalMatrix(normalMatrix: Matrix): void

bindOnlyWorldMatrix

  • bindOnlyWorldMatrix(world: Matrix): void

bindSceneUniformBuffer

  • Binds the scene's uniform buffer to the effect.

    Parameters

    • effect: Effect

      defines the effect to bind to the scene uniform buffer

    • sceneUbo: UniformBuffer

      defines the uniform buffer storing scene data

    Returns void

bindView

  • bindView(effect: Effect): void
  • Binds the view matrix to the effect

    Parameters

    • effect: Effect

      defines the effect to bind the view matrix to

    Returns void

bindViewProjection

  • bindViewProjection(effect: Effect): void
  • Binds the view projection matrix to the effect

    Parameters

    • effect: Effect

      defines the effect to bind the view projection matrix to

    Returns void

buildUniformLayout

  • buildUniformLayout(): void
  • Initializes the uniform buffer layout for the shader.

    Returns void

clone

  • Makes a duplicate of the material, and gives it a new name

    Parameters

    • name: string

      defines the new name for the duplicated material

    Returns Nullable<Material>

    the cloned material

dispose

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

    Parameters

    • Optional forceDisposeEffect: boolean

      Forces the disposal of effects.

    • Optional forceDisposeTextures: boolean

      Forces the disposal of all textures.

    Returns void

forceCompilation

  • forceCompilation(mesh: AbstractMesh, onCompiled?: function, options?: Partial<object>): void

forceCompilationAsync

  • forceCompilationAsync(mesh: AbstractMesh, options?: Partial<object>): Promise<void>
  • Force shader compilation

    Parameters

    • mesh: AbstractMesh

      defines the mesh that will use this material

    • Optional options: Partial<object>

      defines additional options for compiling the shaders

    Returns Promise<void>

    a promise that resolves when the compilation completes

freeze

  • freeze(): void
  • Locks updates for the material

    Returns void

getActiveTextures

getAlphaTestTexture

getAnimatables

  • Returns the animatable textures.

    Returns IAnimatable[]

    • Array of animatable textures.

getBindedMeshes

getClassName

  • getClassName(): string

getEffect

getScene

hasTexture

  • Specifies if the material uses a texture

    Parameters

    • texture: BaseTexture

      defines the texture to check against the material

    Returns boolean

    a boolean specifying if the material uses the texture

isMetallicWorkflow

  • isMetallicWorkflow(): boolean
  • Specifies if the material uses metallic roughness workflow.

    Returns boolean

    boolean specifiying if the material uses metallic roughness workflow.

isReady

  • isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean

isReadyForSubMesh

  • Specifies that the submesh is ready to be used.

    Parameters

    • mesh: AbstractMesh

      BJS mesh.

    • subMesh: SubMesh

      A submesh of the BJS mesh. Used to check if it is ready.

    • Optional useInstances: boolean

      Specifies that instances should be used.

    Returns boolean

    • boolean indicating that the submesh is ready or not.

markAsDirty

  • markAsDirty(flag: number): void
  • Marks a define in the material to indicate that it needs to be re-computed

    Parameters

    • flag: number

      defines a flag used to determine which parts of the material have to be marked as dirty

    Returns void

markDirty

  • markDirty(): void
  • Marks the material to indicate that it needs to be re-calculated

    Returns void

needAlphaBlending

  • needAlphaBlending(): boolean
  • Specifies whether or not this material should be rendered in alpha blend mode.

    Returns boolean

needAlphaBlendingForMesh

needAlphaTesting

  • needAlphaTesting(): boolean
  • Specifies whether or not this material should be rendered in alpha test mode.

    Returns boolean

serialize

  • serialize(): any
  • Serializes this material

    Returns any

    the serialized material object

toString

  • toString(fullDetails?: boolean): string
  • Returns a string representation of the current material

    Parameters

    • Optional fullDetails: boolean

      defines a boolean indicating which levels of logging is desired

    Returns string

    a string with material information

unbind

  • unbind(): void

unfreeze

  • unfreeze(): void
  • Unlocks updates for the material

    Returns void

Static Parse

  • Parse(parsedMaterial: any, scene: Scene, rootUrl: string): any
  • Creates a material from parsed material data

    Parameters

    • parsedMaterial: any

      defines parsed material data

    • scene: Scene

      defines the hosting scene

    • rootUrl: string

      defines the root URL to use to load textures

    Returns any

    a new material

Static ParseMultiMaterial

  • Creates a MultiMaterial from parsed MultiMaterial data.

    Parameters

    • parsedMultiMaterial: any

      defines parsed MultiMaterial data.

    • scene: Scene

      defines the hosting scene

    Returns MultiMaterial

    a new MultiMaterial

Generated using TypeDoc