godotengine / godot

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

Scene drag-and-drop in the 3D editor is dependent on physics FPS, making it look sluggish on high refresh rate monitors #94106

Open Calinou opened 2 months ago

Calinou commented 2 months ago

Tested versions

System information

Godot v4.3.beta (92c8e87cd) - Fedora Linux 40 (KDE Plasma) - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (nvidia; 550.90.07) - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)

Issue description

This means that at the default value of 60 ticks per second, drag-and-drop isn't as smooth as it could be.

https://github.com/godotengine/godot/assets/180032/de51535f-5561-43ad-bd70-6916fd72c425

It gets worse if you use a lower value in the project settings though, such as 10:

https://github.com/godotengine/godot/assets/180032/826bf8a9-9db7-4318-a11e-c87b021032d3

While drag-and-drop depends on a physics operation (raycasting to determine where to place the dragged object), it can safely be done every rendered frame as raycasting isn't an operation that needs to be synchronized to the physics tick rate.

Steps to reproduce

Minimal reproduction project (MRP)

N/A

ryevdokimov commented 2 months ago

I commented on this briefly when submitting a PR for fixing a similar issue in 2D.

https://github.com/godotengine/godot/pull/87886#issuecomment-1925030050

Since this functionality relies on the physics server, having it query on regular process ticks will cause the editor to crash when physics is set to run on a separate thread. The only idea I have at the moment is to decouple editor specific physics functionality (this one and snapping to floor) somehow.

Calinou commented 2 months ago

having it query on regular process ticks will cause the editor to crash when physics is set to run on a separate thread.

We could do this when Run on Separate Thread is disabled at least (it's the default).

ryevdokimov commented 2 months ago

Yeah, true. Although, I think the relevant code is already pretty hacky, and doing that would kind of make it more confusing, but it would certainty solve this problem quickly with minimal risk.