# Append(LightProbes)

> Registers a LightProbes object with the light probe system for use in rendering.

## Definition

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

```csharp
public static void Append(LightProbes lightProbes)
```

### Parameters

**** (\[LightProbes]\(/engine/6000.7/script-reference/unityengine/lightprobes)): The `LightProbes` object to register.

### Remarks

Call [LightProbes.Tetrahedralize](/engine/6000.7/script-reference/unityengine/lightprobes/tetrahedralize.md) or [LightProbes.TetrahedralizeAsync](/engine/6000.7/script-reference/unityengine/lightprobes/tetrahedralizeasync.md) after appending to apply the changes.

Each call to `Append` increments an internal reference count. The object remains active until a corresponding number of [LightProbes.Remove](/engine/6000.7/script-reference/unityengine/lightprobes/remove.md) calls bring the count back to zero.

`Append` is called automatically for `LightProbes` objects belonging to a scene when that scene is loaded.

Additional Resources: [LightProbes.Remove](/engine/6000.7/script-reference/unityengine/lightprobes/remove.md), [LightProbes.IsActive](/engine/6000.7/script-reference/unityengine/lightprobes/isactive.md), [LightProbes.GetReferenceCount](/engine/6000.7/script-reference/unityengine/lightprobes/getreferencecount.md), [LightProbes.needsRetetrahedralization](/engine/6000.7/script-reference/unityengine/lightprobes/needsretetrahedralization.md).

### Examples

```csharp
// Attach this script to a GameObject, then enter Play mode.
// The script spawns a cloud of randomly placed light probes,
// which affects rendering immediately.
// Destroying the GameObject removes the probes again.

using UnityEngine;
using UnityEngine.Rendering;

public class SpawnLightProbes : MonoBehaviour
{
    public int count = 100;
    public float radius = 5;

    LightProbes probes;

    void Start()
    {
        probes = new LightProbes(count);
        Vector3[] positions = new Vector3[count];
        SphericalHarmonicsL2[] coefficients = new SphericalHarmonicsL2[count];
        for (int i = 0; i < count; i++)
        {
            positions[i] = transform.position + Random.insideUnitSphere * radius;
            SphericalHarmonicsL2 sh = new SphericalHarmonicsL2();
            sh.AddAmbientLight(Color.Lerp(Color.red, Color.blue, Random.value));
            coefficients[i] = sh;
        }
        probes.SetPositionsSelf(positions, false);
        probes.SetSHCoefficientsSelf(coefficients);
        LightProbes.Append(probes);
        LightProbes.Tetrahedralize();
    }

    void OnDestroy()
    {
        LightProbes.Remove(probes);
        LightProbes.Tetrahedralize();
    }
}
```
