StandardMaterial

Material

Description

class StandardMaterial extends PushMaterial

Constructor

new StandardMaterial(name, scene)

Parameters

Name Type Description
name string
scene Scene

Members

diffuseTexture : Nullable<BaseTexture>

ambientTexture : Nullable<BaseTexture>

opacityTexture : Nullable<BaseTexture>

reflectionTexture : Nullable<BaseTexture>

emissiveTexture : Nullable<BaseTexture>

specularTexture : Nullable<BaseTexture>

bumpTexture : Nullable<BaseTexture>

lightmapTexture : Nullable<BaseTexture>

refractionTexture : Nullable<BaseTexture>

ambientColor : Color3

diffuseColor : Color3

specularColor : Color3

emissiveColor : Color3

specularPower : number

useAlphaFromDiffuseTexture : boolean

useEmissiveAsIllumination : boolean

linkEmissiveWithDiffuse : boolean

useSpecularOverAlpha : boolean

useReflectionOverAlpha : boolean

disableLighting : boolean

useParallax : boolean

useParallaxOcclusion : boolean

parallaxScaleBias : number

roughness : number

indexOfRefraction : number

invertRefractionY : boolean

useLightmapAsShadowmap : boolean

diffuseFresnelParameters : FresnelParameters

opacityFresnelParameters : FresnelParameters

reflectionFresnelParameters : FresnelParameters

refractionFresnelParameters : FresnelParameters

emissiveFresnelParameters : FresnelParameters

useReflectionFresnelFromSpecular : boolean

useGlossinessFromSpecularMapAlpha : boolean

maxSimultaneousLights : number

invertNormalMapX : boolean

invertNormalMapY : boolean

twoSidedLighting : boolean

imageProcessingConfiguration : 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 : 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.

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

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.

customShaderNameResolve : (shaderName: string, uniforms: string[], uniformBuffers: string[], samplers: string[], defines: StandardMaterialDefines) => string

Parameters

Name Type Description
shaderName string
uniforms string[]
uniformBuffers string[]
samplers string[]

useLogarithmicDepth : boolean

static DiffuseTextureEnabled : boolean

static AmbientTextureEnabled : boolean

static OpacityTextureEnabled : boolean

static ReflectionTextureEnabled : boolean

static EmissiveTextureEnabled : boolean

static SpecularTextureEnabled : boolean

static BumpTextureEnabled : boolean

static LightmapTextureEnabled : boolean

static RefractionTextureEnabled : boolean

static ColorGradingTextureEnabled : boolean

static FresnelEnabled : boolean

Methods

getClassName() string

needAlphaBlending() boolean

needAlphaTesting() boolean

getAlphaTestTexture() Nullable<BaseTexture>

isReadyForSubMesh(mesh, subMesh, useInstances) boolean

Child classes can use it to update shaders

Parameters

Name Type Description
mesh AbstractMesh
subMesh SubMesh
optional useInstances boolean

buildUniformLayout() void

unbind() void

bindForSubMesh(world, mesh, subMesh) void

Parameters

Name Type Description
world Matrix
mesh Mesh
subMesh SubMesh

getAnimatables() IAnimatable[]

getActiveTextures() BaseTexture[]

hasTexture(texture) boolean

Parameters

Name Type Description
texture BaseTexture

dispose(forceDisposeEffect, forceDisposeTextures) void

Parameters

Name Type Description
optional forceDisposeEffect boolean
optional forceDisposeTextures boolean

clone(name) StandardMaterial

Parameters

Name Type Description
name string

serialize() any

static Parse(source, scene, rootUrl) StandardMaterial

Parameters

Name Type Description
source any
scene Scene
rootUrl string