InstancedRenderer

class InstancedRenderer extends PIXI.ObjectRenderer

InstancedRenderer is an object-renderer for drawing meshes/shapes/display-objects that have a common geometry and some "instanced" attributes.

Constructor


new InstancedRenderer(renderer: PIXI.Renderer, options: PIXI.IInstancedRendererOptions) → {}
Parameters:
Name Type Description
renderer PIXI.Renderer

the WebGL renderer to attach to

options PIXI.IInstancedRendererOptions

the pipeline description

Summary


Properties from InstancedRenderer

PIXI.Buffer
_instanceBuffer

The instance buffer holds all instanced attributes in an interleaved fashion.

PIXI.Shader
_shader

The shader used to draw all instances.

PIXI.State
_state = PIXI.State.for2d()

The WebGL state required for using the shader.

PIXI.Geometry
protected _geometry

The reference geometry specifying the "attribute style".

Object<string, number>
protected _instanceAttribSizes

Object mapping (instanced) attribute IDs to their sizes in bytes.

Object<string, string>
protected _instanceAttribViews
Object<string, string>
protected _instanceBuilder
number
protected _instanceSize

The bytes used per instance/display-object.

Array<PIXI.DisplayObject>
protected _objectBuffer

Buffered display-objects

number
protected _objectCount = 0
number
protected instanceRendererID = undefined

Unique ID for this instance renderer.

Methods from InstancedRenderer

void
flush()

Flushes/draws all pending display-objects.

void
render(displayObject: PIXI.DisplayObject)
start()

Properties inherited from ObjectRenderer

PIXI.Renderer
protected renderer

The renderer this manager works for.

Methods inherited from ObjectRenderer

void
destroy()

Generic destruction method that frees all resources. This should be called by subclasses.

void
stop()

Stops the renderer. It should free up any state and become dormant.

Public Properties


_instanceBuffer InstancedRenderer.ts:301
_instanceBuffer: PIXI.Buffer

The instance buffer holds all instanced attributes in an interleaved fashion.

_shader InstancedRenderer.ts:70
_shader: PIXI.Shader

The shader used to draw all instances.

_state InstancedRenderer.ts:77
_state: PIXI.State = PIXI.State.for2d()

The WebGL state required for using the shader.

Protected Properties


_geometry InstancedRenderer.ts:62
protected _geometry: PIXI.Geometry

The reference geometry specifying the "attribute style".

_instanceAttribSizes InstancedRenderer.ts:85
protected _instanceAttribSizes: Object<string, number>

Object mapping (instanced) attribute IDs to their sizes in bytes.

_instanceAttribViews InstancedRenderer.ts:94
protected _instanceAttribViews: Object<string, string>

Object mapping (instanced) attribute IDs to their data type views (i.e. uint32View, float32View, uint8View, etc. in PIXI.ViewableBuffer).

_instanceBuilder InstancedRenderer.ts:53
protected _instanceBuilder: Object<string, string>

Maps display-object property names holding instanced attribute data to their attribute names.

_instanceSize InstancedRenderer.ts:104
protected _instanceSize: number

The bytes used per instance/display-object.

_objectBuffer InstancedRenderer.ts:113
protected _objectBuffer: Array<PIXI.DisplayObject>

Buffered display-objects

_objectCount InstancedRenderer.ts:121
protected _objectCount: number = 0

The number of display-objects buffered. This is different from the buffer's capacity this._objectBuffer.length.

instanceRendererID InstancedRenderer.ts:44
protected instanceRendererID: number = undefined

Unique ID for this instance renderer.

Public Methods


flush InstancedRenderer.ts:152
flush() → {void}

Flushes/draws all pending display-objects.

Returns:
Type Description
void
render InstancedRenderer.ts:142
render(displayObject: PIXI.DisplayObject) → {void}
Parameters:
Name Type Description
displayObject PIXI.DisplayObject
Returns:
Type Description
void
start InstancedRenderer.ts:134
start() → {}

Powered by webdoc!