Renderer

actual class 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

expect class 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

actual class 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

actual class 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

actual class 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

Constructors

Link copied to clipboard
constructor(_engine: Engine, nativeRenderer: Renderer)
constructor(engineRef: Engine, nativeHandle: MemorySegment?)
constructor(nativeHandle: CPointer<FilaRenderer>?)
constructor(jsRenderer: Renderer, _engine: Engine? = null)

Types

Link copied to clipboard
actual class ClearOptions

ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.

expect class ClearOptions

ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.

actual class ClearOptions

ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.

actual class ClearOptions

ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.

actual class ClearOptions

ClearOptions control how the SwapChain is cleared or discarded at the beginning of a frame.

Link copied to clipboard
actual class DisplayInfo

Display refresh-rate information for frame pacing and dynamic resolution scaling.

expect class DisplayInfo

Display refresh-rate information for frame pacing and dynamic resolution scaling.

actual class DisplayInfo

Display refresh-rate information for frame pacing and dynamic resolution scaling.

actual class DisplayInfo

Display refresh-rate information for frame pacing and dynamic resolution scaling.

actual class DisplayInfo

Display refresh-rate information for frame pacing and dynamic resolution scaling.

Link copied to clipboard
actual class FrameRateOptions

Frame rate control and dynamic resolution scaling options.

expect class FrameRateOptions

Frame rate control and dynamic resolution scaling options.

actual class FrameRateOptions

Frame rate control and dynamic resolution scaling options.

actual class FrameRateOptions

Frame rate control and dynamic resolution scaling options.

actual class FrameRateOptions

Frame rate control and dynamic resolution scaling options.

Link copied to clipboard
actual object MirrorFrameFlag

Bit flags for the flags argument of copyFrame.

expect object MirrorFrameFlag

Bit flags for the flags argument of copyFrame.

actual object MirrorFrameFlag

Bit flags for the flags argument of copyFrame.

actual object MirrorFrameFlag

Bit flags for the flags argument of copyFrame.

actual object MirrorFrameFlag

Bit flags for the flags argument of copyFrame.

Properties

Link copied to clipboard

Get/set clear behavior for the SwapChain. The getter returns a snapshot — mutate it and assign back to apply.

Get/set clear behavior for the SwapChain. The getter returns a snapshot — mutate it and assign back to apply.

Get/set clear behavior for the SwapChain. The getter returns a snapshot — mutate it and assign back to apply.

Get/set clear behavior for the SwapChain. The getter returns a snapshot — mutate it and assign back to apply.

Get/set clear behavior for the SwapChain. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard

Get/set display information for frame pacing and dynamic resolution. The getter returns a snapshot — mutate it and assign back to apply.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "state is only tracked locally — setDisplayInfo is not bound in filament.js; frame pacing is managed by the browser.")
expect var displayInfo: Renderer.DisplayInfo

Get/set display information for frame pacing and dynamic resolution. The getter returns a snapshot — mutate it and assign back to apply.

Get/set display information for frame pacing and dynamic resolution. The getter returns a snapshot — mutate it and assign back to apply.

Get/set display information for frame pacing and dynamic resolution. The getter returns a snapshot — mutate it and assign back to apply.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "state is only tracked locally — setDisplayInfo is not bound in filament.js; frame pacing is managed by the browser.")
actual var displayInfo: Renderer.DisplayInfo

Get/set display information for frame pacing and dynamic resolution. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard
actual val engine: Engine

Get the Engine that created this Renderer.

expect val engine: Engine

Get the Engine that created this Renderer.

actual val engine: Engine

Get the Engine that created this Renderer.

actual val engine: Engine

Get the Engine that created this Renderer.

actual val engine: Engine

Get the Engine that created this Renderer.

Link copied to clipboard

Get/set frame rate control and dynamic resolution options. The getter returns a snapshot — mutate it and assign back to apply.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "state is only tracked locally — setFrameRateOptions is not bound in filament.js; frame pacing is managed by the browser.")
expect var frameRateOptions: Renderer.FrameRateOptions

Get/set frame rate control and dynamic resolution options. The getter returns a snapshot — mutate it and assign back to apply.

Get/set frame rate control and dynamic resolution options. The getter returns a snapshot — mutate it and assign back to apply.

Get/set frame rate control and dynamic resolution options. The getter returns a snapshot — mutate it and assign back to apply.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "state is only tracked locally — setFrameRateOptions is not bound in filament.js; frame pacing is managed by the browser.")
actual var frameRateOptions: Renderer.FrameRateOptions

Get/set frame rate control and dynamic resolution options. The getter returns a snapshot — mutate it and assign back to apply.

Link copied to clipboard
actual val frameToSkipCount: Int

Get the number of frames left to skip.

expect val frameToSkipCount: Int

Get the number of frames left to skip.

actual val frameToSkipCount: Int

