Skip to content

[3.x] Editor 3D view mesh stats - #88207

Merged
lawnjelly merged 1 commit into
godotengine:3.xfrom
lawnjelly:view_mesh_stats
Apr 21, 2024
Merged

lawnjelly merged 1 commit into
godotengine:3.xfrom
lawnjelly:view_mesh_stats

Conversation

@lawnjelly

@lawnjelly lawnjelly commented Feb 11, 2024

Copy link
Copy Markdown
Member

Similar to information window, add a small optional window to display face count and other stats.

Implements godotengine/godot-proposals#248

stats4

Vertex Format

Is supported internally but display of the line is commented out for now in the source code so we can leave to a follow up PR. See discussion in later comments.

Notes

  • Switched on an off via View Selected Info in the 3D window (defaults to off).
  • This is pretty simple, but is super useful for performance optimizing scenes.
  • The standard information window is useful, but it doesn't allow us to easily examine individual meshes.
  • Supports MeshInstance and MultiMeshInstance so far.
  • Information is hidden unless relevant. If one mesh is selected, that line is hidden, etc.
  • Counts are added when multiple objects are selected.
  • Vertex format is ORed when multiple objects are selected. This was best compromise I could think of.
  • I did try various options for displaying vertex format - all caps, capital first letter only etc. This version looked best so far but happy to hear ideas.
  • Drawcalls can be inferred from number of surfaces, material swaps might be nice for a followup.
  • Index count can currently be inferred from tri count, but might still be useful for non-tri based geometry (could arguably be hidden though)
  • Index count / Vertex count determines vertex sharing measure. This could be displayed also, but it's usually obvious from the figures.

Discussion

One thing that could be worth improving is that it currently doesn't have a label to tell you this box is for the selected objects. I'm hoping it's kind of obvious, once you have it switched on. Colors could be changed to distinguish it from the Information label. Position wise I don't know if anything else uses the lower left 😀 , I don't use anything else regularly that does.

Also I'm happy to hear other suggestions where to put this info in the editor, am happy to change. This seemed to work pretty well so far though.