# AddSphericalHarmonicsL2(IDeviceContext, BufferSlice<SphericalHarmonicsL2>, BufferSlice<SphericalHarmonicsL2>, BufferSlice<SphericalHarmonicsL2>, int)

> Perform the sum of two arrays of SphericalHarmonicsL2.

## Definition

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

```csharp
public bool AddSphericalHarmonicsL2(IDeviceContext context, BufferSlice<SphericalHarmonicsL2> a, BufferSlice<SphericalHarmonicsL2> b, BufferSlice<SphericalHarmonicsL2> sum, int probeCount)
```

### Parameters

**** (\[IDeviceContext]\(/engine/6000.7/script-reference/unityengine/lighttransport/idevicecontext)): Device context.**** (\[BufferSlice\<SphericalHarmonicsL2>]\(/engine/6000.7/script-reference/unityengine/lighttransport/bufferslice1)): Source buffer A.**** (\[BufferSlice\<SphericalHarmonicsL2>]\(/engine/6000.7/script-reference/unityengine/lighttransport/bufferslice1)): Source buffer B.**** (\[BufferSlice\<SphericalHarmonicsL2>]\(/engine/6000.7/script-reference/unityengine/lighttransport/bufferslice1)): Destination buffer where the sum of A and B is written.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of [SphericalHarmonicsL2](/engine/6000.7/script-reference/unityengine/rendering/sphericalharmonicsl2.md) probes to add.

### Returns

| Type                                                          | Description                                                                      |
| ------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if the operation is successfully added to the command queue in the context. |

### Remarks

Sum = A + B. Each element from source buffer A is added to the corresponding element from source buffer B. The result is written into the destination buffer 'sum'.
