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#
RenderPipe<SilkGraphics>
Constructors#
Constructor#
new SilkPipe(renderer: Renderer): SilkPipe;
Created once per renderer, by the pipe that enableSilkBatching() installs or by Pixi’s extensions.
Parameters#
| Parameter | Type |
|---|---|
renderer | Renderer |
Returns#
SilkPipe
Properties#
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#
| Parameter | Type |
|---|---|
g | SilkGraphics |
set | InstructionSet |
Returns#
void
Implementation of#
RenderPipe.addRenderable
destroyInstructionSet()#
destroyInstructionSet(set: InstructionSet): void;
Frees the batches of an instruction set that Pixi no longer uses.
Parameters#
| Parameter | Type |
|---|---|
set | InstructionSet |
Returns#
void
execute()#
execute(instruction: Instruction): void;
Draws a batch, or hands a single object to the mesh pipe.
Parameters#
| Parameter | Type |
|---|---|
instruction | Instruction |
Returns#
void
updateRenderable()#
updateRenderable(g: SilkGraphics): void;
Nothing to do: a batch reads every object again when it draws.
Parameters#
| Parameter | Type |
|---|---|
g | SilkGraphics |
Returns#
void
Implementation of#
RenderPipe.updateRenderable
validateRenderable()#
validateRenderable(g: SilkGraphics): boolean;
A batch never needs a rebuild for changes inside its objects.
Parameters#
| Parameter | Type |
|---|---|
g | SilkGraphics |
Returns#
boolean
Implementation of#
RenderPipe.validateRenderable