Skip to main content

Interface: Material

Extends

  • PointerHolder

Properties

isValid

readonly isValid: boolean

Get if the refernce to the native pointer is still valid and strong.

If this is false, this object has been manually released with release() and all other methods on this object will throw an Error.

Inherited from

PointerHolder.isValid

Defined in

src/types/PointerHolder.ts:37


name

readonly name: string

Defined in

src/types/Material.ts:31

Methods

createInstance()

createInstance(): MaterialInstance

Returns

MaterialInstance

Defined in

src/types/Material.ts:14


getDefaultInstance()

getDefaultInstance(): MaterialInstance

Returns

MaterialInstance

Defined in

src/types/Material.ts:15


release()

release(): void

Manually release this reference to the native pointer. This will ensure that JS will no longer hold a strong reference, and memory can be safely cleaned up.

If the native pointer is still referenced elsewhere in native code, the underlying memory will not be deleted unless the other references are also released.

If this is not called, the memory will only be cleaned once the JS gabage collector decides to delete this object, which might be at any point in the future.

Calling release() is not required as the GC will destroy this object eventually anyways, but it is recommended to optimize memory usage.

After manually releasing a pointer, all future methods on this object will throw an Error.

Returns

void

Inherited from

PointerHolder.release

Defined in

src/types/PointerHolder.ts:30


setDefaultFloat3Parameter()

setDefaultFloat3Parameter(name, vector): void

Parameters

name: string

vector: Float3

Returns

void

Defined in

src/types/Material.ts:25


setDefaultFloat4Parameter()

setDefaultFloat4Parameter(name, vector): void

Changes the base color of the material. Assumes linear (0-1) linear sRGB color space.

Parameters

name: string

vector: Float4

Returns

void

Defined in

src/types/Material.ts:30


setDefaultFloatParameter()

setDefaultFloatParameter(name, value): void

Parameters

name: string

value: number

Returns

void

Defined in

src/types/Material.ts:17


setDefaultIntParameter()

setDefaultIntParameter(name, value): void

Parameters

name: string

value: number

Returns

void

Defined in

src/types/Material.ts:16


setDefaultMat3fParameter()

setDefaultMat3fParameter(name, value): void

Parameters

name: string

value: Mat3f

Returns

void

Defined in

src/types/Material.ts:24


setDefaultTextureParameter()

setDefaultTextureParameter(renderableManager, name, textureBuffer, textureFlags): TextureInfo

Parameters

renderableManager: RenderableManager

name: string

textureBuffer: FilamentBuffer

textureFlags: TextureFlags

Returns

TextureInfo

Defined in

src/types/Material.ts:18