Configures cubemap-based image-based lighting (IBL) for a View.

Drives the prefiltered-cubemap diffuse + specular contribution to each fragment's BRDF: the renderer projects either a procedural sky (built from Lights.hemispheric) or a user-supplied equirectangular environment image onto a cubemap, then prefilters the diffuse irradiance and GGX-convolved specular for fast lookup at draw time. Active whenever the current View.renderMode is in IBL.renderModes.

The cheap analytical sky/ground/up gradient lives separately on Lights.hemispheric — it applies in every render mode by default and stacks with this cubemap path when both are enabled.

See @xeokit/sdk/viewing/viewer for usage info.

Properties

view: View

The View to which this IBL belongs.

Accessors

  • get environmentImage(): | HTMLCanvasElement
    | HTMLImageElement
    | ImageBitmap
    | OffscreenCanvas

    The decoded environment image currently driving IBL, if any.

    Returns HTMLCanvasElement | HTMLImageElement | ImageBitmap | OffscreenCanvas

  • get environmentVersion(): number
    Internal

    Monotonically-increasing version number, bumped each time the environment image changes. Renderers compare against their own last-seen value to detect changes — an integer beats hashing the image bytes every frame.

    Returns number

  • get intensity(): number

    Gets the cubemap IBL contribution multiplier.

    Returns number

  • set intensity(value: number): void

    Sets the cubemap IBL contribution multiplier. Range [0, ∞). At 0 the cubemap contributes nothing even when the active View.renderMode is in IBL.renderModes.

    Default value is 1.4 — a modest boost over the natural 1.0 level so RealisticRender's prefiltered-cubemap fill reads as distinctly brighter than the analytical hemisphere fill in NavigationRender / DetailedRender.

    Parameters

    • value: number

    Returns void

Methods

  • Drops any user-supplied environment image and reverts to the procedural sky. Cheap; the renderer detaches the equirect texture on the next frame.

    Returns void

  • Replaces the procedural sky with an equirectangular environment image fetched from url. Once loaded, the renderer projects it onto the IBL source cubemap and runs the same prefilter / irradiance pipeline as the procedural sky — so the BRDF picks up real environment reflections on metals and the diffuse ambient term reflects the actual scene context.

    Resolves with { ok: true } once the image has loaded and the renderer has been notified. Rejects with { ok: false } on fetch / decode failure.

    Pass any URL form — http(s):, blob:, data:. Cross-origin URLs need CORS headers from the host or the GPU upload will throw a SecurityError.

    Parameters

    • url: string

    Returns Promise<SDKResult<void>>

  • Replaces the procedural sky with a Radiance HDR (.hdr) file fetched from url. Same effect as setEnvironment but the environment is uploaded as RGBA16F so super-bright pixels (the sun, sky-glow) survive the prefilter at full intensity, giving smooth metals a proper HDR specular bloom under tonemapping.

    Resolves with { ok: true } once the file has fetched and decoded. Rejects on network failure or malformed .hdr contents.

    Pass any URL form — http(s):, blob:, data:. Cross-origin URLs need CORS headers from the host.

    Parameters

    • url: string

    Returns Promise<SDKResult<void>>

  • Replaces the procedural sky with a Radiance HDR file already fetched into an ArrayBuffer. Same effect as setEnvironmentHDR but synchronous — useful when the caller has already produced the bytes (bundler import, IndexedDB, etc.).

    Parameters

    • buffer: ArrayBuffer

    Returns SDKResult<void>

  • Replaces the procedural sky with an already-decoded equirectangular environment image. Same effect as setEnvironment but synchronous — useful when the caller has already produced a canvas or ImageBitmap (for example, from a bundled PNG or a createImageBitmap decode).

    Parameters

    • image: HTMLCanvasElement | HTMLImageElement | ImageBitmap | OffscreenCanvas

    Returns SDKResult<void>