-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement render info counters for the 2D renderer #85811
Conversation
0105acb
to
d16980e
Compare
Finally! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. 👍
In long run would be nice to report separately from 3D as in the amazing work in 3.x.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally with all rendering methods, it works as expected.
It's interesting to note two things about 2D rendering (these apply to all rendering methods):
- A Label with a single character thas has no font outline or shadow results in 6 primitives drawn. I'd expect 2 primitives to be drawn per character instead. An empty Label doesn't result in any primitives or draw calls as expected.
- Invisible characters such as spaces add the same number of draw calls/primitives as visible characters. I'd expect these to not have to be drawn, though bitmap fonts could in theory make these visible (I'm not aware of any such fonts).
This provides information for the debug monitors
d16980e
to
528b4a3
Compare
That was an oversight on my part. I forgot to add the conversion from Vertex/Index to "primitive"
That seems odd, but it must be coming from the font system as the renderer doesn't detect if the section of a texture being used is fully transparent |
@bruvzg Any ideas about this? |
I suggest opening a bug report about this, as I'll merge this PR now :) |
Thanks! |
not working for me. i get zero objects drawn like here #74060 (comment) |
What version are you on? If you're on 4.2 or 4.1 this isn't available, this is 4.3 only Also this one is different, this isn't the same, this isn't supported for that method at the moment, you should use: print(RenderingServer.viewport_get_render_info(get_viewport().get_viewport_rid(), RenderingServer.VIEWPORT_RENDER_INFO_TYPE_CANVAS, RenderingServer.VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME)) |
I'll go ahead and open a PR for adding the equivalent to |
ty ! i am indeed using 4.2, didn't see it was 4.3 sorry. thanks :) |
This provides information for the debug monitors for 2D objects.
For now all the draw data is compiled together for the performance monitors to maintain consistency with previous versions, but it can be reported separately if the information is pulled from
viewport_get_render_info()
.Fixes: #8373 (6 year old bug report 👀)
RD renderer (note draw calls and objects drawn are the same):

Compatibility renderer:
