Class RenderWebGLAbstract

Base class for RenderManager, handling the connection to the rendering system, in this case WebGL. Methods and attributes of this class should not be called directly, only through Render

Hierarchy (view full)

Methods

  • Adjusts the size of the different texture attachments (render targets) to the canvas size ⚠️ CAUTION: Expensive operation, use only when canvas size changed

    Returns void

  • Checks the first parameter and throws an exception with the WebGL-errorcode if the value is null

    Type Parameters

    • T

    Parameters

    • _value: T

      value to check against null

    • _message: string = ""

      optional, additional message for the exception

    Returns T

  • Clear the offscreen renderbuffer with the given Color

    Parameters

    • Optional _color: Color
    • _colors: boolean = true
    • _depth: boolean = true
    • _stencil: boolean = true

    Returns void

  • Initializes offscreen-canvas, renderingcontext and hardware viewport. Call once before creating any resources like meshes or shaders

    Parameters

    • Optional _antialias: boolean
    • Optional _alpha: boolean

    Returns WebGL2RenderingContext

  • Used with a Picker-camera, this method renders one pixel with picking information for each pickable object in the line of sight and returns that as an unsorted array of Picks. The function to render the objects into the pick buffer must be provided by the caller.

    Type Parameters

    • T

    Parameters

    Returns Pick[]

  • Read the (world) position from the pixel at the given point on the render-rectangle (origin top left). ⚠️ CAUTION: Currently only works when ambient occlusion is active due to writing to the position texture being disabled otherwise.

    Parameters

    Returns Vector3

  • Set which color components to enable or to disable when rendering to a color buffer.

    Parameters

    • _r: boolean
    • _g: boolean
    • _b: boolean
    • _a: boolean

    Returns void

  • Set the final framebuffer to render to. If null, the canvas default framebuffer is used. Used by XR to render to the XRWebGLLayer framebuffer.

    Parameters

    • _buffer: WebGLFramebuffer

    Returns void

  • Enable / Disable WebGLs scissor test.

    Parameters

    • _test: boolean
    • Optional _x: number
    • Optional _y: number
    • Optional _width: number
    • Optional _height: number

    Returns void