Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CustomMaterial

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

CustomPartsSearch playground for CustomParts

CustomParts: ShaderSpecialParts

FragmentShaderSearch playground for FragmentShader

FragmentShader: string

VertexShaderSearch playground for VertexShader

VertexShader: string

_createdShaderNameSearch playground for _createdShaderName

_createdShaderName: string

_customAttributesSearch playground for _customAttributes

_customAttributes: string[]

_customUniformSearch playground for _customUniform

_customUniform: string[]

_isCreatedShaderSearch playground for _isCreatedShader

_isCreatedShader: boolean

_newSamplerInstancesSearch playground for _newSamplerInstances

_newSamplerInstances: {}

Type declaration

_newUniformInstancesSearch playground for _newUniformInstances

_newUniformInstances: {}

Type declaration

  • [name: string]: any

_newUniformsSearch playground for _newUniforms

_newUniforms: string[]

allowShaderHotSwappingSearch playground for allowShaderHotSwapping

allowShaderHotSwapping: boolean

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)

alphaCutOffSearch playground for alphaCutOff

alphaCutOff: number

Defines the alpha limits in alpha test mode.

ambientColorSearch playground for ambientColor

ambientColor: Color3

The color of the material lit by the environmental background lighting.

see

https://doc.babylonjs.com/babylon101/materials#ambient-color-example

ambientTextureSearch playground for ambientTexture

ambientTexture: Nullable<BaseTexture>

AKA Occlusion Texture in other nomenclature, it helps adding baked shadows into your material.

animationsSearch playground for animations

animations: Nullable<Array<Animation>>

Stores the animations for the material

bumpTextureSearch playground for bumpTexture

bumpTexture: Nullable<BaseTexture>

Bump mapping is a technique to simulate bump and dents on a rendered surface. These are made by creating a normal map from an image. The means to do this can be found on the web, a search for 'normal map generator' will bring up free and paid for methods of doing this.

see

https://doc.babylonjs.com/how_to/more_materials#bump-map

checkReadyOnEveryCallSearch playground for checkReadyOnEveryCall

checkReadyOnEveryCall: boolean

Specifies if the ready state should be checked on each call

checkReadyOnlyOnceSearch playground for checkReadyOnlyOnce

checkReadyOnlyOnce: boolean

Specifies if the ready state should be checked once

customShaderNameResolveSearch playground for customShaderNameResolve

customShaderNameResolve: (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: MaterialDefines | string[], attributes?: string[], options?: ICustomShaderNameResolveOptions) => string

Custom callback helping to override the default shader used in the material.

Type declaration

depthFunctionSearch playground for depthFunction

depthFunction: number

Specifies the depth function that should be used. 0 means the default engine function

Readonly detailMapSearch playground for detailMap

Defines the detail map parameters for the material.

diffuseColorSearch playground for diffuseColor

diffuseColor: Color3

The basic color of the material as viewed under a light.

diffuseFresnelParametersSearch playground for diffuseFresnelParameters

diffuseFresnelParameters: FresnelParameters

Define the diffuse fresnel parameters of the material.

see

https://doc.babylonjs.com/how_to/how_to_use_fresnelparameters

diffuseTextureSearch playground for diffuseTexture

diffuseTexture: Nullable<BaseTexture>

The basic texture of the material as viewed under a light.

disableColorWriteSearch playground for disableColorWrite

disableColorWrite: boolean

Specifies if color writing should be disabled

disableDepthWriteSearch playground for disableDepthWrite

disableDepthWrite: boolean

Specifies if depth writing should be disabled

disableLightingSearch playground for disableLighting

disableLighting: boolean

Does lights from the scene impacts this material. It can be a nice trick for performance to disable lighting on a fully emissive material.

doNotSerializeSearch playground for doNotSerialize

doNotSerialize: boolean

Specifies if the material should be serialized

emissiveColorSearch playground for emissiveColor

emissiveColor: Color3

Define the color of the material as if self lit. This will be mixed in the final result even in the absence of light.

emissiveFresnelParametersSearch playground for emissiveFresnelParameters

emissiveFresnelParameters: FresnelParameters

Define the emissive fresnel parameters of the material.

see

https://doc.babylonjs.com/how_to/how_to_use_fresnelparameters

emissiveTextureSearch playground for emissiveTexture

