API
Render graph and custom nodes
Graphs, nodes and the renderer feature that runs them, in the PassForge namespace. A custom node derives from PassNode: see "Writing your own node" in the guide.
GraphCompiler
Turns an authored PassGraphAsset into a CompiledGraph. Runs a topological sort, detects cycles, resolves every edge into a slot index, and gathers validation messages from the nodes.
public static class GraphCompiler
Namespace PassForge, assembly PassForge.Runtime.
GraphCompiler.Compile(PassGraphAsset)
Compiles a graph. Never returns null and never throws for authoring mistakes; a graph that cannot run comes back with CompiledGraph.valid false and the reason in CompiledGraph.report.
public static CompiledGraph Compile(PassGraphAsset asset)
NodeExecutors
Static render callbacks shared by every node. They are cached in static readonly fields so that passing them to SetRenderFunc does not allocate a delegate each frame.
public static class NodeExecutors
Namespace PassForge, assembly PassForge.Runtime.
NodeExecutors.blit
Full screen blit, or a bare triangle draw when the node has no source texture.
public static readonly BaseRenderFunc<NodePassData, RasterGraphContext> blit
NodeExecutors.drawRenderers
Draws a renderer list into the bound attachments.
public static readonly BaseRenderFunc<NodePassData, RasterGraphContext> drawRenderers
NodeExecutors.clear
Clears the bound attachments and draws nothing else.
public static readonly BaseRenderFunc<NodePassData, RasterGraphContext> clear
NodeExecutors.copy
Straight texture copy with no material involved.
public static readonly BaseRenderFunc<NodePassData, RasterGraphContext> copy
NodeExecutors.noOp
Does nothing. Used by nodes whose only job is to declare a resource dependency.
public static readonly BaseRenderFunc<NodePassData, UnsafeGraphContext> noOp
NodeExecutors.setGlobals
Publishes the node's vectors as globals and draws nothing.
public static readonly BaseRenderFunc<NodePassData, UnsafeGraphContext> setGlobals
PassForgeEditPreview
Ties code that draws to Preview In Edit Mode, which keeps the Scene and Game views drawing outside Play Mode while something Pass Forge draws moves. Calls do nothing in Play Mode and are removed from players.
public static class PassForgeEditPreview
Namespace PassForge, assembly PassForge.Runtime.
PassForgeEditPreview.isOn
True in the editor while Preview In Edit Mode is on and the editor is not in Play Mode. Always false in a player.
public static bool isOn { get; }
PassForgeEditPreview.KeepDrawing()
Says that what is drawn moves, so the Scene and Game views keep drawing while the preview is on. Call it from your node's Record, or from an [ExecuteAlways] component's Update, on every frame that moves.
public static void KeepDrawing()
PassForgeEditPreview.KeepDrawing(Camera)
As KeepDrawing(), but only for the view that camera draws: the Scene view or the Game view. A null camera keeps both drawing.
public static void KeepDrawing(Camera camera)
CompiledGraph
Execution ready form of a PassGraphAsset. Everything the executor needs per frame is baked into flat arrays here, so recording a graph performs no lookups, no sorting and no allocation.
public sealed class CompiledGraph
Namespace PassForge, assembly PassForge.Runtime.
CompiledGraph.report
Messages produced while compiling and validating.
public readonly GraphReport report
CompiledGraph.valid
True when the graph can be executed. False means it is skipped entirely.
public bool valid { get; }
CompiledGraph.nodeCount
Node count in the compiled order.
public int nodeCount { get; }
CompiledGraph.FormatMessages()
Formats every error and warning as a single multi line string.
public string FormatMessages()
NodePassData
The single pass data type every node uses. Render graph pools pass data per type, so sharing one type across all nodes keeps recording allocation free and, unlike code generation or reflection, needs nothing at build time. Pooled instances are reused across frames, so a node must call Reset and then set every field it depends on.
public sealed class NodePassData
Namespace PassForge, assembly PassForge.Runtime.
NodePassData.maxTextureBinds
Maximum number of textures a single node can bind to shader properties.
public const int maxTextureBinds = 8
NodePassData.maxVectorBinds
Maximum number of vectors a single node can bind to shader properties.
public const int maxVectorBinds = 40
NodePassData.maxKeywords
Maximum number of global shader keywords a single node can set.
public const int maxKeywords = 8
NodePassData.material
Material used to draw, or null for a node that only clears or draws renderers.
public Material material
NodePassData.shaderPass
Shader pass index within material.
public int shaderPass
NodePassData.hasSource
True when source should be blitted through material.
public bool hasSource
NodePassData.source
Texture fed to the blit.
public TextureHandle source
NodePassData.scaleBias
Scale and bias applied to the blit source coordinates.
public Vector4 scaleBias
NodePassData.bindCount
Number of entries in bindIds and bindHandles.
public int bindCount
NodePassData.bindIds
Shader property ids to bind textures to.
public readonly int[] bindIds
NodePassData.bindHandles
Textures to bind, paired with bindIds.
public readonly TextureHandle[] bindHandles
NodePassData.vectorCount
Number of entries in vectorIds and vectorValues.
public int vectorCount
NodePassData.vectorIds
Shader property ids to bind vectors to.
public readonly int[] vectorIds
NodePassData.vectorValues
Vectors to bind, paired with vectorIds.
public readonly Vector4[] vectorValues
NodePassData.keywordCount
Number of entries in keywords and keywordStates.
public int keywordCount
NodePassData.keywords
Global keywords to set before drawing.
public readonly GlobalKeyword[] keywords
NodePassData.keywordStates
Whether each keyword in keywords is turned on.
public readonly bool[] keywordStates
NodePassData.customData
Data a node owns and reads back in its own render function, such as a list of renderers to draw. Set it to an object the node keeps, never to a new one per frame.
public object customData
NodePassData.vectorArray
Vector array bound as a global before drawing, or null for none.
public Vector4[] vectorArray
NodePassData.vectorArrayId
Shader property vectorArray is bound to.
public int vectorArrayId
NodePassData.scissor
Rectangle, in pixels of the render target, that drawing is limited to when hasScissor is set.
public Rect scissor
NodePassData.hasScissor
Draw only inside scissor.
public bool hasScissor
NodePassData.rendererList
Renderer list drawn by a draw renderers node.
public RendererListHandle rendererList
NodePassData.hasRendererList
True when the node draws a renderer list rather than a full screen triangle.
public bool hasRendererList
NodePassData.clearColor
Clears the bound color attachment before drawing.
public bool clearColor
NodePassData.clearDepth
Clears the bound depth attachment, and its stencil, before drawing.
public bool clearDepth
NodePassData.clearStencil
Clears only the stencil of the bound depth attachment before drawing.
public bool clearStencil
NodePassData.clearValue
Color written when clearColor is set.
public Color clearValue
NodePassData.spriteShaderPass
Pass that draws the Sprite Renderers of an object list, or -1 to leave sprites out.
public int spriteShaderPass
NodePassData.proceduralVertexCount
Vertices the bare draw of a pass with no source draws: 3 for a full screen triangle, more for passes that build quads from SV_VertexID, such as Damage Numbers.
public int proceduralVertexCount
NodePassData.Reset()
Returns the instance to a known state. Pooled data carries values from earlier frames, so every node calls this before filling in what it needs.
public void Reset()
NodePassData.AddBind(int, TextureHandle)
Queues a texture to bind to a shader property. Silently ignores binds past maxTextureBinds, which the node reports as a validation warning instead.
public void AddBind(int propertyId, TextureHandle handle)
NodePassData.AddKeyword(GlobalKeyword, bool)
Queues a global shader keyword to turn on or off before drawing.
public void AddKeyword(GlobalKeyword keyword, bool enabled)
NodePassData.AddVector(int, Vector4)
Queues a vector to bind to a shader property. This is how a node gives each of its passes a different value; setting it on the material instead would leave every pass reading whatever the last one wrote, because materials are read at execution time. A vector past maxVectorBinds is dropped, which fails an assertion in the editor and in development builds, so a pass can never lose one unnoticed.
public void AddVector(int propertyId, Vector4 value)
NodePassData.SetVectorArray(int, Vector4[])
Queues a vector array to bind to a shader property. The array is read when the pass executes, so it must stay unchanged until then, and should always have the same length because Unity fixes a global array's size the first time it is set.
public void SetVectorArray(int propertyId, Vector4[] values)
AllocTextureNode
Allocates an intermediate render graph texture for this frame. Chaining passes through intermediate textures is what a graph can do that a single stock full screen feature cannot, so this node is the backbone of blur chains, mask buffers and multi step effects.
public sealed class AllocTextureNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
AllocTextureNode.textureName
Name this texture appears under in the frame debugger.
public string textureName { get; set; }
AllocTextureNode.scale
Fraction of the camera resolution used when the size mode is camera relative.
public float scale { get; set; }
AllocTextureNode.kind
Which attachments this node allocates.
public TextureKind kind { get; set; }
AllocTextureNode.colorFormat
Color format used when not matching the camera.
public GraphicsFormat colorFormat { get; set; }
BlitNode
Draws a full screen triangle through a material, reading one texture and writing another. Unlike a stock full screen feature, both ends are graph ports, so a chain of these can run through intermediate buffers at different resolutions before anything touches camera color. Leave Source empty for a material that only blends over the target. Connect Depth Stencil to let the material's own stencil and depth tests run, for example against a Stencil Mask.
public sealed class BlitNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
BlitNode.material
Material used to draw the full screen triangle.
public Material material { get; set; }
BlitNode.loadTargetContents
Keeps what is already in the target, for a material that blends over it.
public bool loadTargetContents { get; set; }
BlurChainNode
Blurs a texture by walking it down a resolution pyramid and back up again. This is the node that a single stock full screen feature cannot stand in for: it allocates its own chain of intermediate textures and runs a pass per step, reading what the previous step wrote.
public sealed class BlurChainNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
BlurChainNode.downsamplePass
Shader pass index of the downsample step in the blur material.
public const int downsamplePass = 0
BlurChainNode.upsamplePass
Shader pass index of the upsample step in the blur material.
public const int upsamplePass = 1
BlurChainNode.material
Material used for both the downsample and upsample steps.
public Material material { get; set; }
BlurChainNode.iterations
How many times the texture is halved.
public int iterations { get; set; }
DrawRenderersNode
Draws scene geometry, filtered by layer, into a target the graph owns. The stock Render Objects feature can only draw into the camera target, so rendering a layer into a private mask buffer and reading it back in a later pass is the thing this node exists for.
public sealed class DrawRenderersNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
DrawRenderersNode.passName
Name this pass appears under in the frame debugger.
public string passName { get; set; }
DrawRenderersNode.layerMask
Which objects this node draws.
public LayerMask layerMask { get; set; }
DrawRenderersNode.renderingLayerMask
Which objects this node draws, by rendering layer.
public RenderingLayerMask renderingLayerMask { get; set; }
DrawRenderersNode.overrideMaterial
Material drawn instead of each object's own, or null to keep theirs.
public Material overrideMaterial { get; set; }
DrawRenderersNode.clearColorTarget
Clears the color target before drawing.
public bool clearColorTarget { get; set; }
DrawRenderersNode.clearColorValue
Color written when the color target is cleared.
public Color clearColorValue { get; set; }
AfterimageNode
Leaves fading ghosts behind every object carrying a PassForgeAfterimage component. Ghosts standing in the world are drawn again each frame where the object was; ghosts kept on the picture live in a history each camera carries from frame to frame. Both are laid over the picture.
public sealed class AfterimageNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
AfterimageNode.material
Material using the objects shader.
public Material material { get; set; }
IEffectMaterialNode
A node whose material Pass Forge assigns from a shader name when the node is created.
public interface IEffectMaterialNode
Namespace PassForge, assembly PassForge.Runtime.
IEffectMaterialNode.defaultShaderName
Name of the shader the node's material uses.
string defaultShaderName { get; }
IEffectMaterialNode.material
The node's material.
Material material { get; set; }
EffectCategoryNode
Base for nodes that run a category of ready made screen effects from the Volumes affecting each camera. Every effect is one full screen pass of the category shader, found by name, and costs nothing while it is off. Effects can run at a reduced resolution and can be limited to objects marked with Pass Forge Effect Mask. It is not an extension point: in this version only Pass Forge's own category nodes derive from it. A node of your own derives from PassNode.
public abstract class EffectCategoryNode : PassNode, IEffectMaterialNode
Namespace PassForge, assembly PassForge.Runtime.
EffectCategoryNode.entries
Effects the node runs, in the order it runs them.
public abstract Entry[] entries { get; }
EffectCategoryNode.defaultShaderName
Name of the shader the node's material uses.
public abstract string defaultShaderName { get; }
EffectCategoryNode.categoryName
Name of the category, used as the node title.
protected abstract string categoryName { get; }
EffectCategoryNode.material
The node's material.
public Material material { get; set; }
EffectCategoryNode.drawsNow
False while another node of the graph draws this one's effects instead, as the gameplay effects move under the screen looks; the picture then passes through untouched.
protected virtual bool drawsNow { get; }
EffectCategoryNode.Entry
An effect the node runs and the name of the shader pass that draws it.
public readonly struct Entry
Namespace PassForge, assembly PassForge.Runtime.
new EffectCategoryNode.Entry(Type, string)
Creates an entry.
public Entry(Type effect, string pass)
EffectCategoryNode.Entry.effect
The effect's Volume component type, derived from ShaderPassEffect.
public readonly Type effect
EffectCategoryNode.Entry.pass
Name of the shader pass that draws the effect.
public readonly string pass
EffectMaskNode
Draws the objects marked for masks into a mask, so later effect nodes in the graph can limit an effect to those objects or leave them out of it: the objects carrying Pass Forge Effect Mask, and every renderer on the rendering layers chosen with PassForgeEffectMask.renderingLayers or a Pass Forge Effect Mask Layers. Costs nothing while no object is marked and no layer is chosen.
public sealed class EffectMaskNode : PassNode, IEffectMaterialNode
Namespace PassForge, assembly PassForge.Runtime.
EffectMaskNode.defaultShaderName
Name of the shader the node's material uses.
public string defaultShaderName { get; }
EffectMaskNode.material
The node's material.
public Material material { get; set; }
FinishingEffectsNode
Runs the finishing screen effects last, on the finished picture, in this order: Screen Shake, Sharpen, Light Leaks, Letterbox, Transition, Color Vision and Deband. Each active effect costs one full screen pass; effects that are off cost nothing.
public sealed class FinishingEffectsNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
GameplayEffectsNode
Runs the gameplay screen effects, in this order: Screen Warps, Route, Ground Markers, Beacons, Time Stop, Shockwave, Hallucination, Speed Lines, Tethers, Lens Blood, Off-screen Indicators, Spotlight, Feedback Vignette, Damage Direction, Impact Frame, Damage Numbers and Blink. The route's line lies on the ground under the Ground Markers, so an attack warning paints over the way to go. Lens Blood sits on the lens in front of the world, so the indicators, hit directions and numbers after it stay readable over the blood. Damage Numbers come after Impact Frame, so a critical number keeps its color through the frame, and before Blink, whose eyelids cover them. Each active effect costs one full screen pass, except Damage Numbers, which draws small quads where its characters are, and Route, which draws a quad around each piece of its line. Those two first copy the picture unless an effect earlier in this order drew it that frame, and Route also while a Mask limits it, so Route copies unless Screen Warps drew. Effects that are off cost nothing.
public sealed class GameplayEffectsNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
GameplayUnderLooksNode
The gameplay effects of GameplayEffectsNode, drawn before the screen looks while a Volume's HUD Under Looks is on, so a look such as Old Television, Watercolor or Noir covers the indicators, markers, blood and numbers too. It sits right after tonemapping, before Screen Effects, Painterly, the stylize stack, Illustration, Retro and Vision. With the setting off it draws nothing and costs nothing.
public sealed class GameplayUnderLooksNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
HighlightNode
Draws outlines, glow, see-through silhouettes, overlays, patterns, surface styles and brackets on every object carrying a PassForgeHighlight component, and the flashes started with PassForgeHighlight.Flash(Color, float). Objects that share a HighlightProfile are drawn together, so the cost follows the number of distinct profiles on screen rather than the number of objects.
public sealed class HighlightNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
HighlightNode.material
Material using the objects shader.
public Material material { get; set; }
IllustrationEffectsNode
Runs the illustration screen effects in this order: Line Art, Paper Cutout, Mosaic, Print, Digital Rain, Line Boil and Animate On Twos. Each active effect costs one full screen pass; effects that are off cost nothing.
public sealed class IllustrationEffectsNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
InterfaceEffectsNode
Runs the interface screen effects in this order: Privacy Blur, Reveal Lens and Panel Backdrop, which keeps a blurred copy of the picture for frosted UI. Effects that are off cost nothing.
public sealed class InterfaceEffectsNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
LensEffectsNode
Runs the lens screen effects on the scene before URP's post processing, while colors still hold their full range, in this order: Eye Adaptation, Aerial Perspective, Focus Blur and Lens Glow. Effects that are off cost nothing.
public sealed class LensEffectsNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
PainterlyNode
Runs the Painterly Volume effect: brush strokes computed at reduced resolution, then composited at full resolution with paint relief, canvas, ink lines and color controls.
public sealed class PainterlyNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
PainterlyNode.strokesPass
Shader pass that paints Boxes strokes.
public const int strokesPass = 0
PainterlyNode.compositePass
Shader pass that composites strokes, relief, canvas and ink.
public const int compositePass = 1
PainterlyNode.tensorPass
Shader pass that measures the direction of edges.
public const int tensorPass = 2
PainterlyNode.tensorBlurPass
Shader pass that smooths the measured directions along one axis.
public const int tensorBlurPass = 3
PainterlyNode.flowingStrokesPass
Shader pass that paints Flowing strokes along the measured directions.
public const int flowingStrokesPass = 4
PainterlyNode.material
Material using the painterly shader.
public Material material { get; set; }
RetroEffectsNode
Runs the retro and digital screen effects in this order: PSX, JPEG Artifacts, Pixel Sort, Datamosh, Data Fragments and VHS Rewind. Effects that are off cost nothing.
public sealed class RetroEffectsNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
ScreenEffectsNode
Runs the Pass Forge screen effects library from the Volumes affecting each camera, in this order: Scan Pulse, Distortion, Kaleidoscope, Radial Blur, Vision, Watercolor, Sketch, Halftone, ASCII, Glitch and Old Film. Each active effect costs one full screen pass; effects that are off cost nothing.
public sealed class ScreenEffectsNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
ScreenEffectsNode.material
Material using the screen effects shader.
public Material material { get; set; }
StylizeStackNode
Runs the CRT, VHS, Pixelate and Retro Volume effects in a single full screen pass. Each effect is switched in with a shader keyword only while it is active for the camera, so any mix of the four costs one pass, and none of them costs nothing at all.
public sealed class StylizeStackNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
StylizeStackNode.material
Material using the stylize shader.
public Material material { get; set; }
MotionTrailsNode
Runs the Motion Trails Volume effect. Keeps a history per camera, fades it, adds the current frame to it, and blends the result over the picture.
public sealed class MotionTrailsNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
MotionTrailsNode.material
Material using the temporal shader.
public Material material { get; set; }
FeedbackNode
Runs the Feedback Volume effect. Each frame transforms the previous result into an echo, blends it with the picture, and keeps the blend as the next frame's history.
public sealed class FeedbackNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
FeedbackNode.material
Material using the temporal shader.
public Material material { get; set; }
TonemappingNode
Runs the tonemapping effects on the picture URP's post processing hands over, before every other effect after post processing: AgX Tonemapping. Order -100 keeps it first wherever it sits in the graph. It runs in the Scene view too, as URP's own tonemapping does, even where the feature keeps the other effects out of it. Where something keeps AgX from showing, such as URP's own Tonemapping being on, it records nothing, so the picture is never tonemapped twice, and the reason is kept for AgxTonemappingEffect.Status.
public sealed class TonemappingNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
new TonemappingNode()
Creates the node with Order -100, so it runs before the other effects after post processing.
public TonemappingNode()
VisionEffectsNode
Runs the vision screen effects, in this order: Sonar Reveal, Color FX, Camera Feed and Scope. Each active effect costs one full screen pass; effects that are off cost nothing.
public sealed class VisionEffectsNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
WeatherEffectsNode
Runs the weather screen effects after the lens effects, in this order: Screen Rain, Screen Flash and Weather Lens. Effects that are off cost nothing.
public sealed class WeatherEffectsNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
WorldEffectsNode
Runs the world effects on the scene before URP's post processing, in this order: Cavity, Surface Cover, SSR Lite, Caustics, Cloud Shadows, Flash Lights, Height Fog, Fog of War and God Rays. They read scene depth and normals, which sprites on the 2D Renderer leave empty, so there they show nothing or treat the whole picture as far away. Effects that are off cost nothing.
public sealed class WorldEffectsNode : EffectCategoryNode
Namespace PassForge, assembly PassForge.Runtime.
FrameTextureNode
Reads one of URP's own frame textures and exposes it as a graph output. This is the usual entry point of a graph: it is how a pass gets hold of the camera color, scene depth, normals and the rest without writing any C#.
public sealed class FrameTextureNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
FrameTextureNode.source
The frame texture this node reads.
public FrameTextureSource source { get; set; }
FullScreenEffectNode
Applies a material to the camera color and hands the result back to the rest of the frame. A pass cannot read and write the same texture, which is the mistake most hand written full screen passes make. This node allocates the destination, records the pass, and then, wherever the camera allows it, redirects camera color at the new texture instead of copying it back, so the effect costs one pass rather than two.
public sealed class FullScreenEffectNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
FullScreenEffectNode.material
Material applied to the camera color.
public Material material { get; set; }
FullScreenEffectNode.passName
Name this pass appears under in the frame debugger.
public string passName { get; set; }
FullScreenEffectNode.animated
True when the material changes over time, such as with a Shader Graph Time node. Preview In Edit Mode then keeps the Scene and Game views drawing while this node runs. It has no effect in Play Mode or in a player.
public bool animated { get; set; }
PersistentTextureNode
A texture whose contents survive from one frame to the next. Every other texture in a graph is created fresh each frame, so effects that build on what they drew last time, such as trails, accumulation or a comparison with the previous frame, start here. Each camera keeps its own copy, so the Scene view and the Game view never write into each other's history.
public sealed class PersistentTextureNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
PersistentTextureNode.textureName
Name this texture appears under in the frame debugger.
public string textureName { get; set; }
PersistentTextureNode.scale
Fraction of the camera resolution used when the size mode is camera relative.
public float scale { get; set; }
PersistentTextureNode.colorFormat
Color format used when not matching the camera. Setting it stops matching.
public GraphicsFormat colorFormat { get; set; }
PersistentTextureNode.clearColor
Color the texture starts from.
public Color clearColor { get; set; }
PersistentTextureNode.filterMode
Filtering used when the texture is sampled.
public FilterMode filterMode { get; set; }
PersistentTextureNode.RequestClear()
Starts every camera's copy over from the clear color on the next frame. Call it on a camera cut or a level load, where the old history no longer matches the view.
public void RequestClear()
PersistentTextureNode.ReleaseAllPersistentTextures()
Frees the persistent textures held for every graph. Pass Forge calls this before scripts reload. Call it yourself only when tearing rendering down by hand.
public static void ReleaseAllPersistentTextures()
SetGlobalTextureNode
Publishes a texture the graph produced under a global shader property, so ordinary materials and Shader Graphs elsewhere in the scene can sample it. This is the bridge between a graph and shader authoring: the graph renders a mask or a blurred buffer, and a Shader Graph reads it by name without a line of C#.
public sealed class SetGlobalTextureNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
SetGlobalTextureNode.propertyName
Global shader property the texture is published under.
public string propertyName { get; set; }
StencilMaskNode
Marks chosen objects in a stencil buffer without drawing any color. A later pass reads the mark through its own stencil test, so an effect can be limited to those objects, or to the parts of them that something else hides. Feed it the camera depth through Frame Texture Active Depth, then connect its output to the Depth Stencil input of a Blit.
public sealed class StencilMaskNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
StencilMaskNode.material
Material the marked objects are drawn with.
public Material material { get; set; }
StencilMaskNode.layerMask
Which objects to mark, by layer.
public LayerMask layerMask { get; set; }
StencilMaskNode.renderingLayerMask
Which objects to mark, by rendering layer.
public RenderingLayerMask renderingLayerMask { get; set; }
StencilMaskNode.area
Which parts of the objects to mark.
public StencilMaskArea area { get; set; }
StencilMaskNode.reference
Stencil value written, between 1 and 255.
public int reference { get; set; }
VolumeParameterNode
Publishes one slot of a PassForgeVolume as a global shader property, so the materials a graph uses can be driven from URP's Volume system. That means an effect blends with Volume weight and distance the way every stock post effect does, instead of being fixed to whatever the graph asset was saved with.
public sealed class VolumeParameterNode : PassNode
Namespace PassForge, assembly PassForge.Runtime.
VolumeParameterNode.slot
Which Volume slot this node reads.
public VolumeParameterSlot slot { get; set; }
VolumeParameterNode.propertyName
Global shader property the value is published under.
public string propertyName { get; set; }
PassEdge
A directed connection from one node output port to one node input port. Each end is recorded twice, by port index and by port name. The name is what the compiler trusts, so a node type that gains a port in the middle of its list in a later version does not silently rewire every graph already saved against it. The index is the fallback, for edges written before names were stored and for a port that has genuinely been renamed.
public struct PassEdge : IEquatable<PassEdge>
Namespace PassForge, assembly PassForge.Runtime.
new PassEdge(string, int, string, int, string, string)
Creates an edge.
public PassEdge( string fromNode, int fromPort, string toNode, int toPort, string fromPortName = null, string toPortName = null)
PassEdge.fromNode
Guid of the upstream node.
public string fromNode
PassEdge.fromPort
Output port index on the upstream node, used when the name does not resolve.
public int fromPort
PassEdge.fromPortName
Output port name on the upstream node.
public string fromPortName
PassEdge.toNode
Guid of the downstream node.
public string toNode
PassEdge.toPort
Input port index on the downstream node, used when the name does not resolve.
public int toPort
PassEdge.toPortName
Input port name on the downstream node.
public string toPortName
PassEdge.ResolveFromPort(PassNode)
Resolves the output port index on a node, preferring the recorded name. Returns -1 when neither the name nor the index names a port that exists.
public int ResolveFromPort(PassNode node)
PassEdge.ResolveToPort(PassNode)
Resolves the input port index on a node, preferring the recorded name. Returns -1 when neither the name nor the index names a port that exists.
public int ResolveToPort(PassNode node)
PassEdge.Equals(PassEdge)
Compares two edges by endpoints.
public bool Equals(PassEdge other)
PassGraphAsset
A saved render pass graph. Holds the node set, the edges between them, and a lazily built compiled form that the renderer feature executes.
public sealed class PassGraphAsset : ScriptableObject
Namespace PassForge, assembly PassForge.Runtime. Create: Pass Forge > Graph.
PassGraphAsset.nodes
Nodes in this graph, in authoring order. Add and remove nodes with AddNode and RemoveNode, which keep the edges and the compiled graph up to date.
public List<PassNode> nodes { get; }
PassGraphAsset.edges
Edges in this graph.
public List<PassEdge> edges { get; }
PassGraphAsset.GetCompiled()
Returns the compiled graph, building it on first use. Call Invalidate after any structural edit so the next access recompiles.
public CompiledGraph GetCompiled()
PassGraphAsset.Invalidate()
Drops the cached compiled graph so it is rebuilt on next use.
public void Invalidate()
PassGraphAsset.AddNode(PassNode)
Adds a node, assigning it a guid, and invalidates the compiled cache.
public void AddNode(PassNode node)
PassGraphAsset.RemoveNode(PassNode)
Removes a node together with every edge touching it.
public void RemoveNode(PassNode node)
PassGraphAsset.Connect(PassNode, int, PassNode, int)
Connects an output port to an input port. Any edge already feeding that input is replaced, because an input accepts a single source.
public void Connect(PassNode from, int fromPort, PassNode to, int toPort)
PassGraphAsset.DisconnectInput(PassNode, int)
Removes whatever edge currently feeds the given input port.
public void DisconnectInput(PassNode to, int toPort)
PassGraphAsset.FindNode(string)
Finds a node by guid, or null when the graph has no such node.
public PassNode FindNode(string nodeGuid)
PassGraphContext
Per-node view over the frame being recorded. The executor reuses a single instance for the whole graph and rebinds the port windows before each node records, so recording a graph allocates nothing after the first frame.
public sealed class PassGraphContext
Namespace PassForge, assembly PassForge.Runtime.
PassGraphContext.renderGraph
Render graph currently being recorded.
public RenderGraph renderGraph { get; }
PassGraphContext.frameData
Full frame data container, for nodes that need data beyond the cached fields.
public ContextContainer frameData { get; }
PassGraphContext.resourceData
Frame render targets and intermediate textures.
public UniversalResourceData resourceData { get; }
PassGraphContext.cameraData
Camera being rendered.
public UniversalCameraData cameraData { get; }
PassGraphContext.renderingData
Culling results and per-frame rendering state.
public UniversalRenderingData renderingData { get; }
PassGraphContext.lightData
Light data for the frame.
public UniversalLightData lightData { get; }
PassGraphContext.graphName
Name of the graph asset, used to prefix pass names in the profiler.
public string graphName { get; }
PassGraphContext.declaredInputCount
Number of input ports declared by the node currently recording.
public int declaredInputCount { get; }
PassGraphContext.IsConnected(int)
True when the given input port has a connection, whether or not the upstream node produced anything this frame. Lets a node tell an input left empty on purpose apart from one whose source is missing.
public bool IsConnected(int port)
PassGraphContext.HasInput(int)
True when the given input port is connected and the upstream node produced a valid handle.
public bool HasInput(int port)
PassGraphContext.GetInput(int)
Reads the handle feeding an input port. Returns an invalid handle when the port is unconnected, so callers can branch on TextureHandle.IsValid.
public TextureHandle GetInput(int port)
PassGraphContext.SetOutput(int, TextureHandle)
Publishes a handle on an output port so downstream nodes can consume it.
public void SetOutput(int port, TextureHandle handle)
PassGraphRendererFeature
Runs a PassGraphAsset as part of a URP renderer. Add one of these to a Universal Renderer asset and point it at a graph; the graph is interpreted directly against the render graph API, so there is no generated code to keep in sync and no recompile between an edit and seeing the result.
public sealed class PassGraphRendererFeature : ScriptableRendererFeature
Namespace PassForge, assembly PassForge.Runtime.
PassGraphRendererFeature.graph
The graph this feature executes.
public PassGraphAsset graph { get; set; }
NodeFieldGroup
A named, collapsible group of a node's serialized fields. A node with many settings declares groups so its body stays readable on the canvas; anything not named in a group stays at the top, always visible.
public readonly struct NodeFieldGroup
Namespace PassForge, assembly PassForge.Runtime.
new NodeFieldGroup(string, bool, string[])
Creates a group.
public NodeFieldGroup(string name, bool expandedByDefault, params string[] fields)
NodeFieldGroup.name
Heading shown on the foldout.
public readonly string name
NodeFieldGroup.fields
Serialized field names in this group, in the order they should appear.
public readonly string[] fields
NodeFieldGroup.expandedByDefault
Whether the group starts open the first time a node is seen.
public readonly bool expandedByDefault
NodeFieldCondition
Says that one field only matters while another field has a particular value. The graph editor greys out a field whose conditions do not hold, so a setting that currently changes nothing cannot be mistaken for one that does. A field may carry several conditions, and all of them must hold for it to stay active.
public readonly struct NodeFieldCondition
Namespace PassForge, assembly PassForge.Runtime.
NodeFieldCondition.field
Serialized name of the field being gated.
public readonly string field
NodeFieldCondition.controller
Serialized name of the field that gates it.
public readonly string controller
NodeFieldCondition.values
Values of the controller that keep the field active. A bool reads as 1 or 0, an object reference as 1 when assigned, and an enum as its ordinal position in the declaration, which is the plain cast for any enum that does not set explicit numbers.
public readonly int[] values
NodeFieldCondition.invert
When true the field is active for every value except those listed.
public readonly bool invert
NodeFieldCondition.WhenTrue(string, string)
Active while the controlling toggle is on, or its object reference is assigned.
public static NodeFieldCondition WhenTrue(string field, string controller)
NodeFieldCondition.WhenFalse(string, string)
Active while the controlling toggle is off, or its object reference is empty.
public static NodeFieldCondition WhenFalse(string field, string controller)
NodeFieldCondition.WhenAnyOf(string, string, int[])
Active while the controlling enum is one of the given values.
public static NodeFieldCondition WhenAnyOf(string field, string controller, params int[] values)
NodeFieldCondition.WhenNoneOf(string, string, int[])
Active while the controlling enum is none of the given values.
public static NodeFieldCondition WhenNoneOf(string field, string controller, params int[] values)
GraphMessage
A single compile or validation message, optionally attached to a node.
public readonly struct GraphMessage
Namespace PassForge, assembly PassForge.Runtime.
new GraphMessage(GraphMessageKind, string, string)
Creates a message.
public GraphMessage(GraphMessageKind kind, string text, string nodeGuid = null)
GraphMessage.kind
Severity of the message.
public readonly GraphMessageKind kind
GraphMessage.text
Human readable text shown in the inspector and the graph editor.
public readonly string text
GraphMessage.nodeGuid
Guid of the offending node, or null when the message is about the whole graph.
public readonly string nodeGuid
GraphReport
Collects messages produced while compiling and validating a graph.
public sealed class GraphReport
Namespace PassForge, assembly PassForge.Runtime.
GraphReport.messages
All messages gathered so far.
public IReadOnlyList<GraphMessage> messages { get; }
GraphReport.hasErrors
True when at least one error was reported.
public bool hasErrors { get; }
GraphReport.hasWarnings
True when at least one warning was reported.
public bool hasWarnings { get; }
GraphReport.Error(string, string)
Adds an error. An error makes the whole graph skip rendering.
public void Error(string text, string nodeGuid = null)
GraphReport.Warning(string, string)
Adds a warning. The graph still renders.
public void Warning(string text, string nodeGuid = null)
GraphReport.Info(string, string)
Adds an informational message.
public void Info(string text, string nodeGuid = null)
GraphReport.Clear()
Clears every message and resets the error and warning flags.
public void Clear()
PassNode
Base class for every graph node. Nodes are serialized polymorphically inside PassGraphAsset through [SerializeReference], so a node only needs to be a plain serializable class to round trip.
public abstract class PassNode
Namespace PassForge, assembly PassForge.Runtime.
PassNode.k_NoPorts
Shared empty port array for nodes with no inputs or no outputs.
protected static readonly PortDef[] k_NoPorts
PassNode.guid
Stable identity used by edges and messages. Survives list reordering.
public string guid { get; }
PassNode.position
Node position in the graph editor canvas.
public Vector2 position { get; set; }
PassNode.enabled
When false the node and its outputs are excluded from the compiled graph.
public bool enabled { get; set; }
PassNode.order
Decides which of two nodes runs first when their connections do not: lower runs earlier. Connections always win, so this only settles nodes that stand on their own, which is how the ready made effect categories are laid out. Nodes sharing a number keep the order they were added in.
public int order { get; set; }
PassNode.displayName
Title shown on the node in the graph editor.
public abstract string displayName { get; }
PassNode.category
What kind of work this node does. Drives the node's color in the graph editor. Nodes that issue a render pass should leave this as NodeCategory.Pass.
public virtual NodeCategory category { get; }
PassNode.requiredInputs
Frame textures this node needs URP to produce, such as scene depth or normals. The renderer feature requests the union of every enabled node, so a graph never has to be paired with a setting on the URP asset.
public virtual ScriptableRenderPassInput requiredInputs { get; }
PassNode.frameInputs
Frame textures this node needs for the camera being rendered right now. Defaults to requiredInputs. Nodes that need depth or normals only while one of their effects is on override it, so a project pays for those textures only when it uses them.
public virtual ScriptableRenderPassInput frameInputs { get; }
PassNode.followsPostProcessing
True for nodes that, like URP's own Volume effects, draw nothing on a camera whose Post Processing is off. The renderer feature leaves the frame textures of such nodes out on those cameras, so a minimap or UI camera does not pay for depth or normals an effect will never read there.
public virtual bool followsPostProcessing { get; }
PassNode.GetFieldGroups()
Optional collapsible groups for this node's fields in the graph editor. Fields left out of every group stay at the top of the node, always visible. Return null for a node whose settings are few enough to show flat.
public virtual NodeFieldGroup[] GetFieldGroups()
PassNode.GetFieldConditions()
Optional rules saying which fields are inert under the node's current settings. The graph editor greys those fields out. Return null when every field always applies.
public virtual NodeFieldCondition[] GetFieldConditions()
PassNode.GetInputPorts()
Input ports, in port index order. Return a cached array; this is called often.
public virtual PortDef[] GetInputPorts()
PassNode.GetOutputPorts()
Output ports, in port index order. Return a cached array; this is called often.
public virtual PortDef[] GetOutputPorts()
PassNode.Record(PassGraphContext)
Declares this node's work on the render graph. Called once per camera per frame, in topological order. Read inputs with PassGraphContext.GetInput and publish results with PassGraphContext.SetOutput.
public abstract void Record(PassGraphContext ctx)
PassNode.Validate(GraphReport)
Editor and compile time checks that do not need a live frame. Report anything the user should fix before pressing play.
public virtual void Validate(GraphReport report)
PortDef
Static description of a single node port.
public readonly struct PortDef
Namespace PassForge, assembly PassForge.Runtime.
new PortDef(string, PortType, bool, PortRole)
Creates a port description.
public PortDef( string name, PortType type = PortType.Texture, bool optional = false, PortRole role = PortRole.Data)
PortDef.name
Label shown in the graph editor.
public readonly string name
PortDef.type
Data kind this port accepts or produces.
public readonly PortType type
PortDef.optional
When true the graph still compiles while this input is unconnected.
public readonly bool optional
PortDef.role
Whether a connection carries data or only ordering.
public readonly PortRole role
TextureSizing
How an AllocTextureNode or a PersistentTextureNode decides its resolution.
public enum TextureSizing
Namespace PassForge, assembly PassForge.Runtime.
| Value | Meaning |
|---|---|
CameraRelative | A fraction of the camera resolution. Use this for downsampled chains. |
Fixed | A fixed pixel size, independent of the camera. |
TextureKind
What attachments an AllocTextureNode allocates.
public enum TextureKind
Namespace PassForge, assembly PassForge.Runtime.
| Value | Meaning |
|---|---|
Color | Color only. The usual choice for an intermediate effect buffer. |
ColorAndDepth | Color plus a depth buffer, for nodes that draw geometry. |
DepthOnly | Depth only, for mask and prepass style work. |
DepthPrecision
Depth buffer precision.
public enum DepthPrecision
Namespace PassForge, assembly PassForge.Runtime.
| Value | Meaning |
|---|---|
Depth16 | 16 bit depth, no stencil. |
Depth24Stencil8 | 24 bit depth with 8 bit stencil. |
Depth32Stencil8 | 32 bit float depth with 8 bit stencil. |
DrawQueue
Which slice of the render queue a DrawRenderersNode draws.
public enum DrawQueue
Namespace PassForge, assembly PassForge.Runtime.
| Value | Meaning |
|---|---|
Opaque | Opaque geometry only. |
Transparent | Transparent geometry only. |
All | Everything, opaque first. |
FrameTextureSource
Which URP frame resource a FrameTextureNode reads.
public enum FrameTextureSource
Namespace PassForge, assembly PassForge.Runtime.
| Value | Meaning |
|---|---|
ActiveColor | The color target the renderer is writing to right now. |
ActiveDepth | The depth target the renderer is writing to right now. |
CameraOpaque | Copy of the color buffer taken before transparents. Needs Opaque Texture on the URP asset. |
CameraDepth | Copy of scene depth. Needs Depth Texture on the URP asset. |
CameraNormals | Scene normals. Needs a depth normals prepass, which a depth normals consumer enables. |
MotionVectors | Per pixel motion vectors. Needs a feature that requests them, such as TAA or motion blur. |
Ssao | Screen space ambient occlusion result. Needs the SSAO renderer feature. |
MainShadows | Main light shadow map. |
OverlayUI | Overlay UI rendered off screen, when that path is active. |
StencilMaskArea
Which parts of the chosen objects a StencilMaskNode marks.
public enum StencilMaskArea
Namespace PassForge, assembly PassForge.Runtime.
| Value | Meaning |
|---|---|
Visible | Only the parts of the objects the camera can see. |
Hidden | Only the parts hidden behind other geometry. This is what a see-through silhouette needs. |
Everywhere | The whole object, whatever is in front of it. |
NodeCategory
What kind of work a node does. The graph editor colors nodes and their connections by this, so a glance at a graph shows where resources come from and where the GPU actually works.
public enum NodeCategory
Namespace PassForge, assembly PassForge.Runtime.
| Value | Meaning |
|---|---|
Resource | Produces or allocates a texture without issuing any GPU work. |
Pass | Issues a render pass that costs GPU time. |
Utility | Plumbing that neither allocates nor draws, such as publishing a global. |
GraphMessageKind
Severity of a single compile or validation message.
public enum GraphMessageKind
Namespace PassForge, assembly PassForge.Runtime.
| Value | Meaning |
|---|---|
Info | Informational only; the graph still renders. |
Warning | The graph renders but something is likely misconfigured. |
Error | The graph cannot render and is skipped entirely. |
PortType
Data kind carried by a graph port.
public enum PortType
Namespace PassForge, assembly PassForge.Runtime.
| Value | Meaning |
|---|---|
Texture | A render graph texture handle. |
PortRole
What a connection to this port means.
public enum PortRole
Namespace PassForge, assembly PassForge.Runtime.
| Value | Meaning |
|---|---|
Data | The node reads or writes the texture on this port. |
Dependency | The node does not touch the texture. The connection exists only to force the producing pass to run first, which is how a pass that reads a global texture states its ordering. |