BackgroundMaterial

Background material used to create an efficient environement around your scene.

Hierarchy

  • PushMaterial
    • BackgroundMaterial

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

Find examples in Playground
  • Instantiates a Background Material in the given scene

    Parameters

    • name: string

      The friendly name of the material

    • scene: Scene

      The scene to add the material to

    Returns BackgroundMaterial

Properties

alpha

Find examples in Playground
alpha: number

Gets the alpha value of the material

alphaMode

Find examples in Playground
alphaMode: number

Gets the value of the alpha mode

animations

Find examples in Playground
animations: Array<Animation>

Stores the animations for the material

backFaceCulling

Find examples in Playground
backFaceCulling: boolean

Gets the back-face culling state

cameraColorCurves

Find examples in Playground
cameraColorCurves: Nullable<ColorCurves>

The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT). They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects. These are similar to controls found in many professional imaging or colorist software. The global controls are applied to the entire image. For advanced tuning, extra controls are provided to adjust the shadow, midtone and highlight areas of the image; corresponding to low luminance, medium luminance, and high luminance areas respectively.

cameraColorCurvesEnabled

Find examples in Playground
cameraColorCurvesEnabled: boolean

Sets wether the color curves effect is enabled.

cameraColorGradingEnabled

Find examples in Playground
cameraColorGradingEnabled: boolean

Gets wether the color grading effect is enabled.

cameraColorGradingTexture

Find examples in Playground
cameraColorGradingTexture: Nullable<BaseTexture>

Sets the Color Grading 2D Lookup Texture.

cameraContrast

Find examples in Playground
cameraContrast: float

Sets The camera contrast used on this material.

cameraExposure

Find examples in Playground
cameraExposure: float

The camera exposure used on this material. This property is here and not in the camera to allow controlling exposure without full screen post process. This corresponds to a photographic exposure.

cameraToneMappingEnabled

Find examples in Playground
cameraToneMappingEnabled: boolean

Sets wether tonemapping is enabled or not

checkReadyOnEveryCall

Find examples in Playground
checkReadyOnEveryCall: boolean

Specifies if the ready state should be checked on each call

checkReadyOnlyOnce

Find examples in Playground
checkReadyOnlyOnce: boolean

Specifies if the ready state should be checked once

diffuseTexture

Find examples in Playground
diffuseTexture: Nullable<BaseTexture>

Diffuse Texture used in the material. Should be author in a specific way for the best result (refer to the documentation).

disableDepthWrite

Find examples in Playground
disableDepthWrite: boolean

Specifies if depth writing should be disabled

doNotSerialize

Find examples in Playground
doNotSerialize: boolean

Specifies if the material should be serialized

enableNoise

Find examples in Playground
enableNoise: boolean

This helps reducing the banding effect that could occur on the background.

fillMode

Find examples in Playground
fillMode: number

Sets the material fill mode

fogEnabled

Find examples in Playground
fogEnabled: boolean

Gets the value of the fog enabled state

forceDepthWrite

Find examples in Playground
forceDepthWrite: boolean

Specifies if depth writing should be forced

fovMultiplier

Find examples in Playground
fovMultiplier: number

The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out". Best used when trying to implement visual zoom effects like fish-eye or binoculars while not adjusting camera fov. Recommended to be keep at 1.0 except for special cases.

getRenderTargetTextures

Find examples in Playground
getRenderTargetTextures: function

Callback triggered to get the render target textures

hasRenderTargetTextures

Find examples in Playground
hasRenderTargetTextures: boolean

Gets a boolean indicating that current material needs to register RTT

id

Find examples in Playground
id: string

The ID of the material

imageProcessingConfiguration

Find examples in Playground
imageProcessingConfiguration: Nullable<ImageProcessingConfiguration>

Sets the Default image processing configuration used either in the this material.

If sets to null, the scene one is in use.

isFrozen

Find examples in Playground
isFrozen: boolean

Specifies if updates for the material been locked

maxSimultaneousLights

Find examples in Playground
maxSimultaneousLights: int

Number of Simultaneous lights allowed on the material.

name

Find examples in Playground
name: string

The name of the material

needDepthPrePass

Find examples in Playground
needDepthPrePass: boolean

Gets the depth pre-pass value

onBind

Find examples in Playground
onBind: function

Called during a bind event

Type declaration

onBindObservable

Find examples in Playground
onBindObservable: Observable<AbstractMesh>

An event triggered when the material is bound

onCompiled

Find examples in Playground
onCompiled: function

Callback triggered when the material is compiled

Type declaration

    • Parameters

      Returns void

onDispose

Find examples in Playground
onDispose: function

Called during a dispose event

Type declaration

    • (): void
    • Returns void

onDisposeObservable

Find examples in Playground
onDisposeObservable: Observable<Material>

An event triggered when the material is disposed

onError

Find examples in Playground
onError: function

Callback triggered when an error occurs

Type declaration

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

      • effect: Effect
      • errors: string

      Returns void

onUnBindObservable

Find examples in Playground
onUnBindObservable: Observable<Material>

An event triggered when the material is unbound

opacityFresnel

Find examples in Playground
opacityFresnel: boolean

This helps specifying that the material is falling off to the sky box at grazing angle. This helps ensuring a nice transition when the camera goes under the ground.

pointSize

Find examples in Playground
pointSize: number

Stores the size of points

pointsCloud

Find examples in Playground
pointsCloud: boolean

Sets the state of point cloud mode

primaryColor

Find examples in Playground
primaryColor: Color3

Key light Color (multiply against the environement texture)

primaryColorHighlightLevel

Find examples in Playground
primaryColorHighlightLevel: float

Defines the level of the highliights (highlight area of the reflection map) in order to help scaling the colors. The primary color is used at the level chosen to define what the white area would look.

primaryColorShadowLevel

Find examples in Playground
primaryColorShadowLevel: float

Defines the level of the shadows (dark area of the reflection map) in order to help scaling the colors. The color opposite to the primary color is used at the level chosen to define what the black area would look.

reflectionAmount

Find examples in Playground
reflectionAmount: number

This specifies the weight of the reflection against the background in case of reflection Fresnel.

reflectionBlur

Find examples in Playground
reflectionBlur: float

Reflection Texture level of blur.

Can be use to reuse an existing HDR Texture and target a specific LOD to prevent authoring the texture twice.

reflectionFalloffDistance

Find examples in Playground
reflectionFalloffDistance: number

This helps specifying the falloff radius off the reflection texture from the sceneCenter. This helps adding a nice falloff effect to the reflection if used as a mirror for instance.

reflectionFresnel

Find examples in Playground
reflectionFresnel: boolean

This helps specifying that the material is falling off from diffuse to the reflection texture at grazing angle. This helps adding a mirror texture on the ground.

reflectionReflectance0

Find examples in Playground
reflectionReflectance0: number

This specifies the weight of the reflection at grazing angle.

reflectionReflectance90

Find examples in Playground
reflectionReflectance90: number

This specifies the weight of the reflection at a perpendicular point of view.

reflectionStandardFresnelWeight

Find examples in Playground
reflectionStandardFresnelWeight: number

Sets the reflection reflectance fresnel values according to the default standard empirically know to work well :-)

reflectionTexture

Find examples in Playground
reflectionTexture: Nullable<BaseTexture>

Reflection Texture used in the material. Should be author in a specific way for the best result (refer to the documentation).

sceneCenter

Find examples in Playground
sceneCenter: Vector3

In case of opacity Fresnel or reflection falloff, this is use as a scene center. It is usually zero but might be interesting to modify according to your setup.

separateCullingPass

Find examples in Playground
separateCullingPass: boolean

Specifies if there should be a separate pass for culling

shadowLevel

Find examples in Playground
shadowLevel: float

