Skip to content
pixi-silk
GitHub repository
Function

enableSilkBatching

import { enableSilkBatching } from 'pixi-silk';
function enableSilkBatching(): void;

Turns on batching across objects, which is off by default. Runs of consecutive SilkGraphics with the same blend mode and settings then render in one draw call. Only objects created after the call take part, and an object with batch: false never does. There is no call to turn it off. Each renderer gets the pipe the first time it draws one of them, so you can call it before or after creating the Application. It is safe to call again.

It works with WebGL2 and with WebGPU. On WebGPU, call enableWebGPU() too (createSilkApp does it for you), or objects draw one call each, as without batching.

Returns#

void

Example#

import { enableSilkBatching, SilkGraphics } from 'pixi-silk';

enableSilkBatching();
const app = new Application();
await app.init();