jacquesr Posted February 23, 2016 Share Posted February 23, 2016 Hi guys, I'd like to change the state of antialiasing at runtime. I can not get this to work. I dispose everything and build a completely new scene (and a new engine instance!) with the changed antialiasing setting. Afterwards, antialiasing stays on if it was on and off if it was off before. Is it somehow possible to do that? Should it work? Also, it would be really awesome to be able to change antialiasing while a scene is running. I could make use of that because the scene I am developing could benefit from higher fidelity as long as there is no user interaction vs. better performance when there is any. Regards Jacques P.S.: @Deltakosh: Apart from my name, I'm not french :-) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 23, 2016 Share Posted February 23, 2016 Rats! I thought you were French So regarding your question: yes it should work if you create a new engine. can you share your code running somewhere? Quote Link to comment Share on other sites More sharing options...
jacquesr Posted February 23, 2016 Author Share Posted February 23, 2016 Not easily, yet I can try to reproduce the scenario in the playground... Quote Link to comment Share on other sites More sharing options...
jacquesr Posted February 23, 2016 Author Share Posted February 23, 2016 Hey Deltakosh... watch this: http://babylonjs-playground.com/#26IVDP#1 For me, antialiasing is never changed in that example Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 24, 2016 Share Posted February 24, 2016 In this example you did not dispose the previous engine (You cannot have two engines on the same canvas) Quote Link to comment Share on other sites More sharing options...
jacquesr Posted February 24, 2016 Author Share Posted February 24, 2016 Hi Deltakosh, thanks for the remark. I once read that we should not call engine.dispose(). But that was in a different context. However, can you take my example and show me how I can cleanly dispose the engine? If I just add engine.dispose, I get exceptions when trying to rebuild the scene. It doesn't matter if I first delete the scene and then the engine or the other way around. Do I also have to create a completely new canvas? http://babylonjs-playground.com/#26IVDP#2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 24, 2016 Share Posted February 24, 2016 Unfortunately this could not be done on the Playground as it will recreate an engine everytime Quote Link to comment Share on other sites More sharing options...
jacquesr Posted February 24, 2016 Author Share Posted February 24, 2016 ok. I will try This in my project Thank You very much Quote Link to comment Share on other sites More sharing options...
Steffen Posted September 16, 2016 Share Posted September 16, 2016 Hi, is there by now a way to change the antialiasing without disposing the whole scene? Edit: Why it is useful If your app follows some logic (game, simulation, etc) and if this logic is additionally binded to another machine, but still local - you can't simply dispose all of your (dynamically) imported meshes without to restart the whole game/simulation/etc. I think there are much more applications where you want to disable antialiasing to get some extra fps without restarting everything. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 16, 2016 Share Posted September 16, 2016 Unfortunately no, This is tied to context creation (A hard constraint of WebGL) 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.