Jump to content

CreateScreenshotUsingRenderTarget and anti-aliasing


focomoso
 Share

Recommended Posts

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.

image.png.5063845f1190612c3090872c0dd0d340.pngimage.png.8d437bec768c00038bcfcbd8aeaa7e68.png

Thanks

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...