To keep it short, I recently noticed some strange lags on a new Babylon.js project running in Chrome.
When I test the exact same scene on Firefox, everything is perfectly smooth — great performance.
I couldn’t find any issues in my code that would explain this discrepancy (I really hope it’s not my code!).
To check if the issue was local, I decided to test an old, quite GPU-intensive online project. The results are striking: Firefox performs much better than Chrome. Firefox is smooth, while Chrome is very choppy.
Could you please test the provided URL on your end? I’m hoping it’s just a local issue on ‘my end’ and that Chrome and Firefox behave the same way for everyone else.
My specs are: Windows, latest versions of Chrome and Firefox, NVIDIA RTX 3060.
Edit/Update: I just recompiled the project from the URL above locally using Babylon.js 8.4. Firefox is still significantly ahead in terms of performance. (60 fps vs 40-50fps in chrome)
Also as a quick test, after the instanciation of the engine, could you try setting disableUniformBuffers to true ? and the second experiment setting engine.getCaps().supportSRGBBuffers = false ?
Those were two perf culprits in the past and I wonder if the fixes could have regressed somehow.
Cannot confirm? Chrome fast, Firefox slow. (There is no fps indicator, but Firefox is visibly creepingly slow. Chrome has the occasional lag (LOD switch?) but runs smooth otherwise)
I only noticed the regression yesterday. It had been a long time since I last ran the demo.
Setting disableUniformBuffers to true and/or checking engine.getCaps().supportSRGBBuffers as false made no difference.
I posted the demo back in June 2024. I just reinstalled Chrome version 126 from June 2024. The demo now runs normally/smoothly, with no more lag. I will try on my end to find when the specific Chrome version that reproduces the ‘malfunction’ . I will also check the graphics drivers. Thanks for your help !
I reproduce the problem in Chrome retail 142.0.7444.177 (Official Build) (64-bit), but it’s ok in latest Chrome Canary 145.0.7564.1 (Official Build) canary-dcheck (64-bit).
I guess a Chromium ticket with those info would be amazing at this point ? and I ll be sure to forward ASAP as it sounds pretty bad even more if not totally addressed in Canary.
The mistake was located in the GPX track path drawing. It is drawn onto a large dynamic texture and then blended within each shader of every tile.
The error or inconsistency I noticed is that, within the updatePath method, I was not starting the path with the beginPath instruction. I was continuing directly my lineTo instruction with every call.
In the playground that illustrates my laggy development environment, simply uncommenting lines 48 and 49 restores the normal behavior.
Is the new Chrome version more strict? Were the older is more permissive? regression on their end ? Or is it simply a development error in my code that took advantage of a lax environment?!
up to you to determine the appropriate action now.
Strangely, firefox is completely stuck with the playground, the demo runs smooth…