├── .gitignore ├── README.md ├── assets ├── fulldome │ ├── bottom.obj │ ├── left.obj │ ├── right.obj │ └── top.obj ├── shaders │ ├── shader.frag │ └── shader.vert └── texture.jpg ├── cinderblock.png ├── cinderblock.xml ├── resources └── fulldome │ ├── bottom.obj │ ├── left.obj │ ├── right.obj │ └── top.obj ├── samples └── BasicSample │ ├── assets │ ├── fulldome │ │ ├── bottom.obj │ │ ├── left.obj │ │ ├── right.obj │ │ └── top.obj │ ├── shaders │ │ ├── shader.frag │ │ └── shader.vert │ └── texture.jpg │ ├── include │ └── Resources.h │ ├── resources │ ├── CinderApp.icns │ └── cinder_app_icon.ico │ ├── src │ └── BasicSampleApp.cpp │ ├── vc2013 │ ├── BasicSample.sln │ ├── BasicSample.vcxproj │ ├── BasicSample.vcxproj.filters │ └── Resources.rc │ └── xcode │ ├── BasicSample.xcodeproj │ └── project.pbxproj │ ├── BasicSample_Prefix.pch │ └── Info.plist └── src ├── FullDome.cpp └── FullDome.h /.gitignore: -------------------------------------------------------------------------------- 1 | [Bb]uild/ 2 | [Oo]bj/ 3 | *.o 4 | [Dd]ebug*/ 5 | [Rr]elease*/ 6 | *.mode* 7 | *.app/ 8 | *.pyc 9 | .svn/ 10 | *.log 11 | test/ 12 | *.db 13 | 14 | # IDE-specific ignore patterns 15 | 16 | *.pbxuser 17 | *.perspective 18 | *.perspectivev3 19 | *.mode1v3 20 | *.mode2v3 21 | 22 | #XCode 23 | xcuserdata 24 | *.xcworkspace 25 | 26 | #vs 27 | *.sdf 28 | *.opensdf 29 | *.suo 30 | *.pdb 31 | *.ilk 32 | *.aps 33 | ipch/ 34 | 35 | #OSX 36 | .DS_Store 37 | *.swp 38 | *~.nib 39 | # Thumbnails 40 | ._* 41 | 42 | #Windows 43 | Thumbs.db 44 | *.tlog 45 | *.sdf 46 | Desktop.ini 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sharkbox-FullDome 2 | 3 | A fulldome fisheye renderer for Cinder 0.9.0. 4 | 5 | Big thanks to Paul Bourke whose work was critical to figuring this out, specifically [this post](http://paulbourke.net/dome/UnityiDome/). 6 | 7 | How it works 8 | --- 9 | Internally FullDome will create four cameras. Two that look left and right of center 45 degrees on the X-axis, and then 2 that look straight up and straight down with a 45 degree Y-axis twist. 10 | 11 | Each draw cycle each, one is bound and then rendered to an FBO. Each FBO is then bound and mapped to a piece of geometry that makes up a piece of the final circular fisheye render. This means that for each one frame, the scene is drawn four times. 12 | 13 | Usage 14 | -- 15 | Create a normal PerspCamera to drive the fulldome camera. 16 | 17 | ``` 18 | CameraPersp mCam; 19 | mFullDome = FullDome::create( &mCam ); 20 | ``` 21 | 22 | You can change the size of the four individual camera fbos in the constructor. The default is 2048 x 2048. Below we're setting it to 1024 x 1024. 23 | 24 | ```mFullDome = FullDome::create( &mCam, 1024 );``` 25 | 26 | During your draw render your scene once for each camera. 27 | 28 | ``` 29 | mFullDome->bindCamera(FullDome::DomeCam::LEFT); 30 | render(); 31 | mFullDome->unbindCamera(FullDome::DomeCam::LEFT); 32 | 33 | mFullDome->bindCamera(FullDome::DomeCam::RIGHT); 34 | render(); 35 | mFullDome->unbindCamera(FullDome::DomeCam::RIGHT); 36 | 37 | mFullDome->bindCamera(FullDome::DomeCam::UP); 38 | render(); 39 | mFullDome->unbindCamera(FullDome::DomeCam::UP); 40 | 41 | mFullDome->bindCamera(FullDome::DomeCam::DOWN); 42 | render(); 43 | mFullDome->unbindCamera(FullDome::DomeCam::DOWN); 44 | ``` 45 | 46 | The image can then be drawn directly, or rendered to an FBO. 47 | 48 | ``` 49 | mFullDome->draw(); 50 | ``` 51 | 52 | or 53 | 54 | ``` 55 | mFullDome->renderToFbo(); 56 | gl::TextureRef texRef = mFullDome->getFboTexture(); 57 | ``` 58 | 59 | As a caveat, if your lighting calculations are in camera space, they will render funny since the final image is made up of four different cameras. Check the included shaders for an example. 60 | 61 | ---- 62 | The MIT License (MIT) 63 | 64 | Copyright (c) 2016 Charlie Whitney 65 | 66 | Permission is hereby granted, free of charge, to any person obtaining a copy 67 | of this software and associated documentation files (the "Software"), to deal 68 | in the Software without restriction, including without limitation the rights 69 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 70 | copies of the Software, and to permit persons to whom the Software is 71 | furnished to do so, subject to the following conditions: 72 | 73 | The above copyright notice and this permission notice shall be included in all 74 | copies or substantial portions of the Software. 75 | 76 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 77 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 78 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 79 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 80 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 81 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 82 | SOFTWARE. 83 | 84 | -------------------------------------------------------------------------------- /assets/shaders/shader.frag: -------------------------------------------------------------------------------- 1 | #version 150 2 | 3 | uniform sampler2D uTex0; 4 | 5 | in vec4 Color; 6 | in vec3 Normal; 7 | in vec3 NormalWS; 8 | in vec2 TexCoord; 9 | 10 | out vec4 oColor; 11 | 12 | void main( void ) 13 | { 14 | vec3 normal = normalize( -Normal ); 15 | float diffuse = max( dot( normal, vec3( 0, 0, -1 ) ), 0 ); 16 | oColor = Color * diffuse; 17 | } -------------------------------------------------------------------------------- /assets/shaders/shader.vert: -------------------------------------------------------------------------------- 1 | #version 150 2 | 3 | uniform mat4 ciModelViewProjection; 4 | uniform mat3 ciNormalMatrix; 5 | 6 | in vec4 ciPosition; 7 | in vec2 ciTexCoord0; 8 | in vec3 ciNormal; 9 | in vec4 ciColor; 10 | in vec3 vInstancePosition; // per-instance position variable 11 | 12 | out highp vec2 TexCoord; 13 | out lowp vec4 Color; 14 | out highp vec3 Normal; 15 | out highp vec3 NormalWS; 16 | 17 | void main( void ) 18 | { 19 | gl_Position = ciModelViewProjection * (ciPosition + vec4( vInstancePosition, 0 ) ); 20 | Color = ciColor; 21 | TexCoord = ciTexCoord0; 22 | Normal = ciNormalMatrix * ciNormal; 23 | NormalWS = ciNormal; 24 | } 25 | -------------------------------------------------------------------------------- /assets/texture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwhitney/sharkbox-FullDome/7d148353bd6c9d05f5ec6c746d6667de2419a490/assets/texture.jpg -------------------------------------------------------------------------------- /cinderblock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwhitney/sharkbox-FullDome/7d148353bd6c9d05f5ec6c746d6667de2419a490/cinderblock.png -------------------------------------------------------------------------------- /cinderblock.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 13 | src/*.h 14 | src/*.cpp 15 | 16 | src 17 | 18 | resources/fulldome/left.obj 22 | resources/fulldome/right.obj 26 | resources/fulldome/top.obj 30 | resources/fulldome/bottom.obj 34 | 35 | -------------------------------------------------------------------------------- /samples/BasicSample/assets/shaders/shader.frag: -------------------------------------------------------------------------------- 1 | #version 150 2 | 3 | uniform sampler2D uTex0; 4 | 5 | in vec4 Color; 6 | in vec3 Normal; 7 | in vec3 NormalWS; 8 | in vec2 TexCoord; 9 | 10 | out vec4 oColor; 11 | 12 | void main( void ) 13 | { 14 | vec3 normal = normalize( -Normal ); 15 | float diffuse = max( dot( normal, vec3( 0, 0, -1 ) ), 0 ); 16 | oColor = Color * diffuse; 17 | } -------------------------------------------------------------------------------- /samples/BasicSample/assets/shaders/shader.vert: -------------------------------------------------------------------------------- 1 | #version 150 2 | 3 | uniform mat4 ciModelViewProjection; 4 | uniform mat3 ciNormalMatrix; 5 | 6 | in vec4 ciPosition; 7 | in vec2 ciTexCoord0; 8 | in vec3 ciNormal; 9 | in vec4 ciColor; 10 | in vec3 vInstancePosition; // per-instance position variable 11 | 12 | out highp vec2 TexCoord; 13 | out lowp vec4 Color; 14 | out highp vec3 Normal; 15 | out highp vec3 NormalWS; 16 | 17 | void main( void ) 18 | { 19 | gl_Position = ciModelViewProjection * (ciPosition + vec4( vInstancePosition, 0 ) ); 20 | Color = ciColor; 21 | TexCoord = ciTexCoord0; 22 | Normal = ciNormalMatrix * ciNormal; 23 | NormalWS = ciNormal; 24 | } 25 | -------------------------------------------------------------------------------- /samples/BasicSample/assets/texture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwhitney/sharkbox-FullDome/7d148353bd6c9d05f5ec6c746d6667de2419a490/samples/BasicSample/assets/texture.jpg -------------------------------------------------------------------------------- /samples/BasicSample/include/Resources.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "cinder/CinderResources.h" 3 | 4 | //#define RES_MY_RES CINDER_RESOURCE( ../resources/, image_name.png, 128, IMAGE ) 5 | 6 | 7 | 8 | 9 | #define FULLDOME_LEFT_OBJ CINDER_RESOURCE( ../blocks/sharkbox-FullDome/resources/fulldome/, left.obj, 128, IMAGE ) 10 | #define FULLDOME_RIGHT_OBJ CINDER_RESOURCE( ../blocks/sharkbox-FullDome/resources/fulldome/, right.obj, 129, IMAGE ) 11 | #define FULLDOME_TOP_OBJ CINDER_RESOURCE( ../blocks/sharkbox-FullDome/resources/fulldome/, top.obj, 130, IMAGE ) 12 | #define FULLDOME_BOTTOM_OBJ CINDER_RESOURCE( ../blocks/sharkbox-FullDome/resources/fulldome/, bottom.obj, 131, IMAGE ) 13 | -------------------------------------------------------------------------------- /samples/BasicSample/resources/CinderApp.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwhitney/sharkbox-FullDome/7d148353bd6c9d05f5ec6c746d6667de2419a490/samples/BasicSample/resources/CinderApp.icns -------------------------------------------------------------------------------- /samples/BasicSample/resources/cinder_app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cwhitney/sharkbox-FullDome/7d148353bd6c9d05f5ec6c746d6667de2419a490/samples/BasicSample/resources/cinder_app_icon.ico -------------------------------------------------------------------------------- /samples/BasicSample/src/BasicSampleApp.cpp: -------------------------------------------------------------------------------- 1 | #include "cinder/app/App.h" 2 | #include "cinder/app/RendererGl.h" 3 | #include "cinder/gl/gl.h" 4 | #include "cinder/Camera.h" 5 | #include "cinder/CameraUi.h" 6 | #include "cinder/Rand.h" 7 | 8 | #include "FullDome.h" 9 | 10 | using namespace ci; 11 | using namespace ci::app; 12 | using namespace std; 13 | using namespace sb; 14 | 15 | class BasicSampleApp : public App { 16 | public: 17 | void setup() override; 18 | void resize() override; 19 | void update() override; 20 | void draw() override; 21 | 22 | void keyDown( KeyEvent event ) override; 23 | 24 | void render(); 25 | void renderDome(); 26 | 27 | CameraPersp mCam; 28 | CameraUi mCamUi; 29 | 30 | gl::BatchRef mBatch; 31 | gl::VboRef mInstanceDataVbo; 32 | gl::GlslProgRef mGlsl; 33 | gl::TextureRef mTeapotTex; 34 | 35 | FullDomeRef mFullDome; 36 | 37 | bool bShowFisheye = true; 38 | }; 39 | 40 | const int NUM_TEAPOTS = 100; 41 | 42 | void BasicSampleApp::setup() 43 | { 44 | mCam.lookAt( vec3(0, 0, 0), vec3(0, 0, 1), vec3(0,1,0) ); 45 | mCamUi.setCamera( &mCam ); 46 | mCamUi.connect( getWindow() ); 47 | 48 | // The following is all based off of the InstancedTeapots sample. Check it out for more info 49 | mTeapotTex = gl::Texture::create( loadImage( loadAsset("texture.jpg") ) ); 50 | mGlsl = gl::GlslProg::create( loadAsset( "shaders/shader.vert" ), loadAsset( "shaders/shader.frag" ) ); 51 | gl::VboMeshRef mesh = gl::VboMesh::create( geom::Teapot().subdivisions( 4 ) ); 52 | std::vector positions; 53 | for( size_t i = 0; i < NUM_TEAPOTS; ++i ) { 54 | positions.push_back( vec3( Rand::randVec3() * vec3(20.0) ) ); 55 | } 56 | mInstanceDataVbo = gl::Vbo::create( GL_ARRAY_BUFFER, positions.size() * sizeof(vec3), positions.data(), GL_DYNAMIC_DRAW ); 57 | geom::BufferLayout instanceDataLayout; 58 | instanceDataLayout.append( geom::Attrib::CUSTOM_0, 3, 0, 0, 1 /* per instance */ ); 59 | mesh->appendVbo( instanceDataLayout, mInstanceDataVbo ); 60 | mBatch = gl::Batch::create( mesh, mGlsl, { { geom::Attrib::CUSTOM_0, "vInstancePosition" } } ); 61 | 62 | gl::enableDepthWrite(); 63 | gl::enableDepthRead(); 64 | 65 | 66 | // Create the dome renderer! 67 | // The args we're passing in mean that each individual camera will have an fbo size of 1024x1024, and the final composite fbo will be 2048x2048 68 | mFullDome = FullDome::create( &mCam, 1024, 2048 ); 69 | } 70 | 71 | void BasicSampleApp::keyDown( KeyEvent event ) 72 | { 73 | bShowFisheye = !bShowFisheye; 74 | } 75 | 76 | void BasicSampleApp::resize() 77 | { 78 | mCam.setAspectRatio( getWindowAspectRatio() ); 79 | } 80 | 81 | void BasicSampleApp::update() 82 | { 83 | } 84 | 85 | void BasicSampleApp::renderDome() 86 | { 87 | gl::ScopedTextureBind scTex(mTeapotTex, 0); 88 | 89 | mFullDome->bindCamera(FullDome::DomeCam::LEFT); 90 | render(); 91 | mFullDome->unbindCamera(FullDome::DomeCam::LEFT); 92 | 93 | mFullDome->bindCamera(FullDome::DomeCam::RIGHT); 94 | render(); 95 | mFullDome->unbindCamera(FullDome::DomeCam::RIGHT); 96 | 97 | mFullDome->bindCamera(FullDome::DomeCam::UP); 98 | render(); 99 | mFullDome->unbindCamera(FullDome::DomeCam::UP); 100 | 101 | mFullDome->bindCamera(FullDome::DomeCam::DOWN); 102 | render(); 103 | mFullDome->unbindCamera(FullDome::DomeCam::DOWN); 104 | } 105 | 106 | void BasicSampleApp::render() 107 | { 108 | gl::clear(ColorA(0, 0, 0, 1)); 109 | mBatch->drawInstanced( NUM_TEAPOTS ); 110 | gl::drawSphere(vec3(0, 0, 15), 1); 111 | } 112 | 113 | void BasicSampleApp::draw() 114 | { 115 | gl::clear( Color( 0.5, 0.5, 0.5 ) ); 116 | gl::color(1,1,1); 117 | 118 | if(!bShowFisheye){ 119 | gl::setMatrices( mCam ); 120 | mBatch->drawInstanced( NUM_TEAPOTS ); 121 | gl::drawSphere(vec3(0, 0, 15), 1); 122 | }else{ 123 | renderDome(); 124 | mFullDome->draw(); 125 | 126 | // You can also render to a texture like so 127 | // mFullDome->renderToFbo(); 128 | // gl::TextureRef texRef = mFullDome->getFboTexture(); 129 | } 130 | 131 | gl::drawString("Press any key to toggle modes.", vec2(10, 10)); 132 | gl::drawString("Drag mouse to change view.", vec2(10,30)); 133 | } 134 | 135 | CINDER_APP( BasicSampleApp, RendererGl, [&](App::Settings *settings){ 136 | settings->setWindowSize(900, 900); 137 | }) 138 | -------------------------------------------------------------------------------- /samples/BasicSample/vc2013/BasicSample.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicSample", "BasicSample.vcxproj", "{E46DCA90-8529-4163-AEFF-0CEF86C2E431}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {E46DCA90-8529-4163-AEFF-0CEF86C2E431}.Debug|Win32.ActiveCfg = Debug|Win32 15 | {E46DCA90-8529-4163-AEFF-0CEF86C2E431}.Debug|Win32.Build.0 = Debug|Win32 16 | {E46DCA90-8529-4163-AEFF-0CEF86C2E431}.Release|Win32.ActiveCfg = Release|Win32 17 | {E46DCA90-8529-4163-AEFF-0CEF86C2E431}.Release|Win32.Build.0 = Release|Win32 18 | {E46DCA90-8529-4163-AEFF-0CEF86C2E431}.Debug|x64.ActiveCfg = Debug|x64 19 | {E46DCA90-8529-4163-AEFF-0CEF86C2E431}.Debug|x64.Build.0 = Debug|x64 20 | {E46DCA90-8529-4163-AEFF-0CEF86C2E431}.Release|x64.ActiveCfg = Release|x64 21 | {E46DCA90-8529-4163-AEFF-0CEF86C2E431}.Release|x64.Build.0 = Release|x64 22 | EndGlobalSection 23 | GlobalSection(SolutionProperties) = preSolution 24 | HideSolutionNode = FALSE 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /samples/BasicSample/vc2013/BasicSample.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | Win32 6 | 7 | 8 | Debug 9 | x64 10 | 11 | 12 | Release 13 | Win32 14 | 15 | 16 | Release 17 | x64 18 | 19 | 20 | 21 | {E46DCA90-8529-4163-AEFF-0CEF86C2E431} 22 | BasicSample 23 | Win32Proj 24 | 25 | 26 | 27 | Application 28 | false 29 | v120 30 | Unicode 31 | true 32 | 33 | 34 | Application 35 | false 36 | v120 37 | Unicode 38 | true 39 | 40 | 41 | Application 42 | true 43 | v120 44 | Unicode 45 | 46 | 47 | Application 48 | true 49 | v120 50 | Unicode 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | <_ProjectFileVersion>10.0.30319.1 69 | $(SolutionDir)$(Configuration)\ 70 | $(Configuration)\ 71 | true 72 | true 73 | $(SolutionDir)$(Configuration)\ 74 | $(Configuration)\ 75 | false 76 | false 77 | 78 | 79 | 80 | Disabled 81 | ..\include;"..\..\..\..\..\include";..\..\..\src 82 | WIN32;_WIN32_WINNT=0x0601;_WINDOWS;NOMINMAX;_DEBUG;%(PreprocessorDefinitions) 83 | true 84 | EnableFastChecks 85 | MultiThreadedDebug 86 | 87 | Level3 88 | EditAndContinue 89 | true 90 | 91 | 92 | "..\..\..\..\..\include";..\include 93 | 94 | 95 | cinder-$(PlatformToolset)_d.lib;OpenGL32.lib;%(AdditionalDependencies) 96 | "..\..\..\..\..\lib\msw\$(PlatformTarget)" 97 | true 98 | Windows 99 | false 100 | 101 | MachineX86 102 | LIBCMT;LIBCPMT 103 | 104 | 105 | 106 | 107 | Disabled 108 | ..\include;"..\..\..\..\..\include";..\..\..\src 109 | WIN32;_WIN32_WINNT=0x0601;_WINDOWS;NOMINMAX;_DEBUG;%(PreprocessorDefinitions) 110 | EnableFastChecks 111 | MultiThreadedDebug 112 | 113 | Level3 114 | ProgramDatabase 115 | true 116 | 117 | 118 | "..\..\..\..\..\include";..\include 119 | 120 | 121 | cinder-$(PlatformToolset)_d.lib;OpenGL32.lib;%(AdditionalDependencies) 122 | "..\..\..\..\..\lib\msw\$(PlatformTarget)" 123 | true 124 | Windows 125 | false 126 | 127 | LIBCMT;LIBCPMT 128 | 129 | 130 | 131 | 132 | ..\include;"..\..\..\..\..\include";..\..\..\src 133 | WIN32;_WIN32_WINNT=0x0601;_WINDOWS;NOMINMAX;NDEBUG;%(PreprocessorDefinitions) 134 | MultiThreaded 135 | 136 | Level3 137 | ProgramDatabase 138 | true 139 | 140 | 141 | true 142 | 143 | 144 | "..\..\..\..\..\include";..\include 145 | 146 | 147 | cinder-$(PlatformToolset).lib;OpenGL32.lib;%(AdditionalDependencies) 148 | "..\..\..\..\..\lib\msw\$(PlatformTarget)" 149 | false 150 | true 151 | Windows 152 | true 153 | 154 | false 155 | 156 | MachineX86 157 | 158 | 159 | 160 | 161 | ..\include;"..\..\..\..\..\include";..\..\..\src 162 | WIN32;_WIN32_WINNT=0x0601;_WINDOWS;NOMINMAX;NDEBUG;%(PreprocessorDefinitions) 163 | MultiThreaded 164 | 165 | Level3 166 | ProgramDatabase 167 | true 168 | 169 | 170 | true 171 | 172 | 173 | "..\..\..\..\..\include";..\include 174 | 175 | 176 | cinder-$(PlatformToolset).lib;OpenGL32.lib;%(AdditionalDependencies) 177 | "..\..\..\..\..\lib\msw\$(PlatformTarget)" 178 | false 179 | true 180 | Windows 181 | true 182 | 183 | false 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | -------------------------------------------------------------------------------- /samples/BasicSample/vc2013/BasicSample.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 5 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 6 | 7 | 8 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 9 | h;hpp;hxx;hm;inl;inc;xsd 10 | 11 | 12 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 13 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 14 | 15 | 16 | {3C3BD0D3-5D33-4958-8DC5-2E5C38627C55} 17 | 18 | 19 | {726680A4-B3BC-45DA-A74A-4A9E17F55018} 20 | 21 | 22 | {F1D1CBFF-6A71-4135-92C0-4C4560CD16C2} 23 | 24 | 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Blocks\sharkbox-FullDome\src 37 | 38 | 39 | Blocks\sharkbox-FullDome\src 40 | 41 | 42 | 43 | 44 | Header Files 45 | 46 | 47 | 48 | 49 | Resource Files 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /samples/BasicSample/vc2013/Resources.rc: -------------------------------------------------------------------------------- 1 | #include "../include/Resources.h" 2 | 3 | 1 ICON "..\\resources\\cinder_app_icon.ico" 4 | FULLDOME_LEFT_OBJ 5 | FULLDOME_RIGHT_OBJ 6 | FULLDOME_TOP_OBJ 7 | FULLDOME_BOTTOM_OBJ 8 | -------------------------------------------------------------------------------- /samples/BasicSample/xcode/BasicSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 006D720419952D00008149E2 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 006D720219952D00008149E2 /* AVFoundation.framework */; }; 11 | 006D720519952D00008149E2 /* CoreMedia.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 006D720319952D00008149E2 /* CoreMedia.framework */; }; 12 | 0091D8F90E81B9330029341E /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0091D8F80E81B9330029341E /* OpenGL.framework */; }; 13 | 00B784B30FF439BC000DE1D7 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784AF0FF439BC000DE1D7 /* Accelerate.framework */; }; 14 | 00B784B40FF439BC000DE1D7 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */; }; 15 | 00B784B50FF439BC000DE1D7 /* AudioUnit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B10FF439BC000DE1D7 /* AudioUnit.framework */; }; 16 | 00B784B60FF439BC000DE1D7 /* CoreAudio.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B784B20FF439BC000DE1D7 /* CoreAudio.framework */; }; 17 | 00B9955A1B128DF400A5C623 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B995581B128DF400A5C623 /* IOKit.framework */; }; 18 | 00B9955B1B128DF400A5C623 /* IOSurface.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00B995591B128DF400A5C623 /* IOSurface.framework */; }; 19 | 5323E6B20EAFCA74003A9687 /* CoreVideo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5323E6B10EAFCA74003A9687 /* CoreVideo.framework */; }; 20 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 21 | C845B963CC4E481C80D9F71B /* BasicSampleApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 628EC8D850BA4B9BB5CB25F1 /* BasicSampleApp.cpp */; }; 22 | CB347B761D4ABE8800965C67 /* FullDome.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB347B741D4ABE8700965C67 /* FullDome.cpp */; }; 23 | CBCB3DF11D637EC400A934BB /* bottom.obj in Resources */ = {isa = PBXBuildFile; fileRef = CBCB3DED1D637EC400A934BB /* bottom.obj */; }; 24 | CBCB3DF21D637EC400A934BB /* left.obj in Resources */ = {isa = PBXBuildFile; fileRef = CBCB3DEE1D637EC400A934BB /* left.obj */; }; 25 | CBCB3DF31D637EC400A934BB /* right.obj in Resources */ = {isa = PBXBuildFile; fileRef = CBCB3DEF1D637EC400A934BB /* right.obj */; }; 26 | CBCB3DF41D637EC400A934BB /* top.obj in Resources */ = {isa = PBXBuildFile; fileRef = CBCB3DF01D637EC400A934BB /* top.obj */; }; 27 | FEDD145DBB6F4FBEB1E9E22C /* CinderApp.icns in Resources */ = {isa = PBXBuildFile; fileRef = A84F2FCE800944D1BEFFAD46 /* CinderApp.icns */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 006D720219952D00008149E2 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; 32 | 006D720319952D00008149E2 /* CoreMedia.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreMedia.framework; path = System/Library/Frameworks/CoreMedia.framework; sourceTree = SDKROOT; }; 33 | 0091D8F80E81B9330029341E /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; 34 | 00B784AF0FF439BC000DE1D7 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 35 | 00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 36 | 00B784B10FF439BC000DE1D7 /* AudioUnit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioUnit.framework; path = System/Library/Frameworks/AudioUnit.framework; sourceTree = SDKROOT; }; 37 | 00B784B20FF439BC000DE1D7 /* CoreAudio.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreAudio.framework; path = System/Library/Frameworks/CoreAudio.framework; sourceTree = SDKROOT; }; 38 | 00B995581B128DF400A5C623 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; 39 | 00B995591B128DF400A5C623 /* IOSurface.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOSurface.framework; path = System/Library/Frameworks/IOSurface.framework; sourceTree = SDKROOT; }; 40 | 0BAE8242385D49DD91989C0A /* BasicSample_Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = "\"\""; path = BasicSample_Prefix.pch; sourceTree = ""; }; 41 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 42 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 43 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 44 | 5323E6B10EAFCA74003A9687 /* CoreVideo.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreVideo.framework; path = /System/Library/Frameworks/CoreVideo.framework; sourceTree = ""; }; 45 | 628EC8D850BA4B9BB5CB25F1 /* BasicSampleApp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.cpp; name = BasicSampleApp.cpp; path = ../src/BasicSampleApp.cpp; sourceTree = ""; }; 46 | 8D1107320486CEB800E47090 /* BasicSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BasicSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 91CC066FC5FC4969963EDBE4 /* Resources.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Resources.h; path = ../include/Resources.h; sourceTree = ""; }; 48 | A84F2FCE800944D1BEFFAD46 /* CinderApp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = CinderApp.icns; path = ../resources/CinderApp.icns; sourceTree = ""; }; 49 | CB347B741D4ABE8700965C67 /* FullDome.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FullDome.cpp; path = ../../../src/FullDome.cpp; sourceTree = ""; }; 50 | CB347B751D4ABE8800965C67 /* FullDome.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FullDome.h; path = ../../../src/FullDome.h; sourceTree = ""; }; 51 | CBCB3DED1D637EC400A934BB /* bottom.obj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = bottom.obj; path = ../assets/fulldome/bottom.obj; sourceTree = ""; }; 52 | CBCB3DEE1D637EC400A934BB /* left.obj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = left.obj; path = ../assets/fulldome/left.obj; sourceTree = ""; }; 53 | CBCB3DEF1D637EC400A934BB /* right.obj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = right.obj; path = ../assets/fulldome/right.obj; sourceTree = ""; }; 54 | CBCB3DF01D637EC400A934BB /* top.obj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = top.obj; path = ../assets/fulldome/top.obj; sourceTree = ""; }; 55 | DC5BC66FB9344912AE16EABC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 8D11072E0486CEB800E47090 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 006D720419952D00008149E2 /* AVFoundation.framework in Frameworks */, 64 | 006D720519952D00008149E2 /* CoreMedia.framework in Frameworks */, 65 | 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 66 | 0091D8F90E81B9330029341E /* OpenGL.framework in Frameworks */, 67 | 5323E6B20EAFCA74003A9687 /* CoreVideo.framework in Frameworks */, 68 | 00B784B30FF439BC000DE1D7 /* Accelerate.framework in Frameworks */, 69 | 00B784B40FF439BC000DE1D7 /* AudioToolbox.framework in Frameworks */, 70 | 00B784B50FF439BC000DE1D7 /* AudioUnit.framework in Frameworks */, 71 | 00B784B60FF439BC000DE1D7 /* CoreAudio.framework in Frameworks */, 72 | 00B9955A1B128DF400A5C623 /* IOKit.framework in Frameworks */, 73 | 00B9955B1B128DF400A5C623 /* IOSurface.framework in Frameworks */, 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | /* End PBXFrameworksBuildPhase section */ 78 | 79 | /* Begin PBXGroup section */ 80 | 01B97315FEAEA392516A2CEA /* Blocks */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | CB347B721D4ABE7200965C67 /* Cinder-FullDome */, 84 | ); 85 | name = Blocks; 86 | sourceTree = ""; 87 | }; 88 | 080E96DDFE201D6D7F000001 /* Source */ = { 89 | isa = PBXGroup; 90 | children = ( 91 | 628EC8D850BA4B9BB5CB25F1 /* BasicSampleApp.cpp */, 92 | ); 93 | name = Source; 94 | sourceTree = ""; 95 | }; 96 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 006D720219952D00008149E2 /* AVFoundation.framework */, 100 | 006D720319952D00008149E2 /* CoreMedia.framework */, 101 | 00B784AF0FF439BC000DE1D7 /* Accelerate.framework */, 102 | 00B784B00FF439BC000DE1D7 /* AudioToolbox.framework */, 103 | 00B784B10FF439BC000DE1D7 /* AudioUnit.framework */, 104 | 00B784B20FF439BC000DE1D7 /* CoreAudio.framework */, 105 | 5323E6B10EAFCA74003A9687 /* CoreVideo.framework */, 106 | 0091D8F80E81B9330029341E /* OpenGL.framework */, 107 | 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, 108 | 00B995581B128DF400A5C623 /* IOKit.framework */, 109 | 00B995591B128DF400A5C623 /* IOSurface.framework */, 110 | ); 111 | name = "Linked Frameworks"; 112 | sourceTree = ""; 113 | }; 114 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 29B97324FDCFA39411CA2CEA /* AppKit.framework */, 118 | 29B97325FDCFA39411CA2CEA /* Foundation.framework */, 119 | ); 120 | name = "Other Frameworks"; 121 | sourceTree = ""; 122 | }; 123 | 19C28FACFE9D520D11CA2CBB /* Products */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 8D1107320486CEB800E47090 /* BasicSample.app */, 127 | ); 128 | name = Products; 129 | sourceTree = ""; 130 | }; 131 | 29B97314FDCFA39411CA2CEA /* BasicSample */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 01B97315FEAEA392516A2CEA /* Blocks */, 135 | 29B97315FDCFA39411CA2CEA /* Headers */, 136 | 080E96DDFE201D6D7F000001 /* Source */, 137 | 29B97317FDCFA39411CA2CEA /* Resources */, 138 | 29B97323FDCFA39411CA2CEA /* Frameworks */, 139 | 19C28FACFE9D520D11CA2CBB /* Products */, 140 | ); 141 | name = BasicSample; 142 | sourceTree = ""; 143 | }; 144 | 29B97315FDCFA39411CA2CEA /* Headers */ = { 145 | isa = PBXGroup; 146 | children = ( 147 | 91CC066FC5FC4969963EDBE4 /* Resources.h */, 148 | 0BAE8242385D49DD91989C0A /* BasicSample_Prefix.pch */, 149 | ); 150 | name = Headers; 151 | sourceTree = ""; 152 | }; 153 | 29B97317FDCFA39411CA2CEA /* Resources */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | A84F2FCE800944D1BEFFAD46 /* CinderApp.icns */, 157 | DC5BC66FB9344912AE16EABC /* Info.plist */, 158 | ); 159 | name = Resources; 160 | sourceTree = ""; 161 | }; 162 | 29B97323FDCFA39411CA2CEA /* Frameworks */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 166 | 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, 167 | ); 168 | name = Frameworks; 169 | sourceTree = ""; 170 | }; 171 | CB347B721D4ABE7200965C67 /* Cinder-FullDome */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | CBCB3DEB1D637EA600A934BB /* resources */, 175 | CB347B731D4ABE7C00965C67 /* src */, 176 | ); 177 | name = "Cinder-FullDome"; 178 | sourceTree = ""; 179 | }; 180 | CB347B731D4ABE7C00965C67 /* src */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | CB347B741D4ABE8700965C67 /* FullDome.cpp */, 184 | CB347B751D4ABE8800965C67 /* FullDome.h */, 185 | ); 186 | name = src; 187 | sourceTree = ""; 188 | }; 189 | CBCB3DEB1D637EA600A934BB /* resources */ = { 190 | isa = PBXGroup; 191 | children = ( 192 | CBCB3DEC1D637EB200A934BB /* fulldome */, 193 | ); 194 | name = resources; 195 | sourceTree = ""; 196 | }; 197 | CBCB3DEC1D637EB200A934BB /* fulldome */ = { 198 | isa = PBXGroup; 199 | children = ( 200 | CBCB3DED1D637EC400A934BB /* bottom.obj */, 201 | CBCB3DEE1D637EC400A934BB /* left.obj */, 202 | CBCB3DEF1D637EC400A934BB /* right.obj */, 203 | CBCB3DF01D637EC400A934BB /* top.obj */, 204 | ); 205 | name = fulldome; 206 | sourceTree = ""; 207 | }; 208 | /* End PBXGroup section */ 209 | 210 | /* Begin PBXNativeTarget section */ 211 | 8D1107260486CEB800E47090 /* BasicSample */ = { 212 | isa = PBXNativeTarget; 213 | buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "BasicSample" */; 214 | buildPhases = ( 215 | 8D1107290486CEB800E47090 /* Resources */, 216 | 8D11072C0486CEB800E47090 /* Sources */, 217 | 8D11072E0486CEB800E47090 /* Frameworks */, 218 | ); 219 | buildRules = ( 220 | ); 221 | dependencies = ( 222 | ); 223 | name = BasicSample; 224 | productInstallPath = "$(HOME)/Applications"; 225 | productName = BasicSample; 226 | productReference = 8D1107320486CEB800E47090 /* BasicSample.app */; 227 | productType = "com.apple.product-type.application"; 228 | }; 229 | /* End PBXNativeTarget section */ 230 | 231 | /* Begin PBXProject section */ 232 | 29B97313FDCFA39411CA2CEA /* Project object */ = { 233 | isa = PBXProject; 234 | attributes = { 235 | }; 236 | buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "BasicSample" */; 237 | compatibilityVersion = "Xcode 3.2"; 238 | developmentRegion = English; 239 | hasScannedForEncodings = 1; 240 | knownRegions = ( 241 | English, 242 | Japanese, 243 | French, 244 | German, 245 | ); 246 | mainGroup = 29B97314FDCFA39411CA2CEA /* BasicSample */; 247 | projectDirPath = ""; 248 | projectRoot = ""; 249 | targets = ( 250 | 8D1107260486CEB800E47090 /* BasicSample */, 251 | ); 252 | }; 253 | /* End PBXProject section */ 254 | 255 | /* Begin PBXResourcesBuildPhase section */ 256 | 8D1107290486CEB800E47090 /* Resources */ = { 257 | isa = PBXResourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | CBCB3DF31D637EC400A934BB /* right.obj in Resources */, 261 | CBCB3DF21D637EC400A934BB /* left.obj in Resources */, 262 | CBCB3DF11D637EC400A934BB /* bottom.obj in Resources */, 263 | CBCB3DF41D637EC400A934BB /* top.obj in Resources */, 264 | FEDD145DBB6F4FBEB1E9E22C /* CinderApp.icns in Resources */, 265 | ); 266 | runOnlyForDeploymentPostprocessing = 0; 267 | }; 268 | /* End PBXResourcesBuildPhase section */ 269 | 270 | /* Begin PBXSourcesBuildPhase section */ 271 | 8D11072C0486CEB800E47090 /* Sources */ = { 272 | isa = PBXSourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | C845B963CC4E481C80D9F71B /* BasicSampleApp.cpp in Sources */, 276 | CB347B761D4ABE8800965C67 /* FullDome.cpp in Sources */, 277 | ); 278 | runOnlyForDeploymentPostprocessing = 0; 279 | }; 280 | /* End PBXSourcesBuildPhase section */ 281 | 282 | /* Begin XCBuildConfiguration section */ 283 | C01FCF4B08A954540054247B /* Debug */ = { 284 | isa = XCBuildConfiguration; 285 | buildSettings = { 286 | COMBINE_HIDPI_IMAGES = YES; 287 | COPY_PHASE_STRIP = NO; 288 | DEAD_CODE_STRIPPING = YES; 289 | GCC_DYNAMIC_NO_PIC = NO; 290 | GCC_INLINES_ARE_PRIVATE_EXTERN = YES; 291 | GCC_OPTIMIZATION_LEVEL = 0; 292 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 293 | GCC_PREFIX_HEADER = BasicSample_Prefix.pch; 294 | GCC_PREPROCESSOR_DEFINITIONS = ( 295 | "DEBUG=1", 296 | "$(inherited)", 297 | ); 298 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 299 | INFOPLIST_FILE = Info.plist; 300 | INSTALL_PATH = "$(HOME)/Applications"; 301 | OTHER_LDFLAGS = "\"$(CINDER_PATH)/lib/libcinder_d.a\""; 302 | PRODUCT_BUNDLE_IDENTIFIER = "org.libcinder.${PRODUCT_NAME:rfc1034identifier}"; 303 | PRODUCT_NAME = BasicSample; 304 | SYMROOT = ./build; 305 | WRAPPER_EXTENSION = app; 306 | }; 307 | name = Debug; 308 | }; 309 | C01FCF4C08A954540054247B /* Release */ = { 310 | isa = XCBuildConfiguration; 311 | buildSettings = { 312 | COMBINE_HIDPI_IMAGES = YES; 313 | DEAD_CODE_STRIPPING = YES; 314 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 315 | GCC_FAST_MATH = YES; 316 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO; 317 | GCC_INLINES_ARE_PRIVATE_EXTERN = YES; 318 | GCC_OPTIMIZATION_LEVEL = 3; 319 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 320 | GCC_PREFIX_HEADER = BasicSample_Prefix.pch; 321 | GCC_PREPROCESSOR_DEFINITIONS = ( 322 | "NDEBUG=1", 323 | "$(inherited)", 324 | ); 325 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 326 | INFOPLIST_FILE = Info.plist; 327 | INSTALL_PATH = "$(HOME)/Applications"; 328 | OTHER_LDFLAGS = "\"$(CINDER_PATH)/lib/libcinder.a\""; 329 | PRODUCT_BUNDLE_IDENTIFIER = "org.libcinder.${PRODUCT_NAME:rfc1034identifier}"; 330 | PRODUCT_NAME = BasicSample; 331 | STRIP_INSTALLED_PRODUCT = YES; 332 | SYMROOT = ./build; 333 | WRAPPER_EXTENSION = app; 334 | }; 335 | name = Release; 336 | }; 337 | C01FCF4F08A954540054247B /* Debug */ = { 338 | isa = XCBuildConfiguration; 339 | buildSettings = { 340 | ALWAYS_SEARCH_USER_PATHS = NO; 341 | CINDER_PATH = ../../../../..; 342 | CLANG_CXX_LANGUAGE_STANDARD = "c++11"; 343 | CLANG_CXX_LIBRARY = "libc++"; 344 | ENABLE_TESTABILITY = YES; 345 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 346 | GCC_WARN_UNUSED_VARIABLE = YES; 347 | HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\""; 348 | MACOSX_DEPLOYMENT_TARGET = 10.8; 349 | ONLY_ACTIVE_ARCH = YES; 350 | SDKROOT = macosx; 351 | USER_HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\" ../include"; 352 | }; 353 | name = Debug; 354 | }; 355 | C01FCF5008A954540054247B /* Release */ = { 356 | isa = XCBuildConfiguration; 357 | buildSettings = { 358 | ALWAYS_SEARCH_USER_PATHS = NO; 359 | CINDER_PATH = ../../../../..; 360 | CLANG_CXX_LANGUAGE_STANDARD = "c++11"; 361 | CLANG_CXX_LIBRARY = "libc++"; 362 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 363 | GCC_WARN_UNUSED_VARIABLE = YES; 364 | HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\""; 365 | MACOSX_DEPLOYMENT_TARGET = 10.8; 366 | SDKROOT = macosx; 367 | USER_HEADER_SEARCH_PATHS = "\"$(CINDER_PATH)/include\" ../include"; 368 | }; 369 | name = Release; 370 | }; 371 | /* End XCBuildConfiguration section */ 372 | 373 | /* Begin XCConfigurationList section */ 374 | C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "BasicSample" */ = { 375 | isa = XCConfigurationList; 376 | buildConfigurations = ( 377 | C01FCF4B08A954540054247B /* Debug */, 378 | C01FCF4C08A954540054247B /* Release */, 379 | ); 380 | defaultConfigurationIsVisible = 0; 381 | defaultConfigurationName = Release; 382 | }; 383 | C01FCF4E08A954540054247B /* Build configuration list for PBXProject "BasicSample" */ = { 384 | isa = XCConfigurationList; 385 | buildConfigurations = ( 386 | C01FCF4F08A954540054247B /* Debug */, 387 | C01FCF5008A954540054247B /* Release */, 388 | ); 389 | defaultConfigurationIsVisible = 0; 390 | defaultConfigurationName = Release; 391 | }; 392 | /* End XCConfigurationList section */ 393 | }; 394 | rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; 395 | } 396 | -------------------------------------------------------------------------------- /samples/BasicSample/xcode/BasicSample_Prefix.pch: -------------------------------------------------------------------------------- 1 | #if defined( __cplusplus ) 2 | #include "cinder/Cinder.h" 3 | 4 | #include "cinder/app/App.h" 5 | 6 | #include "cinder/gl/gl.h" 7 | 8 | #include "cinder/CinderMath.h" 9 | #include "cinder/Matrix.h" 10 | #include "cinder/Vector.h" 11 | #include "cinder/Quaternion.h" 12 | #endif 13 | -------------------------------------------------------------------------------- /samples/BasicSample/xcode/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | CinderApp.icns 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSHumanReadableCopyright 28 | Copyright © 2015 __MyCompanyName__. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/FullDome.cpp: -------------------------------------------------------------------------------- 1 | #include "FullDome.h" 2 | 3 | using namespace ci; 4 | using namespace ci::app; 5 | using namespace std; 6 | using namespace sb; 7 | 8 | FullDome::FullDome(ci::CameraPersp *cam, const int &fboSize, const int &renderFboSize) { 9 | 10 | // Save the users camera for orientation 11 | mUserCam = cam; 12 | 13 | // This is the camera we'll use to render the scene 4x in different orientations 14 | mCam.setAspectRatio(1.0); 15 | mCam.setFov(90); 16 | mCam.setFovHorizontal(90); 17 | mCam.lookAt(vec3(0), vec3(0,0,1),vec3(0,1,0)); 18 | 19 | // This is the camera we'll use to render the skinned meshes for our final fisheye image 20 | mScreenCam.setAspectRatio(1.0); 21 | mScreenCam.setEyePoint(vec3(0, 0, 1.35)); 22 | mScreenCam.setWorldUp(vec3(0, 1, 0)); 23 | 24 | gl::GlslProgRef texShader = gl::getStockShader(gl::ShaderDef().texture()); 25 | texShader->uniform("uTex0", 0); 26 | 27 | mBU = gl::Batch::create(*loadObj( loadResource(FULLDOME_TOP_OBJ) ), texShader); 28 | mBD = gl::Batch::create(*loadObj( loadResource(FULLDOME_BOTTOM_OBJ) ), texShader); 29 | mBL = gl::Batch::create(*loadObj( loadResource(FULLDOME_LEFT_OBJ) ), texShader); 30 | mBR = gl::Batch::create(*loadObj( loadResource(FULLDOME_RIGHT_OBJ) ), texShader); 31 | 32 | // int fboSize = 2160;//2k 33 | //int fboSize = 3840;//4k 34 | 35 | mFboL = gl::Fbo::create(fboSize, fboSize); 36 | mFboR = gl::Fbo::create(fboSize, fboSize); 37 | mFboU = gl::Fbo::create(fboSize, fboSize); 38 | mFboD = gl::Fbo::create(fboSize, fboSize); 39 | 40 | mCompositeFbo = gl::Fbo::create(renderFboSize, renderFboSize); 41 | 42 | setupQuats(); 43 | } 44 | 45 | TriMeshRef FullDome::loadObj( ci::DataSourceRef loadedObj ) 46 | { 47 | ObjLoader loader(loadedObj); 48 | TriMeshRef tm = TriMesh::create(loader); 49 | 50 | if( ! loader.getAvailableAttribs().count( geom::NORMAL ) ){ 51 | tm->recalculateNormals(); 52 | } 53 | 54 | return tm;//gl::VboMesh::create(*tm); 55 | } 56 | 57 | void FullDome::resize() { 58 | mCam.setAspectRatio(getWindowAspectRatio()); 59 | } 60 | 61 | void FullDome::setupQuats() 62 | { 63 | glm::fquat fwd = mUserCam->getOrientation(); 64 | /* 65 | fwd = glm::rotate(fwd, (float)toRadians(-180.0f), vec3(0, 1, 0)); 66 | fwd = glm::rotate(fwd, (float)toRadians(-90.0f), vec3(0, 0, 1)); 67 | fwd = glm::rotate(fwd, (float)toRadians(90.0), vec3(0, 1, 0)); 68 | */ 69 | 70 | // L 71 | mQuatL = fwd; 72 | mQuatL = glm::rotate(mQuatL, (float)toRadians(-45.0f), vec3(1, 0, 0)); 73 | 74 | // R 75 | mQuatR = fwd; 76 | mQuatR = glm::rotate(mQuatR, (float)toRadians(45.0f), vec3(1, 0, 0)); 77 | 78 | // U 79 | mQuatU = fwd; 80 | mQuatU = glm::rotate(mQuatU, (float)toRadians(90.0), vec3(0, 1, 0)); 81 | mQuatU = glm::rotate(mQuatU, (float)toRadians(-45.0), vec3(0, 0, 1)); 82 | 83 | // D 84 | mQuatD = fwd; 85 | mQuatD = glm::rotate(mQuatD, (float)toRadians(-90.0), vec3(0, 1, 0)); 86 | mQuatD = glm::rotate(mQuatD, (float)toRadians(45.0), vec3(0, 0, 1)); 87 | } 88 | 89 | void FullDome::bindCamera(DomeCam dir) { 90 | 91 | setupQuats(); 92 | 93 | mCurViewport = gl::getViewport(); 94 | gl::pushMatrices(); 95 | 96 | switch (dir) { 97 | case UP: 98 | mFboU->bindFramebuffer(); 99 | mCam.setOrientation(mQuatU); 100 | gl::viewport(mFboU->getSize()); 101 | break; 102 | case DOWN: 103 | mFboD->bindFramebuffer(); 104 | mCam.setOrientation(mQuatD); 105 | gl::viewport(mFboD->getSize()); 106 | break; 107 | case LEFT: 108 | mFboL->bindFramebuffer(); 109 | mCam.setOrientation(mQuatL); 110 | gl::viewport(mFboL->getSize()); 111 | break; 112 | case RIGHT: 113 | mFboR->bindFramebuffer(); 114 | mCam.setOrientation(mQuatR); 115 | gl::viewport(mFboR->getSize()); 116 | break; 117 | default: 118 | break; 119 | } 120 | gl::setMatrices(mCam); 121 | } 122 | 123 | void FullDome::unbindCamera(DomeCam dir) { 124 | switch (dir) { 125 | case UP: 126 | mFboU->unbindFramebuffer(); 127 | break; 128 | case DOWN: 129 | mFboD->unbindFramebuffer(); 130 | break; 131 | case LEFT: 132 | mFboL->unbindFramebuffer(); 133 | break; 134 | case RIGHT: 135 | mFboR->unbindFramebuffer(); 136 | break; 137 | } 138 | gl::popMatrices(); 139 | gl::viewport( mCurViewport.first, mCurViewport.second ); 140 | } 141 | 142 | void FullDome::renderToFbo() { 143 | gl::ScopedFramebuffer scComp(mCompositeFbo); 144 | gl::clear(); 145 | 146 | gl::pushMatrices(); { 147 | gl::ScopedViewport scCompVp( mCompositeFbo->getSize() ); 148 | 149 | mScreenCam.setEyePoint(vec3(0, 0, 1)); 150 | mScreenCam.setOrtho(-1, 1, -1, 1, 0.0001f, 5000.f); 151 | gl::setMatrices(mScreenCam); 152 | { 153 | gl::ScopedTextureBind scTx1(mFboU->getColorTexture()); 154 | mBU->draw(); 155 | } 156 | { 157 | gl::ScopedTextureBind scTx2(mFboD->getColorTexture()); 158 | mBD->draw(); 159 | } 160 | { 161 | gl::ScopedTextureBind scTx3(mFboL->getColorTexture()); 162 | mBL->draw(); 163 | } 164 | { 165 | gl::ScopedTextureBind scTx4(mFboR->getColorTexture()); 166 | mBR->draw(); 167 | } 168 | 169 | }gl::popMatrices(); 170 | } 171 | 172 | void FullDome::draw() { 173 | gl::color(Color::white()); 174 | 175 | gl::pushMatrices(); { 176 | mScreenCam.setEyePoint(vec3(0, 0, 1)); 177 | mScreenCam.setOrtho(-1, 1, -1, 1, 0.0001f, 5000.f); 178 | gl::setMatrices(mScreenCam); 179 | { 180 | gl::ScopedTextureBind scTx1(mFboU->getColorTexture()); 181 | mBU->draw(); 182 | } 183 | { 184 | gl::ScopedTextureBind scTx2(mFboD->getColorTexture()); 185 | mBD->draw(); 186 | } 187 | { 188 | gl::ScopedTextureBind scTx3(mFboL->getColorTexture()); 189 | mBL->draw(); 190 | } 191 | { 192 | gl::ScopedTextureBind scTx4(mFboR->getColorTexture()); 193 | mBR->draw(); 194 | } 195 | 196 | }gl::popMatrices(); 197 | } -------------------------------------------------------------------------------- /src/FullDome.h: -------------------------------------------------------------------------------- 1 | #include "cinder/Cinder.h" 2 | #include "cinder/app/App.h" 3 | #include "cinder/gl/gl.h" 4 | #include "cinder/ObjLoader.h" 5 | #include "cinder/Camera.h" 6 | 7 | #include "cinder/CinderResources.h" 8 | #include "Resources.h" 9 | 10 | namespace sb { 11 | 12 | using FullDomeRef = std::shared_ptr; 13 | 14 | class FullDome { 15 | public: 16 | static FullDomeRef create( ci::CameraPersp *cam, const int &fboSize = 2048, const int &renderFboSize = 2048) { return std::make_shared(cam, fboSize); } 17 | 18 | enum DomeCam { 19 | UP, DOWN, LEFT, RIGHT 20 | }; 21 | 22 | FullDome( ci::CameraPersp *cam, const int &fboSize = 2048, const int &renderFboSize = 2048); 23 | void resize(); 24 | void renderToFbo(); 25 | void draw(); 26 | 27 | ci::gl::TextureRef getFboTexture() { return mCompositeFbo->getColorTexture(); } 28 | 29 | void bindCamera(DomeCam dir); 30 | void unbindCamera(DomeCam dir); 31 | 32 | private: 33 | void setupQuats(); 34 | ci::TriMeshRef loadObj(ci::DataSourceRef loadedObj); 35 | 36 | glm::fquat mQuatL, mQuatR, mQuatU, mQuatD; 37 | 38 | ci::CameraPersp *mUserCam; 39 | ci::CameraPersp mCam; 40 | ci::CameraOrtho mScreenCam; 41 | ci::gl::VboMeshRef mLeftVbo, mRightVbo, mUpVbo, mDownVbo; 42 | ci::gl::BatchRef mBU, mBD, mBL, mBR; 43 | 44 | ci::gl::FboRef mFboL, mFboR, mFboU, mFboD; 45 | ci::gl::FboRef mCompositeFbo; 46 | std::pair mCurViewport; 47 | }; 48 | 49 | } --------------------------------------------------------------------------------