joshcamas Posted January 11, 2015 Share Posted January 11, 2015 Hey guys! I'm working on my editor, and am wondering if it is possible to draw different viewports or cameras on separate canvases! Thanks!-Josh Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 12, 2015 Share Posted January 12, 2015 Hello, separate canvas imply separate BABYLON.Engine Quote Link to comment Share on other sites More sharing options...
joshcamas Posted January 12, 2015 Author Share Posted January 12, 2015 Aw. I feared as much. Thanks Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 12, 2015 Share Posted January 12, 2015 Yes unfortunately webgl is tied to a specific canvas Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 12, 2015 Share Posted January 12, 2015 Just out of curiosity: why do you need multiple canvases? I found this demo from wingy: http://urbanproductions.com/wingy/babylon/polygun/polygun02x1.htm But that's not what you want to do? Quote Link to comment Share on other sites More sharing options...
Xeonzinc Posted January 12, 2015 Share Posted January 12, 2015 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... Quote Link to comment Share on other sites More sharing options...
Wingnut Posted January 12, 2015 Share Posted January 12, 2015 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/ 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.