Shaders (part 5)

Skip Ahead (or back):

Brazil Chrome
Brazil Glass
Brazil Toon
Brazil Advanced (carpaint)
Brazil Advanced (others)
Brazil Utiliy and Brazil Basic

Brazil Advanced (Wax and Skin):

The wax and skin shaders add a few new extra bells and whistles to the brazil advanced material. The wax shader's contribution consists mainly of a sheen highlight which can be adjusted separately from the regular highlight, and the ability to do sub-surface scattering. The Skin shader adds some more complex controls for the sub-surface scattering as well as procedural cellular bump mapping and some skin-related specular controls.

As it is the simpler of the two, we will begin with the wax shader, so that we can cover the basics of sub-surface scattering before getting to the fancy stuff in the skin shader.

The Wax Shader:

The wax shaders biggest contribution to a scene is the ability to use sub-surface scattering. Sub-surface scattering, for those not familiar with the term, is basically when light is scattered around inside an object and can be seen as a sort of 'glow' in the object. Prime examples are the top of a lit candle, or when you shine a flashlight through your fingers and you can see the red light through them. For a little more in-depth info and some keen pictures, check out Neil Blevins' CG Education page on translucency and sub surface scattering.

This can be seen in the wax shader in the following image, where the model is lit by a single area light. THe image on the left has sub-surface scattering (sss) disabled, and the image on the right has it turned on. As you can see, the sss allows the light to enter the object, become scattered around and emerge from the back side of the object, making it appear to be made of a translucent material, such as wax.

So let's get down to business. Things you will need for this tut: a scene setup with a single light (preferably spot or area) with it's shadows turned on, and an object that varies in thickness. By this i mean it should have little skinny bits (like the connecting bits in my sphere above) and thicker areas (like the 'hub' sort-of-things on my sphere). This will allow you to observe the variation in brightness due to the scattering effect. So once you have these things set up, continue onwards.

Next, get yourself a new Brazil Advanced material, and from the shader drop-down menu, choose wax as the type. Next, before doing anything else, and before going off to play on your own and ignoring the rest of the tut, and if you only take one thing away from reading this, let it be this:

Set Your Material to 2-Sided!

This is an easy thing to forget to do, but if you do forget, you will not get proper sss. Brazil needs that inside surface to get the proper effect, and without it, you will get a material that shows almost no sss, so don't forget :) I'm not sure why this isn't turned on by default when you choose wax as the shader type, but either way, it is not, so you have to do it.

Next, in the render dialog, under the Luma Server rollout, enable Sub-Surface Effects and set the sample rate at 5 or 6 for now as this should give us enough samples to test accurately but not take too long to render.

Another important thing, when dealing with sss in brazil, is that it is scale dependent. My test sphere has a radius of about 34 generic units, so unless you make something of about the same size, your results may vary.

So, anyhow, back in the material editor, you've got a wax shader at default settings, and assuming you have it set to 2-sided and you have one area light off to the side of your object, you should get something that looks about like this:

Nothing too fancy, but some nice sss going on there with a sheen highlight. Sidenote: Brazil Area lights will not affect surfaces in a specular manner. That is, you cannot get a highlight from an area light, what you need to do is to make a standard spot light, put it in the same place as the area light, and under the 'affect surfaces' rollout of the spot, uncheck 'diffuse'. This will cause the spot to only make highlights on the surface, meanwhile the area light is only diffusely illuminating the surface, so they work together as one super-light! Now let's take a closer look at what the various controls do.

Starting at the top right, there are four color swatches. The ambient and diffuse colors are pretty standard stuff here. The sheen color swatch controls the color of the sheen highlight and the luminosity swatch acts pretty much like the self-illumination color in a standard max material (setting this to white makes a fully self-illuminating material) Below you can see how the sheen color affects the rendering, when set to white (left) and red (right).

To the right of the color swatches are the coefficients for the color swatch channels. As mentioned in a previous tut, these act pretty much like multipliers (like on a light) in that setting them to 0 turns off that channel and setting them to higher then 1 makes that channel brighter. In the case of the wax shader, I find that the Ks (sheen) control is handy for getting rid of the sheen entirely in cases where you don't need it. Setting this to 0 will get rid of the sheen (but leave the sheen on for now, for testing purposes).

