melonJS
    Preparing search index...

    Class PrimitiveCompositor

    since 18.1.0

    PrimitiveBatcher

    Hierarchy (View Summary)

    Index
    attributes: Object[] | undefined

    an array of vertex attribute properties

    Batcher.addAttribute

    currentSamplerUnit: number | undefined
    currentShader: GLShader | undefined

    the shader currently used by this batcher

    defaultShader: GLShader | undefined

    the default shader created by this batcher

    gl: any
    mode: number | undefined

    primitive type to render (gl.POINTS, gl.LINE_STRIP, gl.LINE_LOOP, gl.LINES, gl.TRIANGLE_STRIP, gl.TRIANGLE_FAN, gl.TRIANGLES)

    gl.TRIANGLES
    
    projectionUniform: string | undefined

    the name of the projection matrix uniform in the shader

    renderer: any
    stride: number | undefined

    the stride of a single vertex in bytes (will automatically be calculated as attributes definitions are added)

    Batcher.addAttribute

    useIndexBuffer: boolean | undefined

    whether this batcher uses indexed drawing

    validatedShaders: WeakSet<object> | undefined
    vertexData: VertexArrayBuffer | undefined

    the vertex data buffer used by this batcher

    vertexSize: number | undefined

    the size of a single vertex in floats (will automatically be calculated as attributes definitions are added)

    Batcher.addAttribute

    vertexState: WebGLVertexState | null | undefined
    viewMatrix: any
    • add vertex attribute property definition to the batcher

      Parameters

      • name: string

        name of the attribute in the vertex shader

      • size: number

        number of components per vertex attribute. Must be 1, 2, 3, or 4.

      • type: number

        data type of each component in the array

      • normalized: boolean

        whether integer data values should be normalized into a certain range when being cast to a float

      • offset: number

        offset in bytes of the first component in the vertex attribute array

      Returns void

    • called by the WebGL renderer when this batcher is being replaced by another. Attribute state no longer needs disabling — it lives in this batcher's vertex-state object and the incoming batcher's bind() replaces the binding wholesale. Kept as a lifecycle hook: subclasses override it to restore mode-specific GL state (see MeshBatcher's blend/depth restore).

      Returns void