This pass accumulates the color attachment 0 of a framebuffer, e.g., the result of an intermediate frame, into an accumulation buffer. For accumulation the frame number is used to derive the accumulation weight. For rendering to texture, a textured ndc-filling triangle is used.
The accumulation pass can be used as follows:
this.accumulate.initialize(); this.accumulate.texture = this.intermediateFBO.texture(gl2facade.COLOR_ATTACHMENT0); this.accumulate.update(); this.accumulate.frame(frameNumber);
Two rgba-framebuffers used for accumulation (buffer ping-ponging is used for alternating the buffers for read and write access due to a limitation in WebGL).
Alterable auxiliary object for tracking changes on this object's input and lazy updates.
Read-only access to the objects context, used to get context information and WebGL API access.
Geometry used to draw on. This is not provided by default to allow for geometry sharing. If no triangle is given, the ndc triangle will be created and managed internally.
Tracks ownership of the ndc-filling triangle.
Stores the index of the last buffer written to.
Returns the framebuffer last accumulated into. Note: the accumulation buffer is represented by two framebuffers swapped for read and write every frame. The accumulation result is in the first color attachment.
Property getter for readonly access to the initialization status of an initializable instance.
Allows to skip accumulation. If pass through is enabled, nothing will be rendered on frame at all and the ping pong render textures will be reduced to a minimum size of [1, 1] until pass through is disabled.
Allows to specify the accumulation precision.
Sets the texture that is to be accumulated. The ping and pong render textures will be resized on next frame automatically if the texture size changed.
Framebuffer that is to be accumulated.
Asserts the objects initialization status to be true. Note that the implementation is cached and forwarded to either an empty function when initialized and to an acutal assert(false) otherwise.
Asserts the objects initialization status to be false. Note that the implementation is cached and forwarded to either an empty function when uninitialized and to an acutal assert(false) otherwise.
An accumulation frame binds the two accumulation textures (ping-pong framebuffer), one for read, the other for write/accumulating into. A screen-aligned triangle is used to fill the viewport and mix the input texture with the weight of 1 / (frameNumber + 1) with the previous accumulation result. If no texture is specified, pass through is used.
Frame number used to select the current read and write framebuffer as well as frame weight.
If specified, the viewport for accumulation will be set to the given width and height. If not, the currently set viewport is used.
Specializes this pass's initialization. This pass requires an ndc-filling triangle, a single accumulation program, and two accumulation framebuffers for ping pong (simultaneous read and write is currently not allowed by webgl). All attribute and dynamic uniform locations are cached.
If specified, assumed to be used as shared geometry. If none is specified, a ndc-filling triangle will be created internally.
Specializes this pass's uninitialization. Program and geometry resources are released (if allocated). Cached uniform and attribute locations are invalidated.
Initialize accumulation textures and FBOs (if not initialized yet). Then verifies if the texture's size has changed, and if so, resizes the accumulation buffers.
Method decorator for asserting the initialization status of an initializable to be true.
Method decorator for asserting the initialization status of an initializable to be false.
Method decorator for initialization of Initializable inheritors. This decorator asserts the initialization status
of the instance that is to be initialized, invokes its initialization with arbitrary number of parameters,
and sets the initialization status to the initialization success (either false or true).
In order to encourage the use of
assertUninitialized they are dynamically
bound to either a static, always-failing assert or an empty/undefined function.
Method decorator for uninitialization of Initializable inheritors. This decorator asserts the initialization
status of the instance that is to be uninitialized, invokes its uninitialization, and falsifies the
initialization status. In order to encourage the use of
assertUninitialized they are
dynamically bound to a static, always-failing assert and an empty/undefined function respectively.