Vixen
dd8b0a81
csharp
public static class MaterialMapNaming

What a baked material's files are called, and what a material calls them.

Read the guide page for this →

Remarks

Two vocabularies meet here and only one of them is ours. The file names are this file's to choose; the parameter names are not — Parameter reads them off the runtime feature records themselves, because WorldRenderer.Paired pairs one shader parameter with one material-side name and keys that on the feature's default. ⚠ A material that renames its map resolves nothing and samples slot zero, which is the bindless table's fallback checker: a normal map read from it is a lit surface whose shading is merely wrong, on every device, with nothing reported. So the names are read rather than typed, and a rename in MaterialFeatures.cs moves both halves at once.

⚠ The suffixes are the vocabulary a graph's Output nodes and the CLI both write against, so they are fixed here rather than composed at each call site — the argument MeshMapNaming makes for its own, and for the same reason: renaming one silently unbinds everything that asks for it.

Fields and properties (6)

  • public const string DefaultFolder

    Which folder under Assets/ a baked material goes in by default.

  • public const string PortableExtension

    What a map is written as up to and including PortableLimit.

  • public const string ContainerExtension

    And above it.

  • public const int PortableLimit

    The largest edge, in texels, that still ships as a PNG.

  • public static IReadOnlyList<MaterialMapUsage> Every

    Every usage, in the order an Output list is written.

  • public static IReadOnlyList<MaterialMapTarget> EveryTarget

    Every file a bake can write, in the order it writes them.

Methods (11)

  • public static string Suffix(MaterialMapUsage usage)

    The suffix a usage is named by, in a file name and in the provenance block.

  • public static string Suffix(MaterialMapTarget target)

    The suffix a file is named by.

  • public static bool TryParseSuffix(string? suffix, out MaterialMapUsage usage)

    The usage a suffix names.

  • public static MaterialMapTarget TargetOf(MaterialMapUsage usage)

    Which file a usage lands in.

  • public static IReadOnlyList<MaterialMapUsage> Packed(MaterialMapTarget target)

    What each of a file's channels holds, in R, G, B order.

  • public static string? Parameter(MaterialMapTarget target)

    What a material calls the map, or null where no feature samples it.

  • public static TextureContent ContentOf(MaterialMapTarget target)

    What the sampler is told the bytes mean.

  • public static TextureCompression CompressionOf(MaterialMapTarget target)

    Which block format it ships in.

  • public static float Absent(MaterialMapUsage usage)

    What a packed channel holds when the graph produced no output for it.

  • public static string FileName(string material, MaterialMapTarget target, string extension)

    What one map of a material's set is called.

  • public static string ExtensionFor(int width, int height)

    Which extension a map of this size is written with.

Used by (17)

  • BakedMaterialImageTestsVixen.Graphics.Golden.Tests
  • ForceBakeDeviceTestsVixen.Editor.Texturing.Tests
  • LayerStackBakeRouteDeviceTestsVixen.Editor.Texturing.Tests
  • MaterialBakeVixen.Editor.Assets
  • MaterialBakeAssetTestsVixen.Editor.Assets.Tests
  • MaterialBakeRouteVixen.Editor.Texturing
  • MaterialBakeRouteDeviceTestsVixen.Editor.Texturing.Tests
  • MaterialBakeTestsVixen.Editor.Assets.Tests
  • MaterialProvenanceVixen.Editor.Assets
  • MaterialSplatTestsVixen.Editor.Assets.Tests
  • ParallaxBakeDeviceTestsVixen.Editor.Texturing.Tests
  • ProjectMaterialBakerVixen.Editor.Assets
  • SplatBakeDeviceTestsVixen.Editor.Texturing.Tests
  • TextureCommandTestsVixen.Cli.Tests
  • TextureGraphRunnerVixen.Cli
  • TextureRunnerVixen.Cli
  • VixenCommandVixen.Cli