Closed Schmavery closed 7 years ago
This may be solved by running
Gl.readBuffer Constants.GL_BACK;
Gl.drawBuffer Constants.GL_FRONT;
Gl.copyPixels Constants.GL_COLOR
right after setup, which should copy the back buffer to the front buffer. Double buffering is probably what is resulting in the flickering. Unfortunately regl doesn't support these operations yet.
Hard to know if this will affect behaviour on web.
Some insight as to the behaviour on web: http://stackoverflow.com/a/11553432
WebGL automatically clears the drawing buffer on each frame unless you tell it not to
This might also be an interesting point regarding parity between native and web default background colour, worth checking out:
Try setting the page CSS background to blue instead of white, does your WebGL canvas still show white, or does it turn blue as well? (In other words, is the white area just a transparent WebGL canvas due to low alpha values?
Woooooo
@bsansouci any ideas
example:
Green square flickers and red one doesn't. Are we somehow clearing the screen and redrawing... seems craaazy.
Eh... on web the green doesn't show up at all.
I probably copy pasted the rect code without understanding exactly how it works.