Need ideas on optimizing simple scene for Intel UHD

Hello, I have a very simple scene that I am trying to get to reach 60 FPS on low-spec Intel UHD machines.

Actually it already reaches that at lower resolution (eg. 1920x1080). But for the resolution I am testing at (2560x1440 screen), it gets about 45-50 FPS.

This is the inspector readings:

I have optimized as much as I could:

  • All textures except 1 are KTX2 compressed (about 4 2048x2048 textures plus 1 512x512)
  • Almost all meshes are instances with uvOffsets, resulting in only 8 draw calls
  • Meshes have alwaysSelectAsActiveMesh set to true resulting in 0 time spent in “Meshes selection”

The Absolute FPS is about 400, but the actual framerate is only 47.

It looks like a lot of time is spent in Inter-frame, but I don’t know how I can lower that.

I’m not doing much of anything per-frame in JavaScript as it a static scene.

However, if I remove the ground or do other things that reduce drawing required such as reduce window size, then the fps is fine and Inter-frame value goes down. It seems like it is fill-rate limited?

For comparison, here is the same scene in on my main dev machine with steady 60 fps.

I’m wondering what else I can do.

EDIT: I solved it! Turns out it was the semi-transparent HTML ui components that I was overlaying on top of the Babylon Canvas LOL! Will leave this post here in-case someone sees this and it helps.

EDIT2: Replied with additional optimizations that worked in my case.

1 Like

Love that!!

1 Like

Update after further optimizations.

After further development of the game a bit, I found that on my Intel UHD test machine the animations weren’t always smooth. So I looked into it and tried to optimize further with the hypothesis that the problem was being fill-rate limited.

Here is what I found

  • I was using useLogarithmicDepth because some of the meshes were very near each other. However later I adjusted the near-far planes of the camera and so the log depth wasn’t needed. After I turned it off GPU frame time dropped by about 1.5ms.
  • I tried reverting back to drawing separate meshes instead of instances cause I thought it might help with zbuffer utilization, but it didn’t help. I didn’t try sorting the rendering order manually though.
  • I tried using needDepthPrePass but couldn’t get it to work at first. Turns out it was due to scene.freezeActiveMeshes so I had to turn that off. Once needDepthPrePass was working the GPU Frame time dropped by half!

This is the current result on the Intel UHD machine:

So to summarize, what helped for me for low spec Intel UHD GPUs which are fill-rate limited was turning useLogarithmicDepth off and using needDepthPrePass.

2 Likes