This is useful for 3D games with a pixel art appearance, or when
using a resolution scale of `0.5` to improve performance without
compromising crispness too much when not using FSR 1.0.
The property hints now allow decreasing the scale further to accomodate
for pixel art use cases, as well as increased precision in the value
(useful for a scale of `0.3333`).
Co-authored-by: Daniel Savage <dansvg@gmail.com>
Co-authored-by: Kaleb Reid <78945904+Kaleb-Reid@users.noreply.github.com>
I believe the crash is a stale-lifetime bug in 3D picking.
Viewport::_process_picking() caches last_object / last_id for multiple queued
input events at the same pointer position. If the first _input_event callback
removes the picked CollisionObject3D or current Camera3D from the tree, the next
queued event can still reuse that cached target and call
_collision_object_3d_input_event(), which immediately does get_global_transform
on an object that is no longer safe to query.
The patch does four things:
1. It rejects captured 3D pick targets that are no longer is_inside_tree()
before reuse at viewport.cpp (similar changes exist in the code):
2. It re-fetches the cached same-position object from ObjectDB, verifies it
still matches the cached pointer, and verifies it is still in the tree before
dispatching.
3. It skips _mouse_exit() for a hovered 3D object that has already left the tree
at viewport.cpp.
4. It adds a final guard inside _collision_object_3d_input_event() so even a
future caller cannot query transforms on removed nodes or cameras at
viewport.cpp.
This allows removing it from `class_db.h`, significantly reducing the amount of files
that include it transitively.
Also includes some include cleanup in `control.h` and `rich_text_label.h` done while
ensure they don't depend on `callable_mp`.
This will allow decoupling `display_server.h` from a number of headers in the
codebase which only require those enums and not all the DisplayServer API.
A number of headers in the codebase included `rendering_server.h` just for
some enum definitions. This means that any change to `rendering_server.h` or
one of its dependencies would trigger a massive incremental rebuild.
With this change, we decouple a number of classes from `rendering_server.h`,
greatly speeding up incremental rebuilds for that area.
On my machine, this reduces incremental compilation time after an edit of
`rendering_server.h` by 60s (from 2m57s).