is there an easy way to find out the total brightness range of a texture?
I often want to remap the range of someting but finding out from where to start remapping can be time consuming.
At the moment I create a plane give it a subdiv modifier and displace it with midlevels set to zero to see how far a map ranges. You also have to set the material to “displacement only” and all of this adds up.
From this we learn for example that the fac output of a standard noise texture ranges from around 0.25 to about 0.75 and the color output from around 0.3 to 0.7.
Is there some easier and more exact way to do this?
2.81 has a remap value node that does what you want.
You can also do it with vector math: use the normalize node (range -1 to 1), then you have to scale by 0.5 and add 1 (now it’s 0-1). Make sure to do it all with vector math nodes. This is the old-school way to do it, before the awesome nodes that OmarSquircleArt added in his GSOC this past summer.
Most of the time it’s easier to set the values to an expected range and work from that than it is to try to figure out what they are.
Do you mean the map range node? I can not find a remap value node.
The problem with the map range node is that I don’t know from where to map to where.
Here is an image. In the green one the map range node is turned off, so I get the “regular” height of a noise map.
In the right image I remaped from min 0.25 and max 0.75 to min 0 and max 1.
But I only found out that I had to map from 0.25 and 0.75 because I tried it out with this displacement setup. I am basically looking for a way to figure this out without going through this process.
Most procedural textures produce an output from 0-1, except for Musgrave which produces values from -1-1 (I think, not sure about that one). So you should map it from 0-1.
As for the vector math nodes- make sure to use a normalize, then an add (1,1,1) node, then a scale *0.5 node (I had them wrong the last time, or rather just in the wrong order). All vector math.
Again, this just remaps the values to 0-1 range.
What you want to do isn’t really possible; shader nodes act on the shading point itself, so it doesn’t know anything about any other point in the image or in space. So the node-tree has no way of knowing what the minimum and maximum values are in the procedural texture, since that would involve looking at all the other points and checking them. It would probably be easy to make a node in Cycles’s core that does this, but it’s not something you can do right now. Or rather, the normalize and map range node do this, but they remap the values, too.
I’m away from my own computer right now so I’ll check on this again later when I have access to a Blender (if this still isn’t working or doesn’t answer the question).
If I set the range from 0-1 it looks like the left one where the map range is turned off.
The green image is the regular height, yes. It ranges from 0.25 to 0.75.
In the blue image i mapped it so that 0.25 to 0.75 ranges from 0 to 1.
This is really the responsibility of the textures themselves. Ideally they all output values between nice numbers like 0 to 1, but sometimes figuring out how to do that can be difficult. If the noise node uses harmonics, there should be a theoretical min and max of the field, but that will never actually happen, so maybe that’s why you normally get values between roughly 0.3 to 0.7. I have noticed the same, I don’t think there’s an easy way around it unless someone forgot to adjust the range of that node.
You could find an analytical min and max for that node by just rendering a whole bunch of it and chucking it into a histogram, that way you can determine how much data you want to go below 0 and 1, maybe you’re willing to accept a little in order to get a better range for the majority of points.
Well, that is pretty much what I am doing by sending it through a displacement node. I just scale the noise to be very small, put it on a plane with adaptive subdivs and check how it deforms. This is time consuming but still better than rendering it out and analysing it.
I’m now making a table in which I can just look up how far which version of which texture ranges.
I think it would be a good idea to include something like that in the Blender manual.