Highlighting edges in high contrast b/w image

I need edges in my map to be highlighted. I want that part when black meets white to be only visible thing that will be a little be blurred (so it won’t stick out in ugly way).
That red thing (and entire that edge :stuck_out_tongue: ) has to be only visible thing (like white, when everything else is black) and as I said before it must be a little blurred. It has to be procedural because it will be animated for multiple objects and playing with it would’t be comfortable for me. Also I don’t want any compositor tricks unless there won’t be any “material nodes way”.
Help, please :slight_smile:

is the black part an object? click ‘freestyle’ in render panel, then go to the render layers panel and change the outline color.

Can you be a bit more descriptive (BI/Cycles, Texture/Shader, Material/PostProd)?.. or with a sample file??
There are many ways to achieve this but all of them depending on where you have the White/Black information…

It’s cycles, and all I’m doing is in material node editor. I made this texture using gradient and image texture of ice, combining them with math (greater than) node. It’s animated, so it has to be fast and procedural.

So add a less than node.

It would just make inverted colours which is not what I want. I want that border between colours to be another mask. Like borders on the map.
I want to create another material on the border between two materials like it’s a little bit glowing in the example.

can you post a screenshot of your nodes, and a sample of your ice texture?

Like this?

Pretty much. This is what I want to see after all, but it can’t be achieved this way because my map from both textures combined is 100% white and 100% black, so color ramp won’t work (I tried it).
Here’s my node configuration and sample ice texture:

you can try something like this:

the green node (a ‘value node’) controls the animation based on the gradient. (most of the math is a bit superfluous, it’s just to keep the values in the green node between 0 and 1)

with the blue node you can control the size of your ‘blur’.

ps: and the RGB to BW node is not necessary here, since the math node does the same when the input is a color.

This is what I want to see after all, but it can’t be achieved this way because my map from both textures combined is 100% white and 100% black, so color ramp won’t work (I tried it).

Yeah, but the way i understand it it is only completely black and white because of the greater than node. If you replace that by a color ramp node and control the textures contrast with that you won´t have that problem.

The problem is that the color ramp method, as well as Secrop’s solution doesn’t use the “border” information.
I can explain it with these images:
When I get closer to my current mask I’m seeing this:

And I want to make it look like that (photoshop: find edges, gaussian blur)

That is what the ramp does. It makes everything below a certain threshold black. Lets say 0.5.
It then eases to white to another threshold, lets say 0.6.
It then is constant white to the next threshold, 0.7.
And eases back to black to the next theshold at 0.8

You just have to set the thresholds right and you´ll get the desired outline.
And of course get rid of the greater than node.

Color ramp increases contrast in image textures, making edges more significant and it can control gradient texture to make thin strip. It gives totally different result, than using greater than node, because color ramp would make entire object covered with more significant patterns, and gradient with color ramp would make straight (ugly, when we need something organic) strip with some variations from image texture. It just can’t be done that way, because it treats that effect kinda from the outside, when I need to get inside.
Using color ramp I’m getting this effect which is not what I want to have, because it’s too fake.

Greater than gives me effect below which in my opinion looks much better because it’s pretty much how water’s surface freezes (for example).

I need another map (3rd one) to mask another shader between ice and water, which in my case will be emission, but it can be so far achieved only, using photoshop and find edges filter.

Hmm… since the threshold defined by the greater than node is what defines the edge but can not be ramped due to the nature of the greater than node we need a second image that is slightly ligher or darker, apply the same greater than node to it and then add or multiply the result of this from the first node. Increasing the brightness should push the border of the black to white cut off created by the greater than a bit further distance wise.

So perhaps try this:

  • Plug your texture into a greater than node like you´ve got it now.
  • Plug the same texture into a brightness/contrast node and increase the brightness by a bit.
  • Plug the brightness node into a greater than node just like the other one.
  • Plug both greater than nodes into an math node and add them together.

<edit>Ah, it works</edit>
Well, partially. You won´t get a smooth transition from white to black this way. However, you could create a couple of similar lines with varying width and brightness and overlay them. Perhaps three or four steps are enough to create the illusion of a smooth transition.

I blurred it after typing “blender texture blur” in Google :smiley: b°wide NodePack has one node tree that does the job, so I just combined it with my node tree and I finally get my expected result :slight_smile:
Big thanks for your help!
And here’s the result: