Vixen
dd8b0a81
csharp
public sealed class ShaderGraphImporter

Checks a .vxshadergraph, and writes nothing.

Read the guide page for this →

As a importer

Extensions
.vxshadergraph

Remarks

⚠ One of the five extensions the editor's own Create menu writes, opens and saves and no importer claimed — docs/overview.md records the set, and CreateAssetMenuAttribute's remarks state the contract it broke. Without this the fallback took a graph as a Blob no typed reader resolves.

⚠ It writes no artefact, and that is the one place it departs from every other importer in this assembly. What a shader graph produces is Raven source, and source is not content: it is an input to a shader compilation, which ShaderGraphSources assembles for the editor and for ShaderBuildRunner at the moment one is needed. Writing the text into the artefact store would put a second copy of it behind an address nothing resolves, and would make the compilation depend on an import having run — which is exactly the coupling that stops an editor opening a project it has not built.

So what this is for is the diagnostics. It compiles the graph to find out whether it is one, on MaterialImporter's terms — "this graph has two masters", "this surface reads a world position" — and reports them beside the file that caused them rather than as a shader that mysteriously fails to appear. A graph that does not compile is an error here even though nothing is written, because a material naming it resolves to an effect miss, which is a draw that does not happen with nothing in the log about a material.

A standalone graph is imported without complaint. It is a legitimate thing to have — a preview thumbnail is one, and so is a shader an author hands to raven compile — and only a surface graph reaches a material.

Fields and properties (1)

  • public override int Version

Methods (1)

Used by (2)

  • BuiltInImportersVixen.Editor.Assets
  • ShaderGraphSourceTestsVixen.Editor.Assets.Tests