# IntegrateIndirectRadiance(IDeviceContext, int, int, int, bool, BufferSlice<SphericalHarmonicsL2>)

> Integrates indirect lighting contribution at probe positions using spherical sampling and path tracing.

## Definition

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

```csharp
public IProbeIntegrator.Result IntegrateIndirectRadiance(IDeviceContext context, int positionOffset, int positionCount, int sampleCount, bool ignoreEnvironment, BufferSlice<SphericalHarmonicsL2> radianceEstimateOut)
```

### Parameters

**** (\[IDeviceContext]\(/engine/6000.6/script-reference/unityengine/lighttransport/idevicecontext)): The [IDeviceContext](/engine/6000.6/script-reference/unityengine/lighttransport/idevicecontext.md) to use for computation and memory operations.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Offset measured from the beginning of the probe position buffer.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Number of probes to integrate.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The number of samples to take per probe.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): If true, excludes environment lighting from the indirect contribution calculation.**** (\[BufferSlice\<SphericalHarmonicsL2>]\(/engine/6000.6/script-reference/unityengine/lighttransport/bufferslice1)): Output [BufferSlice](/engine/6000.6/script-reference/unityengine/lighttransport/bufferslice1.md) that the indirect radiance estimate is written into, encoded as [SphericalHarmonicsL2](/engine/6000.6/script-reference/unityengine/rendering/sphericalharmonicsl2.md).

### Returns

| Type                                                                                            | Description  |
| ----------------------------------------------------------------------------------------------- | ------------ |
| [Result](/engine/6000.6/script-reference/unityengine/lighttransport/iprobeintegrator/result.md) | Return code. |

### Remarks

This method performs multi-bounce global illumination calculations by tracing rays from each probe position and accumulating light bounces through the scene. The number of bounces is controlled by the bounce count parameter set in [RadeonRaysProbeIntegrator.Prepare](/engine/6000.6/script-reference/unityengine/lighttransport/radeonraysprobeintegrator/prepare.md). Higher sample counts and bounce counts significantly improve quality but increase computation time. Indirect radiance includes contribution from the following:

* Light bounced off surfaces.
* Light transmitted through transparent materials.
* Illumination from emissive materials.
* Multi-bounce environment lighting.
