Skip to content

Lightmap Settings

Marblr edited this page Sep 29, 2023 · 10 revisions

Lightmaps are pre-rendered lighting and shadow data used in Marble It Up! Ultra levels. This page will go over how to generate and export lightmaps for your level.

comparison

Generating Lightmaps

Lightmaps are baked using the Lighting Window, which can be found at Window -> Rendering -> Lighting.

This window contains many settings for adjusting how the lighting in your level will look. To quickly apply good settings, go to the menu bar and click Marble It Up -> Fix Lightmap Settings.

quick

To render lightmaps, click the Generate Lighting button in the bottom-right corner. This process can take anywhere from a few seconds to several minutes depending on the complexity of level geometry and the power of your hardware.

The direction of cast shadows depends on the angle of the Sun object. You can experiment with different Sun rotations to give your level a different appearance!

Exporting Lightmaps

If you try to export your level immediately after generating lightmaps, it will fail. This is because lightmap textures need to be compressed to a more efficient texture format.

Lightmap textures are saved in a folder alongside the scene file. There are two textures that get packed into the level file: a light texture, and a shadowmask texture.

Select Lightmap-0_comp_light, click the computer icon tab, check the override box, and change its Format to RGBA Crunched DXT5.

Repeat the above for Lightmap-0_comp_shadowmask, but this time change its Format to RGB Crunched DXT1.

formats

With these settings, your level should export with fancy lighting!

Common Problems

Why do some objects have no lighting after generating lightmaps?

Lighting will only be baked on objects marked as Static in the inspector. Dynamic objects (such as powerups and elevators) should not be marked as Static since they move.

static

Why is my level covered in garbage lighting data?

It is possible that some meshes do not have Lightmap UVs. To fix this, click the Lightmap UVs button in the ProBuilder window and regenerate the lighting.

uv2

Why do I have multiple lightmap textures?

For very large levels, generating lightmaps may result in multiple textures such as Lightmap-1, Lightmap-2, Lightmap-3, etc. This means the first lightmap texture ran out of space, which is undesirable since the game will only use Lightmap-0 textures.

To fix this, either increase Max Lightmap Size to a larger value or decrease Lightmap Resolution to a lower value.

Clone this wiki locally