Vixen
dd8b0a81
csharp
public static class MaterialBakeParallax

The ask a first bake had no way to make: turn the height march on.

Read the guide page for this →

Remarks

#1103's remainder, and it is an authoring route rather than a rendering change. A bake writes a height map for whatever wants it and composes no ParallaxOcclusionFeature for it, because composing one would put a per-pixel march on every material any graph ever emitted a height output from. What Material does instead is preserve and re-seat a feature the material already carries — which by construction cannot help a material that does not exist yet. So the route was two steps, bake and add the feature and bake again, and the baker at least says so in a warning naming the tag to paste. A route a tool describes is not a route the tool offers; this is the offer.

⚠ Nothing here decides where the feature goes, and that is the whole of why it is safe. ParallaxOcclusionFeature declares Coordinate and MaterialCompiler refuses a coordinate feature listed behind one that samples — so a naive "append it" writes a .vxmat the bake itself produced and the importer then rejects. This asks Material to compose the material a second time with the feature present, and that is what seats it at index 0, re-points its HeightMap at the name WorldRenderer.Paired keys on, and drops it again if this bake wrote no height map. One rule, in one place, with a flag in front of it.

⚠ Applied after the write rather than seeded before it. A seed .vxmat would have to be written at the path the bake is going to choose, and that path is ProjectMaterialBaker's: a name already owned by a different source becomes Name_2, so a seed guessing the name either lands beside the set or on somebody else's material. Re-composing what the bake actually wrote needs no guess.

⚠ A material that did not ask still does not get one. The flag is the ask, it is off by default in both hosts, and a bake without it is byte-identical to the bake before this existed.

⚠ It lives here rather than in Vixen.Cli, which is where it shipped, and the move is what let the editor have it. Vixen.Cli is an executable and build/Build.ArchitectureRules.cs treats Editor and Tools as peers, so the editor could not reference the rule and a second copy of it in Vixen.Editor.Texturing would be a second answer to "where does a coordinate feature go". Both hosts call this one.

Fields and properties (1)

  • public const string Tag

    The YAML tag an author would paste, and what the bake's own warning names.

Methods (1)

  • public static IReadOnlyList<string> Requested(MaterialBakeSet set, out string? refused)

    Puts a parallax feature on the material a bake just wrote.

Used by (5)

  • MaterialBakeRouteVixen.Editor.Texturing
  • ParallaxBakeDeviceTestsVixen.Editor.Texturing.Tests
  • TextureCommandTestsVixen.Cli.Tests
  • TextureGraphRunnerVixen.Cli
  • TextureRunnerVixen.Cli