Texturing for Dummies Part 3
The Importance of Real Diffusion

by Leigh van der Byl


What?! Diffusion isn't colour??!!

Yes, I too was shocked when I discovered that diffusion is not actually colour, as many other software packages I'd used before had led me to believe.

But. but. if it's not colour, then what is it??

Well, it has got something to do with colour, but it is not the actual colour itself. In reality, diffusion is actually the extremely essential attribute of an object's surface that scatters light - so basically it's the surface attribute that determines how much light is reflected, as well as absorbed, by the surface - it determines how much of the surface's colour we can see. And you certainly don't need a degree in physics to understand that our eyes are able to see things purely because of light reflecting off everything in the world around us. Simply put, those rays enter our beady little eyeballs and the information is processed in our brains, and we see things. Which is why we can't see too well in the dark - there is very little light bouncing around. And what little we can see, is kind of fuzzy, due to the poor quality of what little light there is available.

To drift slightly from the subject at hand, I'd just like to state here why global illumination (usually just referred to as GI) is so important. Now, for those of you that don't know much about global illumination and radiosity - here is a complicated explanation: Radiosity, technically, is defined as the amount of radiation leaving a surface per unit time per unit area. Which, basically, to us mere animators, means that radiosity is the effect of light bouncing around - in other words, it is the indirect light that is distributed between all the objects in any environment.

To illustrate this an easy example would be to set up a scene of a plain, empty room with a table in it and a light (lets say, for instance, a point/omni light) above the table. Now, without radiosity, if you were to render this scene, the underside of the table would be pitch dark. Now, in real life, this is not so. Set up a table in an empty room and hang a bare lightbulb above the table. You don't even actually have to do this to know that you would definitely be able to see under the table. Why is that?

Well, that's because the light from the bulb would bounce off the walls, onto the floor, and then bounce back up off the floor and illuminate the underside of the table. Actually, it's interesting to note here that the majority of light around you actually comes from indirect light, and not the source itself.

Radiosity is perhaps the most critical element of photorealistic rendering, as it gives an ambient radiance to your scene without making it look flat. And because it is a real world effect, it's essential to include it in your rendering.

Up until very recently, most animators had to fake radiosity with complicated lighting setups consisting of anything up to 100 to 200 carefully placed point (omni) lights in a scene, usually set up similar to a concert lighting rig, in a cone like shape. Obviously this isn't a great solution though, as we all know that too many omni lights can sometimes make things look a little flat. The same thing happens, but to an even worse degree, by using the ambient lighting option that is included in most software. If you want to do your light setup properly - DON'T USE THE AMBIENT LIGHT. Switch it off completely. In most programs, ambient lighting is on as a default, so find out where yours is and SWITCH IT OFF!! To switch it off, go to your Global Illumination panel and adjust the Ambient Intensity setting.

I'm mentioning this because without radiosity, diffused surfaces will not work properly. Instead, they will just appear too dark. But back to the actual subject at hand.

So where were we? Oh yes, I was explaining that diffusion determines how much of a surfaces colour we can see, because it controls how much light is reflected off the surface and how much is absorbed. And although this may sound similar to specularity or reflection - let me quickly just clarify the difference between these - as I said, diffusion controls how the light's rays leave the surface, whereas specularity and reflection control how much the surface reflects the actual light source itself. It would be safe to say, that diffusion, in practice, is simply the opposite of specularity and reflection, in much the same way that opacity is the opposite of transparency. Diffusion refers to the scattering of light, whereas specularity is to do with its reflection.

So, in essence. by diffusing an object, you control the amount of colour that is reflected back off the surface by the light. This is completely different to simply darkening the surface of the object itself. If you were to darken the actual image used as a colour map, you would see only see a change in colour, but not colour depth.

Colour depth is created by scattering light across an object's surface. Take a look at human skin and you'll notice that it has a density. The colour isn't a simple continuous shade but rather many similar shades, created by scattered light. This quality cannot be made by a colour map alone, as a colour map cannot give a surface the richness that a diffuse map can. Of course, we have to bear in mind at this point that obviously translucency is another critical attribute with regards to scattered light, as it determines how the light passes through a surface and, together with sub-surface scattering, is scattered around inside the surface. But I'll be discussing translucency in depth in a later chapter.

Diffusion can also be used with lighting itself. Those of you who have spent any time on film sets or in photography studios will know that it is necessary to put milky, semi-opaque plastic sheets in front of the lights. These are basically diffusion screens. They change the quality of the light, so as to prevent glare on the subjects they are lighting. This is pretty much what we are doing when we diffuse objects. We are preventing over-saturation of the colour of their surfaces.

Right, so now that we understand what diffusion is, how exactly do we use it?

