Vixen
dd8b0a81
csharp
public static class MaterialProvenance

The texturing: block in a baked material's sidecar, and the check it buys.

Read the guide page for this →

Remarks

docs/plan/48 § D4, which is doc 40 § D7's provenance block reused in shape. Source, outputs, resolution, parameters, adapter, a digest and a timestamp — everything needed to say what produced these bytes, on the one file that is not itself an output.

⚠ Flat dotted keys rather than the nested mapping § D4 sketches. A sidecar's extensions are a Dictionary<string, string>, which is what meshMap.usage and every other extension in the tree already writes into; a nested block would need a second shape in the meta format for one consumer. What the sketch is about is which facts are recorded, and all of them are.

⚠ The digest covers the maps and not the .vxmat. The point of it is that a file somebody painted over is detected — and a material an artist edited in the inspector is not that. Including the material would make raising its emissive intensity look identical to painting on a normal map, and the bake would refuse to run for a reason nobody could act on.

Fields and properties (15)

  • public const string SourceKey

    The key naming where the maps came from.

  • public const string SourceAssetKey

    The key naming the asset that produced them, where there is one.

  • public const string SetKey

    The key naming which of the source's texture sets produced this material.

  • public const string OutputsKey

    The key listing which files were written.

  • public const string ResolutionKey

    The key naming what size they were baked at.

  • public const string ParameterPrefix

    The prefix each exposed parameter is written under.

  • public const string AdapterKey

    The key naming the adapter that ran the bake.

  • public const string DigestPrefix

    The prefix each output's own digest is written under.

  • public const string WrittenDigestKey

    The key holding the digest over all of them.

  • public const string AtKey

    The key holding when the bake ran.

  • public const string SplatSourceKey

    The key naming where a splat write's weights came from.

  • public const string SplatAtKey

    And when it ran.

  • public const string MapKey

    The key on a map's own sidecar saying which of the seven it is.

  • public const string MaterialKey

    And which material's set it belongs to.

  • public const string Separator

    What separates the entries of OutputsKey.

Methods (6)

  • public static string KeyOf(MaterialBakeRecord record)

    What identifies the source a set was baked from, for keying the set on.

  • public static string KeyIn(IReadOnlyDictionary<string, string> extensions)

    And the same key as a written sidecar records it.

  • public static string Digest(ReadOnlySpan<byte> bytes)

    The digest of some bytes, as the sidecar writes it.

  • public static string Written(IReadOnlyList<MaterialMapImage> images)

    The digest over a whole set, which is the digests of its parts.

  • public static Dictionary<string, string> Describe(MaterialBakeRecord record, IReadOnlyList<MaterialMapImage> images, DateTimeOffset at)

    The block a bake writes into the material's sidecar.

  • public static IReadOnlyList<MaterialMapTarget> Painted(IReadOnlyDictionary<string, string> recorded, IReadOnlyDictionary<MaterialMapTarget, byte[]> present)

    Which of a set's outputs no longer match what the bake wrote.

Used by (6)

  • LayerStackBakeRouteDeviceTestsVixen.Editor.Texturing.Tests
  • MaterialBakeAssetTestsVixen.Editor.Assets.Tests
  • MaterialBakeRouteDeviceTestsVixen.Editor.Texturing.Tests
  • ProjectMaterialBakerVixen.Editor.Assets
  • ProjectMeshMapBakerVixen.Editor.App
  • TextureCommandTestsVixen.Cli.Tests