RenaudRohlinger / stats-gl

https://stats.renaudrohlinger.com/
167 stars 7 forks source link

GPU + Engine CPU Issue #10

Open ashconnell opened 1 month ago

ashconnell commented 1 month ago

Problem

It's not currently possible to have both:

  1. GPU panel, and
  2. CPU panel that tracks full engine ticks/updates (it only tracks render time)

The function init(renderer) is the only way to get the GPU panel, but this also patches three js to call begin() and end() automatically on each render call.

Most engines have their own tick/update cycle that updates systems etc as well as calling render.

Proposal

Would you accept a PR that modifies init(renderer) to become init(renderer, patch = true) to allow opting out of the three js patch?

This would allow us to have the GPU panel and still be able to manually call begin() and end() at the engine level, instead of just for rendering.

Any other suggestions welcome, i'll happily make a PR.