-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 a nearest-neighbor scaling option to Viewport's Scaling 3D Mode property #79731
base: master
Are you sure you want to change the base?
Add a nearest-neighbor scaling option to Viewport's Scaling 3D Mode property #79731
Conversation
I 'm not familiar with RenderingServer, but would this help with #72548? |
Not entirely, as the use case from that issue is to scale both the 2D and 3D rendering. We only have |
686201d
to
a36519a
Compare
Rebased and tested again, it works as expected. |
CC @DarioSamo |
Code looks fine to me, although I'm not the biggest fan of nearest due to the shimmering on uneven pixel scales like the documentation points out. It makes sense to provide the option regardless. For games that actually want to preserve the pixel art aspect, I'm a bigger fan of filters like these, although they're not free performance wise compared to nearest. But like I said this is one case where the more options the better, as nearest will work properly if the developer makes sure the resolution scale is accurate. |
a36519a
to
540b914
Compare
What happens if you set resolution scale above 1 with nearest scaling? such as 2? |
It reverts to bilinear automatically if resolution scale is above 1.0: https://github.com/godotengine/godot/pull/79731/files#diff-48a2a86e07288d8aa1500bb912bd1d7e51477df56d3a0660648b2382c4a79a4bR136-R139 |
Any updates on merging this? Just saw v4.3 is almost in beta, would be nice to finally add this. |
540b914
to
f8d16e4
Compare
Rebased and tested again, it works as expected in Forward+ and Mobile. Note that 3D scaling support was implemented in the Compatibility rendering method in #83976, but I haven't implemented nearest-neighbor filtering there yet. |
…roperty 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`).
f8d16e4
to
ffe9ec6
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
@GlitchedPolygons Please don't bump without contributing significant new information. Use the 👍 reaction button on the first post instead. Edit: Add your reaction to the main post at the very top, or add your vote here (do not comment unless you have new information there either): |
sry, I'm new here and I got excited with this PR :) is there anywhere else where I can add my vote for this? |
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
).This is supported in all rendering methods.
I've made sure that effects relying on bilinear filtering to look correct (such as glow and depth of field) still work correctly. No Vulkan validation errors are reported when running with
--gpu-validation
on either rendering method.Testing project: test_scaling_3d_nearest.zip
Preview
Bilinear
AMD FSR 1.0
Nearest (this PR)