Material
Wrapper around a native material.
Each material instance will have properties associated to the pipeline it uses. The material properties are automatically added to each material instance, example:
.constructor(engine: WonderlandEngine, params: number | MaterialParameters) ⇒ Material
Create a new Material.
Note: Creating material is expensive. Please use clone to clone a material.
Note: Do not use this constructor directly with an index, this is reserved for internal purposes.
Param | Type | Description |
---|---|---|
engine | WonderlandEngine | |
params | number | MaterialParameters |
.engine: WonderlandEngine
Hosting engine instance.
.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.
.equals(otherMaterial: undefined | null | Material) ⇒ boolean
1.0.0+Checks equality by comparing whether the wrapped native material ids are equal.
Returns: Whether this material equals the given material.
Param | Type | Description |
---|---|---|
otherMaterial | undefined | null | Material | Material to check equality with. |
Material.wrap(engine: WonderlandEngine, index: number) ⇒ null | Material
Wrap a native material index.
Returns: Material instance or null
if index <= 0.
Deprecated: Please use new Material()
instead.
Param | Type | Description |
---|---|---|
engine | WonderlandEngine | Engine instance. |
index | number | The index. |