Reputation: 449
I came across this gifx.js - http://evanw.github.io/webgl-filter/ - which seems to work well except for one thing: the save button always generates a blank image. I have tried playing around with the source but do not understand why the data URI that is generated is always the same (and blank) rather than that of the canvas. This is the script that I've been trying to tinker with - http://evanw.github.io/webgl-filter/script.js. If anyone has any ideas, I would appreciate the help!
Upvotes: 1
Views: 198
Reputation: 1196
The WebGL context needs to be created with { preserveDrawingBuffer: true }
in the options, otherwise the buffer being rendered is cleared once it is drawn to the screen, and toDataURL will give you a blank image.
See also: How do you save an image from a Three.js canvas?
Upvotes: 2