Geometry factory that minimizes buffer uploads by tracking & updating only modified regions of data
npm install @pixi-pbr/diffyThis package can be used to minimize buffer upload overhead in vertex-bound applications. It exploitsbufferSubData to upload only modified parts of the batched geometry. This trades off graphics memory
for reducing data transfers.
``bash`
npm install @pixi-pbr/diffy
* WebGL 1: WebGL 1 does not the required overload of gl.bufferSubData to do partial uploads. Thispixi-viewport
in turns only allows optimizations in the case where the geometry has not changed at all.
* Projection Matrix: If your application uses a viewport (like by David Fignater), then
you can optimize it use a projection-matrix so that your object's coordinate do not change when modifying
the viewport itself. This has the effect of the geometry not changing at all when panning/zooming so buffer uploads can be fully optimized away!
To enable this optimization, you can use the exported geometry-factory and drawer.
`js
import { BatchRendererPluginFactory } from 'pixi-batch-renderer';
import { DiffGeometryFactory, DiffDrawer } from '@pixi-pbr/diffy';
// YourRenderer will have the diffy optimization!
const YourRenderer = BatchRendererPluginFactory.from({
...yourOptions,
BatchGeometryFactoryClass: DiffGeometryFactory,
BatchDrawerClass: DiffDrawer
});
``
I'd like to thank Strytegy for funding the initial development of this package.