public static class MaterialBakeTurns a graph's outputs into the files and the material a project can read.
Remarks
docs/plan/48 § D11, and the seam is a picture rather than a plan. Nothing here knows about TexturePlan, a device or a queue: a bake evaluates the graph, reads its outputs back as bitmaps, and hands them to Encode. That is what lets every decision that can be wrong — which channel roughness goes in, what an absent channel holds, which size crosses into a container, which block format each map ships in — be proved against arrays a test wrote by hand, with no adapter and no disk.
⚠ Two write paths, and they differ in when rather than in what. Up to PortableLimit a map is a PNG whose sidecar names the mips and the block format, and TextureImporter applies both at build time. Above it the same mip chain and the same block format are encoded here, into a KTX2 the importer passes straight through. One table — CompressionOf — drives both, so a 2048 bake and a 4096 bake of one graph do not ship in different formats.
Methods (4)
public static IReadOnlyList<MaterialMapImage> Encode(IReadOnlyDictionary<MaterialMapUsage, Bitmap> outputs)Encodes a graph's outputs into the files a material samples.
public static MaterialMapImage Splat(IReadOnlyList<Bitmap> coverage)Packs a layered material's per-layer coverage into one splat map.
public static MaterialContent Material(IReadOnlyDictionary<MaterialMapTarget, AssetReference> maps, MaterialContent? existing = null)The material a bake's files are sampled by.
public static MaterialContent Splatted(MaterialContent existing, AssetReference splat, int layers)Binds a freshly written splat map onto the material that paints from it.
Used by (10)
- BakedMaterialImageTestsVixen.Graphics.Golden.Tests
- BakedMaterialFileTestsVixen.Editor.AssetEditors.Tests
- MaterialBakeAssetTestsVixen.Editor.Assets.Tests
- MaterialBakeParallaxVixen.Editor.Assets
- MaterialBakeRouteVixen.Editor.Texturing
- MaterialBakeTestsVixen.Editor.Assets.Tests
- MaterialSplatTestsVixen.Editor.Assets.Tests
- ProjectMaterialBakerVixen.Editor.Assets
- TextureGraphRunnerVixen.Cli
- TextureRunnerVixen.Cli