I've been looking to create a 2D SDF effect in Blender's Shader Editor, but trying to research this only shows 3D SDF content which makes it difficult to find answers. Photoshop can create the desired effect, here's an example using Large Luigi as a base

Desired effect with Photoshop Shape Burst layer style

Using the above settings in Photoshop/Photopea's Layer Style menu, you can create a greyscale gradient that follows the contours of an image's alpha (generally really useful to know for making 2D SDFs!) I'm looking to recreate this in Blender's Shader editor, but had no luck so far.

Is there any way to replicate this with an Alpha input from a texture node? It shouldn't rely on geometry or lighting, this should work on a standard plane. Doesn't need to be performant either, this is just so I can bake down geometry without needing several hundred separate images to bring into Photoshop.

Thanks for reading, any thoughts on this would be greatly appreciated!

  • $\begingroup$ Does this answer your question? Procedural Border Detection on a Flat Object $\endgroup$ Oct 8, 2023 at 20:23
  • $\begingroup$ It's really close and could be useful, but this isn't the exact answer I'm looking for as this relies on geometry data. For my use case it needs to have the same effect from just an image alpha input on a plane. $\endgroup$
    – KitOaken
    Oct 8, 2023 at 20:44
  • $\begingroup$ You could create the geometry based on alpha… $\endgroup$ Oct 8, 2023 at 21:40
  • 1
    $\begingroup$ This seems a candidate for batch-processing in Photoshop, or using something like ImageMagick (convert).. This manual page +find ''Distance Gradient Morphology' takes you to a useful-looking chunk. ' $\endgroup$
    – Robin Betts
    Oct 9, 2023 at 7:31
  • $\begingroup$ Creating geometry for the alpha of each image unfortunately wouldn't be practical for my use case. Distance Kernels in Photoshop are exactly what I'm looking for, I'll have a read into each method soon. For now batch processing seems to be workable, but this documentation is a great resource for me to look into. Thanks Robin $\endgroup$
    – KitOaken
    Oct 9, 2023 at 15:50

1 Answer 1


It's computationally expensive, but gets the job done, automatically:





You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .