bagginsbill opened this issue on Apr 23, 2008 · 2832 posts
bagginsbill posted Sat, 27 December 2008 at 8:50 AM
Quote - Quick question: Castle Poser doesn't cover color_math nodes: is the behaviour the same as math_function nodes? There's a really nice graph-based explanation here on the math_function nodes.
I can see in order to understand these shaders I'm just going to have to get into the maths a bit.
Dang.
The Color_Math node is the same as a Math_Node function by function. The difference is that a color is actually 3 numbers, one each for red, green, and blue. Any of the math functions is applied to all 3 values simulatenously and independently. Thus, a Color_Math is identical to 3 individual Math_Nodes working in parallel.
So you like those graphs, do you? Did you know they were generated not with some scientific graphic software, but with Poser itself? Yep each of those graphs is actually the output of a special shader, applied to a one-sided square. Do you know where that shader came from? Me.
Click here to see the original thread about these graphs, and how to make your own in Poser.
Matmatic gurus - graph your functions fast by bagginsbill on 11/01/06
You need to be able to visualize what math functions do in order to manipulate them in your head. Many things you'll try in the material room will not be possible to visualize until the last step. That means if you can only visualize colors and gray-scale images, you cannot understand what happens to math functions beyond the range of zero to one. We can show numbers between 0 and 1 on the screen, and that's really great. But a lot of math involves numbers below 0 or above 1 at times. If you can't keep track of what's happening, then any shaders involving such numbers is forever out of your reach.
I've been thinking for many weeks about this magical range of 0 to 1. Every image we see is in that range. Most of the effects you want to do are in that range. This unit range is really really important and understanding how all the math functions operate in this range is also really important. It comes up so often that I've been trying to come up with some names we can use to refer to this range and the functions that operate on it, and a particular set of functions that have certain specific characteristics. The obvious name for this range of numbers is the Unit Range, or UR.
While almost all math functions can operate on numbers beyond UR, the most important thing you need to understand is what happens within UR.
Let's call the really important functions a BUFF, for now. (Baggins' Unitrange Favorite Functions)
Here is an example of an interesting things about a BUFF.
For all x in UR, BUFF(x) is in UR.
This means that for any input value in the unit range 0 to 1, the output of the function is also in the unit range 0 to 1. If you were to graph the function, it would never go outside the unit range 2-D square between 0 and 1. Why is this important? Because you can string any number of these together and you KNOW that the result is still within UR. This is very handy for thinking about long chains of nodes.
There are other interesting behaviors that are not universal. These further break down the universe of BUFFs. An example:
f(0) = 0, f(1) = 1
Another very important behavior. It says that when the input is 0 or 1, the output is also 0 or 1. Why is this important? Because I know that I'm preserving the full range of the input. I may bend the in-between values up or down in various ways, but 0 is still 0 and 1 is still 1. Bias and Gain do this and they are incredibly useful. There are many other functions made of individual or combinations of nodes that do this.
This is just a small introduction to the incredibly rich world of mathematical functions as used in shaders. To really understand even these two points I've given, I'd have to write at least 10 pages of text and accompanying images.
Have you heard of the 10,000 hour phenomenon? I've encountered it several times in reading about excellence. Currenly I'm reading "Outliers - The Story of Success" by Malcolm Gladwell. Chapter two talks about the 10,000 hour rule.
"The emerging picture from such studies is that ten thousand hours of practice is required to achieve the level of mastery associated with being a world-class expert - in anything. In writers, ice skaters, concert pianists, chess players, master criminals, and what have you, this number comes up again and again. No one has yet found a case in which true world-class expertise was accomplished in less time. It seems that it takes the brain this long to assimilate all that it needs to know to achieve true mastery."
I say this not to discourage but to encourage. You must practice with nodes. Really. I figure I've only got about 3000 hours logged working with shaders. I have a long way to go, yet most people around here consider me an expert. I'm not an expert - yet. Nor am I truly a gifted or talented genius. I am above average in intelligence, but the real reason I can do this so well is because I practice it constantly.
Acadia and I had a similar thread a while back. I keep saying, you have to try and study and experiment and build a model in your head so you can predict what will happen. Only then can you imagine an effect and then head straight for a node-based solution.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)