CLASSES
TagsA - Z

BackgroundMaterial

Description

class BackgroundMaterial extends BABYLON.PushMaterial

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

Constructor

new BackgroundMaterial(name, scene)

constructor

Parameters

Name Type Description
name string The name of the material
scene undefined The scene to add the material to

Members

static standardReflectance0 : number

Standard reflectance value at parallel view angle.

static standardReflectance90 : number

Standard reflectance value at grazing angle.

primaryColor : Color3

primaryLevel : float

secondaryColor : Color3

secondaryLevel : float

tertiaryColor : Color3

tertiaryLevel : float

reflectionTexture : Nullable<BaseTexture>

reflectionBlur : float

diffuseTexture : Nullable<BaseTexture>

shadowLights : Nullable<IShadowLight[]>

shadowBlurScale : int

shadowLevel : float

sceneCenter : Vector3

opacityFresnel : boolean

reflectionFresnel : boolean

reflectionFalloffDistance : number

reflectionAmount : number

reflectionReflectance0 : number

reflectionReflectance90 : number

reflectionStandardFresnelWeight : number

Sets the reflection reflectance fresnel values according to the default standard

empirically know to work well :-)

useRGBColor : boolean

enableNoise : boolean

maxSimultaneousLights : int

imageProcessingConfiguration : Nullable<ImageProcessingConfiguration>

Gets the image processing configuration used either in this material.

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

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

cameraColorCurvesEnabled : boolean

Gets wether the color curves effect is enabled.

Sets wether the color curves effect is enabled.

cameraColorGradingEnabled : boolean

Gets wether the color grading effect is enabled.

Gets wether the color grading effect is enabled.

cameraToneMappingEnabled : boolean

Gets wether tonemapping is enabled or not.

Sets wether tonemapping is enabled or not

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.

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.

cameraContrast : float

Gets The camera contrast used on this material.

Sets The camera contrast used on this material.

cameraColorGradingTexture : Nullable<BaseTexture>

Gets the Color Grading 2D Lookup Texture.

Sets the Color Grading 2D Lookup Texture.

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.

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.

Methods

needAlphaTesting() boolean

The entire material has been created in order to prevent overdraw.

@returns false

needAlphaBlending() boolean

The entire material has been created in order to prevent overdraw.

@returns true if blending is enable

isReadyForSubMesh(mesh, subMesh, useInstances) boolean

Checks wether the material is ready to be rendered for a given mesh.

Parameters

Name Type Description
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

buildUniformLayout() void

Build the uniform buffer used in the material.

unbind() void

Unbind the material.

bindOnlyWorldMatrix(world) void

Bind only the world matrix to the material.

Parameters

Name Type Description
world Matrix The world matrix to bind.

bindForSubMesh(world, mesh, subMesh) void

Bind the material for a dedicated submeh (every used meshes will be considered opaque).

Parameters

Name Type Description
world Matrix The world matrix to bind.
mesh Mesh
subMesh SubMesh The submesh to bind for.

dispose(forceDisposeEffect, forceDisposeTextures) void

Dispose the material.

@forceDisposeEffect Force disposal of the associated effect.

@forceDisposeTextures Force disposal of the associated textures.

Parameters

Name Type Description
optional forceDisposeEffect boolean
optional forceDisposeTextures boolean

clone(name) BackgroundMaterial

Clones the material.

@name The cloned name.

@returns The cloned material.

Parameters

Name Type Description
name string

serialize() any

Serializes the current material to its JSON representation.

@returns The JSON representation.

getClassName() string

Gets the class name of the material

@returns "BackgroundMaterial"

static Parse(source, scene, rootUrl) BackgroundMaterial

Parse a JSON input to create back a background material.

@returns the instantiated BackgroundMaterial.

Parameters

Name Type Description
source any
scene Scene
rootUrl string