Multiwindow, same scene but different cameras?


#1

I am trying to update an older cinder project (0.8.3) and move from running 3 screens with a Matrox to running 3 screens with one computer. Looking at the multi window it seems fairly easy to spawn three windows all fullscreen and I assume assign them to different screens? Second question is if I can setup one 3D scene and have each screen render it from a different camera so I can then project the three as one seamless view? I am trying to determine feasibility before diving in so any advice is deeply appreciated.


#2

What’s the graphics card? You’ll have a much simpler time if you can manage to use the drivers to make a virtual desktop that spans multiple displays. I’ve been using NVidia Mosaic for this, which requires something in the Quadro series, but I believe there is something similar with GTX cards too (Surround, maybe?).

Other than that, you can also manually size just one window to span all three displays, and make it borderless, but this doesn’t work near as nice as a fullscreen app with one window.

If you have multiple windows, you’ll have multiple gl contexts, so handling resources across the three of them becomes more complicated.

cheers,
Rich


#3

Thank you for the feedback! I am trying to pull this off on an early 2013 MBP with an NVIDIA GT 650M. On top of that, MacOS is going to limit the use of the good drivers.

This is the route I will try, but why do you say this is not as nice?
What about the tactic of rendering to one large FBO and then each display/window uses a piece of it?


#4

Hi,

I have been away from Cinder for a while, busy with other stuff, so forgive me in advance if it’s not working, but I have a sample that does what you want:

At the very least, you could have a look at it for ideas. It’s pretty easy to render the same scene in multiple windows, but you’ll have to understand that you’re going to do the same work multiple times and performance will be an issue. Make sure to draw the least amount of polygons by performing culling where possible. I don’t think culling is part of the sample, but you’ll find some culling code in the samples that come with Cinder. Let us here on the forum know if you have more questions.

-Paul

Edit: Rich’s suggestion to use proper hardware is the better way of doing things. If that proves impossible or too expensive, try rendering to an Fbo first, then copying the correct portion to each window. The solution in the sample above should actually be your last resort. But it might be of interest nonetheless.

Problem with rendering to a single Fbo first is that it requires more memory and, additionally, you can’t share the Fbo across each of the window’s graphic contexts. However, you can share the actual texture used by the Fbo.


#5

One small thing, OSX by default enforces a window to belong to a specific display, so calling getWindow()->spanAllDisplays() won’t work unless you disable this setting.