Jump to content
Official BF Editor Forums

LightmapSettings explained


[dice]o2car

Recommended Posts

When developing BF2 we went for a simple yet powerful solution to simulate Global Illumination. Having real bouncing light was not even an option since the sizes of our worlds are just too big.

41425596_ee77562802.jpg

GILightsBaseDir = Directional angle of GILights (0/0.5/-0.5 is 45 degrees)

GILightsIntensity = Intensity of each GILight.

GILightsShadowIntensity = Controls shadows casted by GILights. (1)

GILightsFov = Spread (high value > softer shadows > slower rendering)

GILightsViewDistance = Distance between active object and lightsource (shorter > faster)

GIFillIntensity = simulated ambient

NumberOfGILights = Number of GILights to calculate (default=6 as seen on img)

UseGITopLight = A weak lightsource placed from above that work with the ring of GILights to achieve the lightdome effect.

GITopLightIntensity = Intensity of the GITopLight

SunLightShadowIntensity = Controls shadows casted by the SunLight.

SunLightFov = Spread (low value > sharper shadows > faster rendering)

SunLightIntensity = Intensity of the SunLight

Info:

- In TerrainMode only one GILight is necessary since the terrain does not feature overhangs. When setting the NumberOfGILights to 1 it will be treated as a TopLight.

- GIFillIntensity = Without it you wont be able to see textures in a room without windows (pitchblack)

- The GILightsShadowIntensity and SunLightShadowIntensity should be set to 1. Use the LightIntensity to tweak the lighting instead.

Sideinfo : The renderer calculates what lightsources that can be seen from the active pixel in the lightmap.

Good Luck.

Link to comment
Share on other sites

  • 5 months later...

Is this information still relevant to the current editor, if so, can someone explain what file needs to be changed. And what the recommended values are for each field.

When generating Terrain Lightmaps, the fields I see applied to each patch are:

PropertiesSunlight

Lightmap Generation

Intensity 0.7

ShadowIntensity 0.85

FOV 8

Softness 0

Self Shadowing 1

Object Shadows 1

I can't seem to locate where it is getting those values from. If I change the terrainlight.con from my map foldereditor it just skips over what I change.

Thanks in advance.

Link to comment
Share on other sites

  • 1 month later...

I've generated lightmaps: Terrain, Primary @ Medium + ignore asserts.

The statics look okay in the editor (shadows on self & other statics look okay), but don't see any shadows on the terrain from statics.

In-game (high settings) the statics self-shadows and other-static-shadows seem to show up at about 5m away... And no statics/terrain seem to be casting shadows.

I suspect that one of my lightmap settings is probably screwy (likely intensity of GI lights -vs- intensity of sun light {one may be washing out the other?}).

Does anyone have good ranges for these numbers (I'm assuming they are NOT map-size dependant, but if they are, I'm working on a 512x1 size map). Variables on the left are the LightmapSettings, comments [in the brackets are my notes/questions/speculations]:

GILightsIntensity =  [range: x(off) - y(full)]

GILightsShadowIntensity = [range: x(no shadows) - y(completely black)]

GILightsFov = [range?= x(sharp), y(light feathering), z(heavy feathering)]

GILightsViewDistance = [range?= (in meters?)]

GIFillIntensity = [what is this?  Intensity within the "feather" of FOV?]

NumberOfGILights = [range x=1 (defaults to GI_Toplight), y=6 (default, as in image), z=max]

UseGITopLight = [checkbox= on/off]

GITopLightIntensity = [range: x(off) - y(full)] 

SunLightShadowIntensity = [range: x(no shadows) - y(completely black)] 

SunLightFov = [range?= x(sharp), y(light feathering), z(heavy feathering)] 

