ShaderMaterial

Material

Description

class ShaderMaterial extends Material

Constructor

new ShaderMaterial(name, scene, shaderPath, options)

Parameters

Name Type Description
name string
scene Scene
shaderPath any

Methods

getClassName() string

needAlphaBlending() boolean

needAlphaTesting() boolean

setTexture(name, texture) ShaderMaterial

Parameters

Name Type Description
name string
texture Texture

setTextureArray(name, textures) ShaderMaterial

Parameters

Name Type Description
name string
textures Texture[]

setFloat(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value number

setFloats(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value number[]

setColor3(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value Color3

setColor3Array(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value Color3[]

setColor4(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value Color4

setVector2(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value Vector2

setVector3(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value Vector3

setVector4(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value Vector4

setMatrix(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value Matrix

setMatrix3x3(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value Float32Array

setMatrix2x2(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value Float32Array

setArray2(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value number[]

setArray3(name, value) ShaderMaterial

Parameters

Name Type Description
name string
value number[]

isReady(mesh, useInstances) boolean

Parameters

Name Type Description
optional mesh AbstractMesh
optional useInstances boolean

bindOnlyWorldMatrix(world) void

Parameters

Name Type Description
world Matrix

bind(world, mesh) void

Parameters

Name Type Description
world Matrix
optional mesh Mesh

getActiveTextures() BaseTexture[]

hasTexture(texture) boolean

Parameters

Name Type Description
texture BaseTexture

clone(name) ShaderMaterial

Parameters

Name Type Description
name string

dispose(forceDisposeEffect, forceDisposeTextures) void

Parameters

Name Type Description
optional forceDisposeEffect boolean
optional forceDisposeTextures boolean

serialize() any

static Parse(source, scene, rootUrl) ShaderMaterial

Parameters

Name Type Description
source any
scene Scene
rootUrl string