CLASSES
TagsA - Z

StandardMaterial

Material

Description

class StandardMaterial extends Material

Constructor

new StandardMaterial(name, scene)

Create a new StandardMaterial. Everything to know about materials can be found here : http://doc.babylonjs.com/tutorials/Materials And here : http://blogs.msdn.com/b/eternalcoding/archive/2013/07/01/babylon-js-unleash-the-standardmaterial-for-your-babylon-js-game.aspx

Parameters

Name Type Description
name string
scene Scene

Members

diffuseTexture : BaseTexture

The diffuse texture

ambientTexture : BaseTexture

The ambient texture

opacityTexture : BaseTexture

The opacity texture

reflectionTexture : BaseTexture

The reflection texture

emissiveTexture : BaseTexture

The emissive texture

specularTexture : BaseTexture

The specular texture

bumpTexture : BaseTexture

The bump texture

lightmapTexture : BaseTexture

refractionTexture : BaseTexture

ambientColor : Color3

The ambient color

diffuseColor : Color3

The diffuse color

specularColor : Color3

The specular color

emissiveColor : Color3

The emissive color

specularPower : number

The specular power

useAlphaFromDiffuseTexture : boolean

True to use alpha from diffuse texture

Default value : false

useEmissiveAsIllumination : boolean

linkEmissiveWithDiffuse : boolean

useReflectionFresnelFromSpecular : boolean

useSpecularOverAlpha : boolean

True to use specular over alpha

useReflectionOverAlpha : boolean

disableLighting : boolean

useParallax : boolean

useParallaxOcclusion : boolean

parallaxScaleBias : number

roughness : number

indexOfRefraction : number

invertRefractionY : boolean

useLightmapAsShadowmap : boolean

diffuseFresnelParameters : FresnelParameters

The diffuse Fresnel parameters

opacityFresnelParameters : FresnelParameters

The opacity Fresnel parameters

reflectionFresnelParameters : FresnelParameters

The reflection Fresnel parameters

refractionFresnelParameters : FresnelParameters

emissiveFresnelParameters : FresnelParameters

The emissive Fresnel parameters

useGlossinessFromSpecularMapAlpha : boolean

maxSimultaneousLights : number

invertNormalMapX : boolean

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

invertNormalMapY : boolean

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

cameraColorGradingTexture : BaseTexture

Color Grading 2D Lookup Texture.

This allows special effects like sepia, black and white to sixties rendering style.

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

useLogarithmicDepth : boolean

static DiffuseTextureEnabled : boolean

Function to know if diffuse texture is enabled

@return boolean True if diffuse texture is enabled ; False if not

static AmbientTextureEnabled : boolean

Function to know if ambient texture is enabled

@return boolean True if ambient texture is enabled ; False if not

static OpacityTextureEnabled : boolean

Function to know if opacity texture is enabled

@return boolean True if opacity texture is enabled ; False if not

static ReflectionTextureEnabled : boolean

Function to know if reflection texture is enabled

@return boolean True if reflection texture is enabled ; False if not

static EmissiveTextureEnabled : boolean

Function to know if emissive texture is enabled

@return boolean True if emissive texture is enabled ; False if not

static SpecularTextureEnabled : boolean

Function to know if specular texture is enabled

@return boolean True if specular texture is enabled ; False if not

static BumpTextureEnabled : boolean

Function to know if bump texture is enabled

@return boolean True if bump texture is enabled ; False if not

static FresnelEnabled : boolean

static LightmapTextureEnabled : boolean

static RefractionTextureEnabled : boolean

static ColorGradingTextureEnabled : boolean

Methods

needAlphaBlending() → boolean

Function to know if standard material need alpha blending @return boolean True if standard material need alpha blending ; False if not

needAlphaTesting() → boolean

Function to know if standard material need alpha testing @return boolean True if standard material need alpha testing ; False if not

getAlphaTestTexture() → BaseTexture

Function to get the alpha test texture @return BaseTexture The alpha test texture

isReady(mesh, useInstances) → boolean

Function to know if standard material is ready @return boolean True if is ready ; False if not

Parameters

Name Type Description
optional mesh AbstractMesh
optional useInstances boolean True to use instances

unbind() → void

Unbind the standard material

bindOnlyWorldMatrix(world) → void

Bind only the world matrix

Parameters

Name Type Description
world Matrix

bind(world, mesh) → void

Bind the standard material

Parameters

Name Type Description
world Matrix
optional mesh Mesh

getAnimatables() → IAnimatable[]

Get the animatables @reutnr IAnimatables List of animatables

dispose(forceDisposeEffect, forceDisposeTextures) → void

Parameters

Name Type Description
optional forceDisposeEffect boolean True to force the destroy
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