emissiveTexture: Nullable<BaseTexture>

Define texture of the material as if self lit. This will be mixed in the final result even in the absence of light.

forceDepthWriteSearch playground for forceDepthWrite

forceDepthWrite: boolean

Specifies if depth writing should be forced

getRenderTargetTexturesSearch playground for getRenderTargetTextures

getRenderTargetTextures: Nullable<() => SmartArray<RenderTargetTexture>>

Callback triggered to get the render target textures

idSearch playground for id

id: string

The ID of the material

indexOfRefractionSearch playground for indexOfRefraction

indexOfRefraction: number

In case of refraction, define the value of the index of refraction.

see

https://doc.babylonjs.com/how_to/reflect#how-to-obtain-reflections-and-refractions

inspectableCustomPropertiesSearch playground for inspectableCustomProperties

inspectableCustomProperties: IInspectable[]

List of inspectable custom properties (used by the Inspector)

see

https://doc.babylonjs.com/how_to/debug_layer#extensibility

invertNormalMapXSearch playground for invertNormalMapX

invertNormalMapX: boolean

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

invertNormalMapYSearch playground for invertNormalMapY

invertNormalMapY: boolean

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

invertRefractionYSearch playground for invertRefractionY

invertRefractionY: boolean

Invert the refraction texture alongside the y axis. It can be useful with procedural textures or probe for instance.

see

https://doc.babylonjs.com/how_to/reflect#how-to-obtain-reflections-and-refractions

lightmapTextureSearch playground for lightmapTexture

lightmapTexture: Nullable<BaseTexture>

Complex lighting can be computationally expensive to compute at runtime. To save on computation, lightmaps may be used to store calculated lighting in a texture which will be applied to a given mesh.

see

https://doc.babylonjs.com/babylon101/lights#lightmaps

linkEmissiveWithDiffuseSearch playground for linkEmissiveWithDiffuse

linkEmissiveWithDiffuse: boolean

If true, some kind of energy conservation will prevent the end result to be more than 1 by reducing the emissive level when the final color is close to one.

maxSimultaneousLightsSearch playground for maxSimultaneousLights

maxSimultaneousLights: number

Defines the maximum number of lights that can be used in the material

metadataSearch playground for metadata

metadata: any

Gets or sets user defined metadata

nameSearch playground for name

name: string

The name of the material

onCompiledSearch playground for onCompiled

onCompiled: Nullable<(effect: Effect) => void>

Callback triggered when the material is compiled

onDisposeObservableSearch playground for onDisposeObservable

onDisposeObservable: Observable<Material>

An event triggered when the material is disposed

onErrorSearch playground for onError

onError: Nullable<(effect: Effect, errors: string) => void>

Callback triggered when an error occurs

opacityFresnelParametersSearch playground for opacityFresnelParameters

opacityFresnelParameters: FresnelParameters

Define the opacity fresnel parameters of the material.

see

https://doc.babylonjs.com/how_to/how_to_use_fresnelparameters

opacityTextureSearch playground for opacityTexture

opacityTexture: Nullable<BaseTexture>

Define the transparency of the material from a texture. The final alpha value can be read either from the red channel (if texture.getAlphaFromRGB is false) or from the luminance or the current texel (if texture.getAlphaFromRGB is true)

parallaxScaleBiasSearch playground for parallaxScaleBias

parallaxScaleBias: number

Apply a scaling factor that determine which "depth" the height map should reprensent. A value between 0.05 and 0.1 is reasonnable in Parallax, you can reach 0.2 using Parallax Occlusion.

pointSizeSearch playground for pointSize

pointSize: number

Stores the size of points

Readonly prePassConfigurationSearch playground for prePassConfiguration

prePassConfiguration: PrePassConfiguration

Defines additionnal PrePass parameters for the material.

reflectionFresnelParametersSearch playground for reflectionFresnelParameters

reflectionFresnelParameters: FresnelParameters

Define the reflection fresnel parameters of the material.

see

https://doc.babylonjs.com/how_to/how_to_use_fresnelparameters

reflectionTextureSearch playground for reflectionTexture

reflectionTexture: Nullable<BaseTexture>

Define the texture used to display the reflection.

see

https://doc.babylonjs.com/how_to/reflect#how-to-obtain-reflections-and-refractions

