RedHawk opened this issue on Sep 09, 2006 · 36 posts
bagginsbill posted Sun, 10 September 2006 at 9:56 PM
Ah Acadia,
You demand to know how the chef knows that to sweeten she can use corn syrup, maple syrup, molasses, brown sugar or white sugar. How did Boston baked beans get invented - who would think to sweeten the beans? And how did they know to use molasses, of all things, instead of good old sugar?
You want to know how and when to use cayenne peppar, black peppar, white peppar. What is peppar used for? Somebody came up with peppar jelly, AND THERE ARE PEOPLE WHO LIKE IT!?! How did they know that would happen?
How on earth did anybody ever discover that if you whip egg whites for 10 minutes, they turn super fluffy? And that if you add corn starch and sugar and bake them you get meringue? And what brilliant mind decided to put meringue on top of sweetened (sugar this time) thickened lemon juice and put it in a pie? How did they know not to use peppar in that pie?
Why, THEY TASTED THEM. They studied the flavors. They studied them alone, they studied them in simple combinations, they studied them hot, they studied them cold, they studied them wet, they studied them dry. They studied them baked, broiled, grilled, boiled, microwaved, poached, toasted, and fried.
You must do the same. I can tell you that all the lighting ones interact with light - but that's like telling you they are all sweet. If you want sweet, look here, if you want interaction with lights in a scene, look there. Does that help you? Only a little. You're not going to come up with a great dessert by me just telling you which ingredients are useful for making desserts, right? I mean, you might, but it would be an accident.
So which lighting nodes, and when? Why use clay instead of diffuse, or a specular with roughness set really high?
My dear, if you want all that laid out for you, I'm afraid you'll have to buy a few dozen books. Nevertheless, if you don't TASTE the ingredients, you'll never be a good chef. If you don't experience each ingredient, you can't foresee what you'll produce at all. This seems to be your complaint. You can't predict the outcome of using this node or that one, so you certainly can't work backwards from a set of requirements to a node-based implementation of a shader.
First you must study the simpler materials, examine what they have in common. When does somebody use a clay node? Why did they use it? If they didn't say why, ask them!
Or do like I do. Make two spheres. Put one infinite light in your scene. Turn off shadows. Turn off the diffuse value and specular value on both spheres, so they render black. Put a Diffuse node on both spheres, plugged into the Alternate_Diffuse input. Render. Now change the parameters on one. Render - since they're side by side you can see what difference, if any, the parameter change has made. Move the light and try again.
Put a Clay node on one sphere's Alternate_Diffuse input , and a Diffuse node on the other. Leave the parameters at their defaults. Render. See any difference? Look really closely. Render big, render small. Can you adjust one to look like the other? Can you adjust one to look so different from the other that the other can't match it regardless of settings?
The answer is clay can do all that diffuse can, so why is diffuse there? 1) It's simpler - fewer parameters. 2) It emulates a large part of what 75% of all everyday materials do. 3) It probably was added first, then clay was added later with more options when people hit the limits of what the diffuse node could do. How do I know when to use Diffuse? I go their first because it usually works. When I see that my material falls into shadow too quickly, I think about using Clay instead, because it can produce lower variation of response to light based on angle. I know this because I rendered Clay and Diffuse side by side about 70 times, using different parameter values, and moving my single light around to all different directions. After a while I began to know what I'd see before I rendered.
Now remove all nodes from both. Do the same experiments with the Specular node on both spheres, plugged into Alternate_Specular. Play with the Highlight_Size. How big can you make it. If you make it really big, what does it look like. (Diffuse?!?) Why is that? Have you ever seen anybody use Specular instead of Diffuse? Why? Ask them why?
Now use Specular on one sphere, Blinn on the other. Observe the differences. Move the lights. Render again. Be sure to try the light from almost directly behind the spheres. See anything interesting about the Blinn here? (It really lights up the edges of things that are lit from behind, with the light pointing towards the camera.) What surfaces have you observed in the real world that behave more like what the Blinn is doing. (Answer - human skin.) What surfaces behave more like what the Specular is doing. (Answer - hard things like polished wood, plastic, glass, metals, teeth.) Why would you want to use both Specular and Blinn? How would you combine them? Look around your house. Light them from in front. Light them from behind. How do they behave. Which node would you use.
Now go back and ask yourself when you should change the specular color and why!?!?!
Do you have gold and silver flatware? If you do, this is a great thing to try. Lay out a gold spoon or fork beside a silver one. Look carefully at the reflections. What do you notice? Look at reflections in colored glass and clear glass. What do you notice? (Answer, metals color their specular reflections, glasses don't.) So you learn when to change the specular or blinn color and why.
Those four nodes account for an awfully large number of materials. Given where you're starting from, you should expect to devote at least 100 hours to them alone before you fully understand all that they can do in all the different lighting situations you can create.
And then, after the 100 hours experimenting, you should have at least 5 more interesting questions about diffuse and specular that you will need to come back and ask me about.
I wasn't kidding when I said I've spent thousands of hours on this. I've been playing with computer generated images using math-only (no photos) shaders and textures since 1985. I've also done the same with sound, only longer. I've been making synthetic audio since 1972. In 1978 I had the priviledge to study computer music synthesis under Barry Vercoe at MIT. Professor Vercoe was a pioneer. Way back then when most bands were playing with truly primitive sound generators, we were producing 8-channel audio of hundreds of orchestral instruments (strings, horns, woodwinds, percussion, everything), without benefit of a single actual audio sample. It was an amazing time. We also learned how to make computers pronounce words from first principles - no audio recordings. That was really fun. But it never fooled anybody. Even today, we don't know enough about how we can tell a real human voice from a fake one to be able to fix the algorithms. Close, but not exactly the same.
For an intro to some of the more obscure nodes, which I suggest you play with as a diversion so you don't go bonkers studying just the diffuse and specular nodes, go to:
http://www.castleposer.co.uk/my_tutorials.html
These are made by JohnRickardJR over at RuntimeDNA. He hasn't covered them all, but he does a good job of showing you what the node basically does, and then give you some idea of how it is typically used, as well as a few interesting special ways to do things. By no means are these exhaustive and he himself is still learning a lot of things, but its just the right kind of info for you starting out. For example, about the Math:Add node, he wrote "A frequent use for the add node is to provide a constant - a fixed number that can be plugged into other nodes. This constant can be used to control a series of related values in other nodes, allowing you to change one number instead of several." Brilliant! This is chef stuff he's giving you. Despite my gigantic over-experienced brain, that did not occur to me before I read his tut. In your basic everyday material it doesn't come up that often, but when it does, this is a nice thing to know about.
So remember:
Taste
Experiment with flavors (nodes) and ways of combining them (blend? works for cooking and it's a node too!)
Read things that are specifically written to teach you the basics.
Then when you get that far that you are "listening and performing" well, or "eating and cooking" well, then look at how more complex shaders were done by experts. By then you won't be wondering how did you know to do that? You'll be asking questions more like, "How does glass work? I know to use an edge blend on the reflection value, but what falloff? Is falloff really what I want, or should is there some tricky combination of Bias and Gain that works better? Is 20% reflection on the front-side realistic or too high? What about this beer bottle here - I can't seem to imitate it. What do you see in it that I don't?"
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)