# LightMode

> The light mode a light baking backend uses.

## Definition

* **Type:** Enum
* **Namespace:** [UnityEngine.Experimental.GlobalIllumination](/engine/6000.6/script-reference/unityengine/experimental/globalillumination.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public enum LightMode : byte
```

## Remarks

A light can be real-time, mixed, baked or unknown. Unknown lights will be ignored by the baking backends.

The example below uses `LightMode` in a delegate to be used with [Lightmapping.SetDelegate](/engine/6000.6/script-reference/unityengine/experimental/globalillumination/lightmapping/setdelegate.md). The delegate forces all disc lights in a scene to be baked and all other types of lights to not be baked.

```csharp
using Unity.Collections;
using UnityEngine;
using UnityEngine.Experimental.GlobalIllumination;

internal static class MyLightBakingUtils
{
    public static Lightmapping.RequestLightsDelegate BakeOnlyDiscLightsDelegate = (Light[] requests, NativeArray<LightDataGI> lightsOutput) =>
    {
        LightDataGI lightData = new LightDataGI();

        // Iterate over all lights in the scene
        for (int i = 0; i < requests.Length; i++)
        {
            Light light = requests[i];

            switch (light.type)
            {
                case UnityEngine.LightType.Disc:
                    DiscLight discLight = new DiscLight();
                    LightmapperUtils.Extract(light, ref discLight);
                    discLight.mode = LightMode.Baked;
                    lightData.Init(ref discLight);
                    break;
                case UnityEngine.LightType.Spot:
                case UnityEngine.LightType.Directional:
                case UnityEngine.LightType.Point:
                case UnityEngine.LightType.Rectangle:
                case UnityEngine.LightType.Pyramid:
                case UnityEngine.LightType.Box:
                case UnityEngine.LightType.Tube:
                default:
                    lightData.InitNoBake(light.GetEntityId());
                    break;
            }

            lightsOutput[i] = lightData;
        }
    };
}
```

Additional Resources: [LightmapBakeType](/engine/6000.6/script-reference/unityengine/lightmapbaketype.md).

## Fields

| Value                                                                                                         | Description                                                                                                     |
| ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| [Baked](/engine/6000.6/script-reference/unityengine/experimental/globalillumination/lightmode/baked.md)       | The light is fully baked and has no real-time component.                                                        |
| [Mixed](/engine/6000.6/script-reference/unityengine/experimental/globalillumination/lightmode/mixed.md)       | The light is mixed. Mixed lights are interpreted based on the global light mode setting in the lighting window. |
| [Realtime](/engine/6000.6/script-reference/unityengine/experimental/globalillumination/lightmode/realtime.md) | The light is real-time. No contribution will be baked in lightmaps or light probes.                             |
| [Unknown](/engine/6000.6/script-reference/unityengine/experimental/globalillumination/lightmode/unknown.md)   | The light should be ignored by the baking backends.                                                             |