Next down are the various Sheen Controls, which control various aspects of the sheen highlight. Backscatter and Roughness generally control the addition of extra sheeniness on surfaces facing the camera. Although this only comes into effect when the angle between the light and the surface normal is less then 90 degrees. This means that when turned up high, you will get a sharp line of backscattered sheen at the terminator of the light (point where the light falls to 0 because the surface is in shadow).

The third spinner controls Edginess. Basically, edginess controls how far from the edge you see the sheen. This works the reverse of how you might think it would, meaning that higher numbers make for less sheen and low numbers make for more. Observe:

The next section, Reflection Control, simply allows you to lock the reflection amount to the sheen settings. Here the backscatter and roughness controls come into play again. The images below have a green self-illuminating sphere surrounding the object, so that the reflections are bright green. The edginess is set to 10, and the backscatter and roughness are set to the same setting (the one on the image).

That wraps up the sheen controls, next are the controls for sub-surface scattering. For the following images, I have turned off the sheen (by setting Ks to 0), and turned off the highlight as well, so you can get a better look at what exactly is going on with the subsurface scattering.

The sub-surface controls are all inter-related. This being so, it is possible to change one thing without it making any difference to the render, unless another thing is changed as well. Keeping this in mind, the first things to start messing with are the color swatches for shallow and deep coloration. These are the colors that the scattered light take on, depending on how much off the object they have passed through. Isuggest setting these to contrasting colors so that the way they blend together can be easily seen. In the image below, i have my shallow color set to yellow and the deep color set to red, and you can see how they mix together as the cone gets thicker.

Beneath the color swatches, are spinners for shallow point and deep point. These control the depth at which the color switch happens. These are related to the thickness control in that if the thickness is set to, say, 10, then having shallow point set to 0 and deep point set to 1, puts the shallow color at 0 thickness and the deep color at 10 thickness. BUT...setting the thickness to 10 ALSO, puts the point at which no more light shines through at 10. So what you would get is your shallow color fading to your deep color, while getting darker, all based on object thickness, like so:

But if you set your shallow point to something greater then 0 and your deep point at something less then 1, you will get areas of the shallow and deep color on each extreme of object thickness, with the transition in between, like so:

The blend bias spinner biases the transition between colors towards one color or the other. Although, in my testing, this seems to get a bit flakey below .25 and above about .75, getting some wierd color artifacts and abnormally bright areas. Shown below is .8 first, and .2 below that and as you can see, while the transition between colors is indeed biased towards one color or the other, there are some strange results.

Next, the thickness setting lets you tell brazil how thick the object is, as far as the shader is concerned. Setting this to 10 will tell brazil to scatter light to a depth of 10 units. Areas thicker then 10 units will show no light on the back side. As mentioned above, the thickness setting also has an effect on how the shallow and deep colors blend together, based upon the shallow and deep points. Confused yet? Practically speaking, increasing the thickness setting makes the sss brighter, but also biases the scattered-light color towards the shallow color. This is because you are telling brazil that this object is much thicker and so it treats thinner areas as though they are more translucent (kinda). Setting the thickness setting lower, makes sss darker generally, and you are more likely to see some of the deep color. This can all be a bit confusing, so take some time, and play around with the settings to get a feel for how they interact with one another.

The Intensity spinner, below the thickness spinner, acts as a material-wide sss multiplier. Setting it lower will dim all the sss for that material and setting it higher will brighten sss up for that material. Keep in mind though, that setting it higher then 1 may result in sss brighter then the source light.

Next is the Sub Surface Sampling section. This allows for material-based sampling override, having a given shader ignore global sss sampling rates, when rendering, and instead use a local sampling rate, allowing you to add more samples on materials that need it and keep sampling low on those that don't need it.

Finally, the Opacity color swatch allows you to make a material that is both transparent and translucent. Setting the color swatch to anything below white will allow the material to begin refracting according to the IOR spinner next to the opacity color swatch. Standard opacity rules apply here.

Now, let's move on to something a little more complex: the Skin shader.

-----------------------------------------

Skin Tut, not done yet.

this skin stuff was taking a while, and i figured i'd just turn out the rest of the shader tuts first, upload it all, and then come back to this one later. So hopefully it won't be too long, but who knows ;)

-----------------------------------------

That pretty much wraps up the Wax and Skin shaders. Now, on to the rest of the Brazil Advanced shaders:

>>>> Five down, two to go!! >>>>

--



All images, elements and content are property of nathan fariss and/or real media digital production. all rights reserved.