Force unstretched integer scaling to be precise #93796
Open
+34
−8
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.
Both viewport size and 2D size override are limited to integer for now, therefore having a window size that is not divisible by the scale factor may cause scaling artifacts.
We can prevent this by shrinking the usable window viewport down to the nearest size that is fully divisible by the scale factor. Only apply this for integer scale factors, as this is mostly useless for fractional scale factors.
(In theory scale factors like 1.5 could also benefit from this kind of rounding, but this will require changing viewport size to accept floating point sizes to be really useful.)
Fixes #79726
Unresolved defects with OpenGL rendering:
I think both of the above should be corrected in
godot/drivers/gles3/rasterizer_gles3.cpp
Line 369 in 4ab8fb8