Manages GPU-resident, dynamically-editable data storage for model geometry and attributes.

Constructors

Properties

dataTextures: BatchDataTextures

The data textures that implement GPU-side model storage for this GPUMemoryBatch.

hasNormals: boolean

True when this batch carries per-vertex normals — drives lazy allocation of _vertexNormalTexture and the technique variant that reads from it.

hasUVs: boolean

True when this batch carries per-vertex UV coordinates — drives lazy allocation of _vertexUVTexture and the technique variant that binds it.

index: number

Index of this GPUMemoryBatch within the GPUMemoryManager.sortedBatches array.

mipmap: boolean

When true, the batch's per-batch PBR atlases are allocated with a full mip pyramid and sampled trilinearly. Set when at least one of the meshes' materials binds an opted-in SceneTexture (SceneTextureParams.mipmap === true); otherwise the atlases stay on the cheap single-level path.

triplanar: boolean

When true, the batch's per-batch PBR atlases (albedo, metallic-roughness, normal-map) get allocated even when hasUVs is false. The renderer's triplanar shader variant samples those atlases via world-space UVs derived from vWorldPos, so triplanar batches need the atlases populated even though the geometry itself has no per-vertex UV stream.

Accessors

Methods

  • Sets attributes for e mesh to apply across all Views.

    Sets RenderContext.viewFlags[...].needsRender to true.

    Parameters

    • meshIndex: number
    • params: { tileIndex?: number }
      • OptionaltileIndex?: number

        Optional tileIndex of the GPUTile containing the mesh. This can be dynamically updated, as mesh can move between tiles.

    Returns void

  • Sets per-view mesh cull state. Culling and visibility are independent inputs to the same draw-inclusion decision — a culled mesh is dropped from the view's draw index just like a hidden one, but without disturbing the user-set visibility, so toggling culling never reveals an object the app deliberately hid.

    Parameters

    • meshIndex: number
    • viewIndex: number
    • culled: boolean

    Returns void

  • Sets attributes for a mesh within a specific View.

    Sets RenderContext.viewFlags[viewIndex].needsRender to true.

    Parameters

    • meshIndex: number
    • viewIndex: number
    • params: { clippable?: boolean; color?: Vec3; opacity?: number; pickable?: boolean }

    Returns void

  • Re-upload the pixels of an already-cached SceneTexture from this batch's atlases. Walks all three atlases (albedo, metallic-roughness, normal-map) and re-uploads wherever the id matches; returns true if any of them held the texture.

    Used by the post-finalize onSceneTextureImageDataChanged flow. The source's dimensions must match the placement — heat-map painting mutates pixels in place but never resizes.

    Parameters

    • sceneTexture: { id: string; image?: any; imageData?: any }

    Returns boolean