# Multiwindow, same scene but different cameras?

**URL:** <https://discourse.libcinder.org/t/multiwindow-same-scene-but-different-cameras/760>\
**Category:** Using Cinder\
**Created:** [July 9, 2017, 9:04pm UTC](https://discourse.libcinder.org/t/multiwindow-same-scene-but-different-cameras/760 "2017-07-09T21:04:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![digitalcoleman](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/digitalcoleman/32/383_2.png) [@digitalcoleman](https://discourse.libcinder.org/u/digitalcoleman)\
**Post date:** [July 9, 2017, 9:04pm UTC](https://discourse.libcinder.org/t/multiwindow-same-scene-but-different-cameras/760/1 "2017-07-09T21:04:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rich.e](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/rich.e/32/1025_2.png) [@rich.e](https://discourse.libcinder.org/u/rich.e)\
**Post date:** [July 10, 2017, 12:56am UTC](https://discourse.libcinder.org/t/multiwindow-same-scene-but-different-cameras/760/2 "2017-07-10T00:56:37Z")

</div>

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](https://www.geforce.com/hardware/technology/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

---

<div class="post-metadata">

**Author:** ![digitalcoleman](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/digitalcoleman/32/383_2.png) [@digitalcoleman](https://discourse.libcinder.org/u/digitalcoleman)\
**Post date:** [July 10, 2017, 1:27am UTC](https://discourse.libcinder.org/t/multiwindow-same-scene-but-different-cameras/760/3 "2017-07-10T01:27:36Z")

</div>

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.

> [@rich.e](#):
>
> 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.

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?

---

<div class="post-metadata">

**Author:** ![paul.houx](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/paul.houx/32/31_2.png) [@paul.houx](https://discourse.libcinder.org/u/paul.houx)\
**Post date:** [July 10, 2017, 4:53pm UTC](https://discourse.libcinder.org/t/multiwindow-same-scene-but-different-cameras/760/4 "2017-07-10T16:53:46Z")

</div>

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:

> **[paulhoux/Cinder-Samples](https://github.com/paulhoux/Cinder-Samples/tree/master/OneWorldMultipleWindows)**
>
> Sample applications for the Cinder framework. Contribute to paulhoux/Cinder-Samples development by creating an account on GitHub.

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

---

<div class="post-metadata">

**Author:** ![lithium](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/lithium/32/38_2.png) [@lithium](https://discourse.libcinder.org/u/lithium)\
**Post date:** [July 11, 2017, 3:42am UTC](https://discourse.libcinder.org/t/multiwindow-same-scene-but-different-cameras/760/5 "2017-07-11T03:42:39Z")

</div>

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.

 ![](https://canada1.discourse-cdn.com/flex030/uploads/libcinder/original/1X/e4656de611239a2d8f940d18f236bcf52356f73a.jpg)
