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