Jump to content
Official BF Editor Forums

Lightmap Settings


Outlawz

Recommended Posts

Trace Terrain- renders terrain lightmaps.

Trace Objects- renders objects lightmaps.

Trace selected- renders only lightmaps on the objects you have selected.

Only Nearest- this will only render the terrain square nearest the camera at the time of lightmapping.

Primary- renders all primary terrain.

Secondary- Renders all surrounding terrain.

Low, Medium and High- render low, medium or high resolution lightmaps.

Resume Previous- resume from where you last stopped lightmapps (dont think ive ever seen this work)

Ignore Asserts- Ignore any errors during lightmapping...?

Texture Size- object lightmap atlas size.

DXT Format- DXT format of object lightmap atlas.

So for final lightmapping... Make sure first you have object lightmap sample zip files inside your battlefield2/editor folder (If lightmapping vanilla bf2 objects, if for a mod get samples from mod, but if for sf, af or 2142, your screwed for object lightmaps as there are no samples, only way is to lightmap in max) Then alter the terrain and object lightmap settings, do this by opening objectlight.con and terrainlight.con from your_level/editor folder with notepad, im sure these settings have been explained before somewhere, and its a topic in its self for those settings, but below i have gave a good example of a daylight map.

Then you want to select ... trace terrain, trace objects, trace primary, trace secondary (only if you have surrounding terrain ofcourse) and final buttons pressed, lightmap atlas size can be left as it is. go sleep for a few days and see what happened :) But remember always test out on one object first!!! Nothing worse than lightmapping for hours/days for messed up lightmaps.. Also lightmaps are nothing without good light settings... check out 1/2Hawks light tutorial in the bf2 tuts section.

Objectlight.con

rem ******** Lightmap Generation Settings ********

if v_arg1 == BF2Editor

LightMapGeneration.init

LightMapGeneration.GILightsBaseDir 0/0.33/-0.66

LightMapGeneration.GILightsIntensity 0.33

LightMapGeneration.GILightsShadowIntensity 1

LightMapGeneration.GILightsFov 45

LightMapGeneration.UseGITopLight 1

LightMapGeneration.GITopLightIntensity 0.1

LightMapGeneration.GILightsViewDistance 10

LightMapGeneration.skyWhite 0.3

LightMapGeneration.numberOfGILights 8

LightMapGeneration.sunLightShadowIntensity 1

LightMapGeneration.sunLightFov 2

LightMapGeneration.sunLightIntensity 1

endIf

Terrainlight.con

rem ******** Lightmap Generation Settings ********

if v_arg1 == BF2Editor

LightMapGeneration.init

LightMapGeneration.GILightsBaseDir 0/0.33/-0.66

LightMapGeneration.GILightsIntensity 0.33

LightMapGeneration.GILightsShadowIntensity 1

LightMapGeneration.GILightsFov 45

LightMapGeneration.UseGITopLight 1

LightMapGeneration.GITopLightIntensity 0.1

LightMapGeneration.GILightsViewDistance 10

LightMapGeneration.skyWhite 0.3

LightMapGeneration.numberOfGILights 8

LightMapGeneration.sunLightShadowIntensity 1

LightMapGeneration.sunLightFov 2

LightMapGeneration.sunLightIntensity 1

endIf

Link to comment
Share on other sites

Resume Previous- resume from where you last stopped lightmapps (dont think ive ever seen this work)

it works for me just fine. the trick is, you cannot edit ANYTHING since the last time you gened lightmaps, and it only works with objects. you will also have to regen the lightmap for the object/s you stopped lightmapping on. otherwise it will end up with partially finished lightmaps, and will be at least partially black.

Edited by imtheheadhunter
Link to comment
Share on other sites

There's one setting which isn't in the terrainlights.con or the objectlights.con and this is called 'GIFillIntensity' . A value of 0 renders the interior of houses pitch black (and you can't see a thing :P ) while higher values give more ambient light inside houses.

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

Hrmm... I would expect to see exactly opposite happening on this building. Your string of GILights around your map are really weak (33%) true but your ambient lighting is way in overdrive. A fill intensity of 10 is actually 1000% brightness and I dont think the editor will even accept above 1.0 without crapping its drawers - but anyway, I'd expect either way this building to be washed the f*ck out with no shadows hardly at all or not even a valid lightmap. That, or your trying to overcompensate with your colorlighting - have you changed any of that trying to get a shadow to show up? The less contrast you get on them lightmaps, the less room you have to play with by messing around with the colors. So when you see values like shadow strength 1 (100%) or sun strength 1 (100%) you should be thinking really? Is this map in the Gobi desert? No man, you got a green cloudy sky you need to synch up with your buildings, experiment with your own values. Day... what does DICE know about the settings for Day ... whose day? Your maps day. Thats who - and they werent thinking of that day when they set things to 0s and 1s. Thats the joy of modding right? Put your own values in there. Anyways, you asked about the lightmapping interface when you go to run those lightsmaps right? Make sure things are setup right before you even get to clicking those buttons. Then learn to fine tune once the lightmaps are made to get to whatever look you want. It will save you a lot of heartache honestly.

Link to comment
Share on other sites

  • 1 month later...

Ohh Boy....

I took an old map that was just horrible and washed out... had to take a break from bug chasing on the server and reading debugger logs ;). I like the map as it is fun to play so I thought I'd give a try at redoing it so it would look better.

After redoing it the way I wanted and such, now came the time to really spritz it up.

First I redid all the detail and low detail maps, looked great in the editor.

Now I came to the light mapping to redo that, I changed the direction of the sun and sun flare to a polar oppisite... but then I hit a stumper in the tuts.

Under the compile in the editor you will see:

Lightmaps>GenLightmaps (..... nuf said)

GenAtlasLightmaps (Should this be done BEFORE or ignore cause its already done)

CleanLightmapfolder (Does this remove useless crap or just delete our folder contents - looks dangerous!)

Envmaps>GenEnvmap (I'm afraid to ask since I haven't got past the lightmaps....)

CreateDefaultEnvmaps (Isn't this created when you start a new map?)

GenParticalAtlas (What's this? for effects, is this why some of my ambients don't work, like smoke from the smoke stacks (non triggered))

GenDecalAtlas (What's this? building details?)

GenOvergrowthAtlas (Isn't this created when you start a new or rebuild a map?)

MakegroundHemi (Scary! Have no idea)

This is where I get confused.... since I'm at the point of doing the lightmap (which I already did, recompiled the lightmap and nothing took) there must be some steps that are overlooked in the process.

Lets say I did a custom map from scratch....

Now I want to do my light mapping, then comes the next step - environment maps (haven't got there yet on env). Should I Gen an overgrowth and lightmap atlas first and so forth BEFORE doing the lightmap. In other words, what must be finished and in the editor before you generate the Lightmap, what is the correct order of work before you hit the magic 'GenLightmaps'.... and one thing more, should you have the Lightmap folder IN the editor folder or leave it in the root map folder during the compile. this was never clear, I tried both ways and never got the results I expected when it finished compiling. Undergrowth is black and shadows are still wrong direction, of course I haven't recompiled the map back into zips yet.... but I would expect to see at least the tree shadows in the right direction from the sun source, it's like nothing got compiled for the lightmaps.

Can someone clear this mystery up?

PS: I don't have 3dMax, so I'm working straight from the editor.

Last minute thought, where should the compile be done from, terrain or level editor.... or does it matter?

Edited by Al B. Bach
Link to comment
Share on other sites

Generating Atlas Lightmaps is useful only _after_ you created object lightmaps. The editor then put all the object lightmap files and creates Atlasses containing them, together with the lightmapatlas.tai file. Only the Atlasses are read by the game and it would explain the lack of object lightmaps if you never created the Atlas.

Generate default envmaps should be done once after you placed your envmap objects ( preferably placed above mirroring surfaces like water ) . Generate Envmaps afterwards. Note that the SinglePlayer Editor interferes with the envmap generation ( showing little numbers in the generated envmaps :blink: ) and it mustn't be loaded by the editor while envmaps are generated.

Particle- and Decalatlasses are mod-based and will iterate through all particle and decal textures to generate a new Atlasses, something not necessary when mapping.

Generate Overgrowth Atlas on the other side should be done as soon as your overgrowth is ready. The game will obtain overgrowth textures from this Atlas.

The groundhemi is responsible for reflections from the ground to vehicles and soldiers and should be generated when your ground textures are readily painted. Its more or less a kind of minimap , but without any statics in it. Look at an existing groundhemi.dds in a map to get the idea.

Link to comment
Share on other sites

Thanks that helps clear up many things for me.

Unfortunately, it seems you were responding while I had a last minute thought and edited my post.... so I'll ask again.

Where should the Lightmap compile be done from, terrain or level editor.... or does it matter? AND... more thoughts. I noticed that the light maps also generated an object and terrainlight.cons, where do those go? in objects folder of Lightmaps? What about the GroundProperties.con? Also, IF there is no water, should I worry about environment maps... if I understand correctly, doesn't environment handle reflections off static items as well, such as glass and scope lens?

Next as another last minute thought... when it comes time to compile the map in final finished form, should all the changes I have done be left in the editor folder?

The reason I ask is that I usually make a B/U of the map, then I take all the changes, such as the lights maps, strategic areas... whatever and put them in the root map folder accordingly. the I can run the map in an unzipped fashion and check to see if the changes took hold or if I just plain like them. Saves me a lot of headache IE: bi-pod static mounted MGs always give me fits mounting them. sometime they might just be a little off in placement, you can use them but you can't get off. grr. It use to take me forever to get them right till I stumbled on the trick of holding the control key and incrementing the object with the arrow keys. now if I could get it to work for the Y axis that be great, plus if you adjust your speed with the scroll it will effect the amount of movement by pixel relation.

It would be really nice if some one wrote a manual for the Editor... not tuts... be a definitive "this is what this button does" a users handbook. If there's one I never found it. That might be a good project for some guru out there... hint, hint!

Thanks again for your help mschoeldgen!

Link to comment
Share on other sites

It doesn't matter if you launch lightmap generation from terrain or leveleditor . Its exactly the same for both cases. The 'TerrainLight.con', 'ObjectLights.con' and 'GroundProperties.con' should just stay where they are - in the /editor folder of your map.

Envmaps are not only used for water surface reflections although that is the most obvious use for them. But they are also shown in reflections from other mirroring surfaces, like glass on buildings and on vehicles, depending on the used shader technique for that surface e.g. 'AlphaEnvMap' or 'EnvmapColormapGloss' , so generating them can't hurt, even if there's no water in your map.

A correctly packed map has no /editor folder as it won't be packed with the rest of the map. Like all vanilla maps, the game happily runs a map without it. Save it in a safe place ( i use an 'Inactive Levels' folder for that ) if you ever plan to edit the map further on.

Exactly placing objects can be done by double clicking the joint of the three arrows in 'Move' mode ( Level Editor ) . Here you can enter numerical values with high precision for position and rotation of the object.

Writing an editor manual is simply too much work. Most of us have a living and are busy working on a mod or a map ( or have a band to run , like me :P ) . And as there's no money in it the benefits are very, very small. Most of the guys asking question here cannot even read the forum posts concerning their own problem, so it would be in vain to write an Instruction manual for the editor.

Edited by mschoeldgen[Xww2]
Link to comment
Share on other sites

Save it in a safe place ( i use an 'Inactive Levels' folder for that ) if you ever plan to edit the map further on.

Exactly placing objects can be done by double clicking the joint of the three arrows in 'Move' mode ( Level Editor ) . Here you can enter numerical values with high precision for position and rotation of the object.

Writing an editor manual is simply too much work. Most of us have a living and are busy working on a mod or a map ( or have a band to run , like me ) . And as there's no money in it the benefits are very, very small. Most of the guys asking question here cannot even read the forum posts concerning their own problem, so it would be in vain to write an Instruction manual for the editor.

1) Yes I do that too! I keep a unzipped BU of my levels map just for that purpose. A very helpful and good tip for all.

2) OMG! If you only knew the pain I've endured for getting things dialed in.... see why we need a manual!

3) Awwwwww...... but I do understand, it really WOULD be a PIA and very time comsuming. Oh well, that's why I make notes. When you get old you forget stuff..... like where I left my notes!

Again THANK YOU! Maybe you'd be so kind as to help me on the enviroment pathing prob I have, it's a simple one. See the post in the thread here:

http://bfeditor.org/forums/index.php?s=&am...ost&p=79318

EDIT>>> Prob fixed, Enviro works from editor now.

Edited by Al B. Bach
Link to comment
Share on other sites

  • 1 year later...

If a serious error would occur during lightmapping, the 'Ignore Asserts' option would simply skip the error and continue with the next step ( mostly doing the next object lightmap). An 'Assert' is normally a modal dialog informing the user about an error and stopping the current task.

This option is useful if you'd like to e.g. generate lightmaps overnight and leaving your machine alone.

Errors will still be logged in 'lightmapgeneration.log'

Link to comment
Share on other sites

No. Fatal errors like memory allocation or other such problems can't be ignored as they leave the machine in an unstable state. After all yourself should have an interest in a non-crashing map when its done.

'Ignore Asserts' is meant for things like a missing sample file or a missing lod and such.

Link to comment
Share on other sites

  • 2 weeks later...

There should be a log file called 'lightmapgeneration.log' in your BF2.EXE folder. Have a look at the last few lines to check if its an object causing the trouble. But with 4k+ objects to render the editor might well be overloaded and give up. Afaik it can't use more than 2Gb RAM anyway. If you can't use the 3DSMax option you still could try to render the objects in parts ( e.g. 1000 objects per run ) and generate the atlas after all the runs are done.

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.

Guest
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.

Loading...
×
×
  • Create New...