Instanced drawing for repeated models
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 18/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- csharp
- Área
- computer-graphics, game-dev, performance
Línea de trabajo
Start with Example 12 and the render path around RenderList.Collect and BuildDraws, then reproduce the 10k and 50k measurements described here and in #64. Prototype persistent per-(mesh, material) instance buffers for Example 12's boxes, wire membership to structural change notifications, and keep material-override or per-object-shader cases as individual draws. Done means draw preparation drops by an order of magnitude at 10k boxes with identical output and the GPU tests still green; #104, #325, #326 and the flat-soa-snapshot-pattern design are the background to read first.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Current State
GPU instancing (#104) batches identical mesh and material draws at submission. On the CPU, the shipped Example 12 still prepares 9,996 of its 10,001 boxes as individual draw items. Every frame, the renderer walks all 10k models (RenderList.Collect, ~0.9 ms) and prepares one draw each (BuildDraws, ~1.55 ms), then rebuilds the instance data. After the physics fixes, this is the render-side scaling wall: its cost grows linearly with the object count, even when nothing but poses changed.
Proposal
- Keep persistent per-batch instance buffers for repeated (mesh, material) models. Membership is maintained by structural change notifications, the way the scene index tracks cameras.
- Per frame, write only the transforms (ideally a bulk copy from the transform snapshot in the Tier 2 SoA issue) and cull per batch.
- Feed debris-tier bodies (Tier 3) into the same buffers straight from the physics pose arrays.
Tasks
- Measure the current per-draw CPU cost at 10k and 50k (Collect, BuildDraws, instance upload) in the exported game.
- Prototype persistent batches for Example 12's boxes and compare against today's path, including culling and material overrides.
- Define when a model leaves a batch (unique material override, per-object shader data) and keep those as individual draws.
Acceptance Criteria
- At 10k repeated boxes, CPU draw preparation falls by an order of magnitude, with identical images (the GPU tests stay green).
- Steady-state preparation allocates nothing, and per-object CPU cost scales linearly or better.
Related
- #104 (GPU instancing at submission)
- #64 (the measurements)
- #325 (transform SoA, Tier 2) and #326 (two-tier entities, Tier 3)
- Shared mass4-wiki design:
flat-soa-snapshot-pattern(flat snapshots, stable indices, identity maps, structural change notifications, double buffering and compaction), aligned with MASS4ORG/Guinevere#120.
- Lenguaje dominante
- C#
- Estrellas
- 1
- Forks
- 1
- Merge medio
- 1 h 57 min
- PR fusionados (30 d)
- 36
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de MASS4ORG/Turian
-
c:assets p:low size:XS t:task
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
c:engine c:platform p:low size:S t:feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
c:ui p:medium size:M t:feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
c:build p:low size:XS t:enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
Los mantenedores suelen responder en 1 día
-
c:assets p:medium size:S t:bug
Dificultad 3/5 1-2 días Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
Todos los issues de MASS4ORG/Turian
Issues similares
-
Add dependency list in documentsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 3 días
-
Add 'upm' tag on githubAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug mac アプリ: コード アプリ: チャット 優先: 中 要トリアージ
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
yksr-melt/Meltype#1346 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Collect corrected translations in the app, with no GitHub account and the least possible frictionAbiertolocalization medium ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
hexide-io/HexIDE#2819 · 1 comentario ·
Los mantenedores suelen responder en 1 día