Hello Guest

Author Topic: Graphical glitches when using ZoomScale  (Read 7032 times)

Aaron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Graphical glitches when using ZoomScale
« 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.



unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Graphical glitches when using ZoomScale
« Reply #1 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.

profanicus

  • 2D Toolkit
  • Full Member
  • *
  • Posts: 167
    • View Profile
Re: Graphical glitches when using ZoomScale
« Reply #2 on: September 21, 2013, 12:36:54 am »
Does zooming cause things to no longer fall on pixel boundaries?

Aaron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Graphical glitches when using ZoomScale
« Reply #3 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Graphical glitches when using ZoomScale
« Reply #4 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?


Aaron

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: Graphical glitches when using ZoomScale
« Reply #5 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



unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Graphical glitches when using ZoomScale
« Reply #6 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.