I'm creating procedural creatures with procedural "dragon-skin" or "scales" textures (based on Voronoi texture nodes).
I want to blend multiple of these procedural textures together. However, I don't want a linear blend, instead I want the textures to end exactly where a scale of the first texture ends, so that it looks like these scales lie above the other texture.
As you can see, the two textures are blended (currently I use a vertex color to influence the blending and to control how the gradient flows along the body). However, instead of blending linearly within the (dragon-)scales of the texture, I want the darker scales to be fully opaque... until some threshold, at which they are fully transparent. This will lead to a "jagged" transition line (because some scales end earlier and some end later).
My idea is to replace the current gradient with a gradient-texture that gets the Voronoi's "position" vector as input. That gives me a grayscale texture where each of the scales has a different color. However, then this color does not increase/decrease in the same direction as my original gradient (i.e. the gradient will no longer be a controlled gradient across the side of the creature's body)...
Edit: This is roughly the effect I want:
Edit2: Here's an example .blend file:
Note that the gradient comes from a vertex attribute (vertex color) called "ring_pos". Visualizing this gradient gives you something like this ("ring_pos" encodes the position of the vertex within its "ring" of vertices, allowing me to have a different texture on the top than on the bottom. This is just a simple example, I want to add more complex patterns later, but in any case they should be encoding where I want one texture to show and where I want the other to show. There's no guarantee that these values will for a simple gradient later on.)
When sampling (as suggested in the comments) a gradient texture with the Voronoi's position, I get something that I can use as a mask:
However, this is in the wrong space, i.e. the wrong parts of the model are bright.
P
, will return the vertex color atP
. Maybe via Shader to RGB? Or, would it be OK to bake the vertex color to a UV map? $\endgroup$