Author Topic: Questions on Lightmapping  (Read 781 times)

Offline PapillonFH

  • Jr. Member
  • **
  • Posts: 126
    • View Profile
Questions on Lightmapping
« on: 23-06-2013, 09:06:25 »
Hey there!
I'm creating a new for tournament use, and I face some issues with the lightmapping.
Situation:
I did terrain lightmapping (medium) with the following settings:
- sun low over the horizon, early morning.
TerrainLight.con
Code: [Select]
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

sky.con:
Code: [Select]
Lightmanager.skycolor 0.635294/0.572549/0.639216
Lightmanager.ambientcolor 0.862745/0.858824/0.866667
Lightmanager.sunColor 0.764706/0.764706/0.764706
Lightmanager.sunSpecColor 0.772549/0.741177/0.776471
if v_arg1 == BF2Editor
LightSettings.TerrainSunColor 0.70/0.49/0.00
LightSettings.TerrainSkyColor 0.50/0.50/0.50
LightmapSettings.waterSunIntensity 0
else
terrain.sunColor 0.70/0.49/0.00
terrain.GIColor 0.50/0.50/0.50
terrain.waterSunIntensity 0
endIf
Lightmanager.staticSunColor 0.29/0.20/0.00
Lightmanager.staticSpecularColor 0.50/0.50/0.50
Lightmanager.staticSkyColor 0.36/0.36/0.36
Lightmanager.singlePointColor 0.57/0.47/0.26
Lightmanager.sunDirection -0.977608/0.0199512/-0.209487
Lightmanager.enableSun 0
Lightmanager.effectSunColor 0.59/0.59/0.59
Lightmanager.effectShadowColor 0.36/0.36/0.36
Lightmanager.defaultEffectLightAffectionFactor 1
Lightmanager.hemilerpbias 0.15
hemiMapManager.setBaseHemiMap Levels/fht_elsenborn_ridge/groundhemi 0.000000/0.000000/0.000000 2048.000000 500.000000
Lightmanager.treeAmbientColor 0.75/0.67/0.64
Lightmanager.treeSunColor 0.54/0.40/0.36
Lightmanager.treeSkyColor 1.00/1.00/1.00

if v_arg1 == BF2Editor
else
run /Common/Sky/SkyDome/skydome.con
run /Common/Sky/Flare/flaresprite.con
endIf

Skydome.skyTemplate skydome
Skydome.cloudTemplate cloudlayer
Skydome.hasCloudLayer 1
Skydome.hasCloudLayer2 1
Skydome.scrolldirection 0.025/0
Skydome.scrolldirection2 0/0.05
Skydome.cloudTexture common\textures\cloud\cloud03
Skydome.cloudTexture2 common\textures\cloud\Cloud06
Skydome.skyTexture common\textures\sky\sky_elsenborn
Skydome.domeRotation 0
Skydome.fadeCloudsDistances 0/750
Skydome.cloudLerpFactors 0.25/0.75
Skydome.flareTexture common\textures\sunflare\Null
Skydome.flareDirection -0.05/-0.41/-0.91

Renderer.fogColor 202.00/215.00/222.00
Renderer.fogStartEndAndBase 2.50/400.00/2.50/0.65


The effect is good so far, see screenshot.

Basic question: Why are buildings/statics "lightmapped" when I do terrain lightmapping?

But now:
I lightmap a building with the following settings:

ObjectLight.con
Code: [Select]
rem ******** Lightmap Generation Settings ********
if v_arg1 == BF2Editor

LightMapGeneration.init
LightMapGeneration.GILightsBaseDir 0/0.33/-0.66
LightMapGeneration.GILightsIntensity 0.5
LightMapGeneration.GILightsShadowIntensity 1
LightMapGeneration.GILightsFov 45
LightMapGeneration.UseGITopLight 1
LightMapGeneration.GITopLightIntensity 0.1
LightMapGeneration.GILightsViewDistance 10
LightMapGeneration.skyWhite 0.5
LightMapGeneration.numberOfGILights 8
LightMapGeneration.sunLightShadowIntensity 1
LightMapGeneration.sunLightFov 2
LightMapGeneration.sunLightIntensity 3

endIf
..the result is not what I expected.
What is lost is the sunlight on the house front that was there after the terrain lightmapping, see house in the center:


1. What am I doing wrong? Or am I understanding something probably completly wrong?
2. Shall I even do more lightmapping? I think the buildings look good even w/o object lightmapping.

Any help is appreciated :-)

