Jump to content
Official BF Editor Forums

Advanced Lightmapping Tutorial (using 3dsmax)


Recommended Posts

I've been fielding a lot of questions about lightmapping static objects using Max lately, so I thought I'd take the time to do a deeper dive into the topic for you guys. Note that there is already an excellent tutorial by D-Ran located here: http://bfeditor.org/forums/index.php?showt...amp;#entry52738 from which I got my start. I to this day still struggle to find all the juicy bits in that one though so hopefully this will be a bit easier to follow. Plus, Ive learned a lot of other techniques not discussed in that thread so hopefully you will get something from my tutorial add-on. But again, many thanks to D-Ran for leading the effort in figuring this end of BF2 out for us.


Anybody that has attempted to lightmap a level from the BF2 Editor knows that it can be a slow and painful process, often yielding mixed results. It relies on in-depth knowledge of how to properly setup your lighting, including the GILights which are used to simulate ambient lighting. Even with proper settings, it can be frustrating to light the interiors of buildings properly given that using point light sources can cause editor crashes, create artifacts on building exteriors and they significantly increase rendering times. All of this also relies on having all of the lightmap samples from the dev team of a given mod you'd like to make a map for, and/or having the lightmap samples from the DICE team which is a 700mb download itself.

There is a way to create much better lightmaps in BF2 for your map - even if you don't have the static objects' lightmaps on your machine. Using 3DSMax, you can render a level faster, more accurately and with much more professional looking results - and this is what I will show you in this dev journal today. To prove how effective this methodology is, DICE themselves used Max to create lightmaps on their levels (such as the interiors of Kubra Dam) and did not use their own editor. I will lightmap Dead Calm in this journal because it is one of the few levels in R1 that has not had its lightmaps created yet. If you have played our mod, you can compare the before to the after in the pending 1.2 release.


In order to do lightmaps in Max, you will need to install the standard BF2 tools for Max which can be found at the editor website here. (I recommend using the PoE tools found in the stickies). Once in a new Max window, Choose Units Setup... from the Customize menu. Set to Generic Units, with a System Unit Scale of 1 Unit = 1 Inches found after clicking the System Unit Setup button.

From the new BF2 menu (once your tools are configured and setup properly), choose BF2 Lightmapping and you should see a window like this one below. Create two folders somewhere easy to find - one for your temporary work files and the other for the finished output files. I chose to make them on my Desktop keeping the names simple. Link to these two folders using the two paths at the top of the utility. You are now ready to start loading in components of your map.


Loading in your Terrain

This step isn't necessarily required, but if you have steeper terrain that can cast shadows onto your static objects - you will want to load your terrain into max in order for that to have an effect. In Dead Calm, there isn't much terrain to speak of, but I always load my terrain regardless because it helps me orient myself when zooming around and is helpful for aligning point lights etc later down the road.

One thing to note here, the terrain mesh is very dense and can lag out lower end computers. The smallest 256x2 sized map is already 131k polys and each map size you go up is 4x the previous size. Having terrain in your scene will cause Max to run very slowly, especially if you have a lot of other statics in there. One thing you can do to make it run better is to increase the memory allocated to the application. Warning - setting this too high can crash Max, requiring a reinstall so only do exactly what I say here. In the lower left corner is a small white box. Enter heapsize*=2 and hit enter.

Right, so to load your terrain, click on Load Land in the Lightmapping Utility - navigate to your map's root folder and select the Heightdata.con file. Click Open and it will come into the scene. By default it will be called Object01 - which will later be harder to find in a long list of statics... so I rename mine to "_Terrain" to keep it at the top of the list. I also change the color of the mesh to make the statics easier to see on it. (By default, they are white). Here's the simple terrain for Dead Calm.


Loading in your Static Objects

