1 Tutorials LightWave 3D Texturing for Dummies Part 3 The Importance of Real Diffusion Qua Jan 26, 2011 2:06 am
Admin
Admin
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. We know that, in extremely simplified terms and with regards to its initial immediate effect, lowering the overall diffusion amount and adding a diffusion map darkens the surface. So basically, if you do your diffuse map after you've completed your colour map, then surely when you slap your colour and diffuse maps onto your model and render it, the change in diffusion is going to result in an unwanted change in the colour value. To put it more simply - the colours you painted onto your colour map are the colours you want your actual model to appear when rendered, aren't they? Now, knowing what diffusion does, it's obvious that when you lower your overall diffusion amount and add your diffuse map, the actual colours you painted onto your colour map are going to appear too dark. And that's NOT what you want, is it? No. So how do you compensate for this?? Well, it's actually pretty easy. It just takes a bit of forethought, some cunning, and using your braincells a bit. Okay, as I mentioned earlier, different substances have different base diffuse values - for example, human skin has a basic diffuse value of about 70-80%, wood is about 70-75%, and a reflective metal like chrome has a value of about 15%. So, depending on what your surface is, you would have given it a certain overall value. But how do you decide on what that overall diffusion value is??? Just take a look at it's overall shininess and reflectiveness. These properties are easier to reproduce by eye than diffusion is. So, when you initially begin to make your surface, decide on how shiny and reflective it is first. This is pretty easy for anyone to do, as we all know how shiny different surfaces in real life are. Here is a very important tip: When creating ANY surface, make sure you have plenty of reference handy. Say for instance I'm given an object to texture, and it's a giraffe's snout. Before I start making ANY image maps or assigning any values to any of the surfaces attributes, I'd ensure that I had at least 10 different pictures of a giraffe's snout to refer to. That way I can see exactly how it's surface reacts to light. I cannot stress enough just how important reference pictures are. By referring to reference images, you can tell exactly what it's colour is, how shiny it is, how reflective it is, what sort of texture (bump) it has - basically I can see exactly how it appears in real life. This will thereby ensure that my own cg surface turns out perfectly true to its real life counterpart. Okay, so we've decided on our overall specularity and reflection amounts. Now, decide on an overall diffusion value depending on what the overall specularity/reflection amounts are - keeping in mind that the higher those values, the lower the diffusion will be (or, on the other hand, the lower the reflection, the higher the diffuse). A rough way of determining this would be to use the left-over number from the total reflection value - in other words, if your overall reflection amount is 75%, then make your diffusion 25% (as that is the remainder of the subtraction of the reflection percentage from a possible total of 100%). And if your reflection is 15%, then make your diffusion value 85%, and so on (however, a little leeway is allowed here - sometimes you will find a bit of tweaking of a few percent here and there will be needed to get it looking right at the end). These rules aren't cast in stone, they are just guidelines. Are you following me? Good! Now keep this little equation in mind, as we use it similarly to determine the colour compensation. Right, go back to your colour map. Okay, now say for example I'm making a human face. And I've decided that my overall diffusion value is 75%. Well, in order to compensate for this diffusion value, we are going to need to lighten the colour map by 25%. We lighten it by 25% as this is the difference between 100% and 75% (of course, to put it even more simply, you could say that you would need to lighten the colour map by the same amount as your overall specularity/reflection value, but I'm referring to the diffuse amount, as diffusion is the subject at hand). Knowing this amount by which it needs to be lightened, how exactly do you lighten your colour map? Well, in Adobe Photoshop® there are a couple ways of doing this. You can use the Brightness/Contrast tool, and just drag the slider until it looks like it's a certain percentage along the line. You could also do the same using Levels. However, this simplest way of doing it is by using Curves. Just click on the graph line and adjust it until the percentage displayed beneath the graph is correct. Alternatively, you can use the Brightness adjustment slider in LightWave®s Image Editor, as shown in Figure C. Figure C - LightWave®s Image Editor supplies you with a number of useful tone control tools However, as I said previously, a single global value does not suffice. Bear in mind that this compensation only correlates to the overall diffuse amount, whereas the actual map that you use in your diffuse channel has varying strengths of diffusion, obviously determined by the varying shades of grey within it. That is why it is so important to use the greyscale values from one another. Wow, painting image maps is tricky business, eh? Okay, before you go and experiment with diffusion, let me just let you know that this is, in fact, an extremely subtle effect. So don't go expecting huge, radical differences in your renders. When you have made your diffusion maps correctly, you'll notice that the difference is very slight. However, subtle as it may be, it is nevertheless an extremely important effect. Take a look at Figure D. This hand has no diffusion, whereas Figure E does. You'll see that the difference between the two is only very slight. The colours of the hand in Figure D are over-saturated - the skin of this hand is supposed to be dead, and even though I painted the colour map correctly, the fact that it has 100% diffusion results in the colours becoming over-saturated. Which is not what I wanted. Whereas, with Figure E, I've added a diffuse map, and all my overall values are set correctly, according to the method I've described. As you can, this has resulted in a more desired saturation - the skin now appears the way I want it to. Figure D - hand with 100 diffusion applied Figure E - hand with correct Diffusion map applied I know that a lot of you may be looking at this, and thinking "why bother?" Well, if you want to achieve photorealism, and produce high quality visual effects, these are things that are essential. However subtle and useless this effect may seem, trust me - it IS essential. A character whose skin has been textured and left with 100% diffusion is going to get very nasty looking saturated spots all over it when it gets lit, and the only way to avoid that is to use diffusion correctly. It's all part of the bigger process. Well, that's pretty much all I can really say about diffusion! Hope you found it a fascinating read. By Leigh van der Byl [Tens de ter uma conta e sessão iniciada para poderes visualizar este link] |