hit2501 Posted April 27, 2017 Share Posted April 27, 2017 Hi, to make screenshots of a render canvas I used: BABYLON.Tools.CreateScreenshot(engine, camera, { precision: 2 }); And it was working fine until I changed to V3 of Babylon, is there a way I can make it work? jit you cancheck it on a work in progress: http://10foldfurniture.com/webgl/ Thanks Quote Link to comment Share on other sites More sharing options...
sable Posted April 27, 2017 Share Posted April 27, 2017 I think you just need to set preserveDrawingBuffer to true when creating the engine, i.e. new BABYLON.Engine(canvas, true, {preserveDrawingBuffer: true}); GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
hit2501 Posted April 27, 2017 Author Share Posted April 27, 2017 Thanks Sable, I tried but nothing happens Quote Link to comment Share on other sites More sharing options...
sable Posted April 27, 2017 Share Posted April 27, 2017 Does this pg work for you? http://www.babylonjs-playground.com/#F0EKRP#2 If not, it could be that the browser you are using both doesn't support download on the a tag, and is blocking the opening of a new window to show the rendered image. Quote Link to comment Share on other sites More sharing options...
hit2501 Posted April 27, 2017 Author Share Posted April 27, 2017 Thanks yes, it worked in your playground but no in my project, do you know what could be my problem? Quote Link to comment Share on other sites More sharing options...
sable Posted April 27, 2017 Share Posted April 27, 2017 In your project, does it download a blank screenshot, or just do nothing at all? Your WIP site you posted above for me atm downloads a blank screenshot when clicking the render view button, which is because the engine doesn't have preserveDrawingBuffer set (as above). Quote Link to comment Share on other sites More sharing options...
hit2501 Posted April 27, 2017 Author Share Posted April 27, 2017 Blank screenshot, just in case when I downloaded your sample didnt work either. Strange thing, I put preserveDrawingBuffer as true but the error continues. Maybe is my error, please can you tell my where I must put the "preserveDrawingBuffer" line? (Im a noob :P) Also, do you think this happens with old versions of babylon? Quote Link to comment Share on other sites More sharing options...
sable Posted April 27, 2017 Share Posted April 27, 2017 Try changing window.engine = new BABYLON.Engine(canvas_model, true); to window.engine = new BABYLON.Engine(canvas_model, true, {preserveDrawingBuffer: true}); Wingnut and hit2501 2 Quote Link to comment Share on other sites More sharing options...
hit2501 Posted April 27, 2017 Author Share Posted April 27, 2017 Sir, I love you, now works perfect, I'm still learning and sometimes (a lot) I fail Quote Link to comment Share on other sites More sharing options...
sable Posted April 27, 2017 Share Posted April 27, 2017 No problem, glad I could help. 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.