- Home /
2D sprites - Can I use point filtering without getting the "rippling" effect when the camera moves?
I'm trying to decide whether to use Point or Bilinear filtering on the sprites in my game. My preference would be to use point - the style is pixel art and I'd like the edges and colours to be sharp - bi or trilinear filtering seems to dull the colours slightly and the edges become blurred.
The trouble with using point filtering is that fast movement seems to cause a rippling effect on the sprites - almost like the pixels in a single sprite are trying to move in different directions or at different speeds. The effect is subtle and hard to explain but it can be seen in Unity's 2D platformer demo project - if you change the filtering of the spaceship's sprite to point and then jump around you can see that the edges of the ship have this "rippling" effect. On my pixel art backgrounds this effect is enough to make the handheld camera script I'm using look terrible - it looks fine when all the sprites are bi or trilinear.
Is it really just down to choosing between the lesser of two evils or is there something I've missed? Thanks very much!
Romano
Answer by Romano · Mar 03, 2014 at 06:43 AM
http://www.third-helix.com/2012/02/making-2d-games-with-unity/ gives info on how to set the orthographic size so that you have sharp looking pixels (using point filtering) and no movement rippling.
Answer by Owen-Reynolds · Feb 14, 2014 at 07:13 PM
Bilinear filtering was invented exactly to fix the flickering point problem you're describing. In other words, yes, you can fix the rippling, by switching to bilinear filtering! And the way it fixes the ripple is by blending (blurring) the colors, as you describe.
I'd go with larger images (but still pixel art -- like quadrupling each pixel) Doubling the pixels will cut the interpixel "blend zone" in half. And the images will still compress to about the same size.
You're totally right Owen, bilinear does fix the rippling, but I'm looking for a solution where I can have perfectly sharp pixels and not have the rippling (See Sword and Sworcery). There actually seems to be a point where if the pixels are doubled enough times that the bilinear filter doesn't work to reduce the rippling effect anyway.
I've read in some places that actually the size of the orthographic camera is a major factor in making the pixels look correct. $$anonymous$$aybe I need to post a new question about how to make sure the pixel art will work with the orthographic size and vice versa... I wonder if that would help with the ripple?
EDIT: Posted. http://answers.unity3d.com/questions/643631/will-correct-orthographic-camera-size-fix-point-fi.html
The ortho size won't matter, since all the math cancels out. In the end, you have a physical screen X by Y pixels, no matter what you do. But, what you were reading may have involved using the ortho size to make it easier to shift the background in whole number pixels. Like if the ortho cam is the exact pixel size of the screen.
That is indeed the kind of thing I was hoping to try out. Can you explain what you mean by all the math cancels out?
The orthographic size does seem to make a difference though - by changing it incrementally I can see a difference in the way the jitter looks. It looks better or worse depending on what I do with the size.