copper3d / Modules / Utils/dispose
Module: Utils/dispose
Table of contents
Interfaces
Functions
Functions
disposeMaterial
▸ disposeMaterial(material): void
Material.dispose() does NOT cascade into its textures, so a canvas-backed or image-backed map stays on the GPU without this. Handles the array form too: a multi-material mesh would otherwise reach Array.prototype.dispose, which does not exist.
Parameters
| Name | Type |
|---|---|
material | undefined | null | DisposableMaterial | DisposableMaterial[] |
Returns
void
Defined in
disposeObject3D
▸ disposeObject3D(root): void
Works on a lone mesh as well as on a whole subtree -- traverse visits the root itself -- so a slice plane that was never added to a scene is freed by the same call.
Parameters
| Name | Type |
|---|---|
root | DisposableObject3D |
Returns
void