Open therabug opened 1 week ago
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
Marked this as a draft until you have it ironed out, just for clarity on our end. Appreciate looking into this
thank you!
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.