1
\$\begingroup\$

I don't care how much you insist that Graphic API doesn't matter, I've tested it and I've seen other people test and yes switching graphic API can literally half your FPS.... 50% of your FPS gone just by switching how you render 3D stuff.

But some players might prefer sacrificing 80 fps to get that 1% boost in graphical quality... or some other players might just be playing on a particular machine that runs better on a Graphic API that would make other players run at low FPS.

For those type of people.... how do I put the option for them to switch Rendering API ?

\$\endgroup\$

2 Answers 2

4
\$\begingroup\$

Godot won't let you change rendering backends in runtime. Thus, I'd suggest to create a launcher where the player can choose before running the actual game.


In Godot 3, you cannot change the rendering of the exported game. Thus, we might be talking of separate downloads.

I suppose you might be able to reuse PCKs. See Exporting packs, patches, and mods.

The options you have are, of course, GLES2 and GLES3. With GLES2 being intended to be compatible with more devices, while GLES3 does not care and goes for features (Consequently many old smartphones that support GLES3 did get black screens with Godot GLES3 exports because it was not implemented for compatibility, so it required some extensions without fallback if they weren't available).


In Godot 4 you can use command line arguments to change rendering.

You can get the valid options using --help. These are the options (at least on Windows 10):

  • No Display

    --display-driver headless
    
  • Forward+ (Intended for modern desktop GPUs)

    --rendering-method forward_plus --rendering-driver vulkan
    
  • Mobile (Optimized for mobile GPUs)

    --rendering-method mobile --rendering-driver vulkan
    
  • Compatibility (Intended for old GPUs that do not support Vulkan)

    --rendering-method gl_compatiblity --rendering-driver opengl3
    

Notes:

  • There is an --rendering-driver dummy which is automatically selected when you use --display-driver headless.
  • If you do not specify --display-driver headless, then --display-driver windows is assumed.
  • To have display, you need to specify a working combination of --rendering-method and --rendering-driver or Godot will halt with an error message.
  • The OpenGL rendering backend is not feature complete at the time of writing.
  • You should be able to use Metal on macOS, but I don't have the means to test it at the time of writing.
  • There might be other options added in the future (including DirectX support, for which the development is being financed by W4 Games), but it is not available in official builds at the time of writing.
\$\endgroup\$
0
\$\begingroup\$

Can my game have multiple rendering APIs?

Yes, sure it can. Some games have the option to switch between OpenGL/Vulkan (Doom 2016) or DirectX11/12 (Total War: Warhammer II).

I've tested it and I've seen other people test

So, you've tested and seen other people test, then you should know it's possible.

For those type of people.... how do I put the option for them to switch Rendering API ?

May I suggest a drop-down list inside the graphics settings with all your supported APIs and let the player choose?

Or, if your game has a launcher, then it's also a very good place to put this option, so the user don't have to restart the whole game for the changes to take effect.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ I'm fairly certain that neither Doom 2016 or Total War: Warhammer II were written in godot - how can the problem be addressed using the engine tagged in the question? \$\endgroup\$
    – Pikalek
    Commented Aug 21, 2023 at 18:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .