godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.83k stars 21.13k forks source link

GraphEdit in the editor scales GraphNodes according to editor scale but not positions, leading to broken display at scales different than the design scale #98513

Open ArseniyMirniy opened 1 week ago

ArseniyMirniy commented 1 week ago

Tested versions

Godot 4.3 Stable

System information

Windows 10 64, Godot 4.3 Stable, Forward+

Issue description

Godot Engine does not respect the grid of visual nodes (in shaders or other graphs) if the UI scale has changed. It is crucial for public projects or games developed by multiple people on different screens. Or even if a single person tries to work on a desktop (100% scale) and laptop (150-200% scale).

You made a node graph, when your system is at 100% scale, it looks clean:

Godot_Visual_Shaders_Bug

With 150% scale, nodes are mashed together:

Godot_Visual_Shaders_Bug2

With 200% scale, it gets even worse:

Godot_Visual_Shaders_Bug3

The solution is not just change sizes of nodes themselves, but also make them respect the grid (and reorganize accordingly).

Steps to reproduce

  1. Use system scale of 100% (and/or editor scale of 100%)
  2. Make a visual shader with several nodes aligned in a grid, save it
  3. Change UI scale (in the system or in the Godot Editor), relaunch
  4. Grid is now messed up completely

Minimal reproduction project (MRP)

You can try my graph from here: https://github.com/ArseniyMirniy/Godot-4-Free-Color-Correction-and-Screen-Effects-Visual-Shader

Calinou commented 1 week ago

This should likely be fixed by never scaling anything drawn within GraphNode/GraphEdit in the editor theme, and having only the default zoom level change instead (i.e. what appears as 100% zoom). The same approach is used for the 2D editor viewport already.

GraphNode/GraphEdit use fully vector-based drawing (including MSDF fonts), so they will still look good at high zoom levels.

ArseniyMirniy commented 1 week ago

This should likely be fixed by never scaling anything drawn within GraphNode/GraphEdit in the editor theme, and having only the default zoom level change instead (i.e. what appears as 100% zoom). The same approach is used for the 2D editor viewport already.

GraphNode/GraphEdit use fully vector-based drawing (including MSDF fonts), so they will still look good at high zoom levels.

  1. If so, is the fix a relatively fast with tweaking a few settings in one place and adding the scale factor to zoom level in another? If so, can it be expected in 4.4 or 4.5 at least? I will be glad to test!

  2. Off-topic: thanks for AgX, it's a cool addition to the engine, can't wait to see 4.4 Stable