Creates a render pass for labels.
Valid context to create the object for.
Alterable auxiliary object for tracking changes on render pass inputs and lazy updates.
Context, used to get context information and WebGL API access.
Stores for each label (same index in _labels) the range within the geometry.
Stores typeset glyph vertices data per label and is used as cache to avoid unnecessary typesetting.
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.
Default AA step scale: more crisp text rendering (the value is optimized for multi-frame sampling).
Specify the sampling pattern/mode (anti-aliasing / no anti-aliasing) for glyph rendering. The sampling should be increased when rendering small text, e.g., starting at font size of 16px or less. With larger text, there is no perceptual benefit with more than one derivative sample, i.e., LabelRenderPass.Sampling.Smooth1.
Specify the sampling pattern/mode (anti-aliasing / no anti-aliasing) for glyph rendering. The sampling should be increased when rendering small text, e.g., starting at font size of 16px or less. With larger text, there is no perceptual benefit with more than one derivative sample, i.e., LabelRenderPass.Sampling.Smooth1.
Allows to specify the basic AA step scale which is more of a hack to provide seemingly smoother (e.g., >= 1.0) or crisper (e.g., between 0.0 and 1.0) contours without specific multi sampling. Its just scaling the outcome of the derivatives.
Allows to specify the basic AA step scale which is more of a hack to provide seemingly smoother (e.g., >= 1.0) or crisper (e.g., between 0.0 and 1.0) contours without specific multi sampling. Its just scaling the outcome of the derivatives.
The camera's viewProjection is used for 3D label placement calculation.
Allows to specify the value used for depth buffer comparisons.
Allows to specify the value used for depth buffer comparisons.
Allows to restrict writing into the depth buffer. If the mask is set to true
, labels might affect the depth
buffer and apply fragment-based discard in order to reduce blank glyph areas to override depth values. If this
mode is used, labels should be the last or one of the later rendering passes. If the mask is set to false
, the
common transparency/blending etc issues might occur when several labels overlap or other, e.g., transparent
areas are rendered afterwards... However, if only labels of the same color can overlap and no other objects can
interfere, this might be the better choice.
By default, writing to the depth buffer is disabled (depth mask is false).
Allows to restrict writing into the depth buffer. If the mask is set to true
, labels might affect the depth
buffer and apply fragment-based discard in order to reduce blank glyph areas to override depth values. If this
mode is used, labels should be the last or one of the later rendering passes. If the mask is set to false
, the
common transparency/blending etc issues might occur when several labels overlap or other, e.g., transparent
areas are rendered afterwards... However, if only labels of the same color can overlap and no other objects can
interfere, this might be the better choice.
By default, writing to the depth buffer is disabled (depth mask is false).
Read-only access (leaky) to the actual label geometry (VAO) used to draw this pass's labels.
Property getter for readonly access to the initialization status of an initializable instance.
Access to the labels that should be rendered. Note that label preparation is currently done per label-render pass instance, so drawing the same label with multiple renderers should be avoided. Label preparation will be invoked on update, iff the labels or the font face have changed.
Access to the labels that should be rendered. Note that label preparation is currently done per label-render pass instance, so drawing the same label with multiple renderers should be avoided. Label preparation will be invoked on update, iff the labels or the font face have changed.
The NDC offset is used for vertex displacement within subpixel space for anti-aliasing over multiple intermediate frames (multi-frame sampling).
Subpixel offset used for vertex displacement (multi-frame anti-aliasing).
Read-only access (leaky) to the actual label geometry (VAO) used to draw this pass's labels.
Sets the framebuffer the quads are rendered to.
Framebuffer to render into.
This invokes draw calls on all labels. Thereby it aims to avoid unnecessary binds when texture or color does not change and accumulate draw calls as long as both remain unchanged. Further more, draw calls will be accumulated as much as possible (static labels only).
Typesets and renders 2D and 3D labels.
Unbind the label geometry.
If enabled, everything will be updated, regardless of tracked alterations.
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 discarding of Initializable inheritors. This decorator asserts the initialization
status of the instance that is to be discarded, invokes its uninitialization, and falsifies the
initialization status. In order to encourage the use of assertInitialized
and assertUninitialized
they are
dynamically bound to a static, always-failing assert and an empty/undefined function respectively.
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 assertInitialized
and 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 assertInitialized
and assertUninitialized
they are
dynamically bound to a static, always-failing assert and an empty/undefined function respectively.
This class allows rendering of multiple dynamic as well as static labels. While preparing for frame, all label geometry is packed into single buffers for the GPU and drawing is done with as few draw calls as possible. The preparation tries to reduce state changes when labels of same color and same font are provided consecutively. It might be beneficial to not render labels of large static texts and some often changing dynamic texts using the same label render pass object. Often changing texts should be out into separate passed for better performance.