Vixen
dd8b0a81
csharp
public readonly record struct GrassTerrainSource

What the scatter samples the ground from, on the device.

Read the guide page for this →

Remarks

⚠ The textures the terrain renderer already owns, named rather than re-created. A scatter with its own copy of the heightmap would be a second upload of the same megabytes and a second thing to invalidate when a stroke lands.

⚠ The tile geometry is required, not defaulted, because the atlas packs each tile as its own block and a flat map over is right only for a single-tile terrain. TerrainAtlas is where the numbers come from — the same three Terrain.rvn binds.

Fields and properties (14)

  • public TextureViewHandle HeightMap

    The composited heights, one texel per sample.

  • public TextureViewHandle WeightMap

    The weightmap holding the bound layer.

  • public TextureViewHandle HoleMap

    Where the terrain has no surface at all.

  • public SamplerHandle HeightSampler

    How the heights are read.

  • public SamplerHandle WeightSampler

    And the weights.

  • public SamplerHandle HoleSampler

    And the holes — clamped, unfiltered, at level 0.

  • public int WeightChannel

    Which of the weightmap's four channels the layer is.

  • public Vector2 HeightMapSize

    How many texels the atlas is.

  • public Vector2 HeightRange

    What a stored height of 0 and 1 mean, in metres.

  • public float MetresPerQuad

    How far apart two samples are.

  • public Vector3 Origin

    Where the terrain's low corner is, in world space.

  • public float TileSamples

    How many samples one tile's block is, on a side.

  • public float TileQuads

    How many quads that is — one fewer, because the blocks duplicate their boundary samples.

  • public Vector2 AtlasTiles

    How many tiles the atlas holds, along each axis.

Methods (1)

Used by (5)

  • GrassDispatchVixen.Rendering.Terrain
  • GrassDispatchTestsVixen.Rendering.Terrain.Tests
  • GrassDrawPassTestsVixen.Rendering.Terrain.Tests
  • TerrainRendererVixen.Rendering.Terrain
  • TerrainSceneRendererVixen.Rendering.Terrain