Hierarchy

  • CoreRenderer
    • WebGlCoreRenderer

Constructors

Properties

activeRttNode: null | CoreNode = null
curBufferIdx: number = 0
curRenderOp: null | WebGlCoreRenderOp = null
defShaderCtrl: BaseShaderController
defaultShader: WebGlCoreShader
defaultTexture: Texture

White pixel texture used by default when no texture is specified.

fQuadBuffer: Float32Array
glw: WebGlContextWrapper
mode: undefined | "canvas" | "webgl"
options: CoreRendererOptions
quadBuffer: ArrayBuffer
quadBufferCollection: BufferCollection
quadBufferUsage: number = 0
renderOps: WebGlCoreRenderOp[] = []
renderToTextureActive: boolean = false

Whether the renderer is currently rendering to a texture.

rttNodes: CoreNode[] = []
shManager: CoreShaderManager
stage: Stage
system: CoreWebGlSystem
txMemManager: TextureMemoryManager
uiQuadBuffer: Uint32Array

Methods

  • This function adds a quad (a rectangle composed of two triangles) to the WebGL rendering pipeline.

    It takes a set of options that define the quad's properties, such as its dimensions, colors, texture, shader, and transformation matrix. The function first updates the shader properties with the current dimensions if necessary, then sets the default texture if none is provided. It then checks if a new render operation is needed, based on the current shader and clipping rectangle. If a new render operation is needed, it creates one and updates the current render operation. The function then adjusts the texture coordinates based on the texture options and adds the texture to the texture manager.

    Finally, it calculates the vertices for the quad, taking into account any transformations, and adds them to the quad buffer. The function updates the length and number of quads in the current render operation, and updates the current buffer index.

    Parameters

    • params: QuadOptions

    Returns void

  • Add a texture to the current RenderOp. If the texture cannot be added to the current RenderOp, a new RenderOp will be created and the texture will be added to that one.

    If the texture cannot be added to the new RenderOp, an error will be thrown.

    Parameters

    Returns number

    Assigned Texture Index of the texture in the render op

  • Replace the existing RenderOp with a new one that uses the specified Shader and starts at the specified buffer index.

    Parameters

    • shader: WebGlCoreShader
    • shaderProps: Record<string, unknown>
    • alpha: number
    • dimensions: Dimensions
    • clippingRect: RectWithValid
    • bufferIdx: number
    • Optional renderToTexture: boolean
    • Optional parentHasRenderTexture: boolean
    • Optional framebufferDimensions: Dimensions

    Returns void

  • Render the current set of RenderOps to render to the specified surface.

    TODO: 'screen' is the only supported surface at the moment.

    Parameters

    • surface: "screen" | CoreContextTexture = 'screen'

    Returns void

Generated using TypeDoc