Get the number of frames left to skip.

actual val frameToSkipCount: Int

Get the number of frames left to skip.

actual val frameToSkipCount: Int

Get the number of frames left to skip.

Link copied to clipboard
actual val materialTime: Double

Get material time in seconds.

expect val materialTime: Double

Get material time in seconds.

actual val materialTime: Double

Get material time in seconds.

actual val materialTime: Double

Get material time in seconds.

actual val materialTime: Double

Get material time in seconds.

Link copied to clipboard
val Renderer.nativeObject: Renderer
val Renderer.nativeObject: MemorySegment?
val Renderer.nativeObject: CPointer<FilaRenderer>?
val Renderer.nativeObject: Renderer
Link copied to clipboard
actual val userTime: Double

Get elapsed time since resetUserTime() in seconds.

expect val userTime: Double

Get elapsed time since resetUserTime() in seconds.

actual val userTime: Double

Get elapsed time since resetUserTime() in seconds.

actual val userTime: Double

Get elapsed time since resetUserTime() in seconds.

actual val userTime: Double

Get elapsed time since resetUserTime() in seconds.

Functions

Link copied to clipboard
actual fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean

Prepare a frame for rendering and manage frame pacing.

expect fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean

Prepare a frame for rendering and manage frame pacing.

actual fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean

Prepare a frame for rendering and manage frame pacing.

actual fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean

Prepare a frame for rendering and manage frame pacing.

actual fun beginFrame(swapChain: SwapChain, frameTimeNanos: Long): Boolean

Prepare a frame for rendering and manage frame pacing.

Link copied to clipboard
actual fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int)

Copy the rendered frame to another SwapChain at a specified viewport.

expect fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int)

Copy the rendered frame to another SwapChain at a specified viewport.

actual fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int)

Copy the rendered frame to another SwapChain at a specified viewport.

actual fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int)

Copy the rendered frame to another SwapChain at a specified viewport.

actual fun copyFrame(dstSwapChain: SwapChain, dstViewport: Viewport, srcViewport: Viewport, flags: Int)

Copy the rendered frame to another SwapChain at a specified viewport.

Link copied to clipboard
actual fun endFrame()

Finish the current frame and schedule it for display.

expect fun endFrame()

Finish the current frame and schedule it for display.

actual fun endFrame()

Finish the current frame and schedule it for display.

actual fun endFrame()

Finish the current frame and schedule it for display.

actual fun endFrame()

Finish the current frame and schedule it for display.

Link copied to clipboard
actual fun pauseRenderThread(timeNs: Long)

Pause the render thread for a specified duration in nanoseconds.

expect fun pauseRenderThread(timeNs: Long)

Pause the render thread for a specified duration in nanoseconds.

actual fun pauseRenderThread(timeNs: Long)

Pause the render thread for a specified duration in nanoseconds.

actual fun pauseRenderThread(timeNs: Long)

Pause the render thread for a specified duration in nanoseconds.

actual fun pauseRenderThread(timeNs: Long)

Pause the render thread for a specified duration in nanoseconds.

Link copied to clipboard
@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "delivers asynchronously — filament.js hands the pixels to an internal callback after the frame completes, so the buffer is filled some frames later rather than on return.")
actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "delivers asynchronously — filament.js hands the pixels to an internal callback after the frame completes, so the buffer is filled some frames later rather than on return.")
actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "delivers asynchronously — filament.js hands the pixels to an internal callback after the frame completes, so the buffer is filled some frames later rather than on return.")
expect fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "delivers asynchronously — filament.js hands the pixels to an internal callback after the frame completes, so the buffer is filled some frames later rather than on return.")
expect fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "delivers asynchronously — filament.js hands the pixels to an internal callback after the frame completes, so the buffer is filled some frames later rather than on return.")
actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "delivers asynchronously — filament.js hands the pixels to an internal callback after the frame completes, so the buffer is filled some frames later rather than on return.")
actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "delivers asynchronously — filament.js hands the pixels to an internal callback after the frame completes, so the buffer is filled some frames later rather than on return.")
actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

@PlatformGap(platforms = [FilamentPlatform.WEB], behavior = "delivers asynchronously — filament.js hands the pixels to an internal callback after the frame completes, so the buffer is filled some frames later rather than on return.")
actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

