tebop opened this issue on May 12, 2007 ยท 170 posts
bagginsbill posted Fri, 08 June 2007 at 7:27 AM

Suppose the black line represents real-world behavior of skin, with respect to apparent brightness based on the lights. A perfectly realistic shader that worked under all lighting conditions would track that line.
But to do so would take a lot of math nodes. Suppose instead you don't feel like doing that and just want to use a single math node (Add) that produces a straight line. The Add node has multipliers built into it (the two numbers), so you can produce any line you want. For example, to implement the line y = mx + b, you make a math function Add. Plug "x", the value you're getting from somewhere else, into Value_1. Put "m" into the number for Value_1. That makes m * x. Now put "b" into Value_2. That computes mx + b. Clearly you can make many different lines by chosing m and b.
In the diagram, I show two choices for m and b - one is colored red, the other green. Neither one looks anything like the black line except for a narrow range of x. Depending on the range of values for x in your scene (light brightness) you'd want to adjust the approximation so that the area where it best overlaps the black line is in the neighborhood of the x value for your scene.
Does this help?
The last picture you posted was using actual shaders which I uploaded - you can download those exact shaders and look at them to see what values I chose for the parameters.
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)