Description

Calculate light probes and occlusion probes at the given world space positions.

If there are no probes baked in the Scene, the ambient probe will be written to the lightProbes array and Vector4 (1,1,1,1) will be written to the occlusionProbes array.
ArgumentNullException is thrown if positions is null.
You can omit either lightProbes or occlusionProbes array by passing null to the function, but you cannot omit both at the same time. If both arrays are omitted, an ArgumentException is thrown. lightProbes and occlusionProbes should be calculated together for better performance.
For the overload which takes arrays as arguments, the lightProbes and occlusionProbes must have at least the same number of elements as the positions array.
For the overload which takes lists as arguments, the output lists will be resized to fit the size of the positions array if there is not enough space in the given lists.
The returned probes may be further used for instanced rendering by copying them to a MaterialPropertyBlock object via MaterialPropertyBlock.CopySHCoefficientArraysFrom and MaterialPropertyBlock.CopyProbeOcclusionArrayFrom.

using UnityEngine;

// This script uses OnPreCull for the rendering. It is mandatory to put the script to a Camera object.
// Make sure light probes are placed and baked in the Scene.
// Use Shadowmask mode and mixed lights to see occlusion probes approximating shadowness.
[RequireComponent(typeof(Camera))]
public class Simple : MonoBehaviour
{
public Material material;