# IntegrateOcclusion(IDeviceContext, int, int, int, int, BufferSlice<int>, BufferSlice<float>)

> Integrate occlusion.

## Definition

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

```csharp
public IProbeIntegrator.Result IntegrateOcclusion(IDeviceContext context, int positionOffset, int positionCount, int sampleCount, int maxLightsPerProbe, BufferSlice<int> perProbeLightIndices, BufferSlice<float> probeOcclusionEstimateOut)
```

### Parameters

**** (\[IDeviceContext]\(/engine/6000.7/script-reference/unityengine/lighttransport/idevicecontext)): The [IDeviceContext](/engine/6000.7/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)): Number of samples to take.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): Maximum number of lights per probe. The value must be 4.**** (\[BufferSlice\<int>]\(/engine/6000.7/script-reference/unityengine/lighttransport/bufferslice1)): The [BufferSlice](/engine/6000.7/script-reference/unityengine/lighttransport/bufferslice1.md) containing the per probe light indices.**** (\[BufferSlice\<float>]\(/engine/6000.7/script-reference/unityengine/lighttransport/bufferslice1)): The [BufferSlice](/engine/6000.7/script-reference/unityengine/lighttransport/bufferslice1.md) to write the probe occlusion estimate into. The size of the buffer in bytes should be maxLightsPerProbe \* sizeof(float).

### Returns

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

### Remarks

The integrator does spherical sampling for each probe position. Occlusion is 1 if all rays hit front-facing triangles or the sky. Occlusion is 0 if all rays hit back-facing triangles.

Additional Resources: ComputeOcclusionLightIndicesFromBakeInput.