refractionFresnelParametersSearch playground for refractionFresnelParameters

refractionFresnelParameters: FresnelParameters

Define the refraction fresnel parameters of the material.

see

https://doc.babylonjs.com/how_to/how_to_use_fresnelparameters

refractionTextureSearch playground for refractionTexture

refractionTexture: Nullable<BaseTexture>

Define the texture used to display the refraction.

see

https://doc.babylonjs.com/how_to/reflect#how-to-obtain-reflections-and-refractions

reservedDataStoreSearch playground for reservedDataStore

reservedDataStore: any

For internal use only. Please do not use.

roughnessSearch playground for roughness

roughness: number

Helps to define how blurry the reflections should appears in the material.

separateCullingPassSearch playground for separateCullingPass

separateCullingPass: boolean

Specifies if there should be a separate pass for culling

shadowDepthWrapperSearch playground for shadowDepthWrapper

shadowDepthWrapper: Nullable<ShadowDepthWrapper>

Custom shadow depth material to use for shadow rendering instead of the in-built one

sideOrientationSearch playground for sideOrientation

sideOrientation: number

Stores the value for side orientation

specularColorSearch playground for specularColor

specularColor: Color3

Define how the color and intensity of the highlight given by the light in the material.

specularPowerSearch playground for specularPower

specularPower: number

Defines how sharp are the highlights in the material. The bigger the value the sharper giving a more glossy feeling to the result. Reversely, the smaller the value the blurrier giving a more rough feeling to the result.

specularTextureSearch playground for specularTexture

specularTexture: Nullable<BaseTexture>

Define how the color and intensity of the highlight given by the light in the material.

stateSearch playground for state

state: string

The state of the material

twoSidedLightingSearch playground for twoSidedLighting

twoSidedLighting: boolean

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

uniqueIdSearch playground for uniqueId

uniqueId: number

Gets or sets the unique id of the material

useAlphaFromDiffuseTextureSearch playground for useAlphaFromDiffuseTexture

useAlphaFromDiffuseTexture: boolean

Does the transparency come from the diffuse texture alpha channel.

useEmissiveAsIlluminationSearch playground for useEmissiveAsIllumination

useEmissiveAsIllumination: boolean

If true, the emissive value is added into the end result, otherwise it is multiplied in.

useGlossinessFromSpecularMapAlphaSearch playground for useGlossinessFromSpecularMapAlpha

useGlossinessFromSpecularMapAlpha: boolean

Defines if the glossiness/roughness of the material should be read from the specular map alpha channel

useLightmapAsShadowmapSearch playground for useLightmapAsShadowmap

useLightmapAsShadowmap: boolean

In case of light mapping, define whether the map contains light or shadow informations.

useObjectSpaceNormalMapSearch playground for useObjectSpaceNormalMap

useObjectSpaceNormalMap: boolean

Allows using an object space normal map (instead of tangent space).

useParallaxSearch playground for useParallax

useParallax: boolean

useParallaxOcclusionSearch playground for useParallaxOcclusion

useParallaxOcclusion: boolean

Is parallax occlusion enabled or not. If true, the outcome is way more realistic than traditional Parallax but you can expect a performance hit that worthes consideration.

see

https://doc.babylonjs.com/how_to/using_parallax_mapping

useReflectionFresnelFromSpecularSearch playground for useReflectionFresnelFromSpecular

useReflectionFresnelFromSpecular: boolean

If true automatically deducts the fresnels values from the material specularity.

see

https://doc.babylonjs.com/how_to/how_to_use_fresnelparameters

useReflectionOverAlphaSearch playground for useReflectionOverAlpha

useReflectionOverAlpha: boolean

Specifies that the material will keeps the reflection highlights over a transparent surface (only the most limunous ones). A car glass is a good exemple of that. When the street lights reflects on it you can not see what is behind.

useSpecularOverAlphaSearch playground for useSpecularOverAlpha

useSpecularOverAlpha: boolean

Specifies that the material will keep the specular highlights over a transparent surface (only the most limunous ones). A car glass is a good exemple of that. When sun reflects on it you can not see what is behind.

zOffsetSearch playground for zOffset

zOffset: number

Stores the z offset value

Static Readonly AllDirtyFlagSearch playground for AllDirtyFlag

AllDirtyFlag: number

The all dirty flag value

