-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to preview the 3D scene as a background to the 2D editor #51817
base: master
Are you sure you want to change the base?
Add an option to preview the 3D scene as a background to the 2D editor #51817
Conversation
540a781
to
6f023ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM 🙂
This can be used while designing a HUD to make sure it's readable on top of a 3D scene.
6f023ae
to
d0d59d4
Compare
Rebased and tested again, it works as expected. |
bool shrink = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_HALF_RESOLUTION)); | ||
|
||
if (shrink != (subviewport_container->get_stretch_shrink() > 1)) { | ||
subviewport_container->set_stretch_shrink(shrink ? 2 : 1); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is not present in Viewport::apply_project_settings()
, but it was broken and did nothing in master
anyway (it still works in 3.x
).
This will need to be adjusted to support reading the 3D scale project setting, and also to support an editor-only override of the resolution factor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't look related to this PR. You could split it into a separate one.
If you have two scenes open, one with a camera and one without, using the 3d background feature on the second scene incorrectly renders from the camera in the first scene. In my opinion, it makes more sense to just use the 3D viewport's camera position. Although this would require a lot of technical work (data sharing between plugins 🤢) and there's edge cases (e.g. when the 3D plugin is disabled). Probably not within the scope of these PRs. |
master
version of #51840.This can be used while designing a HUD to make sure it's readable on top of a 3D scene. This feature was "unintentionally" available until #50007, but exposing it as an option that's disabled by default makes more sense.
The main limitation right now is that you can't move the camera by switching to the 3D editor then going back to the 2D editor. Instead, its position will be set based on the initial camera position when the scene was opened.
This closes godotengine/godot-proposals#2635.
Preview
Note: MSAA/FXAA/debanding support for the 3D preview was added after this video was recorded. It will be synchronized with the project settings, like in the 3D editor.
2d-editor-3d-preview.mp4