Bob and his need for spheres kept me away yesterday, but today I will make up for that by showing you all the secret to Dividing and conquering light color!Light Color and Adjustment
We last we left we had just finished adjusting the shadow darkness for the shadows and just had the color of the light left to change.
In order to truly adjust the color of a light in a scene you need to adjust the actual light
and leave the underlying surface properties of the geometry alone... Which, if you know anything about how light works in the real world can be pretty confusing. In the real world the color of a surface is actually determined by light, the surface will bounce back certain wavelengths of light and absorb others (speaking in a very simplified way) the light leaving that surface is then picked up by our eyes and bounced around our rods and cones to determine how bright that light is and what color we see the surface as being. In 3D we cheat this quite a bit (gasp! not a cheat in 3d!
) each surface has it's own color regardless of what's going on in the scene and then we shoot light rays at that surface and the color of the light alters the color of the surface by... you guessed it: Multiplication! So when we want to change the color of a light we need to be able to pull just the information that the light is contributing to a surface regardless of the color that surface might have.
So how do we separate out the light data? The same way we separated out the shadow data. First we look at our available buffers for what we need:
The buffer that we are looking at here is the Diffuse buffer, not the diffuse buffer for any of our three lights mind you, those contain the diffuse color of a surface and the effect of lighting, no we need the Diffuse buffer that contains only
the diffuse surface colors for the objects in the scene which is the one right there at the top: start simple 0 Diffuse.
This is what we call a flat shaded version of the scene. it is what the scene looks like without any lights added in at all, it's not much to look at but it does give us something to divide our diffuse light elements with to get to just the light data.
So we go into our composite and add a branch to the Light 3 diffuse with shadow element, we want to add a Divide branch just as we did to remove the shadow but this time we drag the global diffuse buffer to the branch to complete it. Again, just like we did for the shadow we need to multiply the diffuse elements of the scene back into the composite after we have doe the Divide. I like to do this right now while I'm thinking of it, and it's pretty much IMNSHO a good idea to multiply when you divide and visa versa, it keeps you from forgetting about it later.
Rename your new branches and you might have a composite that looks like this:
if you toggle between the multiply and divide branches you probably won't detect a huge difference, but that's because our surface colors aren't really set, they are all default white, if you had any variation off that default white in the scene you'd see pretty vast differences.
Ok now that we have the light separated we can see that it is indeed yellow in hue, and Bob hates yellow. we need to make this light a cool color. There are a couple ways that we can go about this, we can either use the tint post effect (see that list I made a few posts back
) or we can use the HSE post effect... decisions decisions.... well I tell you what we have another light down there we can change the color on, lets do tint here and HSE there.
Tint is a post effect that takes the range of color in an image and tosses it out the window, what it leaves is the brightness of each pixel, which we can then map to two colors, one will suplant the dark tones in the image and the other will alter the light tones. In the print world (and in photoshop) this is called a duo tone. It is used to give images that old timey sepia tone look to them or to simply take a color image and make it black and white.
We go ahead and add the Tint branch to our Composite tree. Right-click on the Divide Branch we just added in and add a new Tint post effect. The new brach will default to making your image black and white. There are a number of other presets available to us: Colbalt will make the darks of the image black and the lights a rich deep blue, Sepia will turn the image into a sepia tone, where the darks are a dark rich burnt umber color and the lights are a light brown, X-Ray will make the dark tones white and the light tones black. I think i'm going to use a custom set of colors:
The darks are a very dark blue grey and the lights are a brighter version of the same color.
much better no more of that yellow in there and we have a nice cool light
The last little bugbear is the yellow/orange fill light down there on light 1 diffuse. We tackle this just like we did light 3. first we divide out and multiply back in the Diffuse for the entire scene, then we add a branch in to change the color of the separated out light data and as I promised, this time we are going to use the HSE effect to do it!
HSE stands for Hue Saturation and Exposure. The simple way to think of this is: Hue determines the color, Saturation determines how vivid or washed out the colors are and Exposure determines how bright or dark the colors are. In the way of computers, seemingly simple concepts are actually pretty darn complex if you keep digging, but this base understanding will be enough for us now.
So at the point where we have the light data broken out of our composite (i.e. on the divide branch) right click to add a new HSE effect. This effect will now allow us to shift the hue from the yellow range that it is in now to a more Bob-friendly color range. To understand what the hue shift will do think of a color wheel and think of our color as being a fixed point in space not really a color but an coordinate that points to a color on the wheel. When we adjust the HUE we rotate the wheel without changing the location of the point of our color so that now it points to a different color entirely. The upshot is that we can change an entire color range without effecting the variations across a surface (as with tint.) Hue takes a value from -180 (rotate the wheel counter clock wise 180 degrees) to 180 (rotate the wheel clockwise 180 degrees.) With a little experimentation you will be able to find a color that you like, for this case I give the wheel a value of 50 (shifting the color wheel 50 degrees clock wise moves the green range of color under our point)
so at this point we have a full composite that looks like this:
which is a whole world of difference from where we started:
The actual time to build and adjust this composite was actually less than 20 minutes (which if you are talking about an animation with hundreds of frames that you want to adjust is a HUGE time savings on re-rendering.) Of course typing it up took a lot longer than that
and just for your reference here is my final Composite:
If this is what we want, it's a simple matter to commit to this: right click the composite in the PWS and choose Save As Animation... and your composited image will be saved to disk in the format of your choice. Now if we send this to bob and he decides he wants the fill purple instead of green... hey no problem we just change the HUE (-150 would probably do the trick) and save as animation... total re-rendering time? 0 seconds. let that sink in... you just changed something that effects the look of every frame of your animation and the total time to render that change to file is 0 seconds. Suddenly the render is a re-usable asset that can be used again and again changed slightly and output with no real hit to your time.... we'll wait for vern to change his pants before we sum up this little exploration.
The thing to remember here is that Composites aren't just for fixing problems, heck i'd say that's the least of the cool factor. Mostly they are about giving you the freedom to try different things all at full resolution all over the full length of an animation all without having to render a scene dozens of times.
This simple introduction was just intended to give everyone a basic feel for how the feature works and encourage you guys to jump in and start playing with your own renders. Soon I will be starting up a thread that goes into a real scene from an actual animation and go over some of the more advanced ways in which we can use Composite and our EXR layers. Lots and lots of good stuff to come!