godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add triangle / vertex count display for MeshInstances #248

Open lawnjelly opened 4 years ago

lawnjelly commented 4 years ago

Describe the project you are working on: Splitting and merging meshes for balancing draw calls / culling, and optimizing levels for fast rendering

Describe the problem or limitation you are having in your project: There doesn't appear to be an easy way to determine the poly count of a mesh from the IDE.

Some other stats that are useful:

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work: I just asked on IRC in devel and none of us were aware of a current way of seeing this basic info. There were suggestions ranging from putting it in the inspector (when the mesh instance is selected) to putting it as a label in the 3d viewport.

There are actually 2 aspects here: 1) Is an indication of stats of meshes that are currently being rendered (which the monitor already does to an extent) 2) Purely information stats of the info in the mesh instances, which could be queried from the mesh instance directly

One advanced consideration might be if multiple nodes are selected, or only some are MeshInstances.

If this enhancement will not be used often, can it be worked around with a few lines of script?: It will probably be useful quite often.

Is there a reason why this should be core and not an add-on in the asset library?: Could perhaps be made as an add-on (I'm not familiar with making IDE add-ons) but the consensus was that we should put it up here as a proposal as it might be widely useful functionality.

Zireael07 commented 3 years ago

I was going to make a new issue, but then I realized it probably belongs here:

I am trying to figure out the best sub-scenes to optimize in a medium-complexity game. So far the only way I can figure out what I should work on is by enabling/disabling visibility one by one and seeing draw calls go down. This is NOT tenable, as you can imagine, with only a dozen or so intersections plus a dozen or so roads (every road has 3 parts, and a dozen or so buildings alongside, so I estimate 12 to the power of 3 nodes or something around 1800 nodes), whether I go the completely manual route or trying some sort of a technique presented here: https://www.youtube.com/watch?v=QXUCGzJUfkc

Godot really needs something like https://unrealartoptimization.github.io/book/profiling/view-modes/ (shader complexity view) or https://docs.unity3d.com/Manual/FrameDebugger.html, and it also ties to #2704 (mipmap levels view)

me2beats commented 2 years ago

what about draw calls, material count/changes etc as well

me2beats commented 2 years ago

It would be nice to see info for any selection as well imo. You select one or several meshes and it shows info for it

lawnjelly commented 5 months ago

This is now merged in 3.6, although leaving this open as there is some interest in having the same feature in 4.x.