Hello Guest

Author Topic: Creating a "pixel art" game and using bilinear filtering  (Read 4215 times)

Doghelmer

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 20
    • View Profile
Creating a "pixel art" game and using bilinear filtering
« on: September 06, 2014, 09:14:24 pm »
The game I’m developing uses tiles that are 16x16 pixels for its art.  The camera is zoomed out a lot, so the play area looks similar to the game Hammerwatch:
http://greenlitgaming.com/wp-content/uploads/2013/02/Hammerwatch-Vendor.png

My camera moves around a lot, and I’ve found that using bilinear filtering on my tiles causes the game to have an overall much “smoother” appearance than point sampling while in motion.  As expected, this causes the 16x16 tiles to look extremely blurry.  My solution is to scale the images up in Photoshop using Nearest Neighbor, to 64x64, which eliminates that blurriness in the game.

My question: Is there some way to do this type of scaling within Unity/2D Toolkit, or possibly at runtime?  It’s annoying to have to create a second "large" version each image in the game, not to mention when I have to go back and modify those images.

Hammerwatch was able to achieve a smoothness of motion while retaining crisp sprites-- I think they were using their own engine, but I’d love to know the best way to achieve this in Unity.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Creating a "pixel art" game and using bilinear filtering
« Reply #1 on: September 07, 2014, 12:00:30 pm »
I'm not aware of any way to do that at runtime using a shader - all the approaches I can think of are really really expensive. I suppose you could modify the tk2d code to do it, or you could write a batch script that rescales your images using imagemagick...