Material
Wrapper around a native material.
For more information about how to create materials, have a look at the MaterialManager class.
Properties
The material properties are automatically converted into getters/setters:
Getters for non-scalar types have an optional argument to skip an array allocation:
Note: Materials are per-engine, they can thus be shared by multiple scenes.
- Material
.constructor(engine, params) ⇒ Material- .Material._destroyedPrototype: { _ }
- .pipeline
.shader- .clone() ⇒ null | Material
- .hasParameter(name) ⇒ boolean
- .toString() ⇒ string
Material.wrap(engine, index) ⇒ null | Material
.constructor(engine: WonderlandEngine, params: number | MaterialParameters) ⇒ Material
Deprecated: Use getTemplate via materials to create a new material with a given pipeline:
Param | Type | Description |
---|---|---|
engine | WonderlandEngine | |
params | number | MaterialParameters |
._destroyedPrototype: { _ }
Proxy used to override prototypes of destroyed materials.
.pipeline: string
Name of the pipeline used by this material.
.shader: string
Deprecated: Use pipeline instead.
.clone() ⇒ null | Material
Create a copy of the underlying native material.
Returns: Material clone.
.hasParameter(name: string) ⇒ boolean
Check whether a parameter exists on this material.
Returns: true
if the parameter with name name
exists on this material,
false
otherwise.
Param | Type | Description |
---|---|---|
name | string | The name to check. |
.toString() ⇒ string
Material.wrap(engine: WonderlandEngine, index: number) ⇒ null | Material
Wrap a native material index.
Returns: Material instance or null
if index <= 0.
Deprecated: Use the materials instead.
Param | Type | Description |
---|---|---|
engine | WonderlandEngine | Engine instance. |
index | number | The index. |