Putting Diffusion Into Practice

How do you make a diffusion map? Well, for starters, as with most other image maps, a diffusion map's effect is created using varying shades of grey. And, keeping in mind that when working with grey scale images for surface attributes - where white always represents a positive value of the attribute, while black represents no effect at all - the lighter the shade of grey, the more diffused the surface becomes. And obviously, the more diffused the surface is, the more light is reflected off it, carrying colour information into our eyes, and the more colour we will see.

Knowing this, you are now faced with the tricky task of determining the diffusion amount for a surface. As a general rule, absolutely nothing has a diffuse value of 100%. In fact, most things have a diffusion amount of 80% and lower.

Because nothing has a diffusion of 100%, leaving it at that amount will result in your surfaces interacting unrealistically with the light. This will basically result in your objects looking over-saturated, because the actual colour of your object becomes over-saturated by the light. Obviously, without light, diffusion doesn't actually make a difference, but the moment you put any light into your scene to illuminate your object, that light is going to hit your objects surface, and, depending on how shiny you've made the surface, it's going to create a hotspot of light. Now, if the object has 100% diffusion, that hotspot is going to multiply the colour of the surface, as well as adding it's own colour to the surface. This is obviously going to result in an unsightly over-saturated spot.

Take a look at Figures A and B. Figure A has a diffusion of 65%, whereas Figure B has 100% diffusion. Notice how over-saturated that light spot is on the second sphere. Yuck.


Figure A - this surface has been properly diffused, as opposed to
Figure B, which has 100% diffusion.

Okay, so how do we make the diffuse map to go with our surface? Well, here is something to consider - a good general rule is that the more reflective the surface is, the lower its diffuse amount. Why is this? Because the more reflective an object is, the less colour it has of its own - the "colours" you see in it are merely reflections of it's surroundings. And the more they reflect of their environment, the less colour they have of their own. Metals, for example, generally have lower diffusion amounts, as they are usually quite reflective, whereas bark on a tree would have a higher diffusion (unless it's wet, in which case, it appears more reflective, and therefore would have a lower diffusion), as it possesses more colour of it's own.

Remember, the diffuse amount controls how much of the colour is seen, so if the surface doesn't have much colour of it's own, it obviously doesn't scatter light.

Tip: Bearing this in mind, it therefore makes sense that when making an object that reflects 100% (like a mirror), you would make the base colour of it black (in other words, it has no colour). And because it has absolutely no colour, it's diffusion amount would also be zero.

Consider the example below - in the first image, the chrome cow has 100% diffusion and 100% reflection, resulting in a very milky (excuse the pun) look. However, in the second image, the diffusion has been taken to 0%, and what you get is a much cooler chrome look.

Another thing to bear in mind is the topography of the surface. Any cracks, in the actual geometry of object, are going to have a slightly lower diffusion, as light gets trapped in cracks, causing less of the surfaces own colour to show through (in other words, because the light gets trapped there, it doesn't bounce back into our eyes, carrying that colour information which would allow us to see that colour). This obviously means that a diffuse map has to be carefully made, as it has to include these sorts of details. Simply giving a surface a global value is not going to suffice. Remember then, that when making the diffuse map, you must keep in mind what the bump map is going to look like as well, as this will affect the diffusion, but obviously to a lesser extent that any cracks, holes, etc in the object's geometry itself.

Of course, the actual colours on the surface itself do subtly affect the diffusion. A quick science lesson - different colours have different wavelengths. Depending on the length of the wavelength, depends on how much that colour is scattered. For instance, blue has the shortest wavelength, and is therefore scattered the most - which is why the sky appears blue. And because diffusion deals with scattering of light, this is something to bear in mind. Basically, you can start off by de-saturating your colour map to grey values.

Now, remember how I explained earlier how it is that areas which are shinier and more reflective have lower diffusion values? Well, it would therefore stand to reason that the information from your specularity/reflection maps is important to include in the diffuse map. You can do this by inverting your specular map (thereby converting the areas that were shinier and therefore lighter grey in the specularity map to the opposite - darker shades of grey and therefore less diffused) and adding it to your desaturated colour map. Blending these two together makes a great base for your diffuse map. However, the information of the colour map is more important than that of the spec map (I'll explain why later), so make sure that you lower the transparency of the spec map before blending the two together, that way ensuring that the desaturated colour values remain predominant.

But wait a minute!

If you think logically, carrying on with this process in this fashion will lead to a certain problem.

Guessed what it is yet? Okay, this is a tricky one to fully explain.

Proceed To Page 2


Tutorials
 
 
 

 
 
Copyright 2005 NewTek

Privacy Policy | Contact Us