static void ProcessFrustrumClusters(VisibleSets visibleSets, AABB frustrumAABB, WorldFrustrumPlanes frustrumPlanes) { int4 min; int4 max; Octree.GetMinMaxClusterIDs(frustrumAABB, out min, out max); for (int x = min.x; x < max.x; ++x) { for (int y = min.y; y < max.y; ++y) { for (int z = min.z; z < max.z; ++z) { var clusterID = new int4(x, y, z, Octree.ClusterLayer); if (!Math.IsCubeCulled(Octree.ClusterIDToPoint(clusterID.xyz), Octree.ClusterExtent, frustrumPlanes)) { var packedID = Octree.PackID(clusterID); visibleSets.ClusterLayer.Add(packedID); ProcessNodeChildrenRecursive(visibleSets, frustrumPlanes, clusterID, 1); } } } } }