Pixel Perfect problems - Always 0,5 pixel off

[SOLVED - Thanks to hippocoder]

I’m unable to remove this problem:

Scaled up a lot in photoshop so you can see.

It’s a 32x32 texture positioned at 0,0. My game is setup to run at 640x480 and everything is setup properly as far as I can tell.

Camera:

Texture:

I have tried every single texture option.

Material:

“Texture Only” is Jessy’s shader which I found on the wiki. It was used in a final attempt to fix the problem.

As for the quad I’m rendering my sprites on it’s a 1x1m plane created in 3ds max which I use on a gameobject scaled to 32x32. I have tried creating quads through script as well, but it makes no difference.

The last time I tried creating a pixel perfect game in Unity I managed to get it working, but that was many versions ago. Has something changed? Have I forgotten something?

Thanks for your time.

DX needs an offset of 0.5 pixels under DX9 afaik. This problem was fixed in DX10+ and unity uses DX9.

Just add or subtract 0.5 or whatever to the coordinates.

Ahh, that’s pretty smart. I offset the camera by a decimal or two in each dimension and it seems to be pixel perfect now. Will have to investigate your paper if I encounter further problems. :slight_smile:

Thanks a lot.