- Home /
Very weird pixel displacement with point filter mode
I'm making a 2D game and getting the camera to render sharp pixel art is really hard. I can't use bilinear filter mode because everything gets blurry, but when I use point filter mode some parts of the image are displayed incorrectly.
The edges in the middle, the edges in the bottoms, the edges on the hammer are all looking very weird. The image itself is prefectly sharp. The hammer is basically a brown rectangle conencted to a gray rectangle.
Also, I have set max texture size to the size of the spritesheet, format to truecolor, camera size to screenHeight / pixelsPerUnit / 2. I have no idea how to fix this.
EDIT: Another image. The top one is how it renders, the bottom one is how it should look.
This is another map. I've scaled it up so it would be possible to see the flaws clearly. So the edges of the roads blends, the hammer gets some new pixels, and there's one line between the green and the black, a thin blue line - that's the camera's background (clear). Is Unity even capable of producing pixel sharp results? Because I feel that Unity might only truly work in perspective mode. Or maybe that's just my project that's messing up completely.
Those little glitches look like standard "Point filtering" artifacts. I've seen the same thing plenty in non-Unity images. Always happens when actual screen pixels and image pixels don't match correctly.
I'd guess, if you go through and "measure" everything, that there's a math mistake -- the hammer plane really is too big, etc... .
Answer by KiprasNav · Feb 25, 2014 at 01:50 PM
Since somebody might experience a similar problem I thought I should tell how I fixed it. Create a new material with the shader sprites/default, then enable pixel snap.
Answer by zee_ola05 · Feb 24, 2014 at 06:32 PM
At the import setting, instead of Compressed, use 16bits format. If that doesn't work, use Truecolor.
I already tried that. Also, the little orange square in the center of the screen has a border going around the whole sprite, while in the picture you can only see borders on three sides.
Your answer
Follow this Question
Related Questions
2D Sprite Graphics Glitching, Skewing, Flickering, Crazy, Haywire 1 Answer
SpriteRenderer change order in layer in edit mod via script 1 Answer
renderer.enabled doesn't work but coloring does 1 Answer
Sprite Flipping on Camera Move - 2D 0 Answers
Can't create a 2D sprite with Sprite.Create when creating texture in code 1 Answer