Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terrible performance in Godot 3D using Forward+ in a simple scene #82238

Closed
SaadTheGlad opened this issue Sep 24, 2023 · 6 comments
Closed

Terrible performance in Godot 3D using Forward+ in a simple scene #82238

SaadTheGlad opened this issue Sep 24, 2023 · 6 comments

Comments

@SaadTheGlad
Copy link

Godot version

v4.1.1

System information

Godot v4.1.1.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce MX110 (NVIDIA; 31.0.15.3742) - Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz (8 Threads)

Issue description

I have terrible performance when running a very simple scene which contains one box, a simple player controller and a simple skybox without glow (I will explain why this is important). Here is the scene tree:
image

When I run the game, and this is without the glow post processing, without V-Sync and these antialiasing settings and world environment settings:
image
image

I get around 85fps:
image

Now, this is already terrible as I have practically added nothing yet, but if I add glow as a post processing effect, I get this:
image

It drops to 50fps.

Here is the player movement script that I'm using: https://pastebin.com/8FiraqV6

This probably has to do with the fact that Godot is using Vulkan, which I hear has some problems, but I'm unsure if it should be causing this much of a performance hit. I can run other games perfectly fine that are much more demanding than a skybox and a CSGbox.

Finally here is my profiler data with the last settings I mentioned:
image
The change in the middle is caused by me alt-tabbing to the game and back

And the visual profiler:
image

Steps to reproduce

  • Start a basic scene
  • Add directional light, the world environment, antialiasing
  • Add basic player movement
  • Add FPS counter

Minimal reproduction project

minimal reproducation project.zip

This project is written in C#. I could not write it in GDScript as I do not know how. Sorry.

@rsubtil
Copy link
Contributor

rsubtil commented Sep 24, 2023

I happen to have an old laptop with this exact CPU and GPU, so I tried this out of curiosity. I've tested launching your scene, staying idle for 5 seconds, and then collect the average FPS values on this laptop, as well as my main setup:

Testing Settings Intel i5-8250U / Nvidia MX 110 Ryzen 5600G / AMD RX 6500 XT
Forward+ Renderer, Glow On 114 FPS 687 FPS
Forward+ Renderer, Glow Off 209 FPS (+83%) 911 FPS (+32%)
Compatibility Renderer, Glow Off * 343 FPS (+64%) 2776 FPS (+304%)

* the compatibility renderer still hasn't support for glow

I'm getting substantially more performance than in your setup. I'm also getting similar graphs in the visual profiler without any outlier when compared to yours. Might there be any hardware/software issue that's costing you performance?

Regardless of it, in your case it might be better to switch to the compatibility renderer anyways if its current drawbacks don't affect you (lack of glow and 3D shadows are the biggest ones I believe). This was an already entry-level graphics card at the time, and I had some notable performance issues when running Vulkan games when compared to OpenGL, so I think this card has some poor Vulkan driver support.

@SaadTheGlad
Copy link
Author

@rsubtil Hmm that data you have means that there is definitely something else happening because a difference of almost 60fps between my rig and yours (where they should be identical) is pretty weird. The problem is that I do need shadows and compatibility just doesn't seem viable. It's a shame that Godot only has Vulkan support because not all cards support it properly. I've updated my drivers and everything else so I'm not sure what else I could try at this point...

@rsubtil
Copy link
Contributor

rsubtil commented Sep 24, 2023

Yeah, the compatibility renderer is not a drop-in replacement right now. It will improve in the coming future, but there will still be features that'll be exclusive to the new one.

There's also the possibility of using Godot 3; it should give you more performance and it will still be supported for the foreseeable future.

@SaadTheGlad
Copy link
Author

Hmm Godot 3 is an option but 4.1 does have all the new features and is much more convenient I've heard. Anywho, I'll keep looking into this problem and see if I can find a fix. Follow up question, will the compatibility renderer gain as much functionality as Forward+? Wouldn't it be best if there was a Vulkan and OpenGL renderer with the same functionality in the same engine or is that not feasible right now?

@rsubtil
Copy link
Contributor

rsubtil commented Sep 24, 2023

Hmm Godot 3 is an option but 4.1 does have all the new features and is much more convenient I've heard. Anywho, I'll keep looking into this problem and see if I can find a fix. Follow up question, will the compatibility renderer gain as much functionality as Forward+? Wouldn't it be best if there was a Vulkan and OpenGL renderer with the same functionality in the same engine or is that not feasible right now?

I believe they are fundamentally different renderers, going beyond just changing API from OpenGL to Vulkan. So it's very likely some newer features won't be possible on the Compatibility renderer. The team has wrote a few blog posts (here and a whole series detailling it's progress here) if you want to find more details about this.

@Calinou
Copy link
Member

Calinou commented Sep 24, 2023

Godot is a modern engine with a highly flexible renderer and modern visuals, so MSAA is much more expensive than it would be in an oldschool engine. This means using MSAA in modern engines on such bandwidth-constrained GPUs1 is a bad idea. You also don't want to be running 3D games at 1920×1080 on those GPUs (1600×900 or preferably 1366×768 are more viable targets).

Given your hardware, I suggest you stick to Godot 3.x for now and use the Compatibility rendering method once it suits your needs. Note that Compatibility will never be as full-featured as Forward+ though, as it's designed to cater to old/low-end devices.

Closing in favor of #68959, which tracks a similar issue.

Footnotes

  1. Comparison with GTX 1060 and GTX 1060 Mobile, which are 7-year-old mid-range GPUs: https://www.videocardbenchmark.net/compare/3860vs3805vs3548vs4086/GeForce-MX110-vs-Intel-UHD-Graphics-620-vs-GeForce-GTX-1060-vs-GeForce-GTX-1060-(Mobile)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants