Vousk-prod. Posted June 26, 2014 Share Posted June 26, 2014 Hi you,I'm usingscene.clearColor = new BABYLON.Color4(0,0,0,0);to make my canvas transparent (very efficient !). But when I put some antialisas filter on my cameracamera.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 ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 26, 2014 Share Posted June 26, 2014 this should already work could you share a little test somewhere ? Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted June 26, 2014 Author Share Posted June 26, 2014 Ok, I will prepare a test scene this week-end Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted June 26, 2014 Author Share Posted June 26, 2014 And voilà :http://jsfiddle.net/vouskprod/W6exX/ You can activate or not the AA filter, and see the canvas losing its transparency ability... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 27, 2014 Share Posted June 27, 2014 Oh yeah I know why, the fxaa shader return alpha = 1. This is almost impossible to know if it should returns 0 because to do so we have to test every single pixel and this won't work Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted June 27, 2014 Author Share Posted June 27, 2014 Ok. And is there a way to go through this ?Can I force a return alpha = 0 in some way for specific scenes ? Or I can use an other AAf implementation in some cases ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 27, 2014 Share Posted June 27, 2014 I suggest using webgl aa when creating the engine. IF this is not supported then the only way could be to write your own fxaa postprocess, but beware it will be extremely slow if you have to test every pixel Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 27, 2014 Share Posted June 27, 2014 Wait perhaps I have an idea:) Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted June 27, 2014 Author Share Posted June 27, 2014 Ok, I don't move Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 27, 2014 Share Posted June 27, 2014 Could you try the latest version? Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted June 27, 2014 Author Share Posted June 27, 2014 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 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 28, 2014 Share Posted June 28, 2014 Fixed:) Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted June 28, 2014 Author Share Posted June 28, 2014 Can't wait to see that. Did the fix reported in babylon.1.13-beta ? (cause when I try my fiddle with the new one I don't have alpha anymore ) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 28, 2014 Share Posted June 28, 2014 Not yet next update will add it Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted July 8, 2014 Author Share Posted July 8, 2014 I've just seen the result of your fix, it works great.Nice job, thanks ! You rocked, as usual ! 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.