UnityLaparoscopicSceneSimul.../.claude/commands/realtime-performance-budget.md
Artur Mukhamadiev c51e6d1369 feat(models) added models/textures and Agents related stuff
:Release Notes:
- Agents files for opencode and claude
- Skills for opencode and claude
- 3d models with medical organs
- Some textures

:Detailed Notes:
-

:Testing Performed:
-

:QA Notes:
- Looks like shit :)

:Issues Addressed:
TG-1
2026-06-22 16:57:48 +03:00

72 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Real-time Performance Budget (project-scoped)
Sets the budgets and verification routine for the LaparoscopicSurgeryEmulation scene.
## When to use
Load after any visual, hierarchy, material, lighting, or post-processing change, or when diagnosing "scene feels heavy" / "frame rate dropped" reports.
## Per-frame budget
| Resource | Budget | Notes |
|---|---|---|
| Triangle count (visible) | ≤ 250k | Cavity is small; most triangles should be culled |
| Draw calls (visible) | ≤ 200 | Static batching helps |
| SetPass calls | ≤ 100 | Raised by unique shaders / materials |
| Real-time lights (visible) | ≤ 4 | One key, one fill, two rims; everything else baked |
| Reflection probes (visible) | ≤ 1 | One cavity probe at 256² |
| Texture memory (visible) | ≤ 64 MB | Mostly mucosa + organ textures |
| Post-processing overrides | ≤ 8 | Bloom + Vignette + DoF + Tonemapping + ColorAdjustments + LensDistortion + ChromaticAberration + FilmGrain = 8 |
| Render scale | ≤ 1.25 | Bumping to 1.5+ to "fix" softness is a landmine |
| MSAA | ≤ 4× | 2× is the safe default |
| Volume profiles (active global) | ≤ 1 | Multiple globals cause blending surprises |
Flag any budget at 80% capacity as a **warning** (not a fail).
## Texture budget
| Texture role | Max size | Format |
|---|---|---|
| Mucosa base (`TissueMucosa.png`) | 2048 | BC7 (desktop) or ASTC (mobile) |
| Mucosa normal | 2048 | BC5 / ASTC normal |
| Organ diffuse | 2048 | BC7 / ASTC |
| Organ normal | 2048 | BC5 / ASTC normal |
| Organ roughness | 1024 | BC4 / ASTC (single channel) |
| Decals (if added) | 512 | BC7 / ASTC |
Verify import settings on any new/modified texture:
- sRGB on for colour, off for normal/roughness/AO.
- Correct texture type (Default vs Normal map vs Single Channel).
- Generate Mip Maps: on.
- Max Size within budget.
## Shader cost
- Default: URP/Lit. URP/Simple Lit only as non-hero fallback. URP/Unlit only for HUD/debug.
- Custom shaders (`RenderDepth.shader`, `BlendShader.compute`) are constrained to depth/WebRTC pipelines — do not extend for visual work without a bounded change.
- Minimize material keywords: every enabled keyword adds a shader variant.
## Verification routine
Run after every bounded change:
1. `mcp__UnityMCP__read_console(types=["error","warning"], count=50, include_stacktrace=true)`.
2. `mcp__UnityMCP__find_gameobjects(search_term="SurgeryBenchmark", search_method="by_path", include_inactive=true)` — confirm authored roots.
3. `mcp__UnityMCP__manage_profiler(action="profiler_get_counters", category="Render")` — check draw calls, SetPass, triangles.
4. `mcp__UnityMCP__manage_graphics(action="stats_get")` — confirm texture memory.
5. Two screenshots: scope angle + 3045° offset.
## Scene-cleanliness checks
- Missing references (from `read_console`).
- Empty containers with no authored purpose.
- Objects outside `SurgeryBenchmark/` that are not the preserved `MainScene` subtrees.
- Duplicate or stray `.mat` files not in the five-canonical-materials inventory.
- Unused textures > 512px in `Assets/Materials/` or `Assets/Textures/`.
## Verdict levels
- **PASS** — inside budget and visually intact.
- **WARNING** — one or more budgets at 80100%; no regression; note for next agent.
- **REGRESSED** — a budget was inside before the last change and is now exceeded. Request a rollback from unity-execution.
- **FAIL** — a budget was already exceeded before the last change, or a regression is severe. Escalate; do not paper over.