开发者

Save big webgl texture to disk

开发者 https://www.devze.com 2023-04-06 05:12 出处:网络
I did a webgl shader开发者_如何学JAVA that generate a procedural texture of about 8k * 4k. I need to save this texture to disk. I was wondering if there is some facility to do that. I know it would be

I did a webgl shader开发者_如何学JAVA that generate a procedural texture of about 8k * 4k. I need to save this texture to disk. I was wondering if there is some facility to do that. I know it would be possible to write a function that retrieve the texture by block and rebuild it in a 2d canvas to recontruct it, but before doing that I would like to be sure there is not other way.

Anyone ?


Check the File API and the File API Writer for HTML5, you must also keep in mind that your canvas must be untainted (read: no cross-origin images rendered) to read the pixels from it.

With the File API you must read the pixels and write them as a blob directly.

0

精彩评论

暂无评论...
验证码 换一张
取 消