Outlining through animation (pixel art)

Hi,

Basically I want to highlight the enemy I hit with my projectile.
I currently use another set of animations with a white outline, which triggers whenever I want to mark the enemy.

Is making a shader a better solution? (A shader is the only other solution I found while searching through the forum)

Thank you in advance!

Using a shader is better because you reduce the number of textures you’ll need. Your game size will be smaller, it will use less memory when running, and you can apply the shader to any number of sprites to outline them. The trade off is the performance impact as usually outlining requires more texture sampling and rendering time in general.

Yea, I ended up using a simple shader for it, but the reason I asked is due to the performance impact that I heard off.
Although I don’t know much about performance, in my game there is always only one object using a shader, if a shader is used. So I don’t think it will affect the performance that much. Is it right to assume that?

Also, thanks for the reply.

Yeah you’re probably fine, I wouldn’t worry too much about performance in a small game unless it’s really noticeable.