Skip to content
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

Use Viewport's 3D Scaling in the 3D editor's Half Resolution option #93436

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,9 @@ void Node3DEditorViewport::cancel_transform() {
}

void Node3DEditorViewport::_update_shrink() {
bool shrink = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_HALF_RESOLUTION));
subviewport_container->set_stretch_shrink(shrink ? 2 : 1);
subviewport_container->set_texture_filter(shrink ? TEXTURE_FILTER_NEAREST : TEXTURE_FILTER_PARENT_NODE);
const float scaling_3d_scale = GLOBAL_GET("rendering/scaling_3d/scale");
const float shrink_factor = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_HALF_RESOLUTION)) ? 0.5 : 1.0;
viewport->set_scaling_3d_scale(MAX(0.25, scaling_3d_scale * shrink_factor));
}

float Node3DEditorViewport::get_znear() const {
Expand Down Expand Up @@ -2729,8 +2729,6 @@ void Node3DEditorViewport::_project_settings_changed() {
viewport->set_positional_shadow_atlas_quadrant_subdiv(2, Viewport::PositionalShadowAtlasQuadrantSubdiv(atlas_q2));
viewport->set_positional_shadow_atlas_quadrant_subdiv(3, Viewport::PositionalShadowAtlasQuadrantSubdiv(atlas_q3));

_update_shrink();

// Update MSAA, screen-space AA and debanding if changed

const int msaa_mode = GLOBAL_GET("rendering/anti_aliasing/quality/msaa_3d");
Expand Down Expand Up @@ -2758,8 +2756,7 @@ void Node3DEditorViewport::_project_settings_changed() {
const Viewport::Scaling3DMode scaling_3d_mode = Viewport::Scaling3DMode(int(GLOBAL_GET("rendering/scaling_3d/mode")));
viewport->set_scaling_3d_mode(scaling_3d_mode);

const float scaling_3d_scale = GLOBAL_GET("rendering/scaling_3d/scale");
viewport->set_scaling_3d_scale(scaling_3d_scale);
_update_shrink();

const float fsr_sharpness = GLOBAL_GET("rendering/scaling_3d/fsr_sharpness");
viewport->set_fsr_sharpness(fsr_sharpness);
Expand Down
Loading