0 votes

Hey,
in my game I want test lowering the 3d resolution to improve performance as stated in the docs:

If Stretch Mode is set to something other than Disabled, the size of
the root viewport is scaled down by the Shrink factor, and pixels in
the output are scaled up by the same amount. This is rarely useful for
2D games, but can be used to increase performance in 3D games by
rendering them at a lower resolution.

https://docs.godotengine.org/de/stable/tutorials/viewports/multiple_resolutions.html#stretch-shrink
This is e.g. how my main menu in the game looks like:
enter image description here
I've set my stretch mode to "2d" and the aspect to "expand" in the project settings, which is working fine.
Now I want the 3d resolution to be lowered. When I set the shrink value up, my 3d render resolution is correctly lowered, but my ui is messed up:
enter image description here

How can I achieve the lower 3d resolution without scaling the ui?

asked May 19 in Engine by TobiLa (160 points)

1 Answer

0 votes

How can I achieve the lower 3d resolution without scaling the ui?

You need to use two viewports. This means you'll need to create one Viewport node, as Godot will automatically create a viewport for you (it's often called the "root viewport").

The root viewport will render 2D elements, whereas the Viewport node will render the 3D scene. This way, the Viewport node can have its resolution decreased without affecting 2D elements.

There is a demo that showcases this here: https://github.com/godotengine/godot-demo-projects/tree/master/viewport/3d_scaling

answered May 19 by Calinou (5,674 points)
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.