SunLightIntensity = [range: x(no shadows) - y(grey shadows) - z(completely black shadows]

Thanks!

Link to comment
Share on other sites

(I'm assuming they are NOT map-size dependant, but if they are, I'm working on a 512x1 size map)

That sounds like trouble. The scale 1 might cause those problems. As you posted about skewed shadows, i suspect the scale to be a problem. Only Scale 2 is fully working in the editor.

Read it here: http://bfeditor.org/forums/index.php?showtopic=4571

Link to comment
Share on other sites

  • 2 months later...

Easiest way to find that out is either using the editor and play with the sky.con values or look at an existing night map.

Playing with the sky.con values is funnier, though. Tune down the colors (it's those RGB values , like 0.65/0.87/0.77). The effect can be watched immediatly in both editor and game. Later on, modifying the groundhemi and the envmaps could prove necessary.

Link to comment
Share on other sites

  • 4 months later...

Guys help me please...

Give me an example of settings that gives normal results. I tried to compile lightmaps and dont know what to do. On the medium settings of the game map looks fine. But on the high..... in the hangar i cant see something.... too dark. Very dark. Brickwalls frome one of the sides is almost black.

I tried to play with settings and also tried to copy sky.con from the Dragon valley for example. And set parameters like on Dragon valley. But result is one. Dark hangars and rooms, walls and objects in general.

screen047.jpg

screen046.jpg

And last question. My ground and sand after generating lightmaps takes a light blue tone. How i can fix it?

P.S. Sorry if somebody wrote about this problems. Give me link.

Edited by Solid Snake
Link to comment
Share on other sites

  • 1 month later...

GILightsBaseDir = Directional angle of GILights (0/0.5/-0.5 is 45 degrees)

GILightsIntensity = Intensity of each GILight.

GILightsShadowIntensity = Controls shadows casted by GILights. (1)

GILightsFov = Spread (high value > softer shadows > slower rendering)

GILightsViewDistance = Distance between active object and lightsource (shorter > faster)

GIFillIntensity = simulated ambient

NumberOfGILights = Number of GILights to calculate (default=6 as seen on img)

UseGITopLight = A weak lightsource placed from above that work with the ring of GILights to achieve the lightdome effect.

GITopLightIntensity = Intensity of the GITopLight

SunLightShadowIntensity = Controls shadows casted by the SunLight.

SunLightFov = Spread (low value > sharper shadows > faster rendering)

SunLightIntensity = Intensity of the SunLight

Link to comment
Share on other sites

  • 2 months later...

How does that help him? He wanted to know actual values as an example.

Solid Snake, what I did was open my TerrainLight.con in the Editor folder for my map and enter the similar settings into my Tweaker Bar for LightmapSettings. Gave me somewhere to start.

I hope this helps.

Link to comment
Share on other sites

:huh: I thought it was very helpfull, he would now know what all the settings do, and could now adjust them accordingly, There should be no real reason to post lightmap settings as an example as people dont make maps the same, every map needs different settings, the only real way to get them right is realizing what the settings do.

But your light settings for your map, (not lightmap settings) can alter the darknes/brightness, colour ect of the objects and terrain, so no matter what your lightmas turn out like, you can get the desired look by altering these.

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

Thanks for bumping the old posts :D

You should also copy the TerrainLight.con to the ObjectLight.con file. Shadows from buildings are determined by the 'ShadowIntensity' . Higher values yield darker shadows. FillIntensity is the amount of ambient light inside buildings without windows.

Link to comment
Share on other sites

  • 2 weeks later...
Thanks for bumping the old posts :D

You should also copy the TerrainLight.con to the ObjectLight.con file. Shadows from buildings are determined by the 'ShadowIntensity' . Higher values yield darker shadows. FillIntensity is the amount of ambient light inside buildings without windows.

Many thanks, as many ppl, I'm experiencing trouble tweaking my light settings

I got this message in the editor degbug console after having loaded a tweaked .con file :

Ignored Warning[Console] : Unknown object or method!: LightMapGeneration.GIFillIntensity 0.45  (levels/indochine/editor/objectlight.con)

As it is expressed as Intensity, I made the guess it should range from 0 to 1

These are the settings I tried to load

LightMapGeneration.init
LightMapGeneration.GILightsBaseDir 0/0.33/-0.66
LightMapGeneration.GILightsIntensity 0.7
LightMapGeneration.GILightsShadowIntensity 1
LightMapGeneration.GILightsFov 100
LightMapGeneration.UseGITopLight 1
LightMapGeneration.GITopLightIntensity 0.7
LightMapGeneration.GILightsViewDistance 20
LightMapGeneration.GIFillIntensity 0.45
LightMapGeneration.skyWhite 0.1
LightMapGeneration.numberOfGILights 6
LightMapGeneration.sunLightShadowIntensity 0.75
LightMapGeneration.sunLightFov 15
LightMapGeneration.sunLightIntensity 0.75

The problems are : some faces of my buildings show pitch black, and rooms are very dark too.

[EDIT] : Sorry for posting delayed...

Would it be like GIFillIntensity (in the editor) is saved as skyWhite (in the file) ?

Edited by Ganjanoof
Link to comment
Share on other sites

The GIFillIntensity is crap. Youd think it gives you better ambient lighting - but if it did then why have a ring GILights anyway. The reason you are getting some black faces is that you dont have enough GILights - change the number from 6 to at least 8. The reason the rooms are very dark is that your sun and most GILights arent penetrating all the way inside your building without first hitting some other geometry along the way. Either turn down your shadow intensities, or do what DICE did and compile your map's lightmaps from inside Max.

Here's a very good tut: http://bfeditor.org/forums/index.php?showt...amp;#entry52738

Some notes - On the step where it says to change the sun (light source) to Ray Traced Shadows, this will add several more hours to the process for very little extra benefit. I leave mine on the default setting (Adv Raytracing?) and it does just as good only faster. Oh, and if you go to load the terrain you may run out of memory to run your script. The fix for this is to type the following in the little pink window in the bottom left of Max: heapsize *= 2 Once you get this figured out, you'll never compile object lightmaps in the editor again.

Link to comment
Share on other sites

do what DICE did and compile your map's lightmaps from inside Max.

Didn't know about this... actually this is shocking :lol:

Anyway, it's useless to complain... many thanks for your clear and appropriate answer, I'll try this with the help of one of our modellers, 'cause I'm just a mapper and don't know anything about Max :unsure:

Link to comment
Share on other sites

  • 9 months later...

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