Skip to content

an panorama projection system that can receive texture via Spout library and use bezier warping for projection mapping

License

Notifications You must be signed in to change notification settings

gary9716/MultiDisplaySpoutSystem

Repository files navigation

MultiDisplaySpoutSystem

It is a panoramic projection system implemented in Openframeworks and was used in my art exhibition in National Taiwan Museum of Fine Arts. It has been demonstrated that we can run the system that spawned 9 applications for projection, each of which rendered in the resolution of 1920 * 1200 and also run a Vive VR application on a single computer in the same time smoothly. (I forgot the actual frame rate but I wouldn't feel dizzy during the VR app experience.)
The overall system contains 2 Openframeworks class and their roles are:

  1. ofApp:
  • receive an large texture via Spout library (In my case, it received an texture with the resolution of 15390 * 1200 from Unity).
  • show calibration GUI in calibration mode.
  • receive mouse and keyboard events.
  • receive OSC message from other application like Unity so it can be controlled via application in other platform.
  • manage the visibility of other windows applications which are the instances of displayApp.
  • expose the texture processing API for displayApp.
  1. displayApp:
  • process the texture(extract part of the texture and warp the extracted content) via the API in ofApp.
  • project it onto display.

Getting Started

These instructions will get you a copy of the project up and running on your local machine.

Prerequisites

  • Windows OS (Currently,it only support Windows OS and has worked well in 8.1 and 10)
  • Openframeworks SDK (I developed this with SDK version 0.9.8)
  • Visual Studio 2015

Setup this project

  1. Follow the instructions in Openframeworks website: (it can be skipped if you have already setup OF SDK)
  1. Download this repository and unzip it
  2. Open the project generator in the Openframeworks SDK folder (the path would be "{path to the root of OF SDK}\projectGenerator-vs")

projectGenerator

  1. click the "import" button and select the project folder which is the root of bin and src.

setProjPath

  1. If the project is successfully imported, it should look like the image below. click the "Update" button and then click the "Open In IDE" button.

importSucceed

  1. click Build > Build Solution and after the project is successfully built, the executable would be in the bin folder of project folder.

BuildSolution

executable

Specify Parameters

There is a parameter file called "param.xml" under the path {project path}\bin\data. The meaning of these parameters:

  1. ShowDebugInfo: show debugging information like FPS.

  2. MonitorIndices: the indices of monitors(or displays) you want to use. the information can be look up in console window. The console window in the image below sort the monitors' virtual position by their X position.

consoleWin

According to this information, one can set the params.xml like this:

params

  1. SubSectionIndices: the indices used for calculating which part of texture should be extracted. Given the resolution of each display and their overlapping width, the left boundary of each extracted is calculated as ( resolutionX - overlappingWidth ) * index. For example: the left boundary of an application with subsection index 1 would be (1920 - 210) * 1 = 1710

projectorsParams

Because it’s circular, setting 1 and 2 are both valid setting.

Another point is that the monitors in windows display setting also need to be arranged in the right order.

windowsDisplaySetting

  1. PauseAndLeave: pause for viewing the information in console window and terminate the application. mainly for adjusting parameters.(1 for using this function and 0 for not using this function)

  2. AppMode: 0 for demonstration mode and 1 for calibration mode.

  3. LoadMapping: load the bezier warping parameters saved in BezierWarpManager_settings.xml.(1 for loading and 0 for not loading)

  4. DoWarp: 1 for applying bezier warping and 0 for simply displaying extracted region.

  5. CornerX: the percentage of padding of X direction in calibration mode.

  6. CornerY: the percentage of padding of Y direction in calibration mode.

  7. OverlapPixels: the width of overlapping area between two consecutive displays.

  8. SpoutSender: the name of the spout sender that sends the shared texture.

  9. resolution: the resolution of certain monitor.

Test the system

To test the system, you would need a SpoutSender. Here I provide the Unity SpoutSender used in my art exhibition. It creates several cameras, aligns their frustum , makes them render to a large renderTexture and uses a SpoutSender to share the texture. Steps of setting up the SpoutSender in Unity:

  1. drop the PanoramaSpoutSender.unitypackage into Unity asset folder.
  2. drop the PanoramaCamAndSpout.prefab into a scene and save the scene.(if you didn't save the scene after dropping the prefab, it may crash during runtime)
  3. click play button in Unity.
  4. set the AppMode as 0 in param.xml and run the executable in the bin folder of project folder.
  5. see whether the system project correctly.

testResult

Calibration

caliMode
In calibration mode, Main App(ofApp) would render the content based on currently selected displayApp. User can switch among displayApps, adjust the overlapping area and warp the content for adapting curve surface.
How To:

  1. set the AppMode as 1 and run the executable
  2. focus on the Main App and user can do the following interaction.
  • key pressed:
    • F1 or F2: switch among displayApps
    • F5: save the warping parameters
    • F6: load the warping parameters
    • ESC: close the system
    • z: switch between drawing the warped texture or drawing calibration rectangles.
      zSwitch
    • d: restore the default setting of current selected displayApp.
    • arrow keys: move the selected anchor or crosshair.
  • mouse interaction:
    • right click on one of crosshairs: show/hide bezier warping anchors.
    • left click on one of crosshairs or anchors: select clicked anchor or crosshair
    • left click and drag one of crosshairs or anchors: move the anchor or crosshair.

Specs of the computer used in the art exhibition:

  • CPU: i7 7700K
  • GPU: GTX 1060 Mini ITX OC 3G, GTX 1050Ti OC 4G, HD7750
  • Motherboard: ROG STRIX Z270F
  • RAM: DDR4 2400 8GB * 2

Built With

  • Spout - real-time video sharing system.
  • ofxBezierWarp - an addon that can do bezier warping and control the warping with mouse and keyboard.
  • ofxBezierWarpManager - an addon that manage multiple bezier warps.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

  • Kuan-Ting Chou : the only developer of this system

License

This project is licensed under the GNU Lesser General Public License - see the LICENSE.txt file for details

Art exhibition photos

photo1

photo2

photo3

photo4

Acknowledgments

  • The great addons and library I have used in this project
  • Inspired by my friend called Liu Ting Chun who is studying in Taipei National University of the Arts
  • NTMOFA for giving me an chance
  • README Template

About

an panorama projection system that can receive texture via Spout library and use bezier warping for projection mapping

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published