Hello Guest

Author Topic: Pixel-perfect on Bilinear on Device  (Read 6717 times)

TMK

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Dragonhead Games
Pixel-perfect on Bilinear on Device
« on: December 26, 2012, 10:56:37 am »
I'm having trouble getting pixel-perfect art on actual devices when using bilinear. It appears slightly blurry. It works perfect in the editor or PC/Mac standalone builds, it's 100% pixel perfect there, but on my iOS devices or Android devices its blurry.

Attaching a screenshot taken of my Galaxy Nexus (1280x720) of tk2d_demo 11, where you can see the hearts are blurry.

I've made sure of everything I know of that could effect this:
  • Atlas and all textures are Advanced, mipmaps off, not resized (non power of two), uncompressed format.
  • Quality settings on Android/iPhone set to Good, tried Fantastic too, and made sure both of them have Texture Quality set to Full Res.
  • Tried using both tk2dCamera, and regular camera with ortho value of half of native resolution.
  • I'm making sure that it's not scaling it up based on the device's resolution. I'm taking a screenshot from the device, and comparing it with the original PNG version, and they are exactly the same size, just the device's version is blurry.
  • Made sure position of the objects are rounded to int's, e.g. 0,0,0. Also tried setting it to -0.5,0.5 because of the half-pixel issue (but that's just on DirectX 9 I believe).
As the screenshot shows, it happens not just in my own projects, but also the tk2d demo projects.

I know that it should work to get things pixel perfect using bilinear, because it works fine in NGUI on devices (in my game I'm using NGUI for all GUI, while 2D Toolkit for game itself), but I'm having trouble getting it to work on devices in 2D Toolkit...

To reproduce it, I'm just opening tk2d_demo 11, making sure it looks pixel perfect in the editor, then building Android version and running it on my device, and using Android SDK's DDMS to take a screenshot from the device, and comparing it with the original PNG version of the heart.
« Last Edit: December 26, 2012, 11:03:17 am by TMK »

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Pixel-perfect on Bilinear on Device
« Reply #1 on: December 26, 2012, 11:23:12 am »
I've just tried it on an iPhone4S and it looks pretty exact to me - compared with photoshop using difference and can't see any diff.

Please drop me an email to support@unikronsoftware.com - I have something for you to check from the latest version (1.90). I think I may have fixed an issue which might have inadvertently sorted this out.

TMK

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Dragonhead Games
Re: Pixel-perfect on Bilinear on Device
« Reply #2 on: December 26, 2012, 02:01:07 pm »
Thanks for the fast reply! Sent an email now :)

TMK

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 16
    • View Profile
    • Dragonhead Games
Re: Pixel-perfect on Bilinear on Device
« Reply #3 on: December 27, 2012, 11:17:24 am »
Update: This was an issue that only happened on sprite atlases that are larger than 512x512, and was fixed by using the newest version 1.90. Thanks again for the fast fix! :D