Fork me on GitHub


Fake ambient occlusion lightmap generator for tile maps



Generate lightmaps to give your tile maps a smoother, more realistic look.


Tile Maps

The generated textures work for any simple square tile map with flat walls.


Developer Tool

As a development tool, it is not user friendly, has to be compiled with the settings.

 Project status: Stable, unfriendly

Works ok, but options need to be compiled into the application, needs improvement.

How does it work?

A unique lightmap needs to be generated for every possible layout. As each tile has 8 adjacent tiles around it that could contribute to the AO, it makes it 256 different textures. As it is quite a lot, we have to cut it down a bit:

  • Many of these textures are identical if rotated by 90, 180 or 270 degrees. Not duplicating them leaves us with 70 different textures to generate.
  • If we take simple mirroring into account, we’re down to 51.
  • If we assume that a wall to the top and to the left completely seals the top-left corner, regardless whether there is a wall tile to the top-left, we brought it down to 33.

We could save more memory by further dropping matching textures which can be built from others, but this way we can save GPU rendering passes by allowing it to be used with single-pass multitexturing. AO maps are also quite light and subtle gradients, low resolution textures can be used for tile maps. When using the generated textures, you will need to deal with the above transformations yourself.

Generating the maps is simple: we just draw the 9 required tiles in gray and white, apply some gaussian blur, and save the middle tile.

For more information and the results, read this blog post.

License and copyright

This program is available under GPLv2. Please see the LICENSE and COPYRIGHT files for details.


Related blog posts

Share Button

Leave a Reply