Solved LibGDX Switched to TexturePacker and now my textures are blurry.

Originally in my game, I was loading in all of the images as TextureRegions manually. I switched over to TexturePacker(Not the LibGDX, the commercial one).

I read the atlas and save everything as an AtlasRegion. All of the regions on the atlas get saved into the game as separate AtlasRegions in a hashmap using a resource manager. Allowing for easy access of all sprites throughout the game. Nothing it really broken, but not whenever I display a sprite, it’s very blurred. It wasn’t like this when I did it before and just manually loaded the images and saved them as TextureRegions.

The atlas image itself isn’t blurred if I open it in an image viewer, so the problem seems to be somewhere withing my game or LibGDX. Has anyone had this problem before, or know how to fix it? I’d really rather not have to go back to manually loading the images.

That would mean there is some automatic scaling/filtering going on. Check the atlas settings.
Of course even with linear filtering there would be no difference unless there is some scaling.

So I would guess the is scaling involved. Maybe rotating ?

That’s what I thought as well, I’ve disabled any scaling or rotating, even tried scaling up then back down, scaling down then back up, they’re still really blurry.

I’m not too knowledgeable on how LibGDX works at it’s core, could it be a problem with using AtlasRegions rather than saving each one as a Sprite or Texture? Originally they were stored as Textures before I switched to packed textures.

Shouldn’t make a difference whether it’s AtlasRegions or not, what does your pack.json say?

Yeah I’ve changed everything to be stored as a Sprite rather than an AtlasRegion and the problem still persists. So that was not the issue.

Here is the beginning of my atlas and an example entry(None of them are rotated, just different positions):

atlas.png
format: RGBA8888
filter: Linear,Linear
repeat: none
bgs/bg1
  rotate: false
  xy: 324, 2
  size: 320, 240
  orig: 320, 240
  offset: 0, 0
  index: -1

What happens if you change those Linears to Nearests?

Wow that worked, thanks a ton. I’m not too familiar with how filters work. I was under the impression that Linear was best for pixel art type images.

Here’s a nice write up by Mr. Badlogic himself on the topic: http://www.badlogicgames.com/wordpress/?p=1403

It’s from 2010 though, so some specific info may be a bit dated, be forewarned.