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)

Properties

uboLights: WebGLBuffer
uboLightsVariableOffsets: {
    [_name: string]: number;
}

Type declaration

  • [_name: string]: number

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

  • 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

  • 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 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