To implement mouse gestures in webgl, i would like to allow the users to “draw on screen” freehand mode. Doing it in 3D webgl would allow to have nice shader effects on the brush being used such as fire effects, glows or other cool graphical candy.
what is the current recommend way to draw on screen in webgl efficiently?
thanks!
You have 2 options.
You could draw to an fbo and then draw the fbo to the canvas
or
You could request ‘preserveDrawingBuffer: true’ when creating the webgl context.