public static class ShaderGraphMaterialA compiled graph, as the material feature a .vxmat composes.
Remarks
The join, and it is mechanical because the two halves were built to meet. A Surface graph emits shader N : IMaterialSurface, and an IMaterialFeature is a name for exactly that plus the values behind it. So this reads Properties and Maps and hands back a feature — no naming rule of its own, no second convention to keep in step.
⚠ A property the caller does not name is left out of the feature, and it used to be written at its type's zero — #1126, #1133. A GraphSurfaceNumber entry overrides the generated shader's declared default, so a projection that wrote every declared property out replaced every graph default with black — this renderer's standing "zero looks like a valid value" trap. The zeros were justified by a "first composition" where no author intent existed to preserve; that moment turned out not to exist either, and a first composition wants the shader and the maps with no numbers at all, which is what this now returns for a caller that supplies none.
⚠ So this and MaterialDocument.SetGraphValue are one rule rather than two, which is what the old shape prevented: that panel had to leave an untouched property out and this deliberately did not, so the editor's only feature-writing path could not go through the join it exists to be. It does now, and the uint skip, the float/float4 dispatch and the map join are written here once.
⚠ The caller Feature was missing is the link moving, not the panel opening — MaterialDocument.LinkGraph, called when an author points a material at a graph. MaterialHeaderEdits.Graph was a bare [Inspector] property whose write composed nothing, and a material with no GraphSurfaceFeature does not compose the graph's surface at all — nothing reads MaterialAsset.Graph at draw time — so a linked graph did nothing to the picture until an author nudged a value. ⚠ The golden could not have said so: the one fixture that composes this — GraphMaterialImageTests — builds its surface from constants on the master node rather than property nodes, so Properties is empty for it and the picture cannot distinguish this projection from no projection at all.
Here rather than in the importer, because the names being joined are this compiler's own. An assembly that read a file and reconstructed albedo ⇄ albedoIndex would be a second place the generator's convention is written down.
Methods (3)
public static GraphSurfaceFeature Feature(ShaderGraphSource source, IReadOnlyDictionary<string, Vector4>? values = null)The feature a material composes to draw with this graph.
public static GraphSurfaceMap[] Maps(ShaderGraphSource source)The texture pairing a material composing this graph carries.
public static ImmutableArray<ShaderGraphProperty> Values(ShaderGraphSource source)Every property a material is expected to set, and the width each is.
Used by (5)
- GraphMaterialImageTestsVixen.Graphics.Golden.Tests
- GraphMaterialTestsVixen.Editor.ShaderGraph.Tests
- MaterialDocumentVixen.Editor.AssetEditors
- MaterialGraphPropertyTestsVixen.Editor.AssetEditors.Tests
- MaterialViewVixen.Editor.AssetEditors