tparisi / glam

GL and Markup
http://www.glamjs.org/
MIT License
237 stars 36 forks source link

Data URI's and/or Dynamic Textures #36

Open psema4 opened 9 years ago

psema4 commented 9 years ago

Is it possible to use Data URI's (or similar) to generate textures from canvas elements? If yes, would it be possible to see some sample code showing how to do this?

I'm working on a (proof-of-concept) glam-powered editor at http://projects.psema4.com/glam/3de/

3DE Screenshot

I tried to generate a grid texture for my ground plane but wasn't able to get it working. I've saved a copy of the generated image and disabled the texture generator for the time being. (Fwiw, it's still early days for glam & I - less than 12 hours have gone into my project so far. A re-write will be coming soon.)

Another (of several) use cases that I'd like to look at would embed HTML content via https://github.com/cburgmer/rasterizeHTML.js