focomoso Posted October 17, 2017 Share Posted October 17, 2017 I've looked through a couple of threads for this (some seem to be older and use a different method for taking screen shots), but haven't found a simple answer. Is there a way to anti-alias screenshots? I'm using CreateScreenshotUsingRenderTarget and have played with setting the samples to various numbers, but it doesn't seem to have any effect. Image on the left is rendered with samples = 16; on the right samples = 1. Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 18, 2017 Share Posted October 18, 2017 There is a way but only if you are using webgl2 Other option: did you try using Tools.CreateScreenshot directly? it is using another technique that should work Quote Link to comment Share on other sites More sharing options...
focomoso Posted October 18, 2017 Author Share Posted October 18, 2017 Tools.CreateScreenshot is returning an entirely transparent image: CreateScreenshotUsingRenderTarget: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAARElEQVQoU2P8////fwYiAOMAKwwPD2cAORWEG/fuZah3dkZx9erVqxkYQ0JC/gsJCTG8e/cOw0uMjIxwsYH2DBHhzQAAK0005fzJ758AAAAASUVORK5CYII= CreateScreenshot: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAF0lEQVQoU2NkIBIwEqmOYVQh3pAiOngACmkAC5eMKzgAAAAASUVORK5CYII= Edit: I found this thread: but there seems not to be a resolution. Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 18, 2017 Share Posted October 18, 2017 Can you repro in the PG? Quote Link to comment Share on other sites More sharing options...
focomoso Posted October 18, 2017 Author Share Posted October 18, 2017 It seems to work fine in the PG. Not sure what my app could be doing that's any different. Could the fact that I'm using 3.0.0 be an issue? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 19, 2017 Share Posted October 19, 2017 Yes we fixed several issues regarding rendertarget in 3.1 Quote Link to comment Share on other sites More sharing options...
brianzinn Posted October 20, 2017 Share Posted October 20, 2017 In my PG there is antialiasing issue - did I not make the sample large enough or is it because of GUI (or something else)?https://www.babylonjs-playground.com/#HJI09Z#1 Quote Link to comment Share on other sites More sharing options...
Kesshi Posted October 20, 2017 Share Posted October 20, 2017 21 minutes ago, brianzinn said: In my PG there is antialiasing issue - did I not make the sample large enough or is it because of GUI (or something else)?https://www.babylonjs-playground.com/#HJI09Z#1 You did not devine the number of samples in your PG. I fixed it in line 64 here: https://www.babylonjs-playground.com/#HJI09Z#2 I used 16 samples. brianzinn 1 Quote Link to comment Share on other sites More sharing options...
focomoso Posted October 20, 2017 Author Share Posted October 20, 2017 Unfortunately seeing the same issue with 3.1.0-alpha3.6 Quote Link to comment Share on other sites More sharing options...
focomoso Posted October 20, 2017 Author Share Posted October 20, 2017 I've done some digging and it seems that canvas.toDataURL() is the culprit. It's returning a blank png image. This isn't babylon.js's fault per se, but can anyone think why that might be happening? I get the same issue on chrome and firefox. Thanks Quote Link to comment Share on other sites More sharing options...
focomoso Posted October 20, 2017 Author Share Posted October 20, 2017 Also found this: https://stackoverflow.com/questions/35226272/taking-a-snapshot-of-babylonjs-scene-sometimes-works-sometimes-doesnt That suggests sending {preserveDrawingBuffer: true} as an option, but this isn't working either... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 23, 2017 Share Posted October 23, 2017 Do you have a repro in the PG? 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.