Question Details

No question body available.

Tags

unity-game-engine optimization game-development mesh

Answers (1)

February 11, 2026 Score: -1 Rep: 49 Quality: Low Completeness: 80%

This is what I found:

You can get at the SpriteShape’s generated geometry in 2022.3 — just not as a Mesh object. The SpriteShape system exposes the mesh channels (indices/vertices/uvs etc.) through SpriteShapeRenderer.GetChannels(...), and segments through GetSegments(...).

That gives you two practical routes:


Option A — Build your own combined Mesh (true “one mesh” result)

How it works

  1. Force SpriteShape to generate/refresh its geometry (usually SpriteShapeController.BakeMesh()).

  2. Read its geometry via SpriteShapeRenderer.GetChannels(...).

  3. Copy data into a Mesh, transform vertices to world (or to a common root space).

  4. Combine all meshes with Mesh.CombineMeshes(...) into one MeshFilter + MeshRenderer.

Caveat (important)

GetChannels(int dataSize, ...) needs a buffer size (“reserve size”). The API is primarily designed for custom geometry generation/modification where you know/compute required counts.
So you’ll need a way to decide dataSize (e.g., conservative upper bound based on your spline detail / segment count, or your own generator that tracks counts). If your AO SpriteShapes are simple and consistent, using a safe upper bound can be fine.


Option B — Let Unity batch them (no mesh extraction needed)

1) Static batching (best chance at fewer draw calls)

If your AO SpriteShapes don’t move and use the same material, static batching can combine them into bigger internal buffers and reduce draw calls. Unity’s static batching explicitly “combines meshes that don’t move to reduce draw calls.”

What to do:

  • Mark the GameObjects as Static (Batching Static).

  • Ensure same material (same shader + same texture set/atlas).

  • Avoid per-renderer material instances (use sharedMaterial, not material).

  • Call BakeMesh() once after editing splines (then stop updating splines).

2) SRP Batcher (URP)

URP’s SRP Batcher can reduce CPU cost, but it does not merge objects into one draw call by itself; it mainly reduces per-draw setup cost. (So you might see fewer “expensive” draws, but still multiple draws.)


SpriteShape-side knobs that help a lot

On SpriteShapeController, make sure you’re not generating more geometry than needed:

  • Reduce splineDetail

  • Enable optimizeGeometry (if available in your package version)

  • Avoid frequent spline edits at runtime (each change can trigger regeneration)

Also note: there are known performance pitfalls when calling BakeMesh() and how SpriteShape updates around rendering; it’s worth profiling if you see spikes.