Vixen
dd8b0a81
csharp
public readonly record struct UvIsland

A flattened chart, in its own coordinates, waiting to be placed in an atlas.

Read the guide page for this →

Remarks

This is the value that makes Pack a peer of a standalone packer rather than an internal detail. docs/plan/42 § D1: an artist who cut seams by hand in another package wants those seams kept and the islands rearranged, and that is most of why a standalone packer is a product at all. An island can therefore come from this library's own charter, from the remesher's patch layout, or from a file — the packer does not ask.

⚠ Coordinates are per corner, not per position, and that is not an implementation detail. A seam is one shared position whose two sides carry different coordinates; EditMesh's corner layer represents that for nothing, and a per-vertex structure represents it by duplicating the vertex. Doing the arithmetic in the representation where a seam is free is what keeps the split at the very end, where a renderer wants it, instead of threaded through every stage.

⚠ Scale travels with the island because the packer is allowed to move it and not to resize it. docs/plan/42 § D9: non-uniform texel density is invisible in the atlas and glaring in the game — the classic symptom being a character's face at half the resolution of their boots — so a packer that quietly rescales an island to make it fit has to be able to say that it did.

Fields and properties (7)

  • public IReadOnlyList<Vector2> Coordinates

    A coordinate per corner of .

  • public IReadOnlyList<int> Corners

    The triangle corners this island covers, three per triangle.

  • public Vector2 Minimum

    The island's lower corner, in ' space.

  • public Vector2 Maximum

    Its upper corner.

  • public float Scale

    Coordinates per world unit, so that texel density is a fact rather than a guess.

  • public int TriangleCount

    How many triangles the island covers.

  • public Vector2 Size

    How wide and how tall the island is.

Methods (1)

  • public UvIsland(IReadOnlyList<Vector2> Coordinates, IReadOnlyList<int> Corners, Vector2 Minimum, Vector2 Maximum, float Scale)

    A flattened chart, in its own coordinates, waiting to be placed in an atlas.

Used by (34)

  • AttemptVixen.Geometry.Uv
  • FlattenFixturesVixen.Geometry.Uv.Tests
  • FlattenOutcomeVixen.Geometry.Uv
  • FlattenerVixen.Geometry.Uv
  • IslandCorpusVixen.Geometry.Uv.Tests
  • IslandMaskVixen.Geometry.Uv
  • IslandShapeVixen.Geometry.Uv
  • IslandSpaceVixen.Geometry.Uv.Tests
  • LayoutAtlasVixen.Geometry.Remeshing
  • PackedAtlasVixen.Geometry.Uv.Tests
  • PackerVixen.Geometry.Uv
  • RasterizerVixen.Geometry.Uv
  • UvAllTestsVixen.Geometry.Uv.Tests
  • UvDensityVixen.Geometry.Uv
  • UvDensityTestsVixen.Geometry.Uv.Tests
  • UvFlattenBijectivityTestsVixen.Geometry.Uv.Tests
  • UvFlattenCotangentTestsVixen.Geometry.Uv.Tests
  • UvFlattenDeterminismTestsVixen.Geometry.Uv.Tests
  • UvFlattenDistortionTestsVixen.Geometry.Uv.Tests
  • UvFlattenTestsVixen.Geometry.Uv.Tests
  • UvLayeringTestsVixen.Geometry.Uv.Tests
  • UvPackMarginTestsVixen.Geometry.Uv.Tests
  • UvPackPropertyTestsVixen.Geometry.Uv.Tests
  • UvPackingTestsVixen.Geometry.Uv.Tests
  • UvPlacementVixen.Geometry.Uv
  • UvStackingVixen.Geometry.Uv
  • UvStackingTestsVixen.Geometry.Uv.Tests
  • UvUdimTestsVixen.Geometry.Uv.Tests
  • UvUnwrapVixen.Geometry.Uv
  • UvUnwrapPipelinePropertyTestsVixen.Geometry.Uv.Tests
  • BlockoutUvPanelVixen.Editor.Blockout
  • GeometryRunnerVixen.Cli
  • ModelGeometryVixen.Editor.Assets
  • ModelGeometryIslandTestsVixen.Editor.Assets.Tests