Helps adjusting the shadow to a softer level if required. 0 means black shadows and 1 means no shadows.

shadowLights

Find examples in Playground
shadowLights: Nullable<IShadowLight[]>

Specify the list of lights casting shadow on the material. All scene shadow lights will be included if null.

sideOrientation

Find examples in Playground
sideOrientation: number

Stores the value for side orientation

state

Find examples in Playground
state: string

The state of the material

storeEffectOnSubMeshes

Find examples in Playground
storeEffectOnSubMeshes: boolean

Specifies if the effect should be stored on sub meshes

switchToBGR

Find examples in Playground
switchToBGR: boolean

Due to a bug in iOS10, video tags (which are using the background material) are in BGR and not RGB. Setting this flag to true (not done automatically!) will convert it back to RGB.

uniqueId

Find examples in Playground
uniqueId: number

Gets or sets the unique id of the material

useEquirectangularFOV

Find examples in Playground
useEquirectangularFOV: boolean

Enable the FOV adjustment feature controlled by fovMultiplier.

useRGBColor

Find examples in Playground
useRGBColor: boolean

Helps to directly use the maps channels instead of their level.

wireframe

Find examples in Playground
wireframe: boolean

Sets the state of wireframe mode

zOffset

Find examples in Playground
zOffset: number

Stores the z offset value

Static AllDirtyFlag

Find examples in Playground
AllDirtyFlag: number

The all dirty flag value

Static AttributesDirtyFlag

Find examples in Playground
AttributesDirtyFlag: number

The dirty attribute flag value

Static ClockWiseSideOrientation

Find examples in Playground
ClockWiseSideOrientation: number

Returns the clock-wise side orientation

Static CounterClockWiseSideOrientation

Find examples in Playground
CounterClockWiseSideOrientation: number

Returns the counter clock-wise side orientation

Static FresnelDirtyFlag

Find examples in Playground
FresnelDirtyFlag: number

The dirty fresnel flag value

Static LightDirtyFlag

Find examples in Playground
LightDirtyFlag: number

The dirty light flag value

Static LineListDrawMode

Find examples in Playground
LineListDrawMode: number

Returns the line list draw mode

Static LineLoopDrawMode

Find examples in Playground
LineLoopDrawMode: number

Returns the line loop draw mode

Static LineStripDrawMode

Find examples in Playground
LineStripDrawMode: number

Returns the line strip draw mode

Static MiscDirtyFlag

Find examples in Playground
MiscDirtyFlag: number

The dirty misc flag value

Static PointFillMode

Find examples in Playground
PointFillMode: number

Returns the point fill mode

Static PointListDrawMode

Find examples in Playground
PointListDrawMode: number

Returns the point list draw mode

Static StandardReflectance0

Find examples in Playground
StandardReflectance0: number

Standard reflectance value at parallel view angle.

Static StandardReflectance90

Find examples in Playground
StandardReflectance90: number

Standard reflectance value at grazing angle.

Static TextureDirtyFlag

Find examples in Playground
TextureDirtyFlag: number

The dirty texture flag value

Static TriangleFanDrawMode

Find examples in Playground
TriangleFanDrawMode: number

Returns the triangle fan draw mode

Static TriangleFillMode

Find examples in Playground
TriangleFillMode: number

Returns the triangle fill mode

Static TriangleStripDrawMode

Find examples in Playground
TriangleStripDrawMode: number

Returns the triangle strip draw mode

Static WireFrameFillMode

Find examples in Playground
WireFrameFillMode: number

Returns the wireframe mode

Methods

bind

Find examples in Playground
  • Parameters

    Returns void

bindForSubMesh

Find examples in Playground
  • Bind the material for a dedicated submeh (every used meshes will be considered opaque).

    Parameters

    • world: Matrix

      The world matrix to bind.

    • mesh: Mesh
    • subMesh: SubMesh

      The submesh to bind for.

    Returns void