The next step is to click on Load StaticObjects.con, choose the StaticObjects.con file from your map's root folder and Open that. It will crunch away for a minute and eventually bring up all your other geometry. Note that you have to have your mod's (or BF2's) objects archives extracted in order for Max to be able to read the files. [To do this, create an /Objects folder in the mod root, copy the objects_client.zip and objects_server.zip into that folder, extract them and delete. Important: By extracting copies of the archives, you ensure you dont somehow screw up the MD5 checksums that detect whether or not you might be trying to hack the game].

Looking at the list of stuff in the scene, you will find a lot of garbage here. There will be envmaps, root geom and lod dummies and other stuff. What we're really after is the LOD meshes that end in "=0", "=1" etc ... that number representing the LOD in question. [An LOD is a mesh that is optimized for a specific viewing distance. The higher the number, the further away you are from that model and therefore the less detailed it has to be. You will want to lightmap all the LODs or the objects far away will be really bright and suddenly pop into view having shadows when you get closer otherwise].


Selecting the LODs

Lets clean up our list by using a feature of the utility which hides all the extra bits for you once you start the rendering process. First, click on the Save/Update File button and save the text file it creates to your Desktop (for example). Now choose a default lightmap size - which will be the most commonly used lightmap sample size for most objects in your scene. Dead Calm has these two massive ships on it and Im concerned about lag so I will choose something small like 64. Click the Apply Lightmap Settings button to save your changes so far.

Now go look at that text file that got saved. Every static object in your scene should be in here followed by certain numbers. These numbers represent the size of the texture your lightmap will sit on after rendering ... one for each LOD. As these are saved in DXT1 (no alpha) DDS format, note that the texture sizes have to be powers of 2 (128, 256, 512 etc). The larger the texture, the more detailed the resolution of the shadows. Its up to you to optimize the visual quality versus the impact to performance here like in many places when modding. I will choose to make the palm trees a bit bigger, the large 10m rock a bit bigger still and choose to have the best resolution on the deck of the ships where the players will spend most of their time. There are two LODs (0 and 1), so I set these to 2048 and 1024 respectively. Save your text file when you are done.

Cool - lets clean up this joint. Pick any LOD mesh from your list inside Max (an object ending in =0 for example), click the Render Selected Objects and then hit Escape. You will see that everything thats not a mesh is now hidden from view. That is except maybe your terrain. Right click, choose Unhide by Name and go get your _Terrain back in view. Note that you may see some objects that are named "0". These are your bundled meshes which don't get lightmaps because they are typically dynamic objects. Its up to you whether or not to hide those ... depends if you want them to cast shadows or not. In this specific case, my two bundled meshes are the ships' sails. Because they don't move, I would like them to cast shadows on the decks below and will therefore keep them visible for now.


Link to comment
Share on other sites

  • Replies 181
  • Created
  • Last Reply

Top Posters In This Topic

Loading in your Sun

How about we get to lighting this sumnabitch? First lets load up your map's Sun. Now, Im assuming you've already set your sun in an appropriate direction before starting any of this. If you dont know how to do that - here's the skinny. First, take a look at your sky texture from the BF2 Editor on your map. It should have a sun somewhere on it or at least a spot behind clouds that is brighter than the rest. Play with the sky rotation in the Tweaker until its somewhere you think looks cool. Now fly your camera down to the ground level somewhere in the middle of your map. Orient yourself so that the sun or bright spot is directly in the center of your monitor. Go to the lighting menus and click both Set Sun Direction to Camera and Set Sunflare Direction to Camera. Now the lighting will match the sky texture and look more natural once there's shadows all over the place. Save your map and quit the Editor.

Back in Max, choose Load Sun from the lightmapping utility - pick your map's sky.con from the list and Open it. Max will create a Target Directional Light out in space along the same ray you were looking just a minute ago in the Editor. Note that it should have a Target located underneath your terrain. If any of this doesnt look like my pic below, you might have accidently set the sun direction From the camera so go back and fix this, save and redo this step until its right.

Lets setup the lighting levels now. On the menu to the right, make sure the light is On, turn On the Shadows and choose a raytrace option from the dropdown below it. Some devs like the raytraced shadows but I swear by the Adv Ray Traced option which for me will raytrace any object (even these monster galleons) in less than a minute with just about as good a quality as the beefier options. We still dont know how bright or dark to make the shadows yet, so while tweaking at least use this option as you'll likely have to lightmap something a few times to get it right.

In the Intensity area and the Shadow Parameters area, choose Multipliers between 0 and 1.0 appropriate for your level. Dead Calm is on a nice sunny day so I want a nice bright sun with strong shadows so I'll take a guess at 0.9 and 0.7 respectively. Already you should see some basic lighting on the faces if you look closely. You may wish to set your view window to Smooth+Highlights by clicking the word in the top left corner (ie: Perspective) in order to see the effects so far. F4 is handy for toggling the mesh edges.

I'll zoom in to the boat's interior a bit so you can see whats going on. Here I have pretty bright faces where the sun can see, but notice that the faces away from the sun are black. If you get this doing lightmaps the standard way, its because you havent setup your GILights to provide ambient lighting, which we'll do next.


Creating Ambient Lighting

Now we need to create some ambient lighting to brighten up the surfaces the sun cant see directly. Again this map is pretty sunny so you should expect lots of light reflection off the water and other surfaces to see your texture... otherwise they will be pitch black. Select your BF2_SunLight object and Clone it using the "copy" option. This wil allow us to tweak the cloned light separately from the direct sunlight.

Choose the cloned light and open the Advanced Effects area in order to turn this guy into an "Ambient Only" light. Doing so will make the light fall evenly on all faces. Now turn down the Multiplier... This part takes a bit of practice to get right. The more you do this, the better feeling you will have for these values. I'll start with 0.5 and tune from there. Remember that cranking this value up makes the entire static brighter. Increasing the sunlight one only makes the side of the model towards the sun brighter.


Creating Point Lighting

This is also an optional step depending upon whether or not you have torches, lanterns, streetlights, runway lights or anything else on the map that casts its own lighting. Ive got four lanterns handing in the gun deck which Id like to help brighten the area beneath the sails that block the sun. [Note that you can only have a half dozen Omni lights lit during any one pass, so you may need to lightmap in sections if you have a lot of these].

From the Create tab, Im going to click on Lights and choose Omni and drop one on my map. These have to be moved x, y and z to the position where the light is supposedly coming from manually. This can take a minute, but using the Top and Right views for fine adjustments can help quite a bit here. Once I have it situated inside my lantern, Im going to turn Off my other lights in order to see the full effect. Im going to have this guy cast its own shadows, be nice and bright but have an Inverse Square fall-off so that it only goes so far in my model. Mine stays nice and bright and starts fading after 2ft - the boundary of which is shown as green rings around the light. There - that looks bad ass. Now I just need to clone the Omni to my four other places - except this time I will choose Instance so that any change to being on or off, or brighter etc affects all four lights at the same time.


Create test Rendering Passes

Remember that all this fancy pants ray tracing is basically going to create yet another texture on the model that sets its brightness. There is no light calculations going on while you're playing here - its all faked out so the engine can focus on other things - like having 2km to drive around on. So its kinda up to you to work between Max and the Editor to get these values where they make sense.

Lets go back and take a closer look at the Utility. See the drop down top right under Light Pass? Its got three options: point, sky and sun. Make sure that when you do the point light pass, only the Omni lights are turned on. For the sky pass, only the ambient light is on and for the sun pass, just the sun light is turned on. For the test, you may wish to only do the primary mesh and not wait for all the LODs to lightmap too. You can control this by setting the Specific LOD dropdown to 0. When we're ready for the whole thing, set this back to All.

Cool ... did I lose you yet? Hopefully not. Lets pick one of our LOD meshes (a bigger one with a =0 in its name) and then choose Render Selected Objects. After a few seconds of thumb twiddling, you should have a new .tga image in the /Temp folder you setup initially that says something like tallship01_bottom=00=11=34=-5~point.tga. The 00 tells you what LOD this goes on. The next three numbers are the coordinates on the map given that you may have several copies of that object scattered about. The ~point suffix tells you that this is the pass for the omni lights, in my case the lanterns. Feel free to take a peek at the texture so see whats going on. The larger the # you put in that text file, the bigger this file will be in Photoshop. Go do the passes for sun and sky now remembering to turn on and off the lights appropriate for each pass.


Convert to DDS Format

Now we need to get these three images packed into a single .dds that the Editor will be able to use. For this there is a .bat file in your max BF2 tools which most people havent setup properly in order to use the Convert function on the utility. You have to edit this bat to point to the folders you setup in the beginning or it obviously wont work. If you cant find this bat or dont know whats going on with it, here's how mine is setup. You can simply make your own from scratch and drop it in your temp folder.

@echo off
"F:/Program Files/Autodesk/3dsMax8/scripts/bf2/bin/release/mergeTgaColors.exe" "C:/Documents and Settings/1l2Hawk/Desktop/temp/" "C:/Documents and Settings/1l2Hawk/Desktop/temp/merged/"
echo .
echo .
"F:\Program Files\Autodesk\3dsMax8\scripts\bf2\bin\extern\nvdxt.exe" -file "C:\Documents and Settings\1l2Hawk\Desktop\temp\merged\*.tga" -dxt1a -outdir "C:\Documents and Settings\1l2Hawk\Desktop\output"

Point the first parts to your Max directory and the second to a merged directory and output directory wherever these may exist. Note that my merged folder is inside my temp to help keep the .tga and .dds files separated nicely. Run this bat and you should have lightmaps just like the Editor would make should you have gone that route.

To see them in the Editor, you need to place them in your map's \Lightmaps\Objects folder. In my case this is: mods\bfp2\levels\dead_calm\Lightmaps\Objects Check it out in the Editor. [Note - If youve ever packed a lightmap atlas previously, you may not be able to see them... if so, just delete the atlas files in the same directory].


WOW! Boy does that make the color pop or what. Also makes the most of the polys I have in the ship's details by basically recreating the outlines of various pieces in the shadows on the floor.

OK - at this point Im going to go back and refine my lighting values a little bit, retest on a few objects and then prepare to do my final lightmapping run. I also see here that some of my shadows are really blocky looking, so for those objects I'll choose to increase the lightmap size in that text file which controls that.


Sun pass - Only the primary directional lighting is enabled

Sky pass - Only the cloned light (ambient on) is enabled

Point pass - Only the Omni lights enabled

For each pass I turned on/off lights per above, changed the dropdown in the utility to match and let it rip. For the sun pass on the tallship pieces, I really want to make the lightmaps as good quality as possible so I will choose Raytraced Shadows on the sun light and Render Selected Objects for these pieces separately. The dimensions of the lightmap remain the same (and therefore the filesize) no matter which raytrace method you pick - its just how long you want to sit and watch it. So Im going to take a nap and check it out later.

Link to comment
Share on other sites

Touching up the Lightmaps

Once converted to .DDS using the batch file discussed earlier, the lightmaps are now set for use in-game. However, there's a few tricks you can do if you get a number of artifacts along edges (black splotches), totally farqed lightmaps (bad uvw 9:map) or general fuzzyness (low resolution lightmaps). These steps are also optional, but I'll include them if youre curious how to solve these issues.

First lets discuss what to do if you run a lightmap and it doesnt look anything like what you expect. Maybe a big giant shape in it or all a solid black color. There are several reasons this can happen. If you are using an MSO texture, then your uvws for each material are basically lying on top of each other in the same map channel. Even though the game can sort out which uvws go to which color or detail texture - you're only going to call one lightmap texture for the entire object so these need to be separated out. Similarly, if your unwrap tiles or is scale way bigger than the texture youre only going to see part of it.

Fix: Open the model in Max. Select all faces on the object. Add an UnwrapUVW modifier and change the map channel to 9. Click Yes when it asks you to verify. Click Edit... to get into the unwrap window. Again select all faces, go to Mapping -> Flatten Mapping. Set the spacing to 0.05, then check Normalize, Rotate Clusters and Fill Holes. Let her rip and you should get everything laid out on a single texture boundary. Collapse the modifier stack and re-export.

It seems like the lightmapping utility follows the highest map channel in your model. If you have a dirt layer, it will render to the 3:map uvw for example. Having extra channels is often a source of problems elsewhere - but so far I havent had any issues exporting with a 9:map on the object as long as the other textures are done properly. Note that this 9:map only serves to lay out your lightmaps so keeping things perfectly proportional isnt necessary for maintaining a skin's pixel density evenly across all faces. In other words, most of my ship's parts are tiny loose faces that are consuming 80% of my usuable lightmap texture - which sucks. I really want to see sharp outlines on the ship decks and the masts and other key parts. Otherwise, they get crowded out on the lightmap by the little bits and the lightmap there looks fuzzy.

Fix: Reapply the UnwrapUVW modifier and again set the map channel to 9. Go pull off any major pieces that you would like to show better lightmaps on and set them off to the side in the Edit UVWs workspace. Use the scale tool and blow them up in size 2-3x. Select all faces, go to Tools -> Pack UVWs. Use the same options as above (tight spacing, normalized, etc) and hit OK. Now these faces will be substantially larger in comparison to the crowd of other polys. Dont overdo it too much though because you may only get a single pixel or two covering some faces in the crowd there.

Lets look back at my ship's lightmaps more closely. In the bottom left, can you tell where Ive blown up the masts and the metal rings on the Tallship Top so they are bigger than all the ropes and pulleys? The decks and sides of the Bottom also take up about 50% of the lightmap too.


OK, last thing in this section and we'll move on. Using the Tallship Bottom lightmap above, lemme discuss how BF2 stores the information and whats up with the funky colors. If youve ever looked at a terrain or static lightmap its all rainbow colors. The reason is youre looking at the net effect of several color channels working together. In Photoshop, take a peek at your channels and you'll notice each red, green and blue channel has its own greyscale lightmap in it. The red is for the point lights, green is for the sun and blue has the ambient lighting in it.

You can manipulate these as you like in photoshop... just be sure to resave as DXT1 (No alpha). For example, say you stick a lantern in a bunker and its light bleeds thru to the external walls. If you can figure out where these walls are on the lightmap - simply paint them black on the red channel. The blue channel is the ambient lighting but this can contain quite a bit of noise in it. I take the dropper tool, pick the grey color, clear the channel and do a clean fill with the solid grey. Not only does this take away the noise, it also gets rid of any staircasing where you have an angled edge cutting up thru both black and grey pixels. This is more severe on the green channel - particularly for the smaller polys. You may see a lot of black edges or streaks on your object because of this effect. What I do is dropper the darkest color grey on the green channel, and then paint bucket the black with contiguous off and a fairly high tolerance. The edges will be darker, but not jet black anyway.

Making Lightmap Atlases

Nearly there folks! Lets see how they look in the Editor after a bit of touching up on the key statics. The lightmaps go in your map's Lightmaps/Objects directory - now load your level. Here's a look at Dead Calm:



OK, hate to brag ... but thats hot as hell. The shadows from the ropes are much better now that Ive scaled up the decks on the 9:map. The ropes themselves were out in the low poly tiny area and dont have a lot of detail. However, the backs are dark and the tops are light so still effective. No black streaks anymore because Ive manipulated the green and blue channels so the entire lightmap is a nice blue color. Think she's ready for packaging.

Lets make our lightmap atlases now. Atlases are big texture sheets with several images or lightmaps stored on them. The game will only need to open and read a couple atlas files instead of opening 200+ individual lightmaps which can be better for performance. You can also sometimes cut down on the overall size of your map's files by not packing the original lightmaps. The game references which object is where by the LightmapAtlas.tai file - which can be opened with Notepad. In there, it lists each object, which lightmap the information is on and then several decimal values. The values range between 0 and 1, and represent the % distance to the top left and bottom right corner of each lightmap from the top left of the atlas. This is a good thing, because you can go back and scale down the entire atlas without mucking things up should you need to improve performance.

Right - so in the Editor go to Compile -> Lightmaps -> Generate Atlas Lightmaps... Choose a size, make sure its DXT1 and hit Generate. Takes maybe two seconds and they'll appear in the same folder as the lightmaps. The atlasses go in the map's Client.zip, the tai file goes in the Server.zip. The other lightmaps dont need to be packed at all but I'd keep them handy somewhere in case you need to go back and add other statics in down the road. Otherwise, you'd need to hand edit the atlas files or re-run your entire set of lightmaps again.


I hope you've enjoyed this tutorial!


Link to comment
Share on other sites

Ok, that's weird. I understood this. This is a big problem. I think you may want to rewrite this so it leaves hundreds of questions unanswered.

Very sweet tute. In fact, I'm a gonna go ahead and give this one a shot.

...And that does look pretty damn sweet with the boat lightmapped.

Link to comment
Share on other sites

OMG 1/2Hawk!! Spot on tut, Explains things a little easier and lots more, that had been screwing with my mind, and you have just put straight :D

Take note junk ;) ... ill give ya a hand...

Fix: Open the model in Max. Select all faces on the object. Add an UnwrapUVW modifier and change the map channel to 9. Click Yes when it asks you to verify. Click Edit... to get into the unwrap window. Again select all faces, go to Mapping -> Flatten Mapping. Set the spacing to 0.05, then check Normalize, Rotate Clusters and Fill Holes. Let her rip and you should get everything laid out on a single texture boundary. Collapse the modifier stack and re-export.

It seems like the lightmapping utility follows the highest map channel in your model. If you have a dirt layer, it will render to the 3:map uvw for example. Having extra channels is often a source of problems elsewhere - but so far I havent had any issues exporting with a 9:map on the object as long as the other textures are done properly. Note that this 9:map only serves to lay out your lightmaps so keeping things perfectly proportional isnt necessary for maintaining a skin's pixel density evenly across all faces. In other words, most of my ship's parts are tiny loose faces that are consuming 80% of my usuable lightmap texture - which sucks. I really want to see sharp outlines on the ship decks and the masts and other key parts. Otherwise, they get crowded out on the lightmap by the little bits and the lightmap there looks fuzzy.

P.S must of took fecking ages to write that out.

Link to comment
Share on other sites

So we'll be alright without samples then? Here's my deal, and why Bensta is takin jabs: My samples are funky funky. Nothing fixes them. I've gone through and tried every UVmapping combination that I can think of. I've flattened the mapping in ALL channels and left out channel 9. I've left all channels and put a flattened map in channel 9. I've left out every single channel but a flattened map in channel 1. I've tried a flattened map in channel 1 and a flattened map in channel 9. I've tried everything and my samples always come out all jumbled on top of each other, as if it's using my original channel 1, which is stretched way beyond the tile. I have literally tried every combo in-between and can confirm with almost 100% certainty that I'm not looking at problems with the map channels and uv's, rather I've got something funked in the mesh itself. Or the max file is corrupt in an odd way.

