Author Topic: Distance preview after Warp shows unexpected star-like rays  (Read 1375 times)


I'm getting somewhat unexpected results from a distance node that is fed with warped random tiles.
Everything works fine as long as I utilize the random tiles directly. The setup is taken from Wes' procedural rocky ground tutorial and modified.

The problem as I understand it is this:
Distance extends particular colors (or shades of grey) outwards from the "mask" areas into the "non-mask" areas.  Your original random tiles each had uniform color (with jaggy edges).  The Warp filter effectively anti-aliases the edges of your random tiles when it warps them, meaning the edges have lots of various shades of grey.  Those various shades are what get extended outwards.

It's a problem that I've run into many times.  It happens that I thought of an easy solution for it just now, while explaining the cause!  I just tested it, and it works.

Rather than connecting the "Levels" output directly into the "Distance" node, send that output to "Edge Detect" with a thin edge width, and then "Blend" the "Levels" output with the "Edge Detect" output, using multiply mode.  Connect the output of that "Blend" node to "Distance" as the mask.

This is essentially shaving the edges off of your mask so that the mask ends in the uniform-color interior of your tiles and does not include the anti-aliased edges.