Static Readonly AttributesDirtyFlagSearch playground for AttributesDirtyFlag

AttributesDirtyFlag: number

The dirty attribute flag value

Static Readonly ClockWiseSideOrientationSearch playground for ClockWiseSideOrientation

ClockWiseSideOrientation: number

Stores the clock-wise side orientation

Static Readonly CounterClockWiseSideOrientationSearch playground for CounterClockWiseSideOrientation

CounterClockWiseSideOrientation: number

Stores the counter clock-wise side orientation

Static Readonly FresnelDirtyFlagSearch playground for FresnelDirtyFlag

FresnelDirtyFlag: number

The dirty fresnel flag value

Static Readonly LightDirtyFlagSearch playground for LightDirtyFlag

LightDirtyFlag: number

The dirty light flag value

Static Readonly LineListDrawModeSearch playground for LineListDrawMode

LineListDrawMode: number

Returns the line list draw mode

Static Readonly LineLoopDrawModeSearch playground for LineLoopDrawMode

LineLoopDrawMode: number

Returns the line loop draw mode

Static Readonly LineStripDrawModeSearch playground for LineStripDrawMode

LineStripDrawMode: number

Returns the line strip draw mode

Static Readonly MATERIAL_ALPHABLENDSearch playground for MATERIAL_ALPHABLEND

MATERIAL_ALPHABLEND: number

MaterialTransparencyMode: Pixels are blended (according to the alpha mode) with the already drawn pixels in the current frame buffer.

Static Readonly MATERIAL_ALPHATESTSearch playground for MATERIAL_ALPHATEST

MATERIAL_ALPHATEST: number

MaterialTransparencyMode: Alpha Test mode, pixel are discarded below a certain threshold defined by the alpha cutoff value.

Static Readonly MATERIAL_ALPHATESTANDBLENDSearch playground for MATERIAL_ALPHATESTANDBLEND

MATERIAL_ALPHATESTANDBLEND: number

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_NORMALBLENDMETHOD_RNMSearch playground for MATERIAL_NORMALBLENDMETHOD_RNM

MATERIAL_NORMALBLENDMETHOD_RNM: number

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_NORMALBLENDMETHOD_WHITEOUTSearch playground for MATERIAL_NORMALBLENDMETHOD_WHITEOUT

MATERIAL_NORMALBLENDMETHOD_WHITEOUT: number

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_OPAQUESearch playground for MATERIAL_OPAQUE

MATERIAL_OPAQUE: number

MaterialTransparencyMode: No transparency mode, Alpha channel is not use.

Static Readonly MiscDirtyFlagSearch playground for MiscDirtyFlag

MiscDirtyFlag: number

The dirty misc flag value

Static Readonly PointFillModeSearch playground for PointFillMode

PointFillMode: number

Returns the point fill mode

Static Readonly PointListDrawModeSearch playground for PointListDrawMode

PointListDrawMode: number

Returns the point list draw mode

Static Readonly PrePassDirtyFlagSearch playground for PrePassDirtyFlag

PrePassDirtyFlag: number

The dirty prepass flag value

Static ShaderIndexerSearch playground for ShaderIndexer

ShaderIndexer: number

Static Readonly TextureDirtyFlagSearch playground for TextureDirtyFlag

TextureDirtyFlag: number

The dirty texture flag value

Static Readonly TriangleFanDrawModeSearch playground for TriangleFanDrawMode

TriangleFanDrawMode: number

Returns the triangle fan draw mode

Static Readonly TriangleFillModeSearch playground for TriangleFillMode

TriangleFillMode: number

Returns the triangle fill mode

Static Readonly TriangleStripDrawModeSearch playground for TriangleStripDrawMode

TriangleStripDrawMode: number

Returns the triangle strip draw mode

Static Readonly WireFrameFillModeSearch playground for WireFrameFillMode

WireFrameFillMode: number

Returns the wireframe mode

Accessors

alpha

  • get alpha(): number
  • set alpha(value: number): any
  • Gets the alpha value of the material

    Returns number

  • Sets the alpha value of the material

    Parameters

    • value: number

    Returns any

alphaMode

  • get alphaMode(): number
  • set alphaMode(value: number): any
  • Gets 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

    Returns 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

    Parameters

    • value: number

    Returns any

backFaceCulling

  • get backFaceCulling(): boolean
  • set backFaceCulling(value: boolean): any
  • Gets the back-face culling state

    Returns boolean

  • Sets the back-face culling state

    Parameters

    • value: boolean

    Returns any

cameraColorCurves

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

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

    Parameters

    Returns any

cameraColorCurvesEnabled

  • get cameraColorCurvesEnabled(): boolean
  • set cameraColorCurvesEnabled(value: boolean): any

cameraColorGradingEnabled

  • get cameraColorGradingEnabled(): boolean
  • set cameraColorGradingEnabled(value: boolean): any

cameraColorGradingTexture

cameraContrast

  • get cameraContrast(): number
  • set cameraContrast(value: number): any
  • Gets The camera contrast used on this material.

    Returns number

  • Sets The camera contrast used on this material.

    Parameters

    • value: number

    Returns any

cameraExposure

  • get cameraExposure(): number
  • set cameraExposure(value: number): any
  • 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.

    Returns number

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

    Parameters

    • value: number

    Returns any

cameraToneMappingEnabled

  • get cameraToneMappingEnabled(): boolean
  • set cameraToneMappingEnabled(value: boolean): any

canRenderToMRT

  • get canRenderToMRT(): boolean
  • Can this material render to several textures at once

    Returns boolean

fillMode

  • get fillMode(): number
  • set fillMode(value: number): any
  • Gets the material fill mode

    Returns number

  • Sets the material fill mode

    Parameters

    • value: number

    Returns any

fogEnabled

  • get fogEnabled(): boolean
  • set fogEnabled(value: boolean): any
  • Gets the value of the fog enabled state

    Returns boolean

  • Sets the state for enabling fog

    Parameters

    • value: boolean

    Returns any

hasRenderTargetTextures

  • get hasRenderTargetTextures(): boolean
  • Gets a boolean indicating that current material needs to register RTT

    Returns boolean

imageProcessingConfiguration

isFrozen

  • get isFrozen(): boolean
  • Specifies if updates for the material been locked

    Returns boolean

needDepthPrePass

  • get needDepthPrePass(): boolean
  • set needDepthPrePass(value: boolean): any
  • Gets the depth pre-pass value

    Returns boolean

  • Sets the need depth pre-pass value

    Parameters

    • value: boolean

    Returns any

onBind

  • Called during a bind event

    Parameters

    Returns any

onBindObservable

  • An event triggered when the material is bound

    Returns Observable<AbstractMesh>

onDispose

  • set onDispose(callback: () => void): any
  • Called during a dispose event

    Parameters

    • callback: () => void
        • (): void
        • Returns void

    Returns any

onEffectCreatedObservable

  • An event triggered when the effect is (re)created

    Returns Observable<{ effect: Effect; subMesh: Nullable<SubMesh> }>

onUnBindObservable

  • An event triggered when the material is unbound

    Returns Observable<Material>

pointsCloud

  • get pointsCloud(): boolean
  • set pointsCloud(value: boolean): any
  • Gets the value specifying if point clouds are enabled

    Returns boolean

  • Sets the state of point cloud mode

    Parameters

    • value: boolean

    Returns any

transparencyMode

  • get transparencyMode(): Nullable<number>
  • set transparencyMode(value: Nullable<number>): any
  • Gets the current transparency mode.

    Value Type Description
    0 OPAQUE
    1 ALPHATEST
    2 ALPHABLEND
    3 ALPHATESTANDBLEND

    Returns Nullable<number>

  • Sets the transparency mode of the material.

    Value Type Description
    0 OPAQUE
    1 ALPHATEST
    2 ALPHABLEND
    3 ALPHATESTANDBLEND

    Parameters

    Returns any

useLogarithmicDepth

  • get useLogarithmicDepth(): boolean
  • set useLogarithmicDepth(value: boolean): any

wireframe

  • get wireframe(): boolean
  • set wireframe(value: boolean): any
  • Sets the state of wireframe mode

    Returns boolean

  • Sets the state of wireframe mode

    Parameters

    • value: boolean

    Returns any

Static AmbientTextureEnabled

  • get AmbientTextureEnabled(): boolean
  • set AmbientTextureEnabled(value: boolean): any

Static BumpTextureEnabled

  • get BumpTextureEnabled(): boolean
  • set BumpTextureEnabled(value: boolean): any

