A WebGL-based rendering strategy for a Viewer.

See @xeokit/webglrenderer for usage.

Implements

  • Renderer

Constructors

  • Creates a WebGLRenderer.

    Parameters

    • params: {
          textureTranscoder?: TextureTranscoder;
      }

      Configs

      • Optional textureTranscoder?: TextureTranscoder

        Injects an optional transcoder that will be used internally by rendererModel.createTexture to convert transcoded texture data. The transcoder is only required when we'll be providing transcoded data to rendererModel.createTexture. We assume that all transcoded texture data added to a rendererModel will then be in a format supported by this transcoder.

    Returns WebGLRenderer

Properties

renderContext: RenderContext
renderStats: RenderStats
rendererObjects: {
    [key: string]: RendererObject;
}

Interfaces through which each ViewObject shows/hides/highlights/selects/xrays/colorizes its SceneObject within the WebGLRenderer that's configured on its Viewer.

Type declaration

  • [key: string]: RendererObject
tileManager: WebGLTileManager

Accessors

  • get textureTranscoder(): void | TextureTranscoder
  • Internal

    Gets the TextureTranscoder this WebGLRenderer was configured with, if any.

    Returns void | TextureTranscoder

  • get viewer(): Viewer
  • The Viewer this WebGLRenderer is currently attached to, if any.

    Returns Viewer

Methods

  • Internal

    Attaches a @xeokit/viewer!View to this WebGLRenderer.

    The WebGLRenderer will then begin rendering each SceneModel previously or subsequently created with Scene.createModel, for the new View.

    You can only attach as many Views as indicated in Capabilities.maxViews, as returned by Renderer.getCapabilities.

    You must attach a View before you can attach a SceneModel.

    Parameters

    • view: View

      The View to attach.

    Returns void | SDKError

    void

    • View successfully attached.
  • Internal

    Initializes this WebGLRenderer by attaching a Viewer.

    Parameters

    • viewer: Viewer

      Viewer to attach.

    Returns void

    void

    • Viewer successfully attached.
  • Parameters

    • viewIndex: number
    • Optional params: {
          height: number;
          width: number;
      }
      • height: number
      • width: number

    Returns void

  • Internal

    Clears this WebGLRenderer for the given view.

    Parameters

    Returns void | SDKError

    void

    • Success.
  • Internal

    Detaches the given @xeokit/viewer!View from this Renderer.

    The Renderer will then cease rendering for that View.

    Parameters

    • view: View

      The View to detach.

    Returns void | SDKError

    void

    • View successfully detached.
  • Internal

    Detaches the Viewer that is currently attached, if any.

    Returns void | SDKError

    void

    • Viewer successfully detached.
  • Exits snapshot mode.

    Switches rendering back to the main canvas.

    Returns void

  • Internal

    Gets the capabilities of this WebGLRenderer.

    Parameters

    • capabilities: Capabilities

      Returns the capabilities of this WebGLRenderer.

    Returns void

  • Internal

    Gets if a new frame needs to be rendered for the given View.

    Parameters

    Returns boolean

    boolean

    • True if a new frame needs to be rendered for the View.
  • Returns boolean

  • Internal

    TODO

    Parameters

    • viewIndex: number
    • pickParams: PickParams
    • pickResult: PickResult = ...

    Returns PickResult

  • Returns string

  • Returns HTMLCanvasElement

  • Internal

    Renders a frame for a View.

    Parameters

    • viewIndex: number

      Handle to the View, returned earlier by {@param params Rendering params. @param [params.force=false] True to force a render, else only render if needed. @link @xeokit/webglrenderer!WebGLRenderer.attachView | Renderer.attachView}.

    • Optional params: {
          force: boolean;
          opaqueOnly: boolean;
      }
      • force: boolean
      • opaqueOnly: boolean

    Returns void | SDKError

    SDKError

    • No View is currently attached to this Renderer.
    • Can't find a View attached to this Renderer with the given handle.
  • Returns void

  • Internal

    Sets whether the WebGLRenderer draws edges. Triggers a new frame render.

    Parameters

    • viewIndex: number
    • enabled: boolean

    Returns void

  • Internal

    Indicates that the WebGLRenderer needs to draw a new frame.

    Parameters

    • Optional viewIndex: number

    Returns void

  • Internal

    Triggers a rebuild of the shaders within this WebGLRenderer for the given View.

    Parameters

    Returns void

    void

    • Success.
  • Internal

    Sets whether the WebGLRenderer draws with physically-based rendering. Triggers a new frame render.

    Parameters

    • viewIndex: number
    • enabled: boolean

    Returns void

  • Internal

    Sets whether the WebGLRenderer draws with SAO. Triggers a new frame render.

    Parameters

    • viewIndex: number
    • enabled: boolean

    Returns void

  • Internal

    Enable/disable rendering of transparent objects for the given View.

    Parameters

    • viewIndex: number

      Handle to the View, returned earlier by Renderer.attachView.

    • enabled: boolean

      Whether to enable or disable transparent objects for the View.

    Returns void

    void

    • Success.

Events

onCompiled: EventEmitter<WebGLRenderer, boolean>
onDestroyed: EventEmitter<WebGLRenderer, boolean>