dev-docs/RFCs/proposals/view-class-extensions-2-rfc.md
References:
This RFC proposes to extend the functionality of View class hinted at in the original View proposal, such as advanced render parameters.
The new View descriptor classes were introduced partly because they provide a highly extensible API for the future.
TBA..
View Class PropertieslayerFilter : Function | String[] | nullRestricts what layers will be rendererd in this view.
Function: function will be called with the following arguments: layerFilter({layer, view, isPicking})Array: array of layer ids. Layer id's will be matched from with initial substring of layer ids, allowing nested layers to be matched.null (default): All layers will be rendered.onBeforeRender({gl, view, viewport, viewState,...})If supplied, called on every render, just before this view is rendered. However, note that a view that does not intersect the current update rect may not be rendered during that render frame, in which case the callback will not be called.
onAfterRender({gl, view, viewport, viewState,...})If supplied, called on every render, just after this view was rendered. Note that a view that does not intersect the current update rect may not be rendered during that render frame, in which case the callback will not be called.
parametersEnables the application to provide a full set of GL parameters, perhaps most importantly, selecting framebuffer.
framebuffer - makes this view render into a framebufferparameters: {blendMode, ...}framebuffer : Framebuffer | nullIf supplied, controls which framebuffer will be the default render target for the layers rendered in this view. Enables vertain views to be rendered to offscreen framebuffers.
TODO: investigate implications
We could address use cases beyond simply rendering multiple views: More ambitous extensions:
A viewport descriptor could specify additional information like:
context object with parameters that get passed to property animation functions.