I tried to follow those tuts here:
http://www.bfeditor.org/forums/index.php?showtopic=10002
http://www.bfeditor.org/forums/index.php?showtopic=10002
and the standard tut from Fenring, but I seem to miss essential basics :-(

Offline Ts4EVER

  • Banner of THeTA0123
  • Developer
  • ******
  • Posts: 7.812
    • View Profile
Re: Questions on Lightmapping
« Reply #1 on: 23-06-2013, 12:06:50 »
Doesn't look like the statics are lightmapped at all in the first screenshots.

Offline PapillonFH

  • Jr. Member
  • **
  • Posts: 126
    • View Profile
Re: Questions on Lightmapping
« Reply #2 on: 23-06-2013, 15:06:01 »
That's right, 1st screenshot is after terrain lightmapping.

Offline gavrant

  • (Almost) retired dev
  • Moderator
  • ***
  • Posts: 598
    • View Profile
Re: Questions on Lightmapping
« Reply #3 on: 23-06-2013, 17:06:33 »
I concur with Ts4EVER, it looks like both screenshots are missing terrain and statics lightmapping - no shadows on the ground from the building and wooden pallets, buildings interiors are too bright, windows and doors are sunlit despite being on the dark side. With your terrain lighting settings (specifically, LightMapGeneration.GILightsIntensity 0.33 and LightMapGeneration.GITopLightIntensity 0.1) I would at least expect aggressive shadows on the ground.

BTW, did you install FH2 lightmapping samples? Asking because the tutorial from the first post obviously doesn't mention that part.

Offline PapillonFH

  • Jr. Member
  • **
  • Posts: 126
    • View Profile
Re: Questions on Lightmapping
« Reply #4 on: 23-06-2013, 18:06:10 »
Yeah, are installed. Unzipped fh2-samples-2.5.776.zip is here:
C:\Program Files\EA GAMES\Battlefield 2\bf2editor\objects

What I did was to lightmap the primary terrain on medium quality AND I object lightmapped that one building that now is very dark..

Can someone tell me in a few sentences:
Terrain Lightmapping will do the following:
Object Lightmapping will do the following:

Offline gavrant

  • (Almost) retired dev
  • Moderator
  • ***
  • Posts: 598
    • View Profile
Re: Questions on Lightmapping
« Reply #5 on: 23-06-2013, 18:06:28 »
Yeah, are installed. Unzipped fh2-samples-2.5.776.zip is here:
C:\Program Files\EA GAMES\Battlefield 2\bf2editor\objects
Mine were unpacked straight to ...\Battlefield 2\mods\fh2 (the zip has the Objects folder inside).

Quote
What I did was to lightmap the primary terrain on medium quality...
Try to lightmap the secondary terrain too?

Quote
... AND I object lightmapped that one building that now is very dark..
Sorry, skipped the "see house in the center" part. Anyway, I'd try to lightmap one of the front buildings instead, as that house may be obscured from the sunlight by other buildings.

One note: when you relightmap any static, restart the editor to see new lighting. The editor shows new lighting without restart only if the objects has not been previously lightmapped, at least in my case.

Offline Mudzin

  • Jr. Member
  • **
  • Posts: 692
    • View Profile
Re: Questions on Lightmapping
« Reply #6 on: 23-06-2013, 18:06:35 »
Actually what does "secondary terrain" mean? Is it the terrain around the map or does it mean more detailed lightmapping of primary terrain?

Offline PapillonFH

  • Jr. Member
  • **
  • Posts: 126
    • View Profile
Re: Questions on Lightmapping
« Reply #7 on: 23-06-2013, 20:06:57 »
Secondary Terrain is not yet done.
Actually I set a building just on top of that mountain in kp9 where one can even see the sun painting the surface, but that stayed dark too.
Yes, the objects folder comes from the zip.

Offline Ts4EVER

  • Banner of THeTA0123
  • Developer
  • ******
  • Posts: 7.812
    • View Profile
Re: Questions on Lightmapping
« Reply #8 on: 23-06-2013, 22:06:39 »
Static lightmaps often turn out a tad darker than expected, just tweak the lighting settings a bit (object lighting)

Offline PapillonFH

  • Jr. Member
  • **
  • Posts: 126
    • View Profile
Re: Questions on Lightmapping
« Reply #9 on: 23-06-2013, 23:06:59 »
Can you gimme some hints on what setting will change what?
I have this explanation here, but I'm not sure about the value range of most of those settings:
http://www.bfeditor.org/wiki/index.php?title=LightmapSettings_Explained