bindOnlyNormalMatrix

Find examples in Playground
  • bindOnlyNormalMatrix(normalMatrix: Matrix): void
  • Binds the given normal matrix to the active effect

    Parameters

    • normalMatrix: Matrix

      the matrix to bind

    Returns void

bindOnlyWorldMatrix

Find examples in Playground
  • bindOnlyWorldMatrix(world: Matrix): void
  • Bind only the world matrix to the material.

    Parameters

    • world: Matrix

      The world matrix to bind.

    Returns void

bindSceneUniformBuffer

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • 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

Find examples in Playground
  • buildUniformLayout(): void
  • Build the uniform buffer used in the material.

    Returns void

clone

Find examples in Playground

dispose

Find examples in Playground
  • dispose(forceDisposeEffect?: boolean, forceDisposeTextures?: boolean): void
  • Dispose the material.

    Parameters

    • Optional forceDisposeEffect: boolean

      Force disposal of the associated effect.

    • Optional forceDisposeTextures: boolean

      Force disposal of the associated textures.

    Returns void

forceCompilation

Find examples in Playground
  • forceCompilation(mesh: AbstractMesh, onCompiled?: function, options?: Partial<object>): void
  • Force shader compilation

    Parameters

    • mesh: AbstractMesh

      defines the mesh associated with this material

    • Optional onCompiled: function

      defines a function to execute once the material is compiled

    • Optional options: Partial<object>

      defines the options to configure the compilation

    Returns void

forceCompilationAsync

Find examples in Playground
  • 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

Find examples in Playground
  • freeze(): void
  • Locks updates for the material

    Returns void

getActiveTextures

Find examples in Playground

getAlphaTestTexture

Find examples in Playground

getBindedMeshes

Find examples in Playground

getClassName

Find examples in Playground
  • getClassName(): string
  • Gets the class name of the material

    Returns string

    "BackgroundMaterial"

getEffect

Find examples in Playground

getScene

Find examples in Playground

hasTexture

Find examples in Playground
  • 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

isReady

Find examples in Playground
  • isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean
  • Parameters

    • Optional mesh: AbstractMesh
    • Optional useInstances: boolean

    Returns boolean

isReadyForSubMesh

Find examples in Playground
  • Checks wether the material is ready to be rendered for a given mesh.

    Parameters

    • mesh: AbstractMesh

      The mesh to render

    • subMesh: SubMesh

      The submesh to check against

    • Optional useInstances: boolean

      Specify wether or not the material is used with instances

    Returns boolean

    true if all the dependencies are ready (Textures, Effects...)

markAsDirty

Find examples in Playground
  • 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

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

    Returns void

needAlphaBlending

Find examples in Playground
  • needAlphaBlending(): boolean
  • The entire material has been created in order to prevent overdraw.

    Returns boolean

    true if blending is enable

needAlphaBlendingForMesh

Find examples in Playground
  • Specifies if the mesh will require alpha blending

    Parameters

    Returns boolean

    a boolean specifying if alpha blending is needed for the mesh

needAlphaTesting

Find examples in Playground
  • needAlphaTesting(): boolean
  • The entire material has been created in order to prevent overdraw.

    Returns boolean

    false

serialize

Find examples in Playground
  • serialize(): any
  • Serializes the current material to its JSON representation.

    Returns any

    The JSON representation.

toString

Find examples in Playground
  • 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

Find examples in Playground
  • unbind(): void

unfreeze

Find examples in Playground
  • unfreeze(): void
  • Unlocks updates for the material

    Returns void

Static Parse

Find examples in Playground
  • Parse a JSON input to create back a background material.

    Parameters

    • source: any

      The JSON data to parse

    • scene: Scene

      The scene to create the parsed material in

    • rootUrl: string

      The root url of the assets the material depends upon

    Returns BackgroundMaterial

    the instantiated BackgroundMaterial.

Static ParseMultiMaterial

Find examples in Playground
  • 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