2.0.1 • Published 1 year ago

@pixi-pbr/diffy v2.0.1

Weekly downloads
18
License
MIT
Repository
github
Last release
1 year ago

@pixi-pbr/diffy

This package can be used to minimize buffer upload overhead in vertex-bound applications. It exploits bufferSubData to upload only modified parts of the batched geometry. This trades off graphics memory for reducing data transfers.

Installation :package:

npm install @pixi-pbr/diffy

Notes

  • WebGL 1: WebGL 1 does not the required overload of gl.bufferSubData to do partial uploads. This 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 pixi-viewport 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!

Usage

To enable this optimization, you can use the exported geometry-factory and drawer.

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
});

Collaboration

I'd like to thank Strytegy for funding the initial development of this package.

2.0.1

1 year ago

2.0.0

1 year ago

1.1.0

3 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.2

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago