Engine API Reference - v2.20.0-beta.0
    Preparing search index...

    Class DrawCommands

    Container holding parameters for multi-draw commands.

    Obtain an instance via MeshInstance#setMultiDraw and populate it using add followed by update.

    Index

    Accessors

    Methods

    Accessors

    • get count(): number

      Number of draw calls to perform.

      Returns number

    • get maxCount(): number

      Maximum number of multi-draw calls the space is allocated for.

      Returns number

    Methods

    • Writes one draw command into the allocated storage.

      Parameters

      • i: number

        Draw index to update.

      • indexOrVertexCount: number

        Number of indices or vertices to draw.

      • instanceCount: number

        Number of instances to draw (use 1 if not instanced).

      • firstIndexOrVertex: number

        Starting index (in indices, not bytes) or starting vertex.

      • OptionalbaseVertex: number = 0

        Signed base vertex (WebGPU only). Defaults to 0.

      • OptionalfirstInstance: number = 0

        First instance (WebGPU only). Defaults to 0.

      Returns void

    • Finalize and set draw count after all commands have been added.

      Parameters

      • count: number

        Number of draws to execute.

      Returns void