<pass> (//pfx/effect/pass)

The <pass> element defines a rendering operation to one or more targets

The <pass> element defines an entire rendering operation to one or more targets. Targets will usually be inferred from the subpasses, but since <subpass> tags can be omitted, in such a case the targets will be defined in the <pass> element. Depending on the implementation, from one to four targets can be supported, and additionally a depth and stencil target.

There is no need to define the on-screen framebuffer target0, or on-screen depth and/or stencil, as these are used by default.

In the most common usecase, a simple <pass></pass> with no attributes defined would suffice for on-screen rendering; it would define a pass rendering to the default framebuffer. If only one such element would exist, it can – and should – be omitted, and any <subpass> elements added inline to the <effect> element (if they are not themselves omitted).

XML Attributes (<pass> element)

ATTRIBUTE

Description

name

(OPTIONAL) A unique text identifier for this effect.

The effects are considered ordered, so the implementation can always also identify it by index, for example effect[0].passes[0].

[Subpass tags: targetX]

(OPTIONAL) If only a subpass exists and its tags are omitted, its attributes can be added to the <renderpass> tags instead.

This is the recommended approach when using a single subpass. If target0 is not defined, it is implicitly the on-screen FBO.

targetDepthStencil

(OPTIONAL) A reference to a texture that will be used as the depth attachment when using this pass. If omitted, the default depth / depth stencil buffer is used.

Child elements (<pass> element)

ELEMENT

Description

<subpass>

Specifies a subpass.

Subpasses are used sequentially. If only one subpass exists, the tags can be omitted and its contents added directly to the renderpass.