$ npm install @antv/g-webgl
This is a renderer implemented with WebGL2/1.
import { Renderer as WebGLRenderer } from '@antv/g-webgl';
const webglRenderer = new WebGLRenderer();
// create a canvas
const canvas = new Canvas({
container: 'container',
width: 600,
height: 500,
renderer: webglRenderer,
});
We can pass in a specific target(s), which will get downgraded automatically.
new Renderer({
targets: ['webgl2', 'webgl1'],
});
https://www.khronos.org/webgl/wiki/HandlingContextLost
new Renderer({
onContextLost: () => {},
});
© 2010 - cnpmjs.org x YWFE | Home | YWFE