├── .gitignore ├── LICENSE ├── README.md ├── example ├── Makefile ├── Project.xcconfig ├── addons.make ├── bin │ └── data │ │ ├── .gitkeep │ │ └── equimap2.jpg ├── config.make ├── example.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ ├── example Debug.xcscheme │ │ └── example Release.xcscheme ├── openFrameworks-Info.plist └── src │ └── ofApp.cpp └── src ├── ofxEquiMap.cpp └── ofxEquiMap.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by http://www.gitignore.io 2 | 3 | ### Xcode ### 4 | build/ 5 | *.pbxuser 6 | !default.pbxuser 7 | *.mode1v3 8 | !default.mode1v3 9 | *.mode2v3 10 | !default.mode2v3 11 | *.perspectivev3 12 | !default.perspectivev3 13 | xcuserdata 14 | *.xccheckout 15 | *.moved-aside 16 | DerivedData 17 | *.xcuserstate 18 | 19 | 20 | ### OSX ### 21 | .DS_Store 22 | .AppleDouble 23 | .LSOverride 24 | 25 | # Icon must end with two \r 26 | Icon 27 | 28 | 29 | # Thumbnails 30 | ._* 31 | 32 | # Files that might appear on external disk 33 | .Spotlight-V100 34 | .Trashes 35 | 36 | # Directories potentially created on remote AFP share 37 | .AppleDB 38 | .AppleDesktop 39 | Network Trash Folder 40 | Temporary Items 41 | .apdisk 42 | 43 | 44 | ### C++ ### 45 | # Compiled Object files 46 | *.slo 47 | *.lo 48 | *.o 49 | *.obj 50 | 51 | # Compiled Dynamic libraries 52 | *.so 53 | *.dylib 54 | *.dll 55 | 56 | # Compiled Static libraries 57 | *.lai 58 | *.la 59 | *.a 60 | *.lib 61 | 62 | # Executables 63 | *.exe 64 | *.out 65 | *.app 66 | 67 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Yuya Hanai 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ofxEquiMap 2 | OF addon for Equirectangular Projection Rendering 3 | 4 | ![ofxEquiMap](https://raw.githubusercontent.com/hanasaan/ofxEquiMap/master/example/bin/data/equimap2.jpg) 5 | 6 | ## Depends 7 | ofxCubeMap https://github.com/andreasmuller/ofxCubeMap 8 | 9 | ## Reference Implementation 10 | http://forum.openframeworks.cc/t/equirectangular-projection-shader/19937 11 | -------------------------------------------------------------------------------- /example/Makefile: -------------------------------------------------------------------------------- 1 | # Attempt to load a config.make file. 2 | # If none is found, project defaults in config.project.make will be used. 3 | ifneq ($(wildcard config.make),) 4 | include config.make 5 | endif 6 | 7 | # make sure the the OF_ROOT location is defined 8 | ifndef OF_ROOT 9 | OF_ROOT=../../.. 10 | endif 11 | 12 | # call the project makefile! 13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk 14 | -------------------------------------------------------------------------------- /example/Project.xcconfig: -------------------------------------------------------------------------------- 1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT. 2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED 3 | OF_PATH = ../../.. 4 | 5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE 6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig" 7 | 8 | //ICONS - NEW IN 0072 9 | ICON_NAME_DEBUG = icon-debug.icns 10 | ICON_NAME_RELEASE = icon.icns 11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/ 12 | 13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to: 14 | //ICON_FILE_PATH = bin/data/ 15 | 16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS) 17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS) 18 | -------------------------------------------------------------------------------- /example/addons.make: -------------------------------------------------------------------------------- 1 | ofxCubeMap 2 | ofxEquiMap 3 | -------------------------------------------------------------------------------- /example/bin/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanasaan/ofxEquiMap/ede7722dada9c0438227504888837fbfdaa43064/example/bin/data/.gitkeep -------------------------------------------------------------------------------- /example/bin/data/equimap2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hanasaan/ofxEquiMap/ede7722dada9c0438227504888837fbfdaa43064/example/bin/data/equimap2.jpg -------------------------------------------------------------------------------- /example/config.make: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # CONFIGURE PROJECT MAKEFILE (optional) 3 | # This file is where we make project specific configurations. 4 | ################################################################################ 5 | 6 | ################################################################################ 7 | # OF ROOT 8 | # The location of your root openFrameworks installation 9 | # (default) OF_ROOT = ../../.. 10 | ################################################################################ 11 | # OF_ROOT = ../../.. 12 | 13 | ################################################################################ 14 | # PROJECT ROOT 15 | # The location of the project - a starting place for searching for files 16 | # (default) PROJECT_ROOT = . (this directory) 17 | # 18 | ################################################################################ 19 | # PROJECT_ROOT = . 20 | 21 | ################################################################################ 22 | # PROJECT SPECIFIC CHECKS 23 | # This is a project defined section to create internal makefile flags to 24 | # conditionally enable or disable the addition of various features within 25 | # this makefile. For instance, if you want to make changes based on whether 26 | # GTK is installed, one might test that here and create a variable to check. 27 | ################################################################################ 28 | # None 29 | 30 | ################################################################################ 31 | # PROJECT EXTERNAL SOURCE PATHS 32 | # These are fully qualified paths that are not within the PROJECT_ROOT folder. 33 | # Like source folders in the PROJECT_ROOT, these paths are subject to 34 | # exlclusion via the PROJECT_EXLCUSIONS list. 35 | # 36 | # (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank) 37 | # 38 | # Note: Leave a leading space when adding list items with the += operator 39 | ################################################################################ 40 | # PROJECT_EXTERNAL_SOURCE_PATHS = 41 | 42 | ################################################################################ 43 | # PROJECT EXCLUSIONS 44 | # These makefiles assume that all folders in your current project directory 45 | # and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations 46 | # to look for source code. The any folders or files that match any of the 47 | # items in the PROJECT_EXCLUSIONS list below will be ignored. 48 | # 49 | # Each item in the PROJECT_EXCLUSIONS list will be treated as a complete 50 | # string unless teh user adds a wildcard (%) operator to match subdirectories. 51 | # GNU make only allows one wildcard for matching. The second wildcard (%) is 52 | # treated literally. 53 | # 54 | # (default) PROJECT_EXCLUSIONS = (blank) 55 | # 56 | # Will automatically exclude the following: 57 | # 58 | # $(PROJECT_ROOT)/bin% 59 | # $(PROJECT_ROOT)/obj% 60 | # $(PROJECT_ROOT)/%.xcodeproj 61 | # 62 | # Note: Leave a leading space when adding list items with the += operator 63 | ################################################################################ 64 | # PROJECT_EXCLUSIONS = 65 | 66 | ################################################################################ 67 | # PROJECT LINKER FLAGS 68 | # These flags will be sent to the linker when compiling the executable. 69 | # 70 | # (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs 71 | # 72 | # Note: Leave a leading space when adding list items with the += operator 73 | ################################################################################ 74 | 75 | # Currently, shared libraries that are needed are copied to the 76 | # $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to 77 | # add a runtime path to search for those shared libraries, since they aren't 78 | # incorporated directly into the final executable application binary. 79 | # TODO: should this be a default setting? 80 | # PROJECT_LDFLAGS=-Wl,-rpath=./libs 81 | 82 | ################################################################################ 83 | # PROJECT DEFINES 84 | # Create a space-delimited list of DEFINES. The list will be converted into 85 | # CFLAGS with the "-D" flag later in the makefile. 86 | # 87 | # (default) PROJECT_DEFINES = (blank) 88 | # 89 | # Note: Leave a leading space when adding list items with the += operator 90 | ################################################################################ 91 | # PROJECT_DEFINES = 92 | 93 | ################################################################################ 94 | # PROJECT CFLAGS 95 | # This is a list of fully qualified CFLAGS required when compiling for this 96 | # project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS 97 | # defined in your platform specific core configuration files. These flags are 98 | # presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below. 99 | # 100 | # (default) PROJECT_CFLAGS = (blank) 101 | # 102 | # Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in 103 | # your platform specific configuration file will be applied by default and 104 | # further flags here may not be needed. 105 | # 106 | # Note: Leave a leading space when adding list items with the += operator 107 | ################################################################################ 108 | # PROJECT_CFLAGS = 109 | 110 | ################################################################################ 111 | # PROJECT OPTIMIZATION CFLAGS 112 | # These are lists of CFLAGS that are target-specific. While any flags could 113 | # be conditionally added, they are usually limited to optimization flags. 114 | # These flags are added BEFORE the PROJECT_CFLAGS. 115 | # 116 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets. 117 | # 118 | # (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank) 119 | # 120 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets. 121 | # 122 | # (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank) 123 | # 124 | # Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the 125 | # PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration 126 | # file will be applied by default and further optimization flags here may not 127 | # be needed. 128 | # 129 | # Note: Leave a leading space when adding list items with the += operator 130 | ################################################################################ 131 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE = 132 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG = 133 | 134 | ################################################################################ 135 | # PROJECT COMPILERS 136 | # Custom compilers can be set for CC and CXX 137 | # (default) PROJECT_CXX = (blank) 138 | # (default) PROJECT_CC = (blank) 139 | # Note: Leave a leading space when adding list items with the += operator 140 | ################################################################################ 141 | # PROJECT_CXX = 142 | # PROJECT_CC = 143 | -------------------------------------------------------------------------------- /example/example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 40F951BE7A53C33005AE7C62 /* ofxCubeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E58E68F4127344A6B10BCB62 /* ofxCubeMap.cpp */; }; 11 | D1BB63CD7A025E0AC7F63364 /* ofxEquiMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CB08BEFD8CEC72296260766 /* ofxEquiMap.cpp */; }; 12 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E4328148138ABC890047C5CB /* openFrameworksDebug.a */; }; 13 | E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXContainerItemProxy section */ 17 | E4328147138ABC890047C5CB /* PBXContainerItemProxy */ = { 18 | isa = PBXContainerItemProxy; 19 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 20 | proxyType = 2; 21 | remoteGlobalIDString = E4B27C1510CBEB8E00536013; 22 | remoteInfo = openFrameworks; 23 | }; 24 | E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */ = { 25 | isa = PBXContainerItemProxy; 26 | containerPortal = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 27 | proxyType = 1; 28 | remoteGlobalIDString = E4B27C1410CBEB8E00536013; 29 | remoteInfo = openFrameworks; 30 | }; 31 | /* End PBXContainerItemProxy section */ 32 | 33 | /* Begin PBXCopyFilesBuildPhase section */ 34 | E4C2427710CC5ABF004149E2 /* CopyFiles */ = { 35 | isa = PBXCopyFilesBuildPhase; 36 | buildActionMask = 2147483647; 37 | dstPath = ""; 38 | dstSubfolderSpec = 10; 39 | files = ( 40 | ); 41 | runOnlyForDeploymentPostprocessing = 0; 42 | }; 43 | /* End PBXCopyFilesBuildPhase section */ 44 | 45 | /* Begin PBXFileReference section */ 46 | 0BCBC7DD36212B36226BA9F4 /* ofxEquiMap.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = ofxEquiMap.h; path = ../../../addons/ofxEquiMap/src/ofxEquiMap.h; sourceTree = SOURCE_ROOT; }; 47 | 3407D3543AA3AFCB4AD08A01 /* ofxCubeMap.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = ofxCubeMap.h; path = ../../../addons/ofxCubeMap/src/ofxCubeMap.h; sourceTree = SOURCE_ROOT; }; 48 | 8CB08BEFD8CEC72296260766 /* ofxEquiMap.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofxEquiMap.cpp; path = ../../../addons/ofxEquiMap/src/ofxEquiMap.cpp; sourceTree = SOURCE_ROOT; }; 49 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = openFrameworksLib.xcodeproj; path = ../../../libs/openFrameworksCompiled/project/osx/openFrameworksLib.xcodeproj; sourceTree = SOURCE_ROOT; }; 50 | E4B69B5B0A3A1756003C02F2 /* exampleDebug.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = exampleDebug.app; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofApp.cpp; path = src/ofApp.cpp; sourceTree = SOURCE_ROOT; }; 52 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.plist.xml; path = "openFrameworks-Info.plist"; sourceTree = ""; }; 53 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = CoreOF.xcconfig; path = ../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig; sourceTree = SOURCE_ROOT; }; 54 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Project.xcconfig; sourceTree = ""; }; 55 | E58E68F4127344A6B10BCB62 /* ofxCubeMap.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 30; name = ofxCubeMap.cpp; path = ../../../addons/ofxCubeMap/src/ofxCubeMap.cpp; sourceTree = SOURCE_ROOT; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | E4B69B590A3A1756003C02F2 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | E4328149138ABC9F0047C5CB /* openFrameworksDebug.a in Frameworks */, 64 | ); 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXFrameworksBuildPhase section */ 68 | 69 | /* Begin PBXGroup section */ 70 | 6948EE371B920CB800B5AC1A /* local_addons */ = { 71 | isa = PBXGroup; 72 | children = ( 73 | ); 74 | name = local_addons; 75 | sourceTree = ""; 76 | }; 77 | A38207C2431F767B71247BB6 /* ofxCubeMap */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | B65AE53D4E29616A335A440B /* src */, 81 | ); 82 | name = ofxCubeMap; 83 | sourceTree = ""; 84 | }; 85 | A75E6DF8ED3FB2B5E1A9AEBE /* src */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 8CB08BEFD8CEC72296260766 /* ofxEquiMap.cpp */, 89 | 0BCBC7DD36212B36226BA9F4 /* ofxEquiMap.h */, 90 | ); 91 | name = src; 92 | sourceTree = ""; 93 | }; 94 | B65AE53D4E29616A335A440B /* src */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | E58E68F4127344A6B10BCB62 /* ofxCubeMap.cpp */, 98 | 3407D3543AA3AFCB4AD08A01 /* ofxCubeMap.h */, 99 | ); 100 | name = src; 101 | sourceTree = ""; 102 | }; 103 | BB4B014C10F69532006C3DED /* addons */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | A38207C2431F767B71247BB6 /* ofxCubeMap */, 107 | D886685DBBC23BF9A5C7DB8B /* ofxEquiMap */, 108 | ); 109 | name = addons; 110 | sourceTree = ""; 111 | }; 112 | D886685DBBC23BF9A5C7DB8B /* ofxEquiMap */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | A75E6DF8ED3FB2B5E1A9AEBE /* src */, 116 | ); 117 | name = ofxEquiMap; 118 | sourceTree = ""; 119 | }; 120 | E4328144138ABC890047C5CB /* Products */ = { 121 | isa = PBXGroup; 122 | children = ( 123 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */, 124 | ); 125 | name = Products; 126 | sourceTree = ""; 127 | }; 128 | E4B69B4A0A3A1720003C02F2 = { 129 | isa = PBXGroup; 130 | children = ( 131 | E4B6FCAD0C3E899E008CF71C /* openFrameworks-Info.plist */, 132 | E4EB6923138AFD0F00A09F29 /* Project.xcconfig */, 133 | E4B69E1C0A3A1BDC003C02F2 /* src */, 134 | E4EEC9E9138DF44700A80321 /* openFrameworks */, 135 | BB4B014C10F69532006C3DED /* addons */, 136 | 6948EE371B920CB800B5AC1A /* local_addons */, 137 | E4B69B5B0A3A1756003C02F2 /* exampleDebug.app */, 138 | ); 139 | sourceTree = ""; 140 | }; 141 | E4B69E1C0A3A1BDC003C02F2 /* src */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | E4B69E1E0A3A1BDC003C02F2 /* ofApp.cpp */, 145 | ); 146 | path = src; 147 | sourceTree = SOURCE_ROOT; 148 | }; 149 | E4EEC9E9138DF44700A80321 /* openFrameworks */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | E4EB691F138AFCF100A09F29 /* CoreOF.xcconfig */, 153 | E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */, 154 | ); 155 | name = openFrameworks; 156 | sourceTree = ""; 157 | }; 158 | /* End PBXGroup section */ 159 | 160 | /* Begin PBXNativeTarget section */ 161 | E4B69B5A0A3A1756003C02F2 /* example */ = { 162 | isa = PBXNativeTarget; 163 | buildConfigurationList = E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example" */; 164 | buildPhases = ( 165 | E4B69B580A3A1756003C02F2 /* Sources */, 166 | E4B69B590A3A1756003C02F2 /* Frameworks */, 167 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */, 168 | E4C2427710CC5ABF004149E2 /* CopyFiles */, 169 | ); 170 | buildRules = ( 171 | ); 172 | dependencies = ( 173 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */, 174 | ); 175 | name = example; 176 | productName = myOFApp; 177 | productReference = E4B69B5B0A3A1756003C02F2 /* exampleDebug.app */; 178 | productType = "com.apple.product-type.application"; 179 | }; 180 | /* End PBXNativeTarget section */ 181 | 182 | /* Begin PBXProject section */ 183 | E4B69B4C0A3A1720003C02F2 /* Project object */ = { 184 | isa = PBXProject; 185 | attributes = { 186 | LastUpgradeCheck = 0600; 187 | }; 188 | buildConfigurationList = E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example" */; 189 | compatibilityVersion = "Xcode 3.2"; 190 | developmentRegion = English; 191 | hasScannedForEncodings = 0; 192 | knownRegions = ( 193 | English, 194 | Japanese, 195 | French, 196 | German, 197 | ); 198 | mainGroup = E4B69B4A0A3A1720003C02F2; 199 | productRefGroup = E4B69B4A0A3A1720003C02F2; 200 | projectDirPath = ""; 201 | projectReferences = ( 202 | { 203 | ProductGroup = E4328144138ABC890047C5CB /* Products */; 204 | ProjectRef = E4328143138ABC890047C5CB /* openFrameworksLib.xcodeproj */; 205 | }, 206 | ); 207 | projectRoot = ""; 208 | targets = ( 209 | E4B69B5A0A3A1756003C02F2 /* example */, 210 | ); 211 | }; 212 | /* End PBXProject section */ 213 | 214 | /* Begin PBXReferenceProxy section */ 215 | E4328148138ABC890047C5CB /* openFrameworksDebug.a */ = { 216 | isa = PBXReferenceProxy; 217 | fileType = archive.ar; 218 | path = openFrameworksDebug.a; 219 | remoteRef = E4328147138ABC890047C5CB /* PBXContainerItemProxy */; 220 | sourceTree = BUILT_PRODUCTS_DIR; 221 | }; 222 | /* End PBXReferenceProxy section */ 223 | 224 | /* Begin PBXShellScriptBuildPhase section */ 225 | E4B6FFFD0C3F9AB9008CF71C /* ShellScript */ = { 226 | isa = PBXShellScriptBuildPhase; 227 | buildActionMask = 2147483647; 228 | files = ( 229 | ); 230 | inputPaths = ( 231 | ); 232 | outputPaths = ( 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | shellPath = /bin/sh; 236 | shellScript = "mkdir -p \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n# Copy default icon file into App/Resources\nrsync -aved \"$ICON_FILE\" \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Resources/\"\n# Copy libfmod and change install directory for fmod to run\nrsync -aved ../../../libs/fmodex/lib/osx/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/\";\ninstall_name_tool -change @executable_path/libfmodex.dylib @executable_path/../Frameworks/libfmodex.dylib \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME\";\n# Copy GLUT framework (must remove for AppStore submissions)\nrsync -aved ../../../libs/glut/lib/osx/GLUT.framework \"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/Frameworks/\"\n"; 237 | }; 238 | /* End PBXShellScriptBuildPhase section */ 239 | 240 | /* Begin PBXSourcesBuildPhase section */ 241 | E4B69B580A3A1756003C02F2 /* Sources */ = { 242 | isa = PBXSourcesBuildPhase; 243 | buildActionMask = 2147483647; 244 | files = ( 245 | E4B69E210A3A1BDC003C02F2 /* ofApp.cpp in Sources */, 246 | 40F951BE7A53C33005AE7C62 /* ofxCubeMap.cpp in Sources */, 247 | D1BB63CD7A025E0AC7F63364 /* ofxEquiMap.cpp in Sources */, 248 | ); 249 | runOnlyForDeploymentPostprocessing = 0; 250 | }; 251 | /* End PBXSourcesBuildPhase section */ 252 | 253 | /* Begin PBXTargetDependency section */ 254 | E4EEB9AC138B136A00A80321 /* PBXTargetDependency */ = { 255 | isa = PBXTargetDependency; 256 | name = openFrameworks; 257 | targetProxy = E4EEB9AB138B136A00A80321 /* PBXContainerItemProxy */; 258 | }; 259 | /* End PBXTargetDependency section */ 260 | 261 | /* Begin XCBuildConfiguration section */ 262 | E4B69B4E0A3A1720003C02F2 /* Debug */ = { 263 | isa = XCBuildConfiguration; 264 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 265 | buildSettings = { 266 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 267 | COPY_PHASE_STRIP = NO; 268 | DEAD_CODE_STRIPPING = YES; 269 | GCC_AUTO_VECTORIZATION = YES; 270 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 271 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 272 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 273 | GCC_OPTIMIZATION_LEVEL = 0; 274 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 275 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 276 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 277 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 278 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 279 | GCC_WARN_UNUSED_VALUE = NO; 280 | GCC_WARN_UNUSED_VARIABLE = NO; 281 | HEADER_SEARCH_PATHS = ( 282 | "$(OF_CORE_HEADERS)", 283 | src, 284 | ../../../addons/ofxCubeMap/src, 285 | ../../../addons/ofxEquiMap/src, 286 | ); 287 | MACOSX_DEPLOYMENT_TARGET = 10.8; 288 | ONLY_ACTIVE_ARCH = YES; 289 | OTHER_CPLUSPLUSFLAGS = ( 290 | "-D__MACOSX_CORE__", 291 | "-mtune=native", 292 | ); 293 | SDKROOT = macosx; 294 | }; 295 | name = Debug; 296 | }; 297 | E4B69B4F0A3A1720003C02F2 /* Release */ = { 298 | isa = XCBuildConfiguration; 299 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 300 | buildSettings = { 301 | CONFIGURATION_BUILD_DIR = "$(SRCROOT)/bin/"; 302 | COPY_PHASE_STRIP = YES; 303 | DEAD_CODE_STRIPPING = YES; 304 | GCC_AUTO_VECTORIZATION = YES; 305 | GCC_ENABLE_SSE3_EXTENSIONS = YES; 306 | GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES; 307 | GCC_INLINES_ARE_PRIVATE_EXTERN = NO; 308 | GCC_OPTIMIZATION_LEVEL = 3; 309 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 310 | GCC_UNROLL_LOOPS = YES; 311 | GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; 312 | GCC_WARN_ABOUT_INVALID_OFFSETOF_MACRO = NO; 313 | GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; 314 | GCC_WARN_UNINITIALIZED_AUTOS = NO; 315 | GCC_WARN_UNUSED_VALUE = NO; 316 | GCC_WARN_UNUSED_VARIABLE = NO; 317 | HEADER_SEARCH_PATHS = ( 318 | "$(OF_CORE_HEADERS)", 319 | src, 320 | ../../../addons/ofxCubeMap/src, 321 | ../../../addons/ofxEquiMap/src, 322 | ); 323 | MACOSX_DEPLOYMENT_TARGET = 10.8; 324 | OTHER_CPLUSPLUSFLAGS = ( 325 | "-D__MACOSX_CORE__", 326 | "-mtune=native", 327 | ); 328 | SDKROOT = macosx; 329 | }; 330 | name = Release; 331 | }; 332 | E4B69B600A3A1757003C02F2 /* Debug */ = { 333 | isa = XCBuildConfiguration; 334 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 335 | buildSettings = { 336 | COMBINE_HIDPI_IMAGES = YES; 337 | COPY_PHASE_STRIP = NO; 338 | FRAMEWORK_SEARCH_PATHS = ( 339 | "$(inherited)", 340 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 341 | ); 342 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 343 | GCC_DYNAMIC_NO_PIC = NO; 344 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 345 | GCC_MODEL_TUNING = NONE; 346 | HEADER_SEARCH_PATHS = ( 347 | "$(OF_CORE_HEADERS)", 348 | src, 349 | ../../../addons/ofxCubeMap/src, 350 | ../../../addons/ofxEquiMap/src, 351 | ); 352 | ICON = "$(ICON_NAME_DEBUG)"; 353 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; 354 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 355 | INSTALL_PATH = /Applications; 356 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 357 | PRODUCT_NAME = "$(TARGET_NAME)Debug"; 358 | WRAPPER_EXTENSION = app; 359 | }; 360 | name = Debug; 361 | }; 362 | E4B69B610A3A1757003C02F2 /* Release */ = { 363 | isa = XCBuildConfiguration; 364 | baseConfigurationReference = E4EB6923138AFD0F00A09F29 /* Project.xcconfig */; 365 | buildSettings = { 366 | COMBINE_HIDPI_IMAGES = YES; 367 | COPY_PHASE_STRIP = YES; 368 | FRAMEWORK_SEARCH_PATHS = ( 369 | "$(inherited)", 370 | "$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)", 371 | ); 372 | FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/../../../libs/glut/lib/osx\""; 373 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES; 374 | GCC_MODEL_TUNING = NONE; 375 | HEADER_SEARCH_PATHS = ( 376 | "$(OF_CORE_HEADERS)", 377 | src, 378 | ../../../addons/ofxCubeMap/src, 379 | ../../../addons/ofxEquiMap/src, 380 | ); 381 | ICON = "$(ICON_NAME_RELEASE)"; 382 | ICON_FILE = "$(ICON_FILE_PATH)$(ICON)"; 383 | INFOPLIST_FILE = "openFrameworks-Info.plist"; 384 | INSTALL_PATH = /Applications; 385 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 386 | PRODUCT_NAME = "$(TARGET_NAME)"; 387 | WRAPPER_EXTENSION = app; 388 | baseConfigurationReference = E4EB6923138AFD0F00A09F29; 389 | }; 390 | name = Release; 391 | }; 392 | /* End XCBuildConfiguration section */ 393 | 394 | /* Begin XCConfigurationList section */ 395 | E4B69B4D0A3A1720003C02F2 /* Build configuration list for PBXProject "example" */ = { 396 | isa = XCConfigurationList; 397 | buildConfigurations = ( 398 | E4B69B4E0A3A1720003C02F2 /* Debug */, 399 | E4B69B4F0A3A1720003C02F2 /* Release */, 400 | ); 401 | defaultConfigurationIsVisible = 0; 402 | defaultConfigurationName = Release; 403 | }; 404 | E4B69B5F0A3A1757003C02F2 /* Build configuration list for PBXNativeTarget "example" */ = { 405 | isa = XCConfigurationList; 406 | buildConfigurations = ( 407 | E4B69B600A3A1757003C02F2 /* Debug */, 408 | E4B69B610A3A1757003C02F2 /* Release */, 409 | ); 410 | defaultConfigurationIsVisible = 0; 411 | defaultConfigurationName = Release; 412 | }; 413 | /* End XCConfigurationList section */ 414 | }; 415 | rootObject = E4B69B4C0A3A1720003C02F2 /* Project object */; 416 | } 417 | -------------------------------------------------------------------------------- /example/example.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/example.xcodeproj/xcshareddata/xcschemes/example Debug.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /example/example.xcodeproj/xcshareddata/xcschemes/example Release.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 51 | 52 | 58 | 59 | 60 | 61 | 62 | 63 | 69 | 70 | 76 | 77 | 78 | 79 | 81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /example/openFrameworks-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cc.openFrameworks.ofapp 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | APPL 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 1.0 19 | CFBundleIconFile 20 | ${ICON} 21 | 22 | 23 | -------------------------------------------------------------------------------- /example/src/ofApp.cpp: -------------------------------------------------------------------------------- 1 | #include "ofMain.h" 2 | #include "ofxEquiMap.h" 3 | 4 | class ofApp : public ofBaseApp, public ofxEquiMap::Scene{ 5 | ofxEquiMap::Renderer em; 6 | ofxEquiMap::CustomFboRenderer em2; 7 | 8 | ofVboMesh m; 9 | public: 10 | void setup() 11 | { 12 | ofSetVerticalSync(true); 13 | ofSetFrameRate(60); 14 | em.setup(1024, this); 15 | em2.setup(1024, this, GL_RGB, 4); 16 | ofSpherePrimitive p(1000, 24); 17 | m = p.getMesh(); 18 | } 19 | 20 | void drawEquiScene() 21 | { 22 | ofPushStyle(); 23 | ofSetLineWidth(3); 24 | ofSetColor(192); 25 | m.drawWireframe(); 26 | ofPopStyle(); 27 | } 28 | 29 | void update() { 30 | em.render(); 31 | em2.render(); 32 | } 33 | 34 | void draw() 35 | { 36 | ofClear(0); 37 | if (ofGetKeyPressed(' ')) { 38 | em.draw(0, 0, ofGetWidth(), ofGetHeight()); 39 | ofDrawBitmapStringHighlight("Renderer", 10, 40); 40 | } else { 41 | em2.draw(0, 0, ofGetWidth(), ofGetHeight()); 42 | ofDrawBitmapStringHighlight("CustomFboRenderer", 10, 40); 43 | } 44 | 45 | ofDrawBitmapStringHighlight(ofToString(ofGetFrameRate()), 10, 20); 46 | } 47 | }; 48 | 49 | //======================================================================== 50 | int main( ){ 51 | ofSetupOpenGL(1280,640,OF_WINDOW); // <-------- setup the GL context 52 | 53 | // this kicks off the running of my app 54 | // can be OF_WINDOW or OF_FULLSCREEN 55 | // pass in width and height too: 56 | ofRunApp(new ofApp()); 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/ofxEquiMap.cpp: -------------------------------------------------------------------------------- 1 | #include "ofxEquiMap.h" 2 | 3 | #ifndef STRINGIFY 4 | #define STRINGIFY(A) #A 5 | #endif 6 | 7 | namespace ofxEquiMap { 8 | static string warp_frag_shader_str = STRINGIFY( 9 | uniform samplerCube envMap; 10 | 11 | void main() { 12 | 13 | vec2 tc = gl_TexCoord[0].st / vec2(2.0) + 0.5; //only line modified from the shader toy example 14 | vec2 thetaphi = ((tc * 2.0) - vec2(1.0)) * vec2(3.1415926535897932384626433832795, 1.5707963267948966192313216916398); 15 | vec3 rayDirection = vec3(cos(thetaphi.y) * cos(thetaphi.x), sin(thetaphi.y), cos(thetaphi.y) * sin(thetaphi.x)); 16 | 17 | gl_FragColor = textureCube(envMap, rayDirection); 18 | } 19 | ); 20 | 21 | void Renderer::setup(int size, Scene* s, int internalformat) 22 | { 23 | int type = ofGetGlTypeFromInternal(internalformat); 24 | int format = ofGetGLFormatFromInternal(internalformat); 25 | cm.initEmptyTextures(size, format, type); 26 | warpShader.setupShaderFromSource(GL_FRAGMENT_SHADER, warp_frag_shader_str); 27 | warpShader.linkProgram(); 28 | registerScene(s); 29 | } 30 | 31 | void Renderer::render() { 32 | if (!scene) { 33 | return; 34 | } 35 | for (int i = 0; i < 6; i++) { 36 | cm.beginDrawingInto3D( GL_TEXTURE_CUBE_MAP_POSITIVE_X + i ); 37 | ofClear(0); 38 | // work around for ofLight issue caused by ofxCubeMap 39 | ofLoadViewMatrix(ofGetCurrentMatrix(OF_MATRIX_MODELVIEW)); 40 | scene->drawEquiScene(); 41 | cm.endDrawingInto3D(); 42 | } 43 | } 44 | 45 | void Renderer::draw(float x, float y, float w, float h) { 46 | warpShader.begin(); 47 | warpShader.setUniform1i("envMap", 0); 48 | cm.drawFace(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, x, y, w, h); 49 | warpShader.end(); 50 | } 51 | 52 | void CustomFboRenderer::setup(int size, Scene* s, int internalformat, int numSamples) 53 | { 54 | Renderer::setup(size, s, internalformat); 55 | fbo.allocate(cm.getWidth(), cm.getHeight(), internalformat, numSamples); 56 | } 57 | 58 | void CustomFboRenderer::setup(int size, Scene* s, ofFbo::Settings fbo_settings) 59 | { 60 | Renderer::setup(size, s, fbo_settings.internalformat); 61 | fbo.allocate(fbo_settings); 62 | } 63 | 64 | void CustomFboRenderer::render() { 65 | for (int i = 0; i < 6; ++i) { 66 | fbo.begin(); 67 | ofClear(0); 68 | ofPushView(); 69 | 70 | glMatrixMode( GL_PROJECTION ); 71 | glLoadIdentity(); 72 | glLoadMatrixf( cm.getProjectionMatrix().getPtr() ); 73 | 74 | glMatrixMode( GL_MODELVIEW ); 75 | glLoadIdentity(); 76 | glLoadMatrixf( cm.getLookAtMatrixForFace( GL_TEXTURE_CUBE_MAP_POSITIVE_X + i).getPtr() ); 77 | 78 | // work around for ofLight issue caused by ofxCubeMap 79 | ofLoadViewMatrix(ofGetCurrentMatrix(OF_MATRIX_MODELVIEW)); 80 | 81 | scene->drawEquiScene(); 82 | 83 | ofPopView(); 84 | fbo.end(); 85 | 86 | cm.beginDrawingInto2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i); 87 | ofClear(0); 88 | fbo.draw(0, 0); 89 | cm.endDrawingInto2D(); 90 | } 91 | } 92 | } -------------------------------------------------------------------------------- /src/ofxEquiMap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "ofMain.h" 4 | #include "ofxCubeMap.h" 5 | 6 | namespace ofxEquiMap 7 | { 8 | class Scene 9 | { 10 | public: 11 | virtual ~Scene() {} 12 | virtual void drawEquiScene() = 0; 13 | }; 14 | 15 | class Renderer 16 | { 17 | protected: 18 | Scene* scene = NULL; 19 | ofxCubeMap cm; 20 | ofShader warpShader; 21 | public: 22 | void setup(int size, Scene* s, int internalformat = GL_RGB); 23 | virtual void render(); 24 | void draw(float x, float y, float w, float h); 25 | 26 | void setPosition(const ofVec3f& p) { 27 | ofVec3f p2 = p; 28 | cm.setPosition(p2); 29 | } 30 | 31 | void registerScene(Scene* s) {scene = s;} 32 | void setPosition(float x, float y, float z) {cm.setPosition(x, y, z);} 33 | ofxCubeMap& getCubeMap() {return cm;} 34 | 35 | }; 36 | 37 | class CustomFboRenderer : public Renderer 38 | { 39 | protected: 40 | ofFbo fbo; 41 | public: 42 | void setup(int size, Scene* s, int internalformat = GL_RGB, int numSamples = 0); 43 | void setup(int size, Scene* s, ofFbo::Settings fbo_settings); 44 | void render() override; 45 | 46 | ofFbo& getFbo() { return fbo; } 47 | const ofFbo& getFbo() const { return fbo; } 48 | }; 49 | }; --------------------------------------------------------------------------------