- Home /
Particle system edge artifacts
Hi, I'm having an issue with edge artifacts in a particle system that uses texture sheet animation. For some reason, a thin line appears on the top edge of the particle system. I've tried changing just about every setting for the particle system and its material, but haven't been able to fix it. The line itself is not in the texture. Any help would be much appreciated. Thanks!
test
Fun fact: The line you're seeing actually is, in fact, part of the texture. The reason why is described in my answer.
Answer by Eno-Khaon · Feb 16, 2016 at 10:02 AM
That line is the result of either of a pair of factors:
1) Texture filtering -- Bilinear or Trilinear texture filtering means effectively blurring pixels of the image together. What you're seeing are, in fact, the "blurred" bottom edge pixels of each section of the flame(s) combined with...
2) Texture wrapping mode -- When the texture exceeds the UV boundaries (0 to 1 range), it can either wrap around to the other end of the texture again (ideal for tileable textures) or it can repeat the final pixels and not repeat the image again (ideal for countering your particular issue).
What you're seeing is the result of texture filtering and a repeating texture in conjunction with each other. These are details which can be changed in the import settings for the texture(s) itself.
Changing texture filtering to "point" will remove the smooth appearance of the texture, but will result in pixels no longer bleeding over to the neighboring pixels not intended to be viewed.
Alternately, changing the texture wrapping mode to "clamp" will allow you to keep texture filtering in use, but will prevent the use of UV coordinates outside a 0 to 1 range.
One other pair of alternatives, in this case, is to either not have the pixels reach all the way to the edge of the image (which makes for a potentially awkward-looking texture) or use a plane to display it with UV coordinates not quite reaching the very top edge (which potentially clips off the very edge of an image and has no proper control over variable texture dimensions).
Source: http://www.glprogramming.com/red/chapter09.html
Repeating texture: Clamped texture:
That makes a lot of sense, and fixed my problem. Thank you! Since this is a texture for a particle system, I was able to simply put a tiny bit of empty space around each frame and now the pixels which had previously been touching the edges aren't bleeding through. :)