actual fun readPixels(xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back SwapChain pixels asynchronously.

actual fun readPixels(renderTarget: RenderTarget, xoffset: Int, yoffset: Int, width: Int, height: Int, buffer: Texture.PixelBufferDescriptor)

Read back RenderTarget pixels asynchronously.

Link copied to clipboard
actual fun render(view: View)

Render a View into this Renderer's target.

expect fun render(view: View)

Render a View into this Renderer's target.

actual fun render(view: View)

Render a View into this Renderer's target.

actual fun render(view: View)

Render a View into this Renderer's target.

actual fun render(view: View)

Render a View into this Renderer's target.

Link copied to clipboard
actual fun renderStandaloneView(view: View)

Render a View without frame pacing.

expect fun renderStandaloneView(view: View)

Render a View without frame pacing.

actual fun renderStandaloneView(view: View)

Render a View without frame pacing.

actual fun renderStandaloneView(view: View)

Render a View without frame pacing.

actual fun renderStandaloneView(view: View)

Render a View without frame pacing.

Link copied to clipboard
actual fun resetUserTime()

Reset the user time clock to zero.

expect fun resetUserTime()

Reset the user time clock to zero.

actual fun resetUserTime()

Reset the user time clock to zero.

actual fun resetUserTime()

Reset the user time clock to zero.

actual fun resetUserTime()

Reset the user time clock to zero.

Link copied to clipboard
actual fun setDesiredPresentationTime(monotonicClockNanos: Long)

Set the real desired presentation time targeted for this frame.

expect fun setDesiredPresentationTime(monotonicClockNanos: Long)

Set the real desired presentation time targeted for this frame.

actual fun setDesiredPresentationTime(monotonicClockNanos: Long)

Set the real desired presentation time targeted for this frame.

actual fun setDesiredPresentationTime(monotonicClockNanos: Long)

Set the real desired presentation time targeted for this frame.

actual fun setDesiredPresentationTime(monotonicClockNanos: Long)

Set the real desired presentation time targeted for this frame.

Link copied to clipboard
actual fun setMaterialTimeEpoch(timeEpochInNs: Long)

Set the epoch for material time in nanoseconds.

expect fun setMaterialTimeEpoch(timeEpochInNs: Long)

Set the epoch for material time in nanoseconds.

actual fun setMaterialTimeEpoch(timeEpochInNs: Long)

Set the epoch for material time in nanoseconds.

actual fun setMaterialTimeEpoch(timeEpochInNs: Long)

Set the epoch for material time in nanoseconds.

actual fun setMaterialTimeEpoch(timeEpochInNs: Long)

Set the epoch for material time in nanoseconds.

Link copied to clipboard
actual fun setPresentationTime(monotonicClockNanos: Long)

Set the time at which the frame must be presented.

expect fun setPresentationTime(monotonicClockNanos: Long)

Set the time at which the frame must be presented.

actual fun setPresentationTime(monotonicClockNanos: Long)

Set the time at which the frame must be presented.

actual fun setPresentationTime(monotonicClockNanos: Long)

Set the time at which the frame must be presented.

actual fun setPresentationTime(monotonicClockNanos: Long)

Set the time at which the frame must be presented.

Link copied to clipboard
actual fun setRenderingDeadline(monotonicClockNanos: Long)

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().

expect fun setRenderingDeadline(monotonicClockNanos: Long)

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().

actual fun setRenderingDeadline(monotonicClockNanos: Long)

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().

actual fun setRenderingDeadline(monotonicClockNanos: Long)

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().

actual fun setRenderingDeadline(monotonicClockNanos: Long)

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().

Link copied to clipboard
actual fun setVsyncTime(steadyClockTimeNano: Long)

Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.

expect fun setVsyncTime(steadyClockTimeNano: Long)

Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.

actual fun setVsyncTime(steadyClockTimeNano: Long)

Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.

actual fun setVsyncTime(steadyClockTimeNano: Long)

Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.

actual fun setVsyncTime(steadyClockTimeNano: Long)

Set the VSYNC time expressed as the duration in nanoseconds since epoch of std::chrono::steady_clock.

Link copied to clipboard

Check if the current frame should be rendered.

Check if the current frame should be rendered.

Check if the current frame should be rendered.

Check if the current frame should be rendered.

Check if the current frame should be rendered.

Link copied to clipboard
actual fun skipFrame(vsyncSteadyClockTimeNano: Long)

Skip the current frame for frame pacing.

expect fun skipFrame(vsyncSteadyClockTimeNano: Long)

Skip the current frame for frame pacing.

actual fun skipFrame(vsyncSteadyClockTimeNano: Long)

Skip the current frame for frame pacing.

actual fun skipFrame(vsyncSteadyClockTimeNano: Long)

Skip the current frame for frame pacing.

actual fun skipFrame(vsyncSteadyClockTimeNano: Long)

Skip the current frame for frame pacing.

Link copied to clipboard
actual fun skipNextFrames(frameCount: Int)

Skip the next N frames for frame pacing.

expect fun skipNextFrames(frameCount: Int)

Skip the next N frames for frame pacing.

actual fun skipNextFrames(frameCount: Int)

Skip the next N frames for frame pacing.

actual fun skipNextFrames(frameCount: Int)

Skip the next N frames for frame pacing.

actual fun skipNextFrames(frameCount: Int)

Skip the next N frames for frame pacing.