jessepmason Posted July 29, 2015 Share Posted July 29, 2015 Hello Everyone! I am wondering is there a way to save a dynamic texture to disk for later use? Quote Link to comment Share on other sites More sharing options...
jahow Posted July 29, 2015 Share Posted July 29, 2015 Hey, Welcome around. I made you an example where the dynamic texture is saved as PNG image when you click on the scene: http://www.babylonjs-playground.com/#CA4SM#1 The trick is to get the dynamic texture data with this code:var imageurl = groundTexture.getContext().canvas.toDataURL("image/png");Also the download code is taken from the Tools.DumpFramebuffer function of BJS: https://github.com/BabylonJS/Babylon.js/blob/master/src/Tools/babylon.tools.ts#L492 Quote Link to comment Share on other sites More sharing options...
jessepmason Posted July 29, 2015 Author Share Posted July 29, 2015 Thats exactly what I was looking for, quick response too! Thanks! Quote Link to comment Share on other sites More sharing options...
jahow Posted July 29, 2015 Share Posted July 29, 2015 No worries, happy to help jdnichollsc 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.