2D Toolkit Forum

2D Toolkit => Support => Topic started by: Aaron on September 20, 2013, 10:56:05 pm

Title: Graphical glitches when using ZoomScale
Post by: Aaron on September 20, 2013, 10:56:05 pm
Hi all. I'm doing some tests with 2DToolkit and at one point in my game I wanted to zoom in the 2D Camera for a closer look. However when it does I start to get graphical glitches on the display. Pixels, lines and things flash every now and then. Now It could be Unity but seeing as it only happens when I use the 2DToolKit and when I use ZoomScale.


Title: Re: Graphical glitches when using ZoomScale
Post by: unikronsoftware on September 20, 2013, 11:56:14 pm
It really depends what kind of glitches you're seeing, and how you have your sprite collection set up. If you don't have padding turn on padding. Zoom scale doesn't do anything different to changing the camera ortho size, so if you're seeing glitches, it will just be how the atlas is set up, and what options you've got set up.
Title: Re: Graphical glitches when using ZoomScale
Post by: profanicus on September 21, 2013, 12:36:54 am
Does zooming cause things to no longer fall on pixel boundaries?
Title: Re: Graphical glitches when using ZoomScale
Post by: Aaron on September 21, 2013, 10:03:57 am
Many thanks. I changed the padding from Default to 1 and they disappeared. How come the Default padding (of zero I assume) would do such a thing? The terrain was just an image that had a line drawing on it and was diced. Here's a link demonstrating it. Let the ship drop down low (Keep thrusting so you don't plummet into the ground ;) ) and you'll see it start to happen.

http://littlegeek.co.nz/test/Landy.html

Thanks
Title: Re: Graphical glitches when using ZoomScale
Post by: unikronsoftware on September 21, 2013, 11:20:29 am
Default padding depends on if you're using point or bilinear filtering. It should be 1 for bilinear, 0 for point IIRC. Yours looks bilinearly filtered, so I'm not sure why setting padding to 1 changes anything - are you using the default shaders?

Title: Re: Graphical glitches when using ZoomScale
Post by: Aaron on September 22, 2013, 04:30:05 am
Hi.

My Filtering setting in the SpriteCollection settings is 'Point' so that would be 0 padding. I was just curious if there's an issue with the dicing that could be doing this?

Everything else is pretty mush default and I haven't fiddled with the shaders.

Thanks


Title: Re: Graphical glitches when using ZoomScale
Post by: unikronsoftware on September 22, 2013, 11:24:22 am
No, but dicing breaks everything apart into even smaller chunks - theres a lot more room for things to go wrong there due to misalignment in any way.