WebGL: Preventing Color Buffer Clearing

Even if I remove

gl.clearColor(c[0],c[1],c[2],1.0); gl.clear(gl.COLOR_BUFFER_BIT ); 

the screen is still blank at the beginning of the next pull cycle. Is there any way to prevent this. I would like to get some kind of overpaint effect.

+4
source share
1 answer

When you create your WebGLRenderingContext, you can tell it to save the drawing buffer.

 gl = someCanvas.getContext("webgl", { preserveDrawingBuffer: true }); 

By default, preserveDrawingBuffer: false , since in some cases it is faster.

+6
source

All Articles