debugs WebGL rendering
npm install webgl-rendering-debuggerwebgl-rendering-debugger is a debug tool for WebGL.
It adds debug process to WebGLRenderingContext method.
Overloaded methods are executed as before.
import WebGLRenderingDebugger, { DrawCall } from 'webgl-rendering-debugger';var webglDebug = new WebGLRenderingDebugger(webglContext);
webglDebug.attach(WebGLRenderingDebugger.Inspectors.DRAW_CALLS);
`
Inspecting draw calls
`
const inspector = webglDebug.getAttachedInstpector(WebGLRenderingDebugger.Inspectors.DRAW_CALLS);
console.log("drawCall", inspector.count);
inspector.resetCount();
`Detach debugger
`
webglDebug.detach(WebGLRenderingDebugger.Inspectors.DRAW_CALLS);
``It adds debugging process to WebGLRenderingContext methods.
Therefore, performance affect should be expected.