# Optimize lighting in the Built-In Render Pipeline

> Reduce extra lighting work so Unity uses fewer draw calls and processes fewer vertices and pixels.

> **Important:**
>
> The Built-In Render Pipeline is deprecated and will be made obsolete in a future release.
>
> It remains supported, including bug fixes and maintenance, through the full Unity 6.7 LTS lifecycle.
>
> For more information on migration, refer to [Migrating from the Built-In Render Pipeline to the Universal Render Pipeline](/engine/6000.7/manual/render-pipelines/universal-render-pipeline/introduction/installing-and-configuring-urp/upgrading-from-birp.md.md) and [Render pipeline feature comparison](/engine/6000.7/manual/render-pipelines/choose-a-render-pipeline/feature-comparison.md.md).

To optimize the lights in your scene, avoid Unity using multiple render passes to render GameObjects, or doing too much work to render lighting. This reduces the number of the draw calls the CPU sends, and the number of vertices and pixels the GPU processes.

Do the following:

* Use [lightmapping](/engine/6000.7/manual/lighting-overview/direct-and-indirect-lighting/lightmapping.md) to light static objects, instead of realtime lights.
* Avoid combining meshes if they're lit by different realtime per-pixel lights, because Unity calculates every light for every combined mesh.
* Avoid lighting GameObjects with multiple per-pixel lights.

## Prioritize lights

To avoid lighting GameObjects with multiple per-pixel lights, prioritize which lights provide per-pixel lighting based on which GameObjects they light.

For example, in a driving game, prioritize the car headlights as a per-pixel light, but deprioritize the rear lights and distant lampposts.

To decrease the number of per-pixel lights, do any of the following:

* In the [Light component Inspector window](/engine/6000.7/manual/lighting-overview/lighting-birp/class-light.md), set **Render Mode** to **Not important**. This sets the light as a per-vertex light or spherical harmonics (SH) light.
* In the [Quality settings window](/engine/6000.7/manual/unity-editor/editor-settings-reference/comp-manager-group/class-quality-settings.md), decrease **Pixel Light Count**. This excludes lights from the per-pixel light group.

To increase the number of per-pixel lights, do any of the following:

* In the [Light component Inspector window](/engine/6000.7/manual/lighting-overview/lighting-birp/class-light.md), increase the **Intensity**. The brightest light is always a per-pixel light.
* In the [Light component Inspector window](/engine/6000.7/manual/lighting-overview/lighting-birp/class-light.md), set **Render Mode** to **Important**. This sets the light as a per-pixel light.
* In the [Quality settings window](/engine/6000.7/manual/unity-editor/editor-settings-reference/comp-manager-group/class-quality-settings.md), increase **Pixel Light Count**. This includes more lights in the per-pixel light group.

## Disable per-vertex and spherical harmonics (SH) lights

To disable per-vertex and SH lights in a custom shader, add the `OnlyDirectional` tag to the Pass in your ShaderLab code. For more information, refer to [Pass tags in ShaderLab reference](/engine/6000.7/manual/materials-and-shaders/shaders/reference/sl-reference/sl-sub-shader-pass/sl-pass-tags.md).

## Additional resources

* [Per-vertex and per-pixel lights](/engine/6000.7/manual/lighting-overview/lighting-light-sources/components/per-pixel-lights.md)
* [Per-vertex and per-pixel lights in the Built-In Render Pipeline](/engine/6000.7/manual/lighting-overview/lighting-birp/per-pixel-lights-built-in.md)
