Hi, I still really confused about what the Map Range does. And also what the clamping does. Could anyone explain it? And also, could anyone link to me the video in the course where Jonathan explains its funciton?
Hi nneishy here is that video:
https://cgcookie.mavenseed.com/lessons/bonus-understanding-the-map-range-node
The Clamping clamps the result of the Map Range Node to the interval (To Min, To Max). I believe Jonathan mentions somewhere that it clamps to the (0, 1) interval, but that was a mistake (and yes, he is aware of that).
Yikes, yeah, the Map Range node is a doozy one. Spikey, do you remember Adrian also explained it somewhere? I remember he made a short and very easy to understand post with a small graph, but I don't remember where. I do remember it was a very helpful visualization. Let me try and look for it, if I find it I'll post it here. I'll also ask Adrian, since he is the one that made it, perhaps he remembers best where it was.
Unfortunately I don't remember where Adrian posted that, Omar...I have tried explaining it a few times in the Forum...Probably best to ask Adrian if you can't find his explanation. It is always good to hear(/read) a few different explanations, in order to better understand it. There are quite a few people that have problems with that Node!
I'm getting the hang of it now. I wrote this out to help my brain process what Jonathan was doing. I thought I'd leave it here if anyone else came across this post and felt stuck.
My advice is rewatch the video multiple times, and write down what Jonathan is doing and the reasons why he is doing it. I think that helps.
p.s. not saying my understanding above is perfect, so don't take it word for word – I'm just trying to point you in the right direction.
Blender Guru recently published a tutorial,
https://www.youtube.com/watch?v=0YZzHn0iz8U
in which, to create an Earth, he used the Map Range node twice, respectively, at the time stamps 2:20 and 19:48 on the video.
At 19:48 on the video, when he used the Map Range node to determine which side of the Earth is lightened up, my head was spinning. Even the summary from nneishy is not enough to dispel all my confusion about the negative values used on "From Min" and "From Max" from that video.
nnaiad did you look at the answers here:
https://cgcookie.mavenseed.com/community/12267-i-ll-just-have-to-keep-trying
and specifically:
Yes, Martin, I had looked at your answers there. And Thank you!
But regarding to the tutorial about making the Earth by Blender Guru. Here I wrote a few additional remarks to dispel my confusion:
Some important points to keep in mind when use the Map Range node to determine which side of the Earth is lightened up by night lights is:
1, use the Map Range to map the values from the dark side of the Earth to the target range.
2, the dark side has no light, so the values from the dark side must be negative. That is why the negative values used on "From Min" and "From Max".
3, Since the target range only has the information (or values) from the dark side, the values from the bright side automatically get ignored, so that no light is turned on on the bright side of the Earth anymore.
nnaiad ,
look at it this way: the Map Range Node makes a line (not a line segment!) through two points (in a 2 dimensional space), with coordinates (From Min, To Min) and (From Max, To Max). (If not Clamped). This means, that the Input Values can lie outside the given Input range! So in BlenderGuru's video, when both Input Values are negative, positive Input Values will still be Mapped (through linear extrapolation).
If you enable Clamped, only the Output values are being clamped (to the given To Min, To Max interval).
So, important: the given Input Range does not determine what Values can be used as input!
I might have to look at the whole video, to see what Andrew is actually doing....
Thanks a lot, Martin! You have spotted my mistake. So I have modified my remark on the number 3 as below:
3, in BlenderGuru's video, the value on the "From Max" is more negative than the value on the "From Min", so in this case we have:
"From Max" < "From Min"
Hence, for any input value < "From Max", the output of that input value will be clamped to 1, which means to turn the light on.
For any input value > "From Min", the output of that input value will be clamped to 0, which means to turn the light off.
Therefore, the input values from the bright side of the Earth are Not ignored. Instead, all outputs of the corresponding input values from the bright side are clamped to 0, so that no light is turned on on the bright side of the Earth anymore.
I think you got it nnaiad !
I saw he also at some point increases the To Max to 2 and even 5, to make the lights brighter (on the bright side).
I was JUST about to ask this question because I was so confused. Good to know i'm not the only person having a hard time wrapping my head around the map range node haha.
Here is what i've been able to deduce:
1. map range node is used to mask out 2 different parts of a texture.
2. map range node can be used to mask out values beyond just 1 or 0
3. it is very useful for achieving both subtle and extreme effects
am I close at all? Ha, hopefully I at least have a small understanding. I will keep playing around with it though and watching adrian's video since that's how I learn best. If anyone has any other info they want to throw in, it would be much appreciated. Thanks for the info guys!
Hi Justen negativesanchez98 ,
I'd say your number 1 and 2 sound wrong, but maybe I just misunderstand what you mean...
Your number 3 doesn't really say anything... (and certainly doesn't tell me: "Here's someone that understands the Map Range Node.")
It is actually (contrary to what a lot of people seem to think) very straightforward;
The Map Range Node maps two Values (or Vectors) to two new ones (hence the word "Map") and interpolates everything in between (hence the word "Range").
If you un-check Clamp, it also extrapolates.
That''s all. Nothing mysterious or complicated about it.
negativesanchez98 I think you're getting it! If you're thinking of a mask as a greyscale result that's used to mix two different textures, you're on the right track. The difference would be that a mask is only one of the many use cases for the Map Range node, but it is the most common, so thinking about it that way is not necessarily wrong.
Try thinking about it this way:
A texture always has a brightest and a darkest value. The difference between the two is the range. If the difference is not much, it has a small range, and if there's a big difference it's a big range. If you want to make the bright parts even brighter without changing the darkest values, the difference between the dark and light values will increase, and so you're changing the range.
Let's say the darkest value is 0 and the brightest value is 1, but you want a result where the darkest value is 0 and the brightest value is 2. Easy enough, but what exactly happens to all the values in the middle between the two? Should a value that was previously 0.5 stay at 0.5 or should it be increased in proportion? How all the in-between colors get adjusted to fit the new range is how they are mapped to the new range, hence the name Map Range.
Hope that helps!
@jlampel
AH! Thank you! That actually clears up A TON. I think i'm slowly starting to wrap my head around this clever little node. I'll try to get some more practice in. Thanks everyone.