Everything is same to draw-webgl-to-canvas-2d.html except for calling redundant toDataURL(). Canvas spec allows to call toDataURL() without a context. Some bad things can happen if we call toDataURL() without a context and then create a context and then call toDataURL() again.