Hello all,
I am currently working on upgrading my project from babylonjs version 6.43.0 to version 7.5.0. and i’m encountering a issue:
The issue started when i tried to use some functionality to show gui elements when hovering over a mesh.
I get the error: ‘Uncaught Error: getFontOffset is not implemented’.
The scene will also turn white on WebGPU or the default background color on WebGL2.
After some debugging i found out that my project was creating 2 engines:
The first engine that is created is the one i have setup myself.
The second engine i think is created during the flow off the Tools.CreateScreenshotUsingRenderTargetAsync().
More specific when the function _createDumpRenderer is triggerd from the DumpTools class.
This function creates a new engine that is then used when adding a TextBlock to a Rectangle as a control and results in the error: ‘Uncaught Error: getFontOffset is not implemented’ .
I have reproduced the issue in this playground:
The app will throw the ‘getFontOffset is not implemented’ error when hovering over the sphere.
Note: If you where to push the run button after a refresh and before hovering over the sphere, it will work as intened.
When starting from a fresh page and you look at the console:
You can see that there are 2 engines created.
When i comment out the function BABYLON.Tools.CreateScreenshotUsingRenderTargetAsync() only one engine is created.
I have created this playground where the line to create the screenshot has been commented out:
Did i find a issue or am i using the screenshot tool incorrect?
(extra note: The playgrounds are setup starting on webGPU. If you would like to test it with webGL2 you need to open a new playground and paste the code there and push the run button once. If you where to press the run button twice it will work as intended.)
Thanks in advance!