Fudge Core
    Preparing search index...

    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 Summary)

    Index

    Properties

    texColor: WebGLTexture
    texDepthStencil: WebGLTexture
    texNormal: WebGLTexture
    texPosition: WebGLTexture

    Methods

    • Add an event listener to targetStatic.

      Parameters

      • _type: string
      • _handler: EventListener
      • Optional_options: boolean | AddEventListenerOptions

      Returns void

    • 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

    • 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

    • Remove an event listener from targetStatic.

      Parameters

      • _type: string
      • _handler: EventListener
      • Optional_options: boolean | AddEventListenerOptions

      Returns void

    • Set the size of the offscreen-canvas.

      ⚠️ CAUTION: If size changes invokes adjustAttachments which is an expensive operation.

      Parameters

      • _width: number
      • _height: number

      Returns void

    • 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

    • Set WebGLs viewport.

      Parameters

      • _x: number
      • _y: number
      • _width: number
      • _height: number

      Returns void