Class: MaterialManager
Defined in: render/material.ts:72
Constructors
Constructor
new MaterialManager(): MaterialManager;
Returns
MaterialManager
Methods
Create()
Call Signature
static Create(shader): number;
Defined in: render/material.ts:78
Create a new material with the specified shader
Parameters
| Parameter | Type | Description |
|---|---|---|
shader | URP_LIT | The name of the shader to use |
Returns
number
The material handle
Call Signature
static Create(
shader,
entity,
submeshIndex?): number;
Defined in: render/material.ts:87
Create a new material and attach it to a renderable component
Parameters
| Parameter | Type | Description |
|---|---|---|
shader | URP_LIT | The name of the shader to use |
entity | number | The entity with the renderable component |
submeshIndex? | number | The submesh index to attach to (default: 0) |
Returns
number
The material handle
CreateInstance()
static CreateInstance(handle): number;
Defined in: render/material.ts:132
Create a material instance
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The material handle to create an instance from |
Returns
number
The material instance handle
Destroy()
static Destroy(handle): boolean;
Defined in: render/material.ts:121
Destroy a material
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The material handle to destroy |
Returns
boolean
boolean indicating success
GetColor()
static GetColor(handle, prop): string;
Defined in: render/material.ts:252
Get a color property from the material
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The material handle |
prop | ShaderProperties | The property name |
Returns
string
The color as a string
GetFloat()
static GetFloat(handle, prop): number;
Defined in: render/material.ts:237
Get a float property from the material
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The material handle |
prop | ShaderProperties | The property name |
Returns
number
The float value
SetColor()
static SetColor(
handle,
prop,
rgba): boolean;
Defined in: render/material.ts:193
Set a color property on the material
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The material handle |
prop | ShaderProperties | The property name |
rgba | vec4 | vec4 color [0.0, 1.0] |
Returns
boolean
boolean indicating success
SetFloat()
static SetFloat(
handle,
prop,
value): boolean;
Defined in: render/material.ts:148
Set a float property on the material
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The material handle |
prop | ShaderProperties | The property name |
value | number | The float value |
Returns
boolean
boolean indicating success
SetTexture()
static SetTexture(
handle,
prop,
tex): boolean;
Defined in: render/material.ts:217
Set a texture property on the material
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The material handle |
prop | ShaderProperties | The property name |
tex | number | The texture handle |
Returns
boolean
boolean indicating success
SetVector()
static SetVector(
handle,
prop,
value): boolean;
Defined in: render/material.ts:169
Set a vector property on the material
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | number | The material handle |
prop | ShaderProperties | The property name |
value | vec4 | vec4 value |
Returns
boolean
boolean indicating success