Jump to content

Keep canvas transparent when using antialias filter


Vousk-prod.
 Share

Recommended Posts

Hi you,

I'm using

scene.clearColor = new BABYLON.Color4(0,0,0,0);

to make my canvas transparent (very efficient !).

 

But when I put some antialisas filter on my camera

camera.attachPostProcess(new BABYLON.FxaaPostProcess("fxaa", 1.0, camera, BABYLON.Texture.TRILINEAR_SAMPLINGMODE, _ENGINE, true));

the canvas is not transparent anymore. Instead the background of the canvas is the color defined in the scene.clearColor.

 

Is there a way to keep transparency of the canvas while using aa filter ?

 

Link to comment
Share on other sites

The transparency has came back... but in that case AAF draws a lot of strange border artifacts ( http://jsfiddle.net/vouskprod/LW4gg/ )

 

Sorry for the time you spent on this but while babylon AA postprocess is far better than webgl AA (the one activated with engine = new BABYLON.Engine(canvas, true);), in that particular case of canvas transparency an AA filter which draws custom aliased borders is not very usefull :lol:

Link to comment
Share on other sites

  • 2 weeks later...

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...