I’m trying to do something that I feel should be fairly simple but my skills in the material editor are pretty much non-existent. What I want to do is take a texture representing an object in my 2D game and create an outline or ghost of that object, but not just an outline.
As a (bad) example, imagine an image of a brick wall. The end result of what I’m looking for would be all the lines that make up the bricks. As another bad example, this emoji would keep the sunglasses and mouth. It’s basically the equivalent of shrinking down the levels in Photoshop.
Does anyone know how to do this? I feel like there’s just some simple combination of math nodes that would do what I want, but I can’t figure it out.
I managed to figure something out. Using the same test image as above and the following material logic, this is the result I got (ignore the weird black lines in the preview image). My actual goal was to get something that looked like a blueprint or ghost of the original texture which is why my result is slightly different than what I originally posted.
Basically, what I’m doing is grabbing the highest value from the RGB and doing a 1-x. This will give me a value that is closer to 1 the closer to black the RGB value is. I’m then using an If statement that that says for any values less than 0.9 (i.e. anything that’s not black or very close to black), I return 0.25 otherwise I return the value of A. Finally, since I’m using this as my opacity, I also take the min value with the Alpha to make sure that it properly respects the source alpha.
Changing the value of Param (I haven’t renamed it yet, sorry), will change how transparent the blue is outside of the lines i.e. a value of 0 will show only the lines and value of one will result in the car being fully filled in.