Jump to content

Switch renderers during running

Saeki Amae

Recommended Posts

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 by Saeki Amae
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.

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.


  • Recently Browsing   0 members

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