Vixen
02b45cc4
csharp
public static class GpuClusterCulling

The records, the dispatch shape and the tests that the cluster traversal in Raven/Library/Pipeline/Culling.rvn and the host have to agree about.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

GpuCulling's sibling, and deliberately not a second copy of it: the frustum test, the rounding slack, the stage-mask intersection and the whole occlusion test are that one's, called from here. What is new is a normal cone, a screen-space error and a walk — which is exactly the difference improvement 3 of docs/plan/22-virtualized-geometry.md says should be the whole difference.

Traverse is the mirror, and it is what phase 3 is judged on. It is a transliteration of the shader's Traverse, so a randomised comparison against the brute-force cut over the same DAG — which is the definition — says whether the arithmetic the device will run is the arithmetic the engine means. What it cannot say is whether the shader still contains that arithmetic; that is what the source assertion in the tests is for, the same defence IsVisible has.

Fields and properties (3)

  • public static string ClustersKey

    The permutation key selecting the traversal rather than the per-object cull.

  • public const uint ClusterRoot

    The bit of Flags that says nothing simplifies it further.

  • public const int QueueCapacity

    How many clusters one workgroup's shared queue holds.

Methods (10)

  • public static float ErrorScaleFor(float verticalFieldOfView, float screenHeight)

    The screen-space scale an object-space error is projected by, before the distance divide.

  • public static float ErrorScaleFor(float screenHeightScale, int screenHeight)

    The same scale, from what a RenderView already carries.

  • public static float MotionRadiusFor(ReadOnlySpan<Matrix4x4> palette, Vector3 center, float radius)

    How far a pose can move any point of a mesh away from where its bind-pose bound says it is.

  • public static float PixelError(float error, float distance, float errorScale)

    How many pixels of screen an object-space deviation covers, at a distance.

  • public static bool Backfacing(Vector3 center, float radius, Vector3 axis, float cosine, Vector3 eye)

    Whether every triangle of a cluster faces away from a point.

  • public static ClusterScene Flatten(MeshletMesh mesh, MeshletPageSet pages)

    Flattens an offline DAG into the buffers a traversal reads.

  • public static bool IsSoftware(Vector3 center, float radius, in CullView view)

    Whether the traversal would route a cluster to the software raster.

  • public static GpuClusterCulling.TraversalResult Traverse(ClusterScene scene, in CullInstance instance, in CullView view, Func<uint, bool> isResident, GpuCulling.OccluderDepth? occluder = null, Int2 occluderSize = default(Int2))

    Whether the shader's traversal would draw this cluster, and what it would ask for — the whole of the hierarchical culling decision.

  • public static int[] Cut(ClusterScene scene, in CullInstance instance, in CullView view)

    The cut a threshold names, found by asking every cluster about itself — the oracle the traversal is checked against.

  • public static float ProjectedError(in CullCluster record, in CullInstance instance, in CullView view)

    One cluster's own error in pixels, projected at its group's bound.

Used by (8)

  • ClusterRoutingTestsVixen.Rendering.Tests
  • ClusterTraversalAcceptsTestsVixen.Rendering.Tests
  • ClusterTraversalGroupTestsVixen.Rendering.Tests
  • GpuClusterCullingTestsVixen.Rendering.Tests
  • GpuClusterVisibilityVixen.Rendering
  • SkinnedClusterTestsVixen.Rendering.Tests
  • VirtualGeometryFrameTestsVixen.Rendering.Tests
  • VirtualGeometryRenderFeatureVixen.Rendering