Why do my in game sprites have pixelated jagged edges?

I’ve been trying to get started on a 2D game but I can’t get things to look right. I’ve managed to get the faded colors and some other weird problems fixed or at least tolerable but I cannot figure out why my sprites have jagged edges in the game. Not sure if this picture illustrates it very well but the one on the right is the texture (the sprite sheet.) The lines are much smoother. The one on the far left is a flipbook and the middle is the single sprite from the flip book. The most obvious thing is the lines are pixelated in the game assets. The original texture has semi-transparent pixels that make the line smoother.

This also becomes an even bigger problem when things are zoomed out or scaled down. It is extremely noticeable here.

image

I think this happens at the sprite level. It happens whether I use the default Paper2D material or any of my attempts at a custom material.

I’m really trying for a hand painted clean look, not a pixel art game. So if anyone can help me out, I would appreciate it.

I figured out that the problem is in the material but still not sure what to do. Since the material uses ‘Masked’ it allows an Opacity Mask. If I change it to ‘Translucent’ it allows Opacity instead of Opacity Mask.

The mask option is causing the jagged edges because it makes pixels either transparent or not. The translucent option maintains the partially transparent pixels so the lines are smooth. However, translucent materials cannot have normal maps and make the colors look weirdly dark so this is not an option. It also doesn’t solve the zoom/scale problem. It still looks pixelated even translucent in the game when it is zoomed.

Any help on how to properly render 2D sprites in Unreal would be awesome. I love using Unreal but… this is kind of a deal breaker for my game. Every other engine I have tried so far renders the images fine immediately, I just really don’t want to learn another engine. :expressionless:

Managed to figure out how to get things to look how I want! :partying_face:

Using Translucent blend mode on the material, changing Lighting Mode to Surface ForwardShading made my sprites look correct and can use Normal maps! From what I can tell this may impose a performance hit but it doesn’t seem to cause any real problems with my testing (my FPS stays the same on either material setting.)

The scaling of the sprite is still pixelated however. I’m not real sure why that happens. But I’m planning to redraw the sprites anyway so I’ll probably just use the art program to scale things correctly. I think I can live with this.

Hope this helps others that happen across this!

1 Like