-
Notifications
You must be signed in to change notification settings - Fork 233
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 Nearest Neighbor Scaling to 3D Viewport Options #859
Draft
therabug
wants to merge
15
commits into
Redot-Engine:master
Choose a base branch
from
therabug:add_nearest_scaling
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I can't find a way to disable bilinear. Nearest now exists but doesn't change anything? There is some "Bilinear overlay (?)" on top that I can't disable. |
Marked this as a draft until you have it ironed out, just for clarity on our end. Appreciate looking into this |
thank you! |
therabug
changed the title
Add Nearest Neighbor Scaling to 3D Viewport Options
Add Nearest Neighbor Scaling to 3D Viewport Options [WIP]
Nov 14, 2024
therabug
changed the title
Add Nearest Neighbor Scaling to 3D Viewport Options [WIP]
Add Nearest Neighbor Scaling to 3D Viewport Options
Nov 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a "nearest neighbor" scaling mode to the 3D viewport, expanding the available scaling options alongside bilinear and FSR. Nearest neighbor scaling offers a simple and efficient way to scale without interpolation, ideal for pixelated or retro-styled visuals. Unlike bilinear or FSR scaling, this method preserves hard edges and pixelation, which can be useful for both performance optimization and specific aesthetic effects.
Changes Made
Added Nearest Option to ViewportScaling3DMode Enum:
VIEWPORT_SCALING_3D_MODE_NEAREST
option within theRS::ViewportScaling3DMode
enum, allowing users to select nearest neighbor scaling for 3D viewports.Updated
_configure_3d_render_buffers
to Support Nearest Scaling:_configure_3d_render_buffers
function inrenderer_viewport.cpp
to support nearest scaling. When theVIEWPORT_SCALING_3D_MODE_NEAREST
mode is active, the target render resolution is set based on the desired scale, and the texture storage filter is set to nearest neighbor, applying a non-interpolated scaling approach.Enabled Nearest Mode Selection in
viewport_set_scaling_3d_mode
:viewport_set_scaling_3d_mode
function to handle the new nearest scaling mode, allowing users to select it and trigger the appropriate configuration changes through_configure_3d_render_buffers
.Added
BIND_ENUM_CONSTANT
toviewport.cpp
for Nearest Scaling.Added Nearest Scaling Enum to
viewport.h
.Additional Note
This new scaling mode is ideal for projects needing a retro, pixelated aesthetic or seeking optimized performance by reducing the overhead of more complex scaling methods. It provides greater flexibility and control over the appearance and performance of 3D viewport scaling.