Material and Shader Examples – Part 1 – Reflections

To help demonstrate how the various maps can be used in different ways, and along with each other, I thought I’d show an example.

I will use the phrase “given” in this tutorial a lot, as in a map “gives” the shader a value. This is because, for all the trickery and wizardry going on in these maps, they ultimately just output a colour value over some part of the object. As far as the shader cares, come render time a colour value of pure blue is pure blue (or green or red or…), where it comes from a multi-layered set of maps or just a bitmapped texture!

Our basic scene here is just a teapot with some lights. Nothing exciting or sexy in the least. I’m using VRay and Max here, but nothing I’m doing here is VRay specific – you can use it with any render engine and, frankly, and 3D software worth its salt.

The teapot shader is slightly blue in diffuse colour, with fully straight reflections (so they are not blurry at all). However, their distribution is defined by a falloff map in the reflection slot:

Several elements of this are important. Firstly, the “Falloff Type”, set here to “Perpendicular/Parallel”. As you can see above the two colour swatches, these are labelled as Front and Side, which explains quite clearly what it does! The colour given to the shader here effectively fades from the “front” colour when that part of the object is ‘facing’ the camera, to the “side” camera when it is at 90 degrees to is.

A second important aspect are the colours themselves – Front is set to black, Side is set to an off-white. It’s 185,185,185 – so still a very bright colour, but not full white. This means that, if a surface is flat on to the camera it will “give” the reflection property pure black – ie, no reflections. Then, as the surface curves away from the camera it’ll get lighter and lighter (and thus more and more reflective, in this case)until it’s totally perpendicular to the camera, at which point the reflections will be at a value of 185 (out of a possible 255 – so approx 73% reflective!)

Finally you have the mix curve. As if things couldn’t get more complex! This defines the gradiant between two colours. In this case I’ve left it at the default – linear. This means the transformation from the front colour to the side colour is completely proportional; The halfway point between the two (ie 45 degrees) will “give” a value of half way between the Front and Side values – in this case 92.5 (rounded to 93). For an example of some times when you may not wish to have a linear mix curve, please read up on a Fresnel Reflective Curve, a curve that defines the reflections of a number of objects in the real world.

To explain this a little more clearly, here is the same render, only this time I’ve turned off the reflections as well as all of the lighting, and moved the above falloff map into the diffuse slot, thus defining the surface’s colour:

You can see from this render quite clearly how the reflections are thus defined – the lighter the colour, the more “true” the reflection property, and thus the greater the strength of the reflections. If we swapped those colours within the Falloff material, you would get an inverted set of colours here on the teapot and, left in the reflection slot, the edges would be matte and the front of the teapot very shiny.