ID:2488792
 
Resolved
Applies to:
Status: Resolved

This issue has been resolved.
I would like to turn anti-aliasing off for map rendering.

The reason for this, is because it seems impossible to achieve a non-blurry screen zoom effect via:

obj/hud/master_plane
plane = 0
appearance_flags = PLANE_MASTER
screen_loc = "1,1"

New()
..()
var/matrix/m = new()
m.Scale(1.25)
transform = m


It does not matter what zoom value I input, there is always a noticeable blur.

I was suggested by another developer (using another engine) to turn anti-aliasing off to get the same effect they did -- and so here I am.

Thanks for reading.
Lummox JR resolved issue
PIXEL_SCALE exists for exactly this purpose.
Yeah, you're right. Turns out PIXEL_SCALE only achieves the desired effect when using whole numbers for the scaling, otherwise it destroys the pixels.

In response to FKI
FKI wrote:
Yeah, you're right. Turns out PIXEL_SCALE only achieves the desired effect when using whole numbers for the scaling, otherwise it destroys the pixels.

Did you expect a different result?
Yes and no. I expected a non-blurry scale, but not the ugliness I saw. It wasn't until Zane mentioned something about "bicubic scaling" and needing to use whole numbers, that I found out that feature isn't as simple as the reference suggests.
I've clarified the reference entry for that in 513's ref. PIXEL_SCALE uses nearest-neighbor sampling. When you use non-whole-number scaling, or rotations, you'll see a lot of distortion.

I believe what you really want is something like the nice-upscale shader that BYOND uses in the map renderer by default. This shader uses four carefully placed samples to act as though it's upscaling via nearest-neighbor to the next whole number, then downscaling via linear sampling to the correct size.