Jump to content

Multiple Canvases for Multiple Viewports


joshcamas
 Share

Recommended Posts

Given your total resolution is still only going to be a full screen, performance might not be too bad if you just use drawImage a few times a frame.

 

E..g

• For equal 4 canvas viewports you also have a background babylon canvas (hidden) all at 50%w,50%h.

• Every frame babylon selects each viewport and draws the rendered canvas to one of the other canvases.

 

Although thinking about it, if you can only render one viewport a frame in Babylon (I've never tried multiple cameras) you would be limited to 15fps per viewport in this example, or even less with more...

Link to comment
Share on other sites

http://urbanproductions.com/wingy/babylon/polygun/polygun03.htm  :)  A little prettier.  Zip version, too.  (stale BJS version in the zip... update after DL)

 

But it's not the best example.  My cameras/selecting were out of control.  The blue divider lines... are also viewports.  There's probably better ways.

 

That tri-view is a starter for a single-player version of a game called Artillery Duel (shoot cannonballs at things).  It's lower viewport was going to be my first attempt to build a webGL gui.  Not a sophisticated gui, but enough to do the game's controls.  Anyone who feels like advancing that game or using that tri-view (which is actually a 5-view)... please do.

 

Gryff and I once had some trouble with X/Y picking coords when using multiple viewports and/or using a row of html at the top of the screen.  Deltakosh did some work on something to help us compensate for those X/Y offsets, but I haven't had a chance to play with the picking since then.

 

The original thread about that... is http://www.html5gamedevs.com/topic/5973-multiple-viewport-issues/

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