Constructs a new WebGLRenderer.
If a Viewer is provided, the renderer immediately attempts to attach to it. Any errors encountered during attachment are emitted via events.onError.
Optionaldebugging?: booleanOptionalmemoryConfigs?: Partial<MemoryConfigs>Optional overrides for GPU memory budgeting and allocation behavior.
Optionalviewer?: ViewerOptional Viewer to attach during construction.
Internal_viewManages views and their rendering lifecycle - only exists when a Viewer with a Scene is attached to the renderer.
The ViewManager core is a central part of the renderer’s internal state, managing views, batches, and GPU resources. It only exists while a Viewer with an attached Scene is present.
This API is exposed on the renderer for internal developer docs and debugging/telemetry only and is not covered by semantic versioning. It may change or be removed at any time.
Events emitted by this renderer.
These events describe lifecycle transitions (Viewer attachment, rendering start/stop), WebGL context issues, and error reporting.
Enables or disables logging of errors to the console.
Indicates whether debugging features are enabled.
When true, the renderer and its components may emit additional events
and perform extra checks to facilitate debugging and diagnostics.
This may incur performance overhead, so it should be disabled in production.
Enables or disables debugging features.
When true, the renderer and its components may emit additional events
and perform extra checks to facilitate debugging and diagnostics.
Indicates whether the renderer is actively rendering.
Rendering is considered active when a Viewer with an attached Scene is present and the renderer’s internal rendering state has been initialized.
Retrieves the Viewer currently attached to this WebGLRenderer, if any.
Attaches a Viewer to this renderer.
If the Viewer already has an active Scene, the renderer immediately initializes its internal rendering state and begins rendering. Otherwise, rendering begins once a Scene is attached to the Viewer.
Viewer to attach.
Success or failure. Attaching while another Viewer is already attached is an error.
Destroys this renderer instance.
Detaches any attached Viewer, releases internal resources and subscriptions, and emits events.onRendererDestroyed. After this call, the instance should be considered unusable.
Detaches the currently attached Viewer, if any.
If rendering is active, this also tears down the renderer’s internal rendering state before emitting lifecycle events.
Retrieves the capabilities of the WebGLRenderer.
Populates the provided Capabilities object with information about supported
WebGL features, such as texture compression formats and WebGL2 support.
The object to populate with capability information.
InternalSets a DrawInspector to inspect draw calls during rendering.
Retrieves the GPU memory configuration used by this WebGLRenderer.
InternalReturns a read-only view of GPU-resident data used by the renderer.
This API is intended for diagnostics, debugging tools, and monitoring UIs. The returned object exposes structured access to DataTextures while rendering is active.
{ ok: true, value } when a Viewer with an attached Scene is present;
otherwise { ok: false } with SDKErrorType.InvalidOperation.
Returns the renderer’s current GPU memory usage summary.
When the renderer is not actively rendering (no attached Viewer with a Scene), this returns zero usage.
InternalReturns a inspectors view of program shaders used by the renderer.
This API is intended for diagnostics, debugging tools, and monitoring UIs.
{ ok: true, value } when a Viewer with an attached Scene is present;
otherwise { ok: false } with SDKErrorType.InvalidOperation.
Performs a GPU-accelerated pick operation in the specified View.
This method queries the renderer to identify the ViewObject (and optionally the 3D surface position) at a given canvas coordinate or along a specified world-space ray. Picking is performed using the renderer's internal GPU resources and shaders.
Parameters specifying the pick mode and target (canvas coordinates or world-space ray).
An SDKResult containing the PickResult on success, or an error result on failure.
WebGL renderer backing a Viewer.
WebGLRenderer owns and manages the WebGL rendering pipeline for a Viewer. It is responsible for:
See @xeokit/webglrenderer for usage.