Jump to content

Multiple WebGL (Pixi.Renderer) instances on the same screen?


ShotgunJed
 Share

Recommended Posts

Is it possible to have multiple webGL instances or Pixi.Renderer instances on one page?

For example, I'm trying to make a page that has many items in a grid (like an online store), and I was thinking of having one pixi.Renderer for each item. But then I would have about 20 of these instances which I don't really like, because it may not be as fast as having 1 renderer. I know I could use 1 renderer, but I want to merge the interactive Pixi graphics with html elements.

So I'm trying to do something like this:

https://threejs.org/examples/webgl_multiple_elements.html

The webgl render elements (the 3d shapes) are all placed within html divs.

The way that is achieved is by having 1 renderer, drawing all the shapes in a grid, and "splicing" or splitting the renderer, having different parts of the scene draw to different placeholder divs, in each item.

My questions:

1. Can Pixi.js do this "splicing"? i.e: 1 scene can render to multiple divs, and change the visible viewport, before rendering?

2. Is having 1 pixi renderer (fullscreen) = 20 small pixi renderers (fullscreen when put together) in regards to performance?

Link to comment
Share on other sites

Yes, you can use multiple pixi renderers with same stage or different stages.

The idea is to write your own Application, instead of using baseline: https://github.com/pixijs/pixi.js/blob/dev/src/core/Application.js

This is mashup class for hello-world apps and demos. When you need extra renderer, extra stage, or anything else - you have to write your own App instead of this thing.

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.

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