public static class WaterTilesHow the screen is divided for [35 § D8](../../docs/plan/35-water.md#d8-the-surface-is-a-pass-between-lighting-and-translucency-and-its-reflections-are-l5s)'s tile classification — the arithmetic the host, the classifier and the water pass share.
Remarks
Three things address a tile and they have to agree. The host sizes the buffer and picks the instance count from here, WaterTiles.rvn writes one word per tile from WaterTile.Index, and Water.rvn's vertex stage reads it back through WaterTile.Unindex. This is the C# copy of that struct, and WaterTileTests is what holds the two copies together.
⚠ Constants and not settings. A tile size a host could choose would be a number in a buffer's stride, in a dispatch's workgroup size and in a shader's [ComputeShader(64)] — and the last of those is a compile-time property of the module. Changing it means changing both files together, which is what a constant in each says.
Fields and properties (2)
public const int SizeHow many pixels a tile is on a side. WaterTile.Size, and a workgroup of 64.
public const int VerticesPerTileHow many vertices one tile's draw is — two triangles over a rectangle.
Methods (5)
public static Int2 CountFor(Int2 target)How many tiles cover a target that many pixels across.
public static int Total(Int2 count)How many tiles that grid holds, which is the draw's instance count.
public static int Index(Int2 tile, Int2 count)One tile's index in a row-major grid of them.
public static Int2 Unindex(int index, Int2 count)The tile a row-major index names — what an instance id means.
public static int Bytes(Int2 count)How many bytes the flag buffer for that grid is.
Used by (3)
- WaterPassTestsVixen.Rendering.Water.Tests
- WaterRendererVixen.Rendering.Water
- WaterTileTestsVixen.Rendering.Water.Tests