PBRBaseSimpleMaterial

The Physically based simple base material of BJS.

This enables better naming and convention enforcements on top of the pbrMaterial. It is used as the base class for both the specGloss and metalRough conventions.

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Properties

alpha

alpha: number

Sets the alpha value of the material

alphaCutOff

alphaCutOff: number

Defines the alpha limits in alpha test mode.

alphaMode

alphaMode: number

Sets the value of the alpha mode.

Value Type Description
0 ALPHA_DISABLE
1 ALPHA_ADD
2 ALPHA_COMBINE
3 ALPHA_SUBTRACT
4 ALPHA_MULTIPLY
5 ALPHA_MAXIMIZED
6 ALPHA_ONEONE
7 ALPHA_PREMULTIPLIED
8 ALPHA_PREMULTIPLIED_PORTERDUFF
9 ALPHA_INTERPOLATE
10 ALPHA_SCREENMODE

animations

animations: Array<Animation>

Stores the animations for the material

backFaceCulling

backFaceCulling: boolean

Sets 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

disableLighting

disableLighting: boolean

If sets to true, disables all the lights affecting the material.

doNotSerialize

doNotSerialize: boolean

Specifies if the material should be serialized

doubleSided

doubleSided: boolean

If sets to true and backfaceCulling is false, normals will be flipped on the backside.

emissiveColor

emissiveColor: Color3

Emissivie color used to self-illuminate the model.

emissiveTexture

emissiveTexture: BaseTexture

Emissivie texture used to self-illuminate the model.

environmentTexture

environmentTexture: BaseTexture

Environment Texture used in the material (this is use for both reflection and environment lighting).

fillMode

fillMode: number

Sets the material fill mode

fogEnabled

fogEnabled: boolean

Sets the state for enabling fog

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

invertNormalMapX

invertNormalMapX: boolean

If sets to true, x component of normal map value will invert (x = 1.0 - x).

invertNormalMapY

invertNormalMapY: boolean

If sets to true, y component of normal map value will invert (y = 1.0 - y).

isFrozen

isFrozen: boolean

Specifies if updates for the material been locked

lightmapTexture

lightmapTexture: BaseTexture

maxSimultaneousLights

maxSimultaneousLights: number

Number of Simultaneous lights allowed on the material.

name

name: string

The name of the material

needDepthPrePass

needDepthPrePass: boolean

Sets the need depth pre-pass value

normalTexture

normalTexture: BaseTexture

Normal map used in the model.

occlusionStrength

occlusionStrength: number

Occlusion Channel Strenght.

occlusionTexture

occlusionTexture: BaseTexture

Occlusion Texture of the material (adding extra occlusion effects).

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.

uniqueId

uniqueId: number

Gets or sets the unique id of the material

useLightmapAsShadowmap

useLightmapAsShadowmap: boolean

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

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

getBindedMeshes

getClassName

  • getClassName(): string

getEffect

getScene

hasTexture

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

needAlphaBlendingForMesh

needAlphaTesting

  • needAlphaTesting(): 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