Then there's the fact that the object I'm trying to get samples from is physically huge. Almost 1/4 the size of a small map. This is what I personally feel is going on and my next test was to try and shrink the object and try it again. Samples shouldn't be all that badly affected.

But here's the deal, I fucking HATE samples. I'm so goddamn sick of seeing them being corrupted over this past year and a half that I am now in the practice of completely skipping those heartless, soul-stealing sons of bitchasses. But if we Lightmap in max, we're good right? I'm happy? That can't be right.

Link to comment
Share on other sites

Very nice tut. mine had alot of updates on different pages, but I never got around to updateing the main page with all the updates. This is very comprehensive and all in one..... save one thing. If you look at the last post I made, it also includes instructions on how to also lightmap your terrain in max so you can have nice shadows and torch lightsources on your terrain as well for those nightmaps that could allways use abit more. Still, nice one. cheers.


Also, junk. You do NOT need samples files to lightmap this way. Samples files are used to tell the editor where the lightmap coordonates are in the editor as well as the sizes that they use. But the lightmap layouts are coded into the models themselves and are read by max. Lightmap sizes in this are determined by the lightmap size file as described in the "selecting the LODs" part of this tut. This means that you do not need to down load that huge lightmap samples file from ea to lightmap in here. As for your lightmap samples problems, hit me up on msn and I'll see if I can help you work this all out. You can contact me through my msn hotmail name in my profile. I'm not on often, but I'll try to get on tonight around 10pm cst.

