TSE/Atlas/LightMapping

From TDN

Contents

Atlas Scene Lighting

Simple lightmapping support for Atlas terrains has been introduced with TGEA 1.0.3. This is a quick guide to explain how it all works.

What it does and does not do

Just to be up front about the downsides, here are the caveats:

  1. The scene lighting process for Atlas is very slow, and doesn't report progress to the user.
  2. Only blended terrains support lightmapping.

Upsides:

  1. Lighting of blended atlas terrains based on the sun object defined in the mission.
  2. Static shadows for interiors and TSStatics.

Documentation/notes

During scene lighting a new atlas file is generated in the same directory as the source Atlas file. This is named basefile_missioncrc.atlas. This contains only the lightmap texture for that terrain / mission combination. A new property was added to AtlasInstance2 called "lightmapDimension" which is the size of the lightmap texture. It has to be a power of two, and it must be larger than the chunk size of your current blended lightmap texture. Normally this is 256. Check the console for errors after doing scene lighting to see if you've set your lightmapDimension too small. A value of zero disables lightmap generation completely.

The old lightMapSize property has been deleted. The default value of 1024 for lightMapSize can take upwards of a minute to light and we didn't want to create any issues by having a large value there. So it was deleted and replaced with lightmapDimension which has a default value of 256 (for quicker lighting).

Intended usage model

Due to the speed at which the lightmapping process runs, we recommend the following:

  1. During authoring/mission editing, disable lightmaps by setting the lightmapDimension property to 0. This will allow you to move objects around the mission and not endure the lighting time each time you restart.
  2. Before shipping your game, crank up lightmapDimension and ship the generated lightmap files with your game. Note: you only need the basefile_missioncrc.atlas file. You can still ship without the mission_crc.ml files. The atlas lightmap files tend to be small, so it shouldn't affect download size too much.