Table of Contents

Interface IRenderFilterNode

Namespace
nadena.dev.ndmf.preview
public interface IRenderFilterNode : IDisposable
Inherited Members

Properties

WhatChanged

Indicates which aspects of a renderer this node changed, relative to the node prior to the last Update call. This may trigger updates of downstream nodes.

This value is ignored on the first generation of the node, created from IRenderFilter.Instantiate.

RenderAspects WhatChanged { get; }

Property Value

RenderAspects

Methods

OnFrame(Renderer, Renderer)

Invoked on each frame, and may modify the target renderers bound to this render filter node. Generally, you should not modify the mesh or materials in this method, but you may change other properties, such as the bones array, blend shapes, or the active state of the renderer. These properties will be reset to the original renderer state on each frame.

This function is passed the original and replacement renderers, and is invoked for each renderer in question. If an original renderer is destroyed, OnFrame will be called only on remaining renderers, until the preview pipeline rebuild is completed.

void OnFrame(Renderer original, Renderer proxy)

Parameters

original Renderer
proxy Renderer

OnFrameGroup()

Invoked on each frame, once per render group.

void OnFrameGroup()

Refresh(IEnumerable<(Renderer, Renderer)>, ComputeContext, RenderAspects)

Recreates this RenderFilterNode, with a new set of target renderers. The node may reuse state, including things such as output RenderTextures, from its prior run. It may also fast-fail and return null; in this case, the preview pipeline will create a new node from its original IRenderFilter instead. Finally, it may return itself; in this case, it will continue to be used with the new renderers.

This function is passed a list of original-proxy object pairs, which are guaranteed to have the same original objects, in the same order, as the initial call to Instantiate, but will have new proxy objects. It is also passed an update flags field, which indicates which upstream nodes have changed since the last update. This may be zero if the update was triggered by an invalidation on the compute context for this node itself.

As with IRenderFilter.Instantiate, the OnFrame effects of prior stages in the pipeline will be applied before invoking this function. This ensures any changes to bones, blendshapes, etc will be reflected in this mesh.

This function must not destroy the original Node. If it chooses to share resources with the original node, those resources must not be released until both old and new nodes are destroyed.

Task<IRenderFilterNode> Refresh(IEnumerable<(Renderer, Renderer)> proxyPairs, ComputeContext context, RenderAspects updatedAspects)

Parameters

proxyPairs IEnumerable<(Renderer, Renderer)>
context ComputeContext
updatedAspects RenderAspects

Returns

Task<IRenderFilterNode>