0 votes

Best way to control graphical settings in Godot 3.1 with options like: low, medium, high and ultra. Is possible to control at runtime?

in Engine by (66 points)

1 Answer

0 votes
Best answer

There are no complex graphics setting like "low", "medium" etc. in Godot. You need to create your own custom settings. For example:

HIGH
-msaa 16x
-anisotropic filtering 16x
-shadows resolution 8192
-ambient occlusion on (high quality)
-subsurface scattering on

MEDIUM
-msaa 8x
-anisotropic filtering 4x
-shadows resolution 2048
-ambient occlusion on (low quality)
-subsurface scattering on

etc, etc.

These settings can be controlled via "Project Settings" or directly via script (see Docs).

by (144 points)
selected by

I got It changing in project settings via script and adding the command:

ProjectSettings.save()

But only change when i restart the game, You know if its possible change at runtime?

Be aware that saving the ProjectSettings (so that they are automatically loaded on next start) might not work on Android/iOS as they don't allow writing in res:// from where the settings are usually loaded.

To stay on topic:
Depending on the game, you can also change the max distance of shadows on lights (may be set it to 0 on very slow machines).
You can also change the ViewRange of the Camera.

And you can scale the viewport to run the game i.e. at half resolution.
(You'd have to scane the gui accordingly.)

These can be set/changed at runtime.

Actually MSAA, AO, subsurface scattering and shadow resolution (i mean omni and spotlights) you can change on-the-fly from script:

get_viewport().set_shadow_atlas_size(4096)
get_viewport().set_msaa(get_viewport().MSAA_4X)
get_node("Camera").get_environment().set_ssao_enabled(false)

etc.

Directional light(s) shadow resolution you can change only via ProjectSetting + restart.

I'm trying to do the same but I don't know how. Can someone explain to me in more detail because I'm new to this field.
I will do whatever you say in return

Anything for changing the texture resolution?

Godot have a Size Limit option on the Import tab if you have a texture selected, I don't know how it works but it seems that is what You want.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.