docs.run2go.idoptidrawPerformance & Optimization
Back to optidraw
OptiDraw Core System

Performance & Optimization

Burst compiler + GPU dispatch pipeline, batching, and performance-first guidelines for high-poly and mobile targets.

Performance-First Architecture

Every OptiDraw paint operation runs through a two-stage pipeline designed to keep the Unity editor responsive at all times, regardless of mesh complexity:

  • Stage 1 — CPU (Burst): Raycast against BVH, compute brush falloff weights, write to NativeArray vertex buffer. Runs on worker threads via the Job System.
  • Stage 2 — GPU: Upload vertex buffer to the mesh or dispatch a compute shader for texture paint. Uses AsyncGPUReadback where possible to avoid GPU stalls.

Typical Performance Budget

  • 500K vertex mesh, vertex paint: ~0.8ms per stroke frame (Burst, i7-12700K)
  • 4K texture paint, single tile: ~1.2ms per stroke frame (GPU, RTX 3070)
  • UDIM 4-tile paint: ~2.1ms per stroke frame
  • Animation Draw Mode overhead vs static: +0.3ms for pose sampling

Use Splat or Vertex paint for mobile-target assets — they write no additional textures and produce the lightest runtime shaders.

Batching (OptiDraw Batching)

For scenes with many painted static meshes, OptiDraw Batching remaps UV atlases and merges draw calls using GPU instancing. This is an advanced workflow — see the OptiDraw Batching article for the full setup guide.

Best Practices

  • Keep brush radius proportional to mesh density — very large brushes on dense meshes increase Burst job time
  • Use the Layer System merge-down frequently to free GPU memory from stacked RenderTextures
  • Bake vertex colors into the mesh asset before shipping — eliminates ScriptableObject overhead at runtime
  • For LOD chains, paint the LOD0 then use the Bake function to propagate vertex color to lower LODs