Cache Mesh
Updated
Draws this entity and every identical copy of it in one draw call.
- Type
comp-cache-mesh- Script class
CacheMeshComponent- Per entity
- One
- Version
- 1.0.0
Read about it in LOD and caching: what it does, how to use it from a script, and examples.
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
Plant a forest with one draw call per partA script scatters 500 copies of a disabled tree template with random turns and sizes, and the Cache Mesh on each part draws all of them in one draw call per part.
Look around the forest; it is the same forest on every reload. Drag to orbit the camera, scroll to zoom.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(CacheMeshComponent); if (component) log(component.props);}