Vixen
dd8b0a81
csharp
public record class BakedMaps

A normal map and a displacement map, as pixels, with no file anywhere in sight.

Read the guide page for this →

Remarks

⚠ A bake returns pixels and writing them is the caller's job. Core/ is under the virtual-path rule — no System.IO.Path, no File — so an asset compiler, a CLI and an editor each write these where their own conventions say, and none of that reaches this assembly.

⚠ Displacement is in the model's own units and is deliberately not normalised. A displacement map quantized into [0, 1] needs a scale stored beside it or it means nothing, and half of the ways that goes wrong are the scale and the pixels being written by different code. DisplacementRange is what a caller quantizes with, and it is measured rather than assumed.

Fields and properties (18)

  • public required int Resolution

    The edge length, in texels. Both maps are this square.

  • public required IReadOnlyList<Vector3> Normals

    One normal per texel, row-major from the bottom-left, in Space.

  • public required IReadOnlyList<float> Displacement

    One signed distance per texel, in the model's own units.

  • public required IReadOnlyList<bool> Coverage

    Whether a texel is chart content rather than gutter or background.

  • public required BakeSpace Space

    Which frame Normals is in.

  • public required int Covered

    How many texels the charts covered.

  • public required int Dilated

    How many the gutter filled afterwards.

  • public required int Missed

    How many covered texels found no source at all within the search radius.

  • public required float DisplacementRange

    The largest absolute displacement, which is what a caller quantizes with.

  • public IReadOnlyList<float>? AmbientOcclusion

    The unoccluded fraction of the hemisphere per texel, or null if it was not asked for.

  • public IReadOnlyList<Vector3>? BentNormal

    The average unoccluded direction per texel, or null if it was not asked for.

  • public IReadOnlyList<float>? Curvature

    Mean curvature per texel, in reciprocal model units, or null if it was not asked for.

  • public IReadOnlyList<float>? Thickness

    How enclosed the inside is per texel, or null if it was not asked for.

  • public IReadOnlyList<Vector3>? Position

    The surface point per texel, normalised into the source's box, or null.

  • public IReadOnlyList<Vector3>? WorldNormal

    The source's normal per texel, in the source's own space, or null.

  • public IReadOnlyList<int>? Ids

    The source's material or island index per texel, -1 where there is none, or null.

  • public float CurvatureRange

    The largest absolute curvature, which is what a caller quantizes with.

  • public IReadOnlyList<string> Warnings

    What could not be baked.

Used by (7)

  • MapBakerVixen.Geometry.Remeshing
  • MapBakerTestsVixen.Geometry.Remeshing.Tests
  • MeshMapTestsVixen.Geometry.Remeshing.Tests
  • ContentTasksVixen.Editor.App
  • MeshMapBakeVixen.Editor.Assets
  • MeshMapBakesVixen.Editor.App.Tests
  • MeshMapEncodingTestsVixen.Editor.Assets.Tests