I will be continuing to update this article as I think of things to add, as well as based on feedback I get. If you have a question or anything to suggest, please drop me a line at dan-grover at dan-grover dot com. Latest Updated: 19th July, 2011.
What is this?
This article is intended to explain the differences between a material, a map and a bitmap/texture, and how they all work with one another. The reason I wanted to write this is because, when looking at a number of threads on various forums, it seemed there were a few people who weren’t quite understanding the differences and how they all fit together. I think that one it clicks, it makes the creation of the look you really want (and probably have in your head!) a whole lot easier!
It seems that quite a lot of tutorials place an emphasis on the specifics of how to make a particular material, but rarely explain why those values are appropriate – I hope this guide to be the opposite. There will be no overall example or goal, but rather an explanation of the structure.
Who is it for?
This is aimed at artists, and I want to avoid getting too heavily involved in the technical aspects. This should also be software-independent, though as a 3ds Max user, some of my nomenclature may be a bit unusual to Maya/xsi/c4d etc users – I apologise!
What is a shader/material?
A material (I’ll use this word throughout, but for all intents and purposes, to the user, they’re the same thing) is effectively a list of parameters that define how a surface looks. For example, there might be a “Reflectivity” parameter, and the higher the number, the higher the reflectivity. Typically, the more parameters a material has, the more flexible it is (though this is by no means always the case!) You can get specialist materials that perform a certain task – such as provising sub-surface scattering to create accurate skin, or a matte material to make invisible objects ‘catch’ shadows. Or you can have more versatile ones, such as Max’s default standard material, or the Arch & Design (max)/ mia (maya) which provide a great many options, all within a single material.
The crucial thing to understand here is that almost all of these parameters can usually be defined by “maps”.
What is a map?
A map is a specific way of defining the value of a parameter in a material. What does that mean in English? It means that if you want the value of something like ‘reflectivity’ to be more complex than a simple number, you’ll need some way of telling the material what the value should be. Typically it does this using colour, with black equating to 0% and white equating to 100%. Thus, for reflectivity, if you put a black and white chequered map into the reflectivity slot, you’d end up with chequer’s of reflection over the object, with the areas mapped in white being 100% reflective, and the black parts being totally opaque (or 0% reflective).
Typically, though, a map will be more useful than this. One example is a falloff maps. This is a procedurally generated gradient, from one colour to the next – and, crucially, the ‘procedure’ that generates this gradient is based upon your scene. Within a falloff map, you will typically have a number of ways to generate this, with the default (in 3ds Max) being front:away. What this means is that the colour in the “front” slot is the colour applied to a polygon exactly facing the camera. The “away” slot colour is applied to a polygon facing exactly perpendicular to the camera (ie at 90 degrees to what you see). Anything between is a gradient between the two (the default gradient here being linear – so an object at 45 degrees has a value exactly between the “front” and “away” colour. If you put black in the “front” slot, and white in the “away” slot, and put this into the reflectivity slot of a material, then you have an object that gets more reflective and the angle you’re viewing it at gets more acute (much like glass and many other reflective surfaces – though many of these are governed by a very particular gradient known as ‘Fresnel’, named after the scientist who first codified the existence of this angle! In 3ds Max you will find this as an option in the falloff mode, along with another very useful option – distance!)
Speaking of this distance parameter, here is another example of a use of a map to help explain how they work. At work we had a problem the other day, whereby we had very specific constraints on the way we had to move a camera through a scene that required us “smashing” through some walls. Whilst not too bad, this was somewhat jarring, so I made a map to go into he ‘opacity’ slot of each of the materials in the scene.
This map was another falloff map. This time, I set the mode to ‘Z-Distance’ – that is distance away from the camera (with the X-Distance being to the side of the camera, and Y-Distance being above and below it). The two colours, in this mode, has distances attached to them. So, for example, when setting “Near” to Black and 1m, and “Far” to White and 6m, you have a map that changes depending on an object’s distance from the camera – if it is less than 1m from the camera, the map outputs white. If it’s further than 6m, it outputs black. Anywhere between this, and it fades from one to the other. As a result, when this was placed into the opacity slot of the scene materials, it had the effect of fading an object from view shortly before it “smashes” into the camera – great!
What is a bitmap?
A bitmap is a kind of map. In fact, it’s a very simple one, albeit powerful. This has (on its own) no procedural properties at all – you simply paint it. This is particularly useful for certain properties, like colour and bump slots. When surfacing a human head model, for example, you would struggle to texture the face using procedural maps, such as the falloff map mentioned above. You would almost certainly have to use a bitmap – where each pixel of the map is pre-defined by the user (in Photoshop, for example), and then remains as it is. That said, it’s just a map – there’s nothing special about it. Anywhere you can use a bitmap, you could have used a falloff, or chequer, or gradient, or any other map. People often refer to these maps as “textures”, also.
More Confusing Stuff
Maps within maps! There’s an Inception joke to be made here, but I don’t have it in me! Anyway, you can often nest maps within maps. For example, in a noise map you have a map which generates random “noise” between two colours. You have a few parameters which define how this noise is created – how big the various splotches are, how smoothly they fade into one another, how the edges of this fade look, etc. And these two colours can be set to anything you want, but they can also be set to contain another map rather than just a colour. What does this do?
It simply replaces the colour with the map. That simple! Let’s say you’re using a noise map, with settings such that it makes quite high contrast, to make the surface of an object appear like it has lots of paint splattered over it. Perhaps you would put this Noise map in the diffuse slot – but you probably wouldn’t want a black floor with white paint. So within “black” slot, you might put a bitmap of some concrete, and in the “white” slot put a bright blue, to represent the paint. You might put the same noise map in the bump slot. This time, in the “black” slot you could put a bump map associated with the concrete texture, and just a white colour in the “white” slot – so that the paint is a) smooth and b) always “on top” of the concrete (as white = more bumpy, aka appearing most extruded from the surface). You might also put this map into the reflection slot, leaving the “black” slot black (as, in this example, the concrete would not be reflective) and in the “white” slot (ie the paint layer) you might put a falloff map, set up like described above – that that it’s level of reflectivity is defined by the angle at which is is viewed (whilst the concrete remains non-reflective, irrespective of the angle).
In each of these cases, you have a second map within a map, to achieve a more complex result. You can keep layering these up and up, to get ever more complicated results.
Another use of maps is when creating Composite map. This is a map (Yup – more maps within maps!) designed to help you layer up maps, just like layers in photoshop. If you’re just doing this to layer up bitmaps, it may be quicker (and kinder on your RAM usage) to do it in photoshop and save it out as a single bitmap. However, this is incredibly useful if you need to use procedural maps for anything. Not only does it allow you to use a map as a mask, but you can also set maps to have different layer blending modes, just like in Photoshop – so what you can do is create a bitmapped texture of, say, some bricks. Tile them as many times as you need to in order to achieve the correct scale. Then, place that bitmap within a composite material, and add a layer on top of that. This layer could be a noise map set to overlay or multiply. This will darken certain, seemingly random areas and not others, but different ammounts. This way, a texture that’s tile multiple times may look different each other, due to these random variations. This isn’t very sophisticated – you could replace the simply overlaying, for a second layer of texture (perhaps bare plaster or torn paper representing old posters) and have a heavily contrasting smoke map define this map’s opacity within the Composite material. This would have the effect of mixing together two maps (in this instance, two bitmaps) using a procedural map, so that the tiling areas never look the same. Of course, you could do this in Photoshop, but you would have to save out a huge bitmap to cover the whole area. This same material can be applied to multiple surfaces, and achieve a different result (if the mapping is correct), making it more efficient in terms of working AND RAM usage.
As you can see, when you begin to think creatively with maps, and how they interact with the materials, it’s easy to get complex looking results. It also makes it very easy to get the kind of material you want, whether it’s realistic or cartoony. You want a Super-Mario-Galaxy-like glow around the edges of your objects? Put your diffuse bitmap into both slots of a falloff map (set to front:Away) and lighten up the “away” map in the “output” section of the map. This way, around the edges of the object the diffuse colours get lighter!
When looking at an image of something you wish to replicate, think about what makes the object appear how it does. Does it reflect? Does it refract? Are either of those two very clear, or are they blurry? Is their level and the colour of the reflections/refractions/surface colour the same across the surface of the object? If not, does it change in a mathematical way (ie it gets more x as the geometry becomes y) or is it random/planned? If the latter, can it be randomly recreated using noise/smoke maps, or will it need to be bitmapped? Is the surface bumpy? Is THAT random and does THIS alter across the surface? Look through the material you’re using, and think “If I want to replicate this object, will THIS parameter need to change?” and try to work out how that physical object (or, if it’s a bit of concept art, how that piece of art) came to look the way it did.
Once you’re happy with knowing what makes up an object, it’s time to work out what maps will best go about making your 3D object look the same. If it’s about how the angles of the object appear compared to the camera, try a falloff map. If it’s about how they appear to one another, try an Ambient Occlusion material. And finally, remember that all maps can be used in all slots – a falloff map isn’t just for reflections. It can define the colour of an object, the level of bump, the blurriness of the refractions etc. It’s also worth noting that there are a lot of free resources available online, such as vraymaterials and mentalraymaterials where you can download materials and take a look through them to see how they tick – it’s a great learning resource!