Saeki Amae Posted August 9, 2020 Share Posted August 9, 2020 (edited) Hello, i would like to ask, how to switch renderers from canvas to webGL and opposite without refreshing page (and hopefully keeping old stage) ? When i try to simply stop the ticker and replace renderer object with another i get errors Please, help me Here is the code i do: setRenderer(webgl) { this.isWebGL = webgl; if (webgl) this.renderer = new px.Renderer(this.renderOptions); else this.renderer = new px.CanvasRenderer(this.renderOptions); } When I try to switch from GL to canvas i get error "Uncaught TypeError: Cannot read property 'imageSmoothingEnabled' of null" and when from canvas to GL it says that my browser doesn't support GL renderer (using chrome here and having new nvidia card) Edited August 9, 2020 by Saeki Amae Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 9, 2020 Share Posted August 9, 2020 (edited) Stage, ticker and load actually dont care about specific renderer. Just destroy old one, create new one. all renderTexture contents will be lost, but everything else will stay The bigger problem is to change RESOLUTION (pixel density). Edited August 9, 2020 by ivan.popelyshev Quote Link to comment Share on other sites More sharing options...
Saeki Amae Posted August 9, 2020 Author Share Posted August 9, 2020 I did destroy but i keep getting those errors 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.