Skip to content

feat(cientos): <Decal> geometry batching for high decal counts #1412

Description

@alvarosabu

Follow-up from the <Decal> roadmap (previously tracked in packages/cientos/src/core/abstractions/Decal/ROADMAP.md).

Use case

Scenes with many decals on the same mesh currently issue one draw call per decal. Past ~100 decals per host mesh this becomes a bottleneck.

Approach

Merge every DecalItem's BufferGeometry (same material) into a single BufferGeometry and render it as one draw call.

  • Useful from: ~100 decals on the same mesh.
  • Re-merge cost: O(total vertices) on every edit. Mitigate with lazy batching — keep the entry being edited as its own un-merged mesh, merge only on commit() / initial scene load.

Friction

  • Hover edges (EdgesGeometry) and per-decal material slot need their own path.
  • polygonOffsetFactor becomes per-batch.

Prerequisite for the full draw-call collapse: a texture atlas + unified material (separate issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    cientosIssues related to @tresjs/cientosfeaturep2-to-be-discussedEnhancement under consideration (priority)pending-triageTicket is pending to be prioritised

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions