Lightmap Atlas Explained

From Reflex Wiki
Revision as of 06:06, 13 December 2014 by AEon (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
by Devil
Synopsis
The lit faces of brushes are organized into the lightmap atlas, and saved into a separate .light file, after a lightmap compile.

What is the Lightmap Atlas?

The lightmap atlas shows you every single brush face to be rendered after having run a full lightmap compile using the r_lm_build command. All brush faces to be rendered are systematically organized within the atlas like pages within a book. The more brushes you have and the larger the brushes are the more pages you will have in your atlas. Brush Count vs Brush Size count goes a long way towards determining the final amount of atlas pages. The more pages the longer it will have taken to build your lightmap. In terms of optimizations the less brushes and pages you have the better it will be for the lighting engine and map performance.

Limitations on the brush size

Do not make any brush larger than 7800 units. If you create a brush too large the editor will now give you a warning and your lightmap will fail to properly build. Prior to Reflex version 0.28.3 the maximum brush size was 4000u. This has been raised to 8000u in 0.28.3.

How to view the Lightmap Atlas?

You can view your lightmap atlas with:

r_lm_debug_show 1

Each shape is a brush face within your map. Everything you see in the atlas below are brush faces from my map and all are properly lightmapped. This can be used as an example of a good lightmap atlas.

Note: The lit faces are always placed into rectangular blocks on the lightmap atlas. This means space is wasted on the atlas when angled brushes, like ramps, are used extensively. So using large non-coplanar brushes, created by vertex editing them, will quickly fill up atlas pages. And thus create very large .light files. (AEon)

To see your entire lightmap atlas you must rescale the atlas to be viewable on your screen. Use

r_lm_debug_scale 0.5

to show your full atlas of lightmaps.

Question: I do not know how to bring up a specific page from the atlas for closer inspection. If anyone knows please tell me. I would love to be able to zoom in on a specific page to see more details.

Optimizing the Lightmap Atlas

The main method of optimizing the lightmap atlas, is to reduce the number of lit brush faces. There is a special nolight texture applicable to all brush faces that the player will never see in the map. See Nolight Texture Explained for details. (AEon)