Renderer
Renderer represents an operating system window and manages frame rendering and pacing.
Typically, applications create a Renderer per window. The Renderer generates drawing commands for the render thread and manages frame latency to keep it low.
A Renderer generates drawing commands from a View, which itself contains a Scene description.
Typical render loop:
while (!quit) {
if (renderer.beginFrame(swapChain)) {
renderer.render(view)
renderer.endFrame()
}
}Frame pacing: beginFrame() manages frame pacing and returns false if the GPU is falling behind (to skip frames and reduce latency). When false is returned, either skip the frame or proceed anyway; if proceeding, you must still call endFrame().
See also
Types
ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.
Display refresh-rate information for frame pacing and dynamic resolution scaling.
Timing information about a frame. Times are nanoseconds since the steady-clock epoch; durations are nanoseconds.
Frame rate control and dynamic resolution scaling options.
Properties
Get/set clear behavior for the SwapChain. The getter returns a snapshot — mutate it and assign back to apply.
Get the number of frames left to skip.
Whether GPU execution has fallen behind the CPU, to detect latency build-up when driving the presentation loop manually.
Get material time in seconds.
The maximum supported frame history size.
The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.
Functions
Prepare a frame for rendering and manage frame pacing.
Returns up to historySize entries of frame timing history, most recent first. The history can be lost when beginFrame() switches SwapChain.
Pause the render thread for a specified duration in nanoseconds.
Read back SwapChain pixels asynchronously.
Read back RenderTarget pixels asynchronously.
readPixels straight into native memory the caller owns, without a copy (e.g. a Skia bitmap's pixels). onDone runs once address holds the frame, possibly on Filament's driver thread.
Render a View without frame pacing.
Reset the user time clock to zero.
Set the real desired presentation time targeted for this frame.
Sets display information for frame pacing and dynamic resolution.
Sets frame rate control and dynamic resolution options.
Sets the steady-clock time the frame scheduling callback was entered, so frame pacing can measure the CPU time spent before beginFrame().
Set the epoch for material time in nanoseconds.
Set the time at which the frame must be presented.
Set the deadline by which CPU and GPU rendering must complete for the buffer to meet its target display latching window. Must be called before endFrame().
Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.
Check if the current frame should be rendered.
Skip the next N frames for frame pacing.