Static ColorGradingTextureEnabled

  • get ColorGradingTextureEnabled(): boolean
  • set ColorGradingTextureEnabled(value: boolean): any

Static DetailTextureEnabled

  • get DetailTextureEnabled(): boolean
  • set DetailTextureEnabled(value: boolean): any

Static DiffuseTextureEnabled

  • get DiffuseTextureEnabled(): boolean
  • set DiffuseTextureEnabled(value: boolean): any

Static EmissiveTextureEnabled

  • get EmissiveTextureEnabled(): boolean
  • set EmissiveTextureEnabled(value: boolean): any

Static FresnelEnabled

  • get FresnelEnabled(): boolean
  • set FresnelEnabled(value: boolean): any
  • Are fresnels enabled in the application.

    Returns boolean

  • Are fresnels enabled in the application.

    Parameters

    • value: boolean

    Returns any

Static LightmapTextureEnabled

  • get LightmapTextureEnabled(): boolean
  • set LightmapTextureEnabled(value: boolean): any

Static OpacityTextureEnabled

  • get OpacityTextureEnabled(): boolean
  • set OpacityTextureEnabled(value: boolean): any

Static ReflectionTextureEnabled

  • get ReflectionTextureEnabled(): boolean
  • set ReflectionTextureEnabled(value: boolean): any

Static RefractionTextureEnabled

  • get RefractionTextureEnabled(): boolean
  • set RefractionTextureEnabled(value: boolean): any

Static SpecularTextureEnabled

  • get SpecularTextureEnabled(): boolean
  • set SpecularTextureEnabled(value: boolean): any

Methods

AddAttributeSearch playground for AddAttribute

  • Parameters

    • name: string

    Returns CustomMaterial

AddUniformSearch playground for AddUniform

  • Parameters

    • name: string
    • kind: string
    • param: any

    Returns CustomMaterial

AttachAfterBindSearch playground for AttachAfterBind

  • AttachAfterBind(mesh: Mesh, effect: Effect): void
  • Parameters

    Returns void

BuilderSearch playground for Builder

  • Builder(shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: MaterialDefines | string[], attributes?: string[]): string
  • Parameters

    • shaderName: string
    • uniforms: string[]
    • uniformBuffers: string[]
    • samplers: string[]
    • defines: MaterialDefines | string[]
    • Optional attributes: string[]

    Returns string

Fragment_Before_FogSearch playground for Fragment_Before_Fog

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Fragment_Before_FragColorSearch playground for Fragment_Before_FragColor

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Fragment_Before_LightsSearch playground for Fragment_Before_Lights

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Fragment_BeginSearch playground for Fragment_Begin

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Fragment_Custom_AlphaSearch playground for Fragment_Custom_Alpha

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Fragment_Custom_DiffuseSearch playground for Fragment_Custom_Diffuse

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Fragment_DefinitionsSearch playground for Fragment_Definitions

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Fragment_MainBeginSearch playground for Fragment_MainBegin

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

ReviewUniformSearch playground for ReviewUniform

  • ReviewUniform(name: string, arr: string[]): string[]
  • Parameters

    • name: string
    • arr: string[]

    Returns string[]

Vertex_After_WorldPosComputedSearch playground for Vertex_After_WorldPosComputed

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Vertex_Before_NormalUpdatedSearch playground for Vertex_Before_NormalUpdated

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Vertex_Before_PositionUpdatedSearch playground for Vertex_Before_PositionUpdated

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Vertex_BeginSearch playground for Vertex_Begin

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Vertex_DefinitionsSearch playground for Vertex_Definitions

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Vertex_MainBeginSearch playground for Vertex_MainBegin

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

Vertex_MainEndSearch playground for Vertex_MainEnd

  • Parameters

    • shaderPart: string

    Returns CustomMaterial

bindSearch playground for bind

  • Parameters

    Returns void

bindForSubMeshSearch playground for bindForSubMesh

  • Binds the submesh to this material by preparing the effect and shader to draw

    Parameters

    • world: Matrix

      defines the world transformation matrix

    • mesh: Mesh

      defines the mesh containing the submesh

    • subMesh: SubMesh

      defines the submesh to bind the material to

    Returns void

bindOnlyNormalMatrixSearch playground for bindOnlyNormalMatrix

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

    Parameters

    • normalMatrix: Matrix

      the matrix to bind

    Returns void

