graphics icon indicating copy to clipboard operation
graphics copied to clipboard

Scaling graphics causes artifacting

Open KongouDesu opened this issue 6 years ago • 0 comments

I'm trying to make piston scale my graphics automatically, but it seems to cause some wierd artifacting.

What I'm trying to do is cause my coordinate space to be stretched to fit the size of the window, without changing the coordinates. I'm currently using this code to scale it, which does work: c.transform = c.transform.scale( args.width as f64 / 1920., args.height as f64 / 1080. ); Where args is "RenderArgs" and c is "Context". This causes everything everything to be sized and positioned relatively with 1920x1080 being the lower left corner. However, it causes some serious artifacting. This image (the image is only the black part and has no white in it) image Turns into this (again, blue is just a background) image When the window size is 1900 by 1000. The issue is present even downscaling by eg. 0.5x. In fact, this happens even if the window is 1920 by 1080 and no scaling should happen.

The issue might be solved by using a Viewport, but it doesn't seem obvious to me how it's supposed to be used, and I couldn't get it to work properly when trying.

Is this because I'm scaling it incorrectly, not using a viewport, or a bug?

KongouDesu avatar Aug 09 '18 19:08 KongouDesu