|
|
|
|
|
|
int[] m_PlanarReflectionProbeIndices; |
|
|
|
PlanarReflectionProbe[] m_VisiblePlanarReflectionProbes; |
|
|
|
|
|
|
|
CullingGroup m_CullingGroup; |
|
|
|
PlanarReflectionProbe[] m_Probes; |
|
|
|
|
|
|
|
public int visiblePlanarReflectionProbeCount { get; private set; } |
|
|
|
public PlanarReflectionProbe[] visiblePlanarReflectionProbes { get { return m_VisiblePlanarReflectionProbes; } } |
|
|
|
|
|
|
|
|
|
|
visiblePlanarReflectionProbeCount = cullingGroup.QueryIndices(true, m_PlanarReflectionProbeIndices, 0); |
|
|
|
for (var i = 0; i < visiblePlanarReflectionProbeCount; ++i) |
|
|
|
m_VisiblePlanarReflectionProbes[i] = planarReflectionProbes[m_PlanarReflectionProbeIndices[i]]; |
|
|
|
} |
|
|
|
|
|
|
|
public void PrepareCull(CullingGroup cullingGroup, PlanarReflectionProbe[] planarReflectionProbesArray) |
|
|
|
{ |
|
|
|
Assert.IsNull(m_CullingGroup, "Culling was prepared but not used nor disposed"); |
|
|
|
Assert.IsNull(m_Probes, "Culling was prepared but not used nor disposed"); |
|
|
|
|
|
|
|
m_CullingGroup = cullingGroup; |
|
|
|
m_Probes = planarReflectionProbesArray; |
|
|
|
} |
|
|
|
|
|
|
|
public void Cull() |
|
|
|
{ |
|
|
|
Assert.IsNotNull(m_CullingGroup, "Culling was not prepared, please prepare cull before performing it."); |
|
|
|
Assert.IsNotNull(m_Probes, "Culling was not prepared, please prepare cull before performing it."); |
|
|
|
|
|
|
|
visiblePlanarReflectionProbeCount = m_CullingGroup.QueryIndices(true, m_PlanarReflectionProbeIndices, 0); |
|
|
|
for (var i = 0; i < visiblePlanarReflectionProbeCount; ++i) |
|
|
|
m_VisiblePlanarReflectionProbes[i] = m_Probes[m_PlanarReflectionProbeIndices[i]]; |
|
|
|
|
|
|
|
m_CullingGroup.Dispose(); |
|
|
|
m_CullingGroup = null; |
|
|
|
m_Probes = null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |