Hello everyone, I have been struggling with the performance of Gaussian Splatting on MacOS for a long time. I have been attempting to match the performance of Gaussian Splatting in Babylon with that in PlayCanvas SuperSplat. When using splat data with 5 million points, their framerates are very close on Windows Chrome. However, the framerate of PlayCanvas on MacOS is about 3 to 4 times that of Babylon on Mac.
I have gone through the optimization guides for both Babylon and PlayCanvas. My current attempts are as follows:
Making the camera static, which means sorting is not running.
Profiling with the Chrome profiler shows that the CPU payloads are both very small, almost empty.
Comparing the draw calls captured from Spector.js, number of draw calls are same, and each drawElementsInstanced shares the same parameters including instance count, types, depth, and blending.
Simplifying both shaders to draw square quads and pure colors only, abandoning the Gaussian projection parts and alpha calculation parts. However, the framerate gap does not change.
Syncing WebGL parameters such as antialias: false, powerPreference: "high-performance" tag, etc.
Both using maxPixelRatio (window.maxPixelRatio is 2 on MacOS), and the visual results did match after setting this.
Reordering splats buffer with Morton order for better gpu memory access at render time, this did increased the framerate of Babylon by 15%, but the performance gap remains significant.
No multisampling techniques for both impl.
After all of these optimizations and comparisons, the framerate of Babylon’s Gaussian Splatting is still about 1/3 of PlayCanvas. In general, these two implementations are quite similar, and after point 4 and 7 above, they are almost identical.
I am wondering if there is any optimization that I might have missed that could be causing this performance gap, especially on MacOS? With current attempts I think the problem is probably not within the implementation of GS.
Many thanks!
Tip:
There’s no clue in this thread that suggests any connection to Engine’s antialias option has no effect, as Gaussian Splatting does not employ HDR or antialiasing. Their behaviors simply exhibit some similarities.
By the way, is there a way to verify multisampling or other antialiasing techniques?
Even though I have disabled antialiasing and have not set multisampling anywhere else, this behavior does seem like it could be related to multisampling. How can I double-check this?
Thank you! My canvas size is 3584x2066, which is twice the CSS size of 1792x1033.
I tried using engine.setHardwareScalingLevel(0.5). It had the same effect as my current usage of new Engine(..., ..., ..., true). Both methods cause the rendering size to be twice the CSS size, and their framerates are also the same.
It seems that setting hardwareScalingLevel to 0.25 is equivalent to setting the canvas size to 4x. I don’t understand why this would increase the framerate.
Let me guess. That sounds to me like the retina-resolution (the original ‘retina’ = *2). In fact you are rendering the canvas at retina resolution (where on PC, you are rendering at just the original size)
Yes, I am on a retina screen. The issue is that PlayCanvas’s GS is also on a retina screen, and both Babylon and PlayCanvas are using a canvas with the same large size. After some checks, no multisampling is used in both impls, so there should be no significant difference.
Honestly, I have no faen clue, but that’s an assumption, I wouldn’t make without knowing.
May be the easiest would be to put your monitor resolution to non-retina (just a fixed default of say HD). As said, I will attempt some tests on my rig (since I can have retina - the new one *4) is set by default on both MAC and WIN. Running the tests in both environment at different resolution will take a bit of time though! I’ll let you(rs) know when I get a chance to test this.
I just compared PlayCanvas GS and Babylon GS on a 1080p screen connected to my Mac. Their framerates are now almost the same. So I suppose this test can also confirm that the issue should not be related to the implementation of Babylon GS itself.
Thanks for that. I suppose this come like a relief for all of us (and for the Team)
Now, we just have to figure this mac related issue. With retina and the possible activation of the default rendering pipeline in non-HDR mode (which is the part that really strikes me, if it really is so ) Honestly, I never noticed it so far but I also avoid playing with the hardware scaling (because it messes up other things like the gui and text display). I’m also not making any FPS or things that would require a high-level of FPS optimization. So, as long as the relation between rendering at different resolutions with or without post is still ‘acceptable’ for my project/experience, I never really bothered with doing enhanced tests for performance.
I would like to clarify that, there’s no clue this thread that suggests any connection to Engine’s antialias option has no effect, as Gaussian Splatting does not employ HDR or antialiasing. Their behaviors simply exhibit some similarities.
Sorry for my poor expression. Setting the hardware scaling level higher than 1 would simply result in blurry rendering, which is equivalant to reduce canvas size directly. I aim to enhance the performance in full Retina resolution rather than compromise it for resolution.