Vixen
c7401864
csharp
public readonly record struct WaterZone

A region's water: the window the field is rasterised over, and what that costs.

Read the guide page for this →

Remarks

[35 § D3](../../docs/plan/35-water.md#d3-the-water-info-texture-is-the-interchange-and-it-is-a-zone-render). The zone is the render unit because transitions between bodies must be resolved once, by rasterising them in priority order into one field, rather than being blended per pixel by a material that has to know which two bodies it is between.

Always a sliding window. Unreal made local tessellation a mode in 5.3 because the fixed-extent version does not survive an open world; there is no reason to build the version that does not survive first.

The resolution is derived and stated, not typed. MetresPerTexel and Bytes are what a panel shows, in the style of [31](../../docs/plan/31-terrain-grass-and-trees.md)'s create dialog. A number an author types into a resolution with no idea what it buys is how the reference gets configured wrongly — and "four metres a texel" is a sentence where "512" is not.

Fields and properties (10)

  • public float Extent

    How wide and deep the window is, in metres.

  • public int Resolution

    How many texels along each axis.

  • public WaterInfoPrecision Precision

    How many bits a channel carries.

  • public float ScrollThreshold

    How far the view may move before the window is re-rasterised, as a fraction of the extent.

  • public float CoarsestTexel

    How many metres a texel of the coarsest thing that reads the field covers.

  • public static WaterZone Default

    A 512-metre window at two metres a texel, in full precision.

  • public float MetresPerTexel

    How many metres apart two neighbouring texels are.

  • public long Bytes

    How many bytes the info texture occupies.

  • public float HeightQuantum

    The smallest height difference the info texture can represent at this zone's scale, in metres.

  • public float ScrollDistance

    How far the view may move before the window is re-rasterised, in metres.

Methods (2)

  • public WaterFieldDescription WindowFor(Vector2 view)

    The shape the field is rasterised at, centred and snapped for a view.

  • public string? Validate()

    Why this zone cannot be rasterised, or if it can.

Used by (13)

  • TypeRegistrationVixen.Rendering.Water
  • UnderwaterShapeTestsVixen.Rendering.Water.Tests
  • Vixen_Water_WaterZoneSerializerVixen.Water
  • WaterInfoTextureVixen.Rendering.Water
  • WaterInfoTextureTestsVixen.Rendering.Water.Tests
  • WaterZoneComponentVixen.Rendering.Water
  • WaterZoneStateVixen.Water
  • WaterZoneSystemVixen.Rendering.Water
  • WaterZoneSystemTestsVixen.Rendering.Water.Tests
  • WaterZoneTestsVixen.Water.Tests
  • SceneWaterComponentTestsVixen.Editor.Assets.Tests
  • WaterEditTestsVixen.Editor.Water.Tests
  • WaterZoneSettingsVixen.Editor.Water