Description
class Material
Constructor
new Material(name, scene, doNotAdd)
Parameters
|
Name |
Type |
Description |
|
name |
string |
|
|
scene |
Scene |
|
optional |
doNotAdd |
boolean |
|
Members
static TriangleFillMode : number
static WireFrameFillMode : number
static PointFillMode : number
static ClockWiseSideOrientation : number
static CounterClockWiseSideOrientation : number
static TextureDirtyFlag : number
static LightDirtyFlag : number
static FresnelDirtyFlag : number
static AttributesDirtyFlag : number
static MiscDirtyFlag : number
id : string
name : string
checkReadyOnEveryCall : boolean
checkReadyOnlyOnce : boolean
state : string
alpha : number
backFaceCulling : boolean
sideOrientation : number
onCompiled : (effect: Effect) => void
Parameters
|
Name |
Type |
Description |
|
effect |
Effect |
|
onError : (effect: Effect, errors: string) => void
Parameters
|
Name |
Type |
Description |
|
effect |
Effect |
|
|
errors |
string |
|
doNotSerialize : boolean
storeEffectOnSubMeshes : boolean
animations : Array<Animation>
An event triggered when the material is disposed.
@type {BABYLON.Observable}
onDispose : () => void
An event triggered when the material is bound.
@type {BABYLON.Observable}
Parameters
An event triggered when the material is unbound.
@type {BABYLON.Observable}
alphaMode : number
needDepthPrePass : boolean
disableDepthWrite : boolean
forceDepthWrite : boolean
separateCullingPass : boolean
fogEnabled : boolean
pointSize : number
zOffset : number
wireframe : boolean
pointsCloud : boolean
fillMode : number
isFrozen : boolean
Methods
toString(fullDetails) → string
subclasses should override adding information pertainent to themselves
Parameters
|
Name |
Type |
Description |
optional |
fullDetails |
boolean |
|
getClassName() → string
Child classes can use it to update shaders
freeze() → void
unfreeze() → void
isReady(mesh, useInstances) → boolean
Parameters
|
Name |
Type |
Description |
optional |
mesh |
AbstractMesh |
|
optional |
useInstances |
boolean |
|
isReadyForSubMesh(mesh, subMesh, useInstances) → boolean
Parameters
getEffect() → Nullable<Effect>
getScene() → Scene
needAlphaBlending() → boolean
Parameters
needAlphaTesting() → boolean
getAlphaTestTexture() → Nullable<BaseTexture>
markDirty() → void
bind(world, mesh) → void
Parameters
|
Name |
Type |
Description |
|
world |
Matrix |
|
optional |
mesh |
Mesh |
|
bindForSubMesh(world, mesh, subMesh) → void
Parameters
bindOnlyWorldMatrix(world) → void
Parameters
|
Name |
Type |
Description |
|
world |
Matrix |
|
Parameters
bindView(effect) → void
Parameters
|
Name |
Type |
Description |
|
effect |
Effect |
|
bindViewProjection(effect) → void
Parameters
|
Name |
Type |
Description |
|
effect |
Effect |
|
unbind() → void
getActiveTextures() → BaseTexture[]
hasTexture(texture) → boolean
Parameters
clone(name) → Nullable<Material>
Parameters
|
Name |
Type |
Description |
|
name |
string |
|
forceCompilation(mesh, onCompiled, options) → void
Force shader compilation including textures ready check
Parameters
|
markAsDirty(flag) → void
Parameters
|
Name |
Type |
Description |
|
flag |
number |
|
dispose(forceDisposeEffect, forceDisposeTextures) → void
Parameters
|
Name |
Type |
Description |
optional |
forceDisposeEffect |
boolean |
|
optional |
forceDisposeTextures |
boolean |
|
serialize() → any
static ParseMultiMaterial(parsedMultiMaterial, scene) → MultiMaterial
Parameters
|
Name |
Type |
Description |
|
parsedMultiMaterial |
any |
|
|
scene |
Scene |
|
static Parse(parsedMaterial, scene, rootUrl) → any
Parameters
|
Name |
Type |
Description |
|
parsedMaterial |
any |
|
|
scene |
Scene |
|
|
rootUrl |
string |
|