0
$\begingroup$

Currently, I have run into a problem in my understanding of how to create a node set up using the map range nodes.

What I'm attempting to achieve is creating a stepped map range shader similar to this example that utilizes a color ramp node instead. enter image description here

The problem The map range node does have a stepped option. However, this is just not suitable for what I'm attempting to do. I need direct control over every layer for adjusting each layer's color, size, and texture. Not to mention, I need to make this gradient have 7+ controllable layers, while at most the map range only allows 4 controllable inputs.

The solution idea involves creating a daisy chain of map range nodes to make an infinitely adjustable stepped gradient. I'm envisioning something akin to this image below to achieve results similar to image 1. However, no matter what I try, I can't seem to achieve this desired effect. Many thanks if someone knows how to do this. enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ Why don't you use the color ramp? $\endgroup$ Oct 26, 2023 at 22:47
  • $\begingroup$ I think you should provide more context to increase the chance of getting more precise answers. What exactly are you trying to create? What kind of control do you need for size and texture? $\endgroup$ Oct 27, 2023 at 9:03
  • $\begingroup$ @MartynasŽiemys The context to this is a toon wood shader imgur.com/a/oiVjFtj. Currently, I'm just using a basic color ramp, but this method doesn't allow for different textures on each layer of the wood. So I'm planing to use a map range node instead. However, the final product will have more layers than inputs on the map range node, so I'm looking for a way to add as many inputs to the map range as possible. Hence, the daisy-chaining. $\endgroup$ Oct 28, 2023 at 21:02

2 Answers 2

2
$\begingroup$

If you want to have different step sizes and different textures for each layer, I would use a Math > Greater than node with a Mix Color node to create the stepped layers.

step group

For clarity, you can put the two nodes in one group and pass the factor through so that you can daisy-chain the groups easily.

example

The values for the Threshold must increase from node group to node group and are similar to the slider positions of a Color Ramp node.

$\endgroup$
0
$\begingroup$

The context to this is a toon wood shader

Well then why don't you avoid the XY problem kind of situation and ask about wood?..

Wood texture comes from the way a tree grows. The trunk grows outwards and environment conditions change in a similar way through the year and that's why the trunk is made out of layers of rings:

enter image description here

We can see this one is around 7 years old. The seasons are similar so what happens in every ring is similar and there aren't that many extremely distinct types of texture, probably not over 7 especially not in a simplified toon style anyway... ...maybe in a photorealistic texture you can go crazy and make some years very distinct, maybe especially cold winter or a draught...

You can take some extremely useful insight from this regarding how you could make wood textures procedurally. You can make a volume with a cylinder with rings inside procedurally so the surface of your object could be inside it and the texture would be sort of where the piece is cut out of that cylinder:

enter image description here

Then you can deform the volume in various ways to give it variation and randomness manipulating the coordinates of the volume. It will also later have grain - tubes going along the rings that transport water and nutrients up from the ground. It's also possible to introduce distortions given by branches, but that gives me nightmares so let's not go there yet...

Let's start with randomness in the volume with some noise and let's make the center wider since the tree has to grow bigger amounts of wood volume every year as the trunk gets wider so probably the rings get narrower:

enter image description here

Grain can be made with Voronoi deformed in the same way the rest of the tree(well maybe you want to add something grain specific to that later):

enter image description here

And so like this you can add more and more stuff to it in terms of volume deformations and then various noises on top to make the wood realistic. The start of this process still has the waves where it goes from 0 to 1 so you can worry about remapping that to something more interesting.

Here is one (somewhat)photorealistic made this way, but cutting parts out and putting them together(with many UV planes and baking):

enter image description here

Hopefully it should be possible to go into the other direction then photorealism once you have the basic pattern.

This is not a complete answer, but hopefully it could give you a start/example or a way to look at the problem, that might lead to something.

$\endgroup$

You must log in to answer this question.

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