# lightmapIndex

> The index of the baked lightmap applied to this renderer.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public int lightmapIndex { get; set; }
```

### Remarks

The index refers to the [LightmapSettings.lightmaps](/engine/6000.7/script-reference/unityengine/lightmapsettings/lightmaps.md) array. A value of -1 (0xFFFF)  means no lightmap has been assigned, which is the default. A value of 0xFFFE is internally used for objects that have their scale in lightmap set to 0; they affect lightmaps, but don't have a lightmap assigned themselves. The index is 16 bits internally and can't be larger than 65533 (0xFFFD).

Note: this property is only serialized when building the player. In all the other cases it's the responsibility of the Unity lightmapping system (or a custom script that brings external lightmapping data) to set it when the Scene loads or playmode is entered.

A lightmap is a texture atlas and multiple Renderers can use different portions of the same lightmap.

Additional Resources: [LightmapSettings](/engine/6000.7/script-reference/unityengine/lightmapsettings.md) class, [Renderer.lightmapScaleOffset](/engine/6000.7/script-reference/unityengine/renderer/lightmapscaleoffset.md) property, [ShaderLab properties](/engine/6000.7/manual/materials-and-shaders/shaders/reference/sl-reference/sl-shader-object/sl-properties.md).
