I removed the console and commented out the render (no render in this case 1.5~2.6 usage → maybe Common usage of react) and
I tried to turn vsysnc on and off, but no noticeable change.
wrap testScene in memo and add an empty array to the dependency array of the useEffect hook. Hooks rerun every render unless you tell them not to, so you’re recreating the engine a bunch of times.
you could also just create the canvas and babylon engine outside of react, no real reason to have it inside a react component there, its not like you’re disposing the canvas/engine on unmount (that would be a good use case to put it in react)
hello @carolhmj@jeremy-coleman
First of all, sorry for the very late reply because I was too busy to solve the project
so, The problem was about the creation of too many engines and canvases and the enigne not being disposed.
The reason was that there was an iteration in the step before creating the corresponding babylon and did not block the case for it.
In the end everything was resolved and I had normal gpu use