Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
即使我删除
gl.clearColor(c[0],c[1],c[2],1.0); gl.clear(gl.COLOR_BUFFER_BIT );
在下一个绘制周期开始时屏幕仍会被清除。有没有办法防止这种情况。我想实现某种重绘效果。
当您创建 WebGLRenderingContext 时,您可以告诉它保留绘图缓冲区。
gl = someCanvas.getContext("webgl", { preserveDrawingBuffer: true });
默认是preserveDrawingBuffer: false因为它在某些情况下更快。
preserveDrawingBuffer: false