Instantiates a Background Material in the given scene
The friendly name of the material
Optional
scene: SceneThe scene to add the material to
Gets or sets a boolean indicating that the material is allowed (if supported) to do shader hot swapping. This means that the material can keep using a previous shader while a new one is being compiled. This is mostly used when shader parallel compilation is supported (true by default)
Stores the animations for the material
Specifies if the ready state should be checked on each call
Specifies if the ready state should be checked once
Gets or sets the active clipplane 1
Gets or sets the active clipplane 2
Gets or sets the active clipplane 3
Gets or sets the active clipplane 4
Gets or sets the active clipplane 5
Gets or sets the active clipplane 6
Custom callback helping to override the default shader used in the material.
Optional
attributes: string[]Optional
options: ICustomShaderNameResolveOptionsSpecifies the depth function that should be used. 0 means the default engine function
Diffuse Texture used in the material. Should be author in a specific way for the best result (refer to the documentation).
Specifies if color writing should be disabled
Specifies if depth writing should be disabled
Specifies if the material should be serialized
Enables the ground projection mode on the material.
https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
This helps reducing the banding effect that could occur on the background.
Specifies if depth writing should be forced
Callback triggered to get the render target textures
The ID of the material
List of inspectable custom properties (used by the Inspector)
https://doc.babylonjs.com/toolsAndResources/inspector#extensibility
Number of Simultaneous lights allowed on the material.
Gets or sets user defined metadata
The name of the material
Callback triggered when the material is compiled
An event triggered when the material is disposed
Callback triggered when an error occurs
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.
Optional
pluginPlugin manager for this material
Stores the size of points
Key light Color (multiply against the environment texture)
Defines the height of the projected ground if enableGroundProjection is true.
https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
Defines the radius of the projected ground if enableGroundProjection is true.
https://doc.babylonjs.com/features/featuresDeepDive/environment/skybox#ground-projection
This specifies the weight of the reflection against the background in case of reflection Fresnel.
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.
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.
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.
This specifies the weight of the reflection at grazing angle.
This specifies the weight of the reflection at a perpendicular point of view.
Reflection Texture used in the material. Should be author in a specific way for the best result (refer to the documentation).
For internal use only. Please do not use.
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.
Specifies if there should be a separate pass for culling
Custom shadow depth material to use for shadow rendering instead of the in-built one
Helps adjusting the shadow to a softer level if required. 0 means black shadows and 1 means no shadows.
Specify the list of lights casting shadow on the material. All scene shadow lights will be included if null.
Make the material only render shadows
Stores the value for side orientation
The state of the material
Readonly
stencilGives access to the stencil properties of the material
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.
Gets or sets the unique id of the material
Enable the FOV adjustment feature controlled by fovMultiplier.
Helps to directly use the maps channels instead of their level.
Stores the z offset Factor value
Stores the z offset Units value
Static
Readonly
AllThe all dirty flag value
Static
Readonly
AttributesThe dirty attribute flag value
Static
Readonly
ClockStores the clock-wise side orientation
Static
Readonly
CounterStores the counter clock-wise side orientation
Static
Readonly
FresnelThe dirty fresnel flag value
Static
Readonly
LightThe dirty light flag value
Static
Readonly
LineReturns the line list draw mode
Static
Readonly
LineReturns the line loop draw mode
Static
Readonly
LineReturns the line strip draw mode
Static
Readonly
MATERIAL_MaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.
Static
Readonly
MATERIAL_MaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.
Static
Readonly
MATERIAL_MaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer. They are also discarded below the alpha cutoff threshold to improve performances.
Static
Readonly
MATERIAL_The Reoriented Normal Mapping method is used to blend normals. Details of the algorithm can be found here: https://blog.selfshadow.com/publications/blending-in-detail/
Static
Readonly
MATERIAL_The Whiteout method is used to blend normals. Details of the algorithm can be found here: https://blog.selfshadow.com/publications/blending-in-detail/
Static
Readonly
MATERIAL_MaterialTransparencyMode: No transparency mode, Alpha channel is not use.
Static
Readonly
MiscThe dirty misc flag value
Static
OnEvent observable which raises global events common to all materials (like MaterialPluginEvent.Created)
Static
Readonly
PointReturns the point fill mode
Static
Readonly
PointReturns the point list draw mode
Static
Readonly
PreThe dirty prepass flag value
Static
StandardStandard reflectance value at parallel view angle.
Static
StandardStandard reflectance value at grazing angle.
Static
Readonly
TextureThe dirty texture flag value
Static
Readonly
TriangleReturns the triangle fan draw mode
Static
Readonly
TriangleReturns the triangle fill mode
Static
Readonly
TriangleReturns the triangle strip draw mode
Static
Readonly
WireReturns the wireframe mode
Experimental Internal Use Only.
Key light Color in "perceptual value" meaning the color you would like to see on screen. This acts as a helper to set the primary color to a more "human friendly" value. Conversion to linear space as well as exposure and tone mapping correction will be applied to keep the output color as close as possible from the chosen value. (This does not account for contrast color grading and color curves as they are considered post effect and not directly part of lighting setup.)
Gets the alpha value of the material
Sets the alpha value of the material
Gets the value of the alpha mode
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 |
Gets the culling state
Sets the culling state (true to enable culling, false to disable)
Block the dirty-mechanism for this specific material When set to false after being true the material will be marked as dirty.
The color grading curves provide additional color adjustment 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 adjustment 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.
Gets whether the color curves effect is enabled.
Sets whether the color curves effect is enabled.
Gets whether the color grading effect is enabled.
Gets whether the color grading effect is enabled.
Gets the Color Grading 2D Lookup Texture.
Sets the Color Grading 2D Lookup Texture.
Gets The camera contrast used on this material.
Sets The camera contrast used on this material.
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.
Gets whether tonemapping is enabled or not.
Sets whether tonemapping is enabled or not
If the material can be rendered to several textures with MRT extension
Gets the type of faces that should be culled
Sets the type of faces that should be culled (true for back faces, false for front faces)
Gets the material fill mode
Sets the material fill mode
Gets the value of the fog enabled state
Sets the state for enabling fog
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.
Gets a boolean indicating that current material needs to register RTT
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.
Specifies if updates for the material been locked
Can this material render to prepass
Gets the depth pre-pass value
Sets the need depth pre-pass value
Called during a bind event
An event triggered when the material is bound
Called during a dispose event
An event triggered when the effect is (re)created
Gets the value specifying if point clouds are enabled
Sets the state of point cloud mode
Defines the level of the highlights (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.
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.
Sets the reflection reflectance fresnel values according to the default standard empirically know to work well :-)
Gets the current transparency mode.
Sets the transparency mode of the material.
Value | Type | Description |
---|---|---|
0 | OPAQUE | |
1 | ALPHATEST | |
2 | ALPHABLEND | |
3 | ALPHATESTANDBLEND |
Sets the state of wireframe mode
This allows you to modify the material without marking it as dirty after every change. This function should be used if you need to make more than one dirty-enabling change to the material - adding a texture, setting a new fill mode and so on. The callback will pass the material as an argument, so you can make your changes to it.
the callback to be executed that will update the material
Clones the material.
The cloned material.
The cloned name.
Force shader compilation
defines the mesh associated with this material
Optional
onCompiled: ((material: Material) => void)defines a function to execute once the material is compiled
Optional
options: Partial<IMaterialCompilationOptions>defines the options to configure the compilation
Optional
onError: ((reason: string) => void)defines a function to execute if the material fails compiling
Force shader compilation
a promise that resolves when the compilation completes
defines the mesh that will use this material
Optional
options: Partial<IMaterialCompilationOptions>defines additional options for compiling the shaders
Gets the meshes bound to the material
an array of meshes bound to the material
Optional
mesh: AbstractMeshOptional
useInstances: booleanChecks whether the material is ready to be rendered for a given mesh.
true if all the dependencies are ready (Textures, Effects...)
The mesh to render
The submesh to check against
Optional
useInstances: booleanSpecify wether or not the material is used with instances
Marks the material to indicate that it needs to be re-calculated
Optional
forceMaterialDirty: booleanForces the material to be marked as dirty for all components (same as this.markAsDirty(Material.AllDirtyFlag)). You should use this flag if the material is frozen and you want to force a recompilation.
Specifies if the mesh will require alpha blending
a boolean specifying if alpha blending is needed for the mesh
defines the mesh to check
Static
ParseParse a JSON input to create back a background material.
the instantiated BackgroundMaterial.
The JSON data to parse
The scene to create the parsed material in
The root url of the assets the material depends upon
Generated using TypeDoc
Background material used to create an efficient environment around your scene.