1/2Hawk Posted January 30, 2008 Report Share Posted January 30, 2008 Introduction Whats up modders! Well, if you've followed along with my previous tutorial on Advanced Lightmapping techniques [Link: http://bfeditor.org/forums/index.php?showtopic=10563] then maybe you've dropped some killer lightmaps on your map but they still look a bit blah. Youve doublechecked your settings in Max and tweaked em, the lightmaps look really good in Photoshop, but in the end you just cant get em to pop like I showed on those tallships. Or, maybe you're still old school (ie: a glutton for punishment) and let the Editor give it a go (overnight) with likewise mixed results. Ever happen to you? No? OK, well maybe you're one of the 80% of mappers up in here that just paints a green square on the ground and drops any old statics you find on top - then you run lightmaps as an afterthought. Maybe you dont have an eye for detail that would otherwise lead you to tying all of the elements of your map, including lighting, such that your map gives off a particular mood. Like this: Fuel Station - from Battlefield Apocalypse by Bensta-IDF Or this: Shallow Draft - from Battlefield Pirates 2 by BrotherJustice Or this: Vile Ville - from Battlefield Apocalypse by Bensta-IDF Maybe you just dont know how yet. No worries - this tutorial will show you how to pull looks like these off, while at the same time making the best use of those lightmaps you've worked so hard to create. And it doesnt soak up a lot of extra resources because even a basic map is using the default colors already. LightSettings Primer Now wait a minute, you might be thinking. I've seen some of those buildings in BF2 and they definitely werent orange. And Ive never seen a palm tree with a blue-white trunk on it before. Are those custom skins? Well no, because many of those statics will be reused on other maps with entirely different atmospheres and reskinning them each time would be a horrible waste of resources. OK then, you must have colored your lightmaps yeah. Well its true that the lightmaps are in fact brightly colored, but they dont work the way you might think they do. For example, you might make them all pink but that doesnt necessarily mean your objects and terrain will turn pink as well. Let me focus your attention on a part of the TweakerBar that you may have messed with but it didnt seem to do much. If you click on the tab with your map's name and expand the section titled LightSettings, you should see some colored boxes like these below. The default settings are on the left, with the settings for two of the maps above also shown. This is the same place where you set your fog, clouds and sky texture.. and if that still isnt enough to guide you to the right spot then your map probably sucks so bad that none of my expertise is going to help you any. Most of those properties with the colored boxes next to them will work in conjunction with the different channels on the lightmaps to tint your map's assets to create a consistent feel throughout. Tomcruisesayzwhat? Yeah you heard me. OK, more slowly this time around. *sigh* Let's go look at some lightmaps. Random Lightmap Segway Right... Here's a DICE terrain lightmap from Sharqi Pennisula (tx02x03.dds). Terrain lightmaps are stored in the map's client.zip in the /Lightmaps folder. Inside that folder is also an /Objects folder which is where the static object lightmaps are kept. They work the same way. OK well if you look at them directly in Photoshop then they look all colored blue, green and sometimes pink (if over water). But what you're looking at here is actually the combined influence of three different lightmaps which were created from different light sources. Each is stored on its own channel... Put together, you get the rainbow colors. What's a channel?!? Good god kid ... its probably good you stole Photoshop because you are probably only using about $20 of its value. OK - click on Window -> Channels and you'll see the RGB main channel and then one for Red, Green and Blue - sort of like layers. The blue channel stores information about the ambient lighting. Clearly the ground beneath the buildings isnt going to receive much light so those areas are much darker than the ground which is out in the open. This has really nothing to do with the sun's position etc so dont get confused there - its more a measure of the light reflecting from the sky. Directional sunlight (meaning it points somewhere - duh) casts shadows stored on the green channel. Basically you would go pixel by pixel on this channel and determine if you can see the sun, and from what angle - kinda like the Verizon dude going "Can you hear me now?" at each spot. Thus the hillsides facing the sun are bright white, while the ones facing away are darker - and wherever a tree is blocking the sunlight altogether is jet black. The red channel is reserved for point lights. Its picked up a few blips on this part of the map, but there isnt a lot going on. Now, if this was a lightmap for a large building with an interior you might see a lot on this channel. I show in my last tutorial what this looks like for the lanterns hanging on the pirate ships if you're really that interested. Otherwise just trust me for now. Sodafukwhat Well let's get back on topic here and cut to the chase. Each of those channels in the lightmaps multiplies with one (or more) of those colored LightSetting boxes I talked about earlier, and the result is applied to the texture of your terrain or object. And, if you stick with the default settings (go back and look at em) you might be disappointed with your lightmap because frankly the defaults are pretty frickin boring! Look closely at the names of the LightSetting properties more closely. You'll see a few labelled like this: TerrainSunColor StaticSunColor EffectSunColor TreeSunColor TerrainSkyColor StaticSkyColor EffectSkyColor TreeSkyColor Ohhhh... now you get it. The xxxSunColors work off the green channels and the xxxSkyColors work off the blue channels. If your LightSettings are black and you multiply your kickass lightmap across it, you could wind up with BLAH. Interesting. Well actually, there's another very handy thing going on here. Lets say you just spent four hours running your Sun pass in 3DSMax and the shadows turn out sucky. No problem - just make a change to some of these values and you can often save yourself the effort of having to re-run them again. [That said - I did previously warn you to run a test on just a few objects before a full run... not because Im a smartass, its just Ive wasted a lot of my precious freetime doing this crap over and over again]. Its also an important point that its probably better to overdrive your shadows (high Intensity values) in Max so you have more to work with ... its easier to tone down shadows than to bring them out. Half - I havent read this much since 10th Grade OK fine - lets wrap this tutorial up with a 6 Step Guide putting all this in action with an example. I recently had the pleasure to help out the BF:A guys lightmapping and color adjusting a few of their maps, including this one called Vile Ville. Here it is with the default settings. Step 1 - Formulate a Plan The first thing I notice is that there are a few very unique effects on this map - including dust storms and a tornado. These should cause the map to look dark and dingy, with sand blanketing all surfaces making visibility poor. Im going to rely on strong ambient lighting, given that the direct sunlight wont penetrate the dust storms. I'll also keep all the colors in a similar family of dusty colors. Step 2 - Pick your Sky Texture When I think of dusty maps with poor visibility, I think of Stirke at Karkand - which is like that to help hide the fact you cant render a billion city buildings and keep a good framerate going. So lets set the sky texture to Karkand_Cloudy. The color of this sky will also guide me in setting the rest of the colors going forward as everything else (including the dust storm effects) can be tinted in the Editor. Step 3 - Set your Fog Color Fog, as mentioned, can not only help set the mood of the map - it has the practical benefit of allowing you to reduce your view distance which helps framerates. But, in order for it to look realistic then by definition it means that your far away mountains needs to disappear into the sky. Some of you may already know this trick, but let me present it here for those that dont. Take a screenshot of your map once you have picked a sky texture but make sure the fog is turned off. Paste it into photoshop and use the Eyedropper Tool to pick a color from the sky near the horizon. Note the RGB value of this sky as it appears in the Editor. Go back to your Fog Color property, click on the colored box to open the pop-up and then enter these same values there. Your hills should disappear. Its unlikely that color you snagged is uniform all the way around your horizon, so you may need to keep looking around and dialing in a better color that suits well as seen from the busiest part of your map. Note in this pic how those grey hills in the distance have disappeared. Step 4 - Set your Terrain Colors OK - Key point... TerrainSkyColors are tied to the ambient lightmaps which are applied (almost) globally. TerrainSunColors are tied to the directional lightmaps which only affect the faces pointing towards the sun. They are both applied to your terrain at the same time. Therefore - always start by coloring your shadowed areas first as this will also affect the sunny parts as well. Afterwards, go and color the sunny parts which only affect that particular part of the terrain. By now you should understand (finally) WTF I was talking about when I said a) you can use the colors to make your lightmaps pop [use a dark xxxSkyColor and a bright xxxSunColor], and strong lightmap shadows give you more to work with [you can lighten them back up with a brigther xxxSkyColor]. So, Im going to steer the shadows/TerrainSkyColor to a darker tan but not that terribly dark as I dont want the terrain shadows to be too strong with the lack of a clear sun. Then Im going to go for a darker TerrainSunColor which will also soften up the shadows more and darken up the terrain considerably. Step 5 - Set your Static Colors Same thing applies to the static colors here - Im going to start by looking at the shadows behind the primary buildings and tint those to a nice dusty color. Then, I'll go back and work on the sunny side of the buildings once the base tint has been applied. Same as Step 4. Here's another handy tip. When you go to the color square, you should see a slider bar off to the right side. In the case where youd like to tone down all the individual colors of the statics and make them more uniform, such as the case here, then that slider can be used to adjust brightness. If you pick a color and make it really dark, then jack that slider up the effect will be not too much unlike the Colorize feature when you adjust Hue in Photoshop. It will effectively look like youre making the surface glow somewhat, but really its just another way to dial in some other RGB value and the slider will return to 1 if you come back to it later. Step 6 - Set your Effect Colors, Tree Colors, etc These sandstorms are already pretty close to the sky colors I started out with so I'll just tweak em slightly to pick up a bit more of the orange. There's no trees on this map, but going back to the second pic in this tut it should be clear how to make those palm trees look like theyre lit by that massive full moon. Anyways, here's the final result from another perspective: Last couple of tips before I wrap this up: * If you want to copy settings from another map, know that the color values are stored in decimal format from 0.000 to 1.000 - you need to multiply by 255 in order to convert them into their RGB values. * Bundledmeshes dont lightmap and therefore are often much brighter than their neighbor static objects.. you can tone these down with the property labelled simply SunColor. * I didnt have any point lightsources in this example, but you can tint these with the SinglePointColor. For example, if you have lots of torches on your map - you can tint their shadows with a yellow color. * Trees also have an TreeAmbientColor which can help separate out the trunks from the leaves. On Sharqi Peninsula, the palm leaves look dried out and dead by having a brackish colored sky texture and a yellowed sun texture. But you can have brilliant healthy jungle palms too by saturating the values with greens. * Water colors are out of scope for this tutorial, but word to the wise - dont even try to set these by hand. Go copy a suitable DICE water.con and tweak from there. Trick is with this and every other part of the editor -> experiment with options and see what things do! If you cant find a tutorial explaining something you've learned - write one yourself. Happy modding! 1/2 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.