Class ClusterGrid¶
Namespace: Apogee.Rendering
Assembly: Apogee.Rendering.dll
The grid lights are culled against: 16 x 9 cells over the screen and 24 slices in depth, spaced exponentially from the camera's near plane
to
public static class ClusterGrid
Inheritance¶
Inherited Members¶
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Fields¶
CountX¶
public const int CountX = 16
Field Value¶
CountY¶
public const int CountY = 9
Field Value¶
CountZ¶
public const int CountZ = 24
Field Value¶
MaxLightsPerCluster¶
public const int MaxLightsPerCluster = 64
Field Value¶
Stride¶
Uints per cluster in the light list: the count, then the indices.
public const int Stride = 65
Field Value¶
Total¶
public const int Total = 3456
Field Value¶
Methods¶
Bounds(int, int, int, float, float, float, float)¶
The view-space box around a cluster. projX and projY are the projection's [0,0] and [1,1] (the latter negative).
public static (Vector3 Min, Vector3 Max) Bounds(int x, int y, int z, float near, float far, float projX, float projY)
Parameters¶
x int
y int
z int
near float
far float
projX float
projY float
Returns¶
Index(int, int, int)¶
public static int Index(int x, int y, int z)
Parameters¶
x int
y int
z int
Returns¶
SliceDepth(float, float, int)¶
The distance in front of the camera where slice slice starts (slice 24 is the far end).
public static float SliceDepth(float near, float far, int slice)
Parameters¶
near float
far float
slice int
Returns¶
SliceOf(float, float, float)¶
The slice a distance in front of the camera falls in; closer than near is slice 0, farther than far the last.
public static int SliceOf(float near, float far, float viewDepth)
Parameters¶
near float
far float
viewDepth float