Edited by D-Ran*sdp*
Link to comment
Share on other sites

Here's the steps you missed if you are seeing undefined:

First, click on the Save/Update File button and save the text file it creates to your Desktop (for example).

Now choose a default lightmap size - which will be the most commonly used lightmap sample size for most objects in your scene.

Click the Apply Lightmap Settings button to save your changes so far.

But no worries - you can enter in the values by hand. Just make sure they are powers of 2 in size.

If you dont see a =0 behind your object, then it is not a valid static object (maybe its a bundledmesh or skinnedmesh). If youre certain its a static, then check your hierarchy because this is auto-generated off of your geom0 and lod0 dummy helpers. Also be sure that your object_client and object_server archives are unpacked in your /objects directory.

Link to comment
Share on other sites

oh i'm stupid. missed to unpack the server files.

dont have the time to experiment with it for my current project cause i have to ship it in time to my mod mates.

would be nice if theres a possibility to just press the generate lightmaps button without hiding all the stuff and converting it with the .bat.

by the way. it works also very good with finalrender renderer. it launches the render to texture plugin. im sure i could set AA and GI for the lightmaps baking. its so fast with finalrender.

Link to comment
Share on other sites

Something is really bugging me... haven't tryed lightmapping in max since i got my new comp few months ago (which has vista) now everytime i try to lightmap a map, it seams to go well, samples are created fine.. i look at them in ps too, and they look fine, shadows in right place ect... then i place the samples into the map folder to load up in the editor to look... and nothing... no shadows on objects... tryed everything i can think of, tested many times on single statics, many light settings in max, sample created fine, converted fine, samples look good in ps... just dont fecking show in editor... im lost, I have lightmapped a few times in max before on old comp with no probs... now either im doing something totally stupid, or its something with vista, or its something else.. So is anyone else having problems like this with vista, or got any other ideas?

