Vixen
02b45cc4
csharp
public readonly record struct TerrainLodRanges

Where each level of detail takes over, and where each one morphs.

Read the guide page for this →

Remarks

[docs/plan/31 § D3]. A level's range doubles with the level, which is what makes the screen-space size of a quad roughly constant: twice as far away, twice as coarse.

⚠ The morph band of a level ends exactly where the next level begins, and that identity is the whole no-crack argument. A node is fully morphed into its parent's grid by the time the parent takes over, so the two agree along the boundary they share. Any other arrangement — a global morph distance, a band that stops short, a ratio applied to the wrong end — leaves the finer node's shared edge somewhere the coarser node has no vertex, which is a crack that daylight comes through.

Fields and properties (4)

  • public float NearRange

    How far level 0 reaches, in metres.

  • public int LevelCount

    How many levels there are.

  • public float MorphStartRatio

    Where in a level's band the morph starts, 0…1 of the way from the previous range to this one.

  • public static TerrainLodRanges Default

    Five levels from 64 m, morphing over the last two fifths of each band.

Methods (6)

  • public float RangeOf(int level)

    How far this level reaches, in metres. Beyond it, the next level takes over.

  • public float BandStartOf(int level)

    Where this level's band begins — the previous level's range, or zero.

  • public float MorphStartOf(int level)

    Where this level begins morphing towards its parent.

  • public float MorphEndOf(int level)

    Where this level is fully morphed into its parent. Its range, exactly.

  • public float MorphOf(int level, float distance)

    How far a node of this level has morphed at a distance, 0…1.

  • public string? Validate()

    Why these ranges cannot be used, or null if they can.

Used by (7)

  • TerrainLodTestsVixen.Terrain.Tests
  • TerrainLodTreeVixen.Terrain
  • TerrainRendererVixen.Rendering.Terrain
  • TerrainRendererTestsVixen.Rendering.Terrain.Tests
  • TerrainStreamingTestsVixen.Rendering.Terrain.Tests
  • TypeRegistrationVixen.Terrain
  • ScenePresenterVixen.Editor.App