StaticMeshStorage

Storage for a reusable (static) mesh draw call.

Unlike the dynamic path that uploads per frame into shared buffers, this class keeps dedicated VBO/IBO storage and a cached MeshDraw so the same geometry can be rendered across multiple frames.

Constructors

Link copied to clipboard
constructor(label: String)

Properties

Link copied to clipboard
val byteBufferBuilder: ByteBufferBuilder
Link copied to clipboard

Functions

Link copied to clipboard
open fun bindAndDraw(pass: RenderPass)
Draw the currently uploaded mesh if available.
Link copied to clipboard
inline fun StaticMeshStorage.buildMesh(pipeline: RenderPipeline, rotate: Boolean = true, block: VertexConsumer.(pose: PoseStack) -> Unit)

Build new mesh data and upload it. This method is designed for lazy building so rotate defaults to true.

Link copied to clipboard
open fun clearBuffers()
Link copied to clipboard
open fun clearStates()
Clear the render state.
Link copied to clipboard
open fun isReady(): Boolean
Link copied to clipboard
open fun uploadAndSet(meshData: MeshData, pipeline: RenderPipeline, rotate: Boolean)
Upload mesh data into this storage's dedicated buffers and refresh the draw state.