bindOnlyWorldMatrixSearch playground for bindOnlyWorldMatrix

  • bindOnlyWorldMatrix(world: Matrix): void
  • Binds the given world matrix to the active effect

    Parameters

    • world: Matrix

      the matrix to bind

    Returns void

bindSceneUniformBufferSearch playground for 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

bindViewSearch playground for 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

bindViewProjectionSearch playground for 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

buildUniformLayoutSearch playground for buildUniformLayout

  • buildUniformLayout(): void
  • Builds the material UBO layouts. Used internally during the effect preparation.

    Returns void

cloneSearch playground for 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 StandardMaterial

    the cloned material

disposeSearch playground for dispose

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

    Parameters

    • Optional forceDisposeEffect: boolean

      specifies if effects should be forcefully disposed

    • Optional forceDisposeTextures: boolean

      specifies if textures should be forcefully disposed

    Returns void

forceCompilationSearch playground for forceCompilation

  • Force shader compilation

    Parameters

    • mesh: AbstractMesh

      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

        • (reason: string): void
        • Parameters

          • reason: string

          Returns void

    Returns void

forceCompilationAsyncSearch playground for forceCompilationAsync

  • Force shader compilation

    Parameters

    Returns Promise<void>

    a promise that resolves when the compilation completes

freezeSearch playground for freeze

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

    Returns void

getActiveTexturesSearch playground for getActiveTextures

getAlphaTestTextureSearch playground for getAlphaTestTexture

getAnimatablesSearch playground for getAnimatables

  • Get the list of animatables in the material.

    Returns IAnimatable[]

    the list of animatables object used in the material

getBindedMeshesSearch playground for getBindedMeshes

  • Gets the meshes bound to the material

    Returns AbstractMesh[]

    an array of meshes bound to the material

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Gets the current class name of the material e.g. "StandardMaterial" Mainly use in serialization.

    Returns string

    the class name

getEffectSearch playground for getEffect

getSceneSearch playground for getScene

  • Returns the current scene

    Returns Scene

    a Scene

hasTextureSearch playground for 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

isReadySearch playground for isReady

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

    • Optional mesh: AbstractMesh
    • Optional useInstances: boolean

    Returns boolean

isReadyForSubMeshSearch playground for isReadyForSubMesh

  • Get if the submesh is ready to be used and all its information available. Child classes can use it to update shaders

    Parameters

    • mesh: AbstractMesh

      defines the mesh to check

    • subMesh: SubMesh

      defines which submesh to check

    • Optional useInstances: boolean

      specifies that instances should be used

    Returns boolean

    a boolean indicating that the submesh is ready or not

markAsDirtySearch playground for 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

markDirtySearch playground for markDirty

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

    Returns void

needAlphaBlendingSearch playground for needAlphaBlending

  • needAlphaBlending(): boolean
  • Specifies if the material will require alpha blending

    Returns boolean

    a boolean specifying if alpha blending is needed

needAlphaBlendingForMeshSearch playground for needAlphaBlendingForMesh

  • Specifies if the mesh will require alpha blending

    Parameters

    Returns boolean

    a boolean specifying if alpha blending is needed for the mesh

needAlphaTestingSearch playground for needAlphaTesting

  • needAlphaTesting(): boolean
  • Specifies if this material should be rendered in alpha test mode

    Returns boolean

    a boolean specifying if an alpha test is needed.

serializeSearch playground for serialize

  • serialize(): any
  • Serializes this material in a JSON representation

    Returns any

    the serialized material object

setPrePassRendererSearch playground for setPrePassRenderer

  • Sets the required values to the prepass renderer.

    Parameters

    Returns boolean

    true if the pre pass is needed.

toStringSearch playground for 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

unbindSearch playground for unbind

  • unbind(): void
  • Unbinds the material from the mesh

    Returns void

unfreezeSearch playground for unfreeze

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

    Returns void

Static ParseSearch playground for Parse

  • Creates a standard material from parsed material data

    Parameters

    • source: any

      defines the JSON representation of the material

    • scene: Scene

      defines the hosting scene

    • rootUrl: string

      defines the root URL to use to load textures and relative dependencies

    Returns StandardMaterial

    a new standard material

Legend

  • Constructor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Static property
  • Static method