Dad72 Posted November 12, 2016 Share Posted November 12, 2016 Hi, Tools.CreateScreenshotUsingRenderTarget() returns a texture with a download error. Tools.CreateScreenshot() returns an error with a black texture. This produces if I leave the camera as is is loading the scene. If I look at the sky, it works for one, but the other always has a black texture. http://www.babylonjs-playground.com/#1WQSPX Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 13, 2016 Share Posted November 13, 2016 Have same problem as @Dad72. I also get a totally black screenshot image using BJS v2.5 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 14, 2016 Share Posted November 14, 2016 Unfortunately this is a Chrome security issue. It works on firefox and IE for isntance Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 14, 2016 Author Share Posted November 14, 2016 In fact I have the impression that it works when the camera is horizontal. If it looks down, it does not work anymore. This works with Chrome, but depending on the orientation of the camera. Or another idea, the camera must look at an object. If there is only the sky, it does not work : On the other hand, there is a new error now with document is undefined http://www.babylonjs-playground.com/#1WQSPX#4 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 14, 2016 Share Posted November 14, 2016 Does it work on firefox for you? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 14, 2016 Author Share Posted November 14, 2016 Yes, on Firfox is Ok. And it seems to work with Chrome now. Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 15, 2016 Share Posted November 15, 2016 @Deltakosh It is not working to take screenshot any more with the v2.5! I checked with v2.3 and v2.4 and there it works. This is the code i use to take screenshots with. BABYLON.Tools.CreateScreenshot(engine, scene.activeCamera,{width: canvas.width,height: canvas.height}); Edit: @Dad72 command BABYLON.Tools.CreateScreenshot(engine, scene.activeCamera, { precision: 2 }); works however in v 2.5 Edit again: New PG:http://www.babylonjs-playground.com/#1WQSPX#6 BABYLON.Tools.CreateScreenshot(engine, scene.activeCamera, { precision: 1 }); DOES not work either! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 15, 2016 Share Posted November 15, 2016 Your PG works for me Quote Link to comment Share on other sites More sharing options...
DigiHz Data Posted November 16, 2016 Share Posted November 16, 2016 I checked it on firefox, opera,firefox developer edition, IE and chrome on my developer computer and other computer.(all updated to latest version) And it DOES work.(but not on my developer computer). It is just me having some problem with firefox extensions on my developer computeri think. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Jaskar Posted June 23, 2017 Share Posted June 23, 2017 I know this is an old topic, but after some times searching why my screenshot render was transparent, I found that you have to set the engine "preserveDrawingBuffer" to true to get it working. This message is a reminder for myself and maybe help for people having the same issue Temechon 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 23, 2017 Author Share Posted June 23, 2017 I also noticed that "preserveDrawingBuffer: true" solve this problem. But why should we use that? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 23, 2017 Share Posted June 23, 2017 preserveDrawingBuffer won't create a new buffer for every frame. And thus will keep the content as it is. Without it, every frame is filled with transparent color Jaskar 1 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted June 23, 2017 Author Share Posted June 23, 2017 ok, I see. 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.