Skip to content
pixi-silk
GitHub repository
Class

SilkPipe

import { SilkPipe } from 'pixi-silk';

Render pipe that draws runs of consecutive SilkGraphics in one instanced draw call, under WebGL2 and WebGPU. enableSilkBatching installs it.

Implements#

Constructors#

Constructor#

new SilkPipe(renderer: Renderer): SilkPipe;

Created once per renderer, by the pipe that enableSilkBatching() installs or by Pixi’s extensions.

Parameters#

ParameterType
rendererRenderer

Returns#

SilkPipe

Properties#

PropertyModifierTypeDescriptionDefined in
extensionstatic{ name: string; type: ExtensionType[]; }Pixi extension metadata, for extensions.add(SilkPipe) if you register it yourself.batch.ts:217
extension.namepublicstringKey in renderer.renderPipes, and the renderPipeId of batched objects.batch.ts:221
extension.typepublicExtensionType[]Renderer pipe lists the pipe joins.batch.ts:219

Methods#

addRenderable()#

addRenderable(g: SilkGraphics, set: InstructionSet): void;

Adds g to the current run when it can share its draw, or starts a new run.

Parameters#

ParameterType
gSilkGraphics
setInstructionSet

Returns#

void

Implementation of#

RenderPipe.addRenderable

destroyInstructionSet()#

destroyInstructionSet(set: InstructionSet): void;

Frees the batches of an instruction set that Pixi no longer uses.

Parameters#

ParameterType
setInstructionSet

Returns#

void


execute()#

execute(instruction: Instruction): void;

Draws a batch, or hands a single object to the mesh pipe.

Parameters#

ParameterType
instructionInstruction

Returns#

void


updateRenderable()#

updateRenderable(g: SilkGraphics): void;

Nothing to do: a batch reads every object again when it draws.

Parameters#

ParameterType
gSilkGraphics

Returns#

void

Implementation of#

RenderPipe.updateRenderable

validateRenderable()#

validateRenderable(g: SilkGraphics): boolean;

A batch never needs a rebuild for changes inside its objects.

Parameters#

ParameterType
gSilkGraphics

Returns#

boolean

Implementation of#

RenderPipe.validateRenderable