Skip to content

Class: Material

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

constructor

new Material(): Material

Returns

Material

Defined in

src/materials/Material.ts:33

Properties

instanceID

instanceID: string

Material Unique Identifier

Defined in

src/materials/Material.ts:19


name

name: string

name of this material

Defined in

src/materials/Material.ts:25


enable

enable: boolean = true

Defined in

src/materials/Material.ts:27

Accessors

shader

get shader(): Shader

Returns

Shader

Defined in

src/materials/Material.ts:41

set shader(shader): void

Parameters

NameType
shaderShader

Returns

void

Defined in

src/materials/Material.ts:36


doubleSide

get doubleSide(): boolean

Returns

boolean

Defined in

src/materials/Material.ts:45

set doubleSide(value): void

Parameters

NameType
valueboolean

Returns

void

Defined in

src/materials/Material.ts:49


castShadow

get castShadow(): boolean

Returns

boolean

Defined in

src/materials/Material.ts:53

set castShadow(value): void

Parameters

NameType
valueboolean

Returns

void

Defined in

src/materials/Material.ts:57


acceptShadow

get acceptShadow(): boolean

Returns

boolean

Defined in

src/materials/Material.ts:64

set acceptShadow(value): void

Parameters

NameType
valueboolean

Returns

void

Defined in

src/materials/Material.ts:68


castReflection

get castReflection(): boolean

Returns

boolean

Defined in

src/materials/Material.ts:77

set castReflection(value): void

Parameters

NameType
valueboolean

Returns

void

Defined in

src/materials/Material.ts:81


blendMode

get blendMode(): BlendMode

Returns

BlendMode

Defined in

src/materials/Material.ts:85

set blendMode(value): void

Parameters

NameType
valueBlendMode

Returns

void

Defined in

src/materials/Material.ts:89


depthCompare

get depthCompare(): GPUCompareFunction

Returns

GPUCompareFunction

Defined in

src/materials/Material.ts:93

set depthCompare(value): void

Parameters

NameType
valueGPUCompareFunction

Returns

void

Defined in

src/materials/Material.ts:97


transparent

get transparent(): boolean

Returns

boolean

Defined in

src/materials/Material.ts:102

set transparent(value): void

Parameters

NameType
valueboolean

Returns

void

Defined in

src/materials/Material.ts:106


cullMode

get cullMode(): GPUCullMode

Returns

GPUCullMode

Defined in

src/materials/Material.ts:113

set cullMode(value): void

Parameters

NameType
valueGPUCullMode

Returns

void

Defined in

src/materials/Material.ts:117


depthWriteEnabled

get depthWriteEnabled(): boolean

Returns

boolean

Defined in

src/materials/Material.ts:128

set depthWriteEnabled(value): void

Parameters

NameType
valueboolean

Returns

void

Defined in

src/materials/Material.ts:132


useBillboard

set useBillboard(value): void

Parameters

NameType
valueboolean

Returns

void

Defined in

src/materials/Material.ts:136

Methods

getPass

getPass(passType): RenderShaderPass[]

get render pass by renderType

Parameters

NameType
passTypePassType

Returns

RenderShaderPass[]

Defined in

src/materials/Material.ts:145


getAllPass

getAllPass(): RenderShaderPass[]

get all color render pass

Returns

RenderShaderPass[]

Defined in

src/materials/Material.ts:153


clone

clone(): Material

clone one material

Returns

Material

Material

Defined in

src/materials/Material.ts:161


destroy

destroy(force): void

Parameters

NameType
forceboolean

Returns

void

Defined in

src/materials/Material.ts:168


setDefine

setDefine(define, value): void

Parameters

NameType
definestring
valueboolean

Returns

void

Defined in

src/materials/Material.ts:174


setTexture

setTexture(propertyName, texture): void

Parameters

NameType
propertyNamestring
textureTexture

Returns

void

Defined in

src/materials/Material.ts:178


setStorageBuffer

setStorageBuffer(propertyName, buffer): void

Parameters

NameType
propertyNamestring
bufferStorageGPUBuffer

Returns

void

Defined in

src/materials/Material.ts:182


setUniformBuffer

setUniformBuffer(propertyName, buffer): void

Parameters

NameType
propertyNamestring
bufferUniformGPUBuffer

Returns

void

Defined in

src/materials/Material.ts:186


setUniformFloat

setUniformFloat(propertyName, value): void

Parameters

NameType
propertyNamestring
valuenumber

Returns

void

Defined in

src/materials/Material.ts:191


setUniformVector2

setUniformVector2(propertyName, value): void

Parameters

NameType
propertyNamestring
valueVector2

Returns

void

Defined in

src/materials/Material.ts:195


setUniformVector3

setUniformVector3(propertyName, value): void

Parameters

NameType
propertyNamestring
valueVector3

Returns

void

Defined in

src/materials/Material.ts:199


setUniformVector4

setUniformVector4(propertyName, value): void

Parameters

NameType
propertyNamestring
valueVector4

Returns

void

Defined in

src/materials/Material.ts:203


setUniformColor

setUniformColor(propertyName, value): void

Parameters

NameType
propertyNamestring
valueColor

Returns

void

Defined in

src/materials/Material.ts:207


getUniformFloat

getUniformFloat(str): any

Parameters

NameType
strstring

Returns

any

Defined in

src/materials/Material.ts:211


getUniformV2

getUniformV2(str): Vector2

Parameters

NameType
strstring

Returns

Vector2

Defined in

src/materials/Material.ts:215


getUniformV3

getUniformV3(str): Vector3

Parameters

NameType
strstring

Returns

Vector3

Defined in

src/materials/Material.ts:219


getUniformV4

getUniformV4(str): Vector4

Parameters

NameType
strstring

Returns

Vector4

Defined in

src/materials/Material.ts:223


getUniformColor

getUniformColor(str): Color

Parameters

NameType
strstring

Returns

Color

Defined in

src/materials/Material.ts:227


getTexture

getTexture(str): Texture

Parameters

NameType
strstring

Returns

Texture

Defined in

src/materials/Material.ts:231


getStorageBuffer

getStorageBuffer(str): StorageGPUBuffer

Parameters

NameType
strstring

Returns

StorageGPUBuffer

Defined in

src/materials/Material.ts:235


getStructStorageBuffer

getStructStorageBuffer(str): GPUBufferBase

Parameters

NameType
strstring

Returns

GPUBufferBase

Defined in

src/materials/Material.ts:239


getUniformBuffer

getUniformBuffer(str): GPUBufferBase

Parameters

NameType
strstring

Returns

GPUBufferBase

Defined in

src/materials/Material.ts:243


applyUniform

applyUniform(): void

Returns

void

Defined in

src/materials/Material.ts:247

Released under the MIT License