Manual
Writing your own node
Derive from PassNode, declare ports, and record passes:
[Serializable]
public sealed class MyNode : PassNode
{
static readonly PortDef[] k_Inputs = { new PortDef("Source") };
static readonly PortDef[] k_Outputs = { new PortDef("Result") };
public override string displayName => "My Node";
public override PortDef[] GetInputPorts() => k_Inputs;
public override PortDef[] GetOutputPorts() => k_Outputs;
public override void Record(PassGraphContext ctx)
{
var source = ctx.GetInput(0);
// declare passes on ctx.renderGraph here
ctx.SetOutput(0, source);
}
}
The add menu finds it automatically. Serialized fields appear on the node in the graph editor, with their tooltips.
A node whose picture changes over time, such as one whose shader reads _Time, calls PassForgeEditPreview.KeepDrawing(ctx.cameraData.camera) in Record on every frame that moves. Preview In Edit Mode then keeps that camera's view drawing outside Play Mode. An [ExecuteAlways] component that moves calls PassForgeEditPreview.KeepDrawing() from its Update. The calls do nothing in Play Mode or while the preview is off, and players leave them out.
Pass Forge protects its own node types from managed code stripping, but it cannot see yours. Add a link.xml under Assets that preserves the assembly your node lives in. Without it an IL2CPP build can strip the node, and the graph renders nothing while the editor still works.