Vixen
dd8b0a81
csharp
public sealed class SurfaceMasterNode

A metal-rough surface a material composes, lit by the scene.

Read the guide page for this →

As a graph node

Create menu
Master/Surface

Remarks

The master that makes a graph draw, and the only one that does. The other three emit a whole shader with its own stages and its own transforms — readable, previewable, and impossible for anything in the engine to put on a mesh, because a draw binds a transform record, a light cluster, a shadow atlas and a bindless table by names such a shader does not declare. This one emits an IMaterialSurface instead: MaterialCompiler composes it into CompositeSurface beside MetalRoughnessSurface and the rest, so a graph-authored material is lit, shadowed and drawn by exactly the path every hand-authored one already takes. No new render feature, no new pass, no new binding convention.

⚠ It contributes rather than replaces, which is what inout means in MaterialSurface.rvn and what makes the chain a chain. A channel this master does not write keeps whatever the features before it left — so a graph wired only to BaseColour is a base-colour contribution, not a surface with its roughness reset to whatever a default happened to be.

The lighting is the engine's, and that is the difference from Master/PBR. That master carries an inline Lambert-plus-GGX with one directional light out of uniforms, and its own remarks call that the first half of the job; this one writes channels and lets StandardShading and the clustered pass do the shading, which is the "later step" those remarks were describing.

Fields and properties (9)

  • public Float3 BaseColour

    Albedo for a dielectric, specular tint for a conductor. Linear.

  • public Scalar Metallic

    How much of a conductor it is, 0..1.

  • public Scalar Roughness

    Perceptual roughness, as authored.

  • public Float3 Normal

    A tangent-space normal, wired only when the graph has one.

  • public Float3 Emission

    What it emits on its own, in the frame's photometric units.

  • public Scalar Occlusion

    How much ambient light reaches it, 0..1.

  • public Scalar Alpha

    How opaque it is.

  • protected internal override ShaderGraphKind Kind

    What shape of shader this master makes the graph.

  • public static NodeTypeDefinition Definition

    What this node type is, for the registry. Generated.

Methods (2)

  • protected internal override void Emit(RavenEmitter emitter)

    Writes whatever this node contributes.

  • public override void Bind(NodeBinding binding)

    Fills the port fields from what the compiler resolved. Generated.

Used by (1)

  • NodeTypesVixen.Editor.ShaderGraph