@equinor/videx-3d
    Preparing search index...

    Function RenderStats

    • A lightweight render-statistics overlay for R3F. It reports metrics that the usual FPS/frame-time counters miss and that matter most when profiling large scenes:

      • GPU — actual GPU time per frame (via EXT_disjoint_timer_query_webgl2), which — unlike frame time — is not hidden by the vsync cap, so you can compare GPU cost even at a locked 60 fps.
      • Frame / FPS — wall-clock frame time and rate.
      • Draw calls and Triangles — accumulated across every render pass in the frame (it sets renderer.info.autoReset = false while mounted and resets once per frame), so multi-pass pipelines report a true per-frame total.
      • Geometries / Textures / Programs — resident GPU resource counts.

      Measurement is non-invasive: it brackets the whole frame with global R3F before/after callbacks rather than taking over the render loop, so it works with the default loop, custom pipelines and effect composers alike.

      Place it inside a <Canvas> (it needs the renderer). It renders no 3D content — only a DOM overlay appended to RenderStatsProps.parent.

      Parameters

      • __namedParameters: RenderStatsProps

        RenderStats props

        RenderStats props

        • OptionalclassName?: string

          Optional class name applied to the overlay container (for custom styling).

        • Optionalgpu?: boolean

          Measure real GPU time via EXT_disjoint_timer_query_webgl2. When the extension is unavailable (e.g. some browsers, or the WebGPU renderer) the GPU row shows n/a. Default true.

        • Optionalinterval?: number

          UI refresh interval in milliseconds (the metrics themselves sample every frame).

        • Optionaloffset?: [number, number]

          Pixel offset [x, y] from the anchored corner.

        • Optionalorigin?: "top-left" | "top-right" | "bottom-left" | "bottom-right"

          Corner the overlay is anchored to.

        • Optionalparent?: HTMLElement | null

          DOM element the overlay is appended to. Defaults to the renderer canvas' parent element (falling back to document.body).

      Returns null

      Debug/profiling tool. The GPU timer uses a TIME_ELAPSED query, and only one such query can be active per WebGL context — do not enable gpu at the same time as another consumer of the timer (e.g. OITRenderPass.profile).