Edited by Bensta-IDF
Link to comment
Share on other sites

So ... if I were to go down a checklist of things to doublecheck, itd include a couple things. One, are you putting them in the correct spot? The static lightmaps go in the lightmaps/objects subdirectory. Two, are they the correct format? Should be DXT1 (no alpha) dds. Three, do you have a lightmap atlas tai file in your map already? Having that would ignore any new samples you may want to add once youve run the atlases already. Four, do you have all the latest drivers for your gfx card and DirectX etc? Other than that, hard to say really. I dont know of an editor setting that makes those go away. I often cant see my terrain lightmaps unless I quit out from the Editor, go take a nap and look at it some other day.

Link to comment
Share on other sites

1,Yes files are in right place, 2,yes files are dxt1, i opened with notepad to check, 3, yup i deleated all files in lightmaps/objects before i placed my files there, (and generated altases too), 4, yup i have very latest gfx drivers ... :(

Humm one thing i noticed, is it says...

Could not open [destroyed_warehouse=00=2598=975=1062.dds] for delete! Make sure it is not opened for edit!

Could not open [destroyed_warehouse=01=2598=975=1062.dds] for delete! Make sure it is not opened for edit!

ect, when i try to compile atlases, although it appears to create the atlas fine...

So i try to lightmap in the editor... and i get this error...

Ignored Warning[Ra] : Could not find valid technique for the shader: shaders/rashadersmhasnormalmapusehemimap.fx

:o Getting fed up with lightmaps... bring on crysis and its dynamic lightmaps.

Edited by Bensta-IDF
Link to comment
Share on other sites

the 3dsmax bf2 tools cant import destroyable objects, i had this problem some time ago. When it tries to import them, it starts, then quits it, leaving a cross or something there which gets in the way of the lightmaps, and you need to delete these to get some good lightmaps otherwise they block the light...

best way to do it is select all the destructible objects in the editor, and delete them, then save the staticobjects.con and ligthmap with that (with having the first one backed up before hand of course) then lightmap the destructible objects (if u want to) in bf2.

Link to comment
Share on other sites

now either im doing something totally stupid,

It was that one :P

Started over with new scene, and it works now, think i must of imported it in meters, then changed to inches after... thanks for the help anyways

Now just got to get these dam settings right, can't get good shadows, cant remember the settings ive used before, well though i could but not getting good shadows. but hey another 20 attemps and i might just get there... :huh:

Link to comment
Share on other sites

Make sure that the Shadows option is checked On and then under Shadow Parameters you have a pretty high value for both your lightsources. The other thing that threw me off for a long time which watered down my shadows a lot is that you have to turn Off your ambient light when rendering your Sun pass with the BF2Sunlight light. Then turn off the sunlight when rendering your Sky pass with the ambient light. Also make sure your ambient isnt cranked up too high (say, around 0.4 intensity).


Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

Do you mean your own custom overgrowth? If you look in the 4th picture at the start of the thread, you can see Ive got palm tree clusters, shrubs, deadlogs, etc on the map inside Max... they also show up in the list with lightmap sizes in that text box. Lightmapping overgrowth doesnt work so good because all the leaves overlap (ie: they get the same shadows no matter where they are on the tree) however its good to have them in there in case a tree shadow comes up onto a building for example.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Create New...