Download

Paper2D & Outline Shaders

If this was 3D, I might know where to start. I am working on a 2D game, and I need to slap a slowly pulsating glowing line around odd/non-uniform 2D sprites. They are set to translucent unlit material if that matters. Any help would be super appreciated! Even just somewhere to start.

I am plum out of ideas on how to approach this with a 2D sprite. If anyone has any tips or pointers, I am all ears.

I imagine this isn’t exactly what you’re looking for, but in this situation I’d probably use two sprites and hook them together via BPs. One for the actual sprite, then a slightly blown up version of that sprite for the second one, with a different material that pulses, which is placed behind the first one.

Yeah, it’s not a single sprite with a glowing outline, but my Material-fu is weak, and this is how I’d approach the problem. Good luck, and let us know what you end up doing, if you can!

A shader based way of achieving this could be:

In base color: Use your image alpha from 1 to ~0.8 to blend from your regular base color to the outline color.

In opacity: Use your image alpha from ~0.2 to 0. Animate these values to create the pulsating effect.

You might want to blur your alpha a bit to get the desired line thickness. Additionally you can vary the blend ranges to create sharper or smoother transitions.

I might give this a try and see how it works out. I think with Paper2D you have to get a bit hacky.

I guess the trouble I am having, is figuring out HOW to apply the material to the sprite. This is Paper2D.

Hi there, new guy here, please disregard me at the slightest hint of idiocy on my part (or even better point out my idiocy so I can learn).

I’ve been using the prototyping sprite and it’s material in the 2D side scroller starter content, and… dammit now I need to check to be sure. I promised I was going to take a night off and do something light and fun like play Bloodborne or pound nails through my wang, but no, here we are opening the editor…
Yep there it is. Any Paper2D object should have a slot for a default material on it just below the texture.

Ah here we go in the documentation, a section on how to create a sprite material.

And just to be thorough, here’s a screen shot of the object’s details panel showing where you’d drop the material in. So sure you have a base texture it becomes a sprite object, but it can also hold a material and get totally awesome and complex at a moment’s notice!

https://docs.unrealengine.com/latest/images/Engine/Paper2D/Sprites/sprite_new_details_texture.jpg