├── README.md ├── RenderOrder.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── toshihirogoto.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── RenderOrder ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── GameViewController.swift ├── Info.plist ├── Scene │ └── RenderOrder.scn └── image │ ├── Background_sky.png │ ├── max_AO.png │ ├── max_diffuse.png │ ├── max_diffuseB.png │ ├── max_diffuseC.png │ ├── max_diffuseD.png │ └── max_roughness.png ├── RenderOrderTests ├── Info.plist └── RenderOrderTests.swift ├── RenderOrderUITests ├── Info.plist └── RenderOrderUITests.swift └── mov.gif /README.md: -------------------------------------------------------------------------------- 1 | # SceneKit / SCNNode - Rendering Order sample 2 | 3 | ![Rendering Order sample](mov.gif "Rendering Order sample") -------------------------------------------------------------------------------- /RenderOrder.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 8259EE171FCD3BD900BF24AB /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8259EE161FCD3BD900BF24AB /* AppDelegate.swift */; }; 11 | 8259EE1B1FCD3BD900BF24AB /* GameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8259EE1A1FCD3BD900BF24AB /* GameViewController.swift */; }; 12 | 8259EE1E1FCD3BD900BF24AB /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE1C1FCD3BD900BF24AB /* Main.storyboard */; }; 13 | 8259EE201FCD3BD900BF24AB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE1F1FCD3BD900BF24AB /* Assets.xcassets */; }; 14 | 8259EE231FCD3BD900BF24AB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE211FCD3BD900BF24AB /* LaunchScreen.storyboard */; }; 15 | 8259EE2E1FCD3BD900BF24AB /* RenderOrderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8259EE2D1FCD3BD900BF24AB /* RenderOrderTests.swift */; }; 16 | 8259EE391FCD3BD900BF24AB /* RenderOrderUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8259EE381FCD3BD900BF24AB /* RenderOrderUITests.swift */; }; 17 | 8259EE4F1FCD3C4800BF24AB /* Background_sky.png in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE481FCD3C4700BF24AB /* Background_sky.png */; }; 18 | 8259EE501FCD3C4800BF24AB /* max_AO.png in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE491FCD3C4700BF24AB /* max_AO.png */; }; 19 | 8259EE511FCD3C4800BF24AB /* max_diffuseC.png in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE4A1FCD3C4700BF24AB /* max_diffuseC.png */; }; 20 | 8259EE521FCD3C4800BF24AB /* max_roughness.png in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE4B1FCD3C4700BF24AB /* max_roughness.png */; }; 21 | 8259EE531FCD3C4800BF24AB /* max_diffuse.png in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE4C1FCD3C4800BF24AB /* max_diffuse.png */; }; 22 | 8259EE541FCD3C4800BF24AB /* max_diffuseD.png in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE4D1FCD3C4800BF24AB /* max_diffuseD.png */; }; 23 | 8259EE551FCD3C4800BF24AB /* max_diffuseB.png in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE4E1FCD3C4800BF24AB /* max_diffuseB.png */; }; 24 | 8259EE571FCD3C5D00BF24AB /* RenderOrder.scn in Resources */ = {isa = PBXBuildFile; fileRef = 8259EE561FCD3C5D00BF24AB /* RenderOrder.scn */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | 8259EE2A1FCD3BD900BF24AB /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 8259EE0B1FCD3BD900BF24AB /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 8259EE121FCD3BD900BF24AB; 33 | remoteInfo = RenderOrder; 34 | }; 35 | 8259EE351FCD3BD900BF24AB /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 8259EE0B1FCD3BD900BF24AB /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = 8259EE121FCD3BD900BF24AB; 40 | remoteInfo = RenderOrder; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 8259EE131FCD3BD900BF24AB /* RenderOrder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RenderOrder.app; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 8259EE161FCD3BD900BF24AB /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 47 | 8259EE1A1FCD3BD900BF24AB /* GameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameViewController.swift; sourceTree = ""; }; 48 | 8259EE1D1FCD3BD900BF24AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 49 | 8259EE1F1FCD3BD900BF24AB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 50 | 8259EE221FCD3BD900BF24AB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 51 | 8259EE241FCD3BD900BF24AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 52 | 8259EE291FCD3BD900BF24AB /* RenderOrderTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RenderOrderTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 8259EE2D1FCD3BD900BF24AB /* RenderOrderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RenderOrderTests.swift; sourceTree = ""; }; 54 | 8259EE2F1FCD3BD900BF24AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | 8259EE341FCD3BD900BF24AB /* RenderOrderUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RenderOrderUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | 8259EE381FCD3BD900BF24AB /* RenderOrderUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RenderOrderUITests.swift; sourceTree = ""; }; 57 | 8259EE3A1FCD3BD900BF24AB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | 8259EE481FCD3C4700BF24AB /* Background_sky.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Background_sky.png; sourceTree = ""; }; 59 | 8259EE491FCD3C4700BF24AB /* max_AO.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = max_AO.png; sourceTree = ""; }; 60 | 8259EE4A1FCD3C4700BF24AB /* max_diffuseC.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = max_diffuseC.png; sourceTree = ""; }; 61 | 8259EE4B1FCD3C4700BF24AB /* max_roughness.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = max_roughness.png; sourceTree = ""; }; 62 | 8259EE4C1FCD3C4800BF24AB /* max_diffuse.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = max_diffuse.png; sourceTree = ""; }; 63 | 8259EE4D1FCD3C4800BF24AB /* max_diffuseD.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = max_diffuseD.png; sourceTree = ""; }; 64 | 8259EE4E1FCD3C4800BF24AB /* max_diffuseB.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = max_diffuseB.png; sourceTree = ""; }; 65 | 8259EE561FCD3C5D00BF24AB /* RenderOrder.scn */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; path = RenderOrder.scn; sourceTree = ""; }; 66 | /* End PBXFileReference section */ 67 | 68 | /* Begin PBXFrameworksBuildPhase section */ 69 | 8259EE101FCD3BD900BF24AB /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | 8259EE261FCD3BD900BF24AB /* Frameworks */ = { 77 | isa = PBXFrameworksBuildPhase; 78 | buildActionMask = 2147483647; 79 | files = ( 80 | ); 81 | runOnlyForDeploymentPostprocessing = 0; 82 | }; 83 | 8259EE311FCD3BD900BF24AB /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXFrameworksBuildPhase section */ 91 | 92 | /* Begin PBXGroup section */ 93 | 8259EE0A1FCD3BD900BF24AB = { 94 | isa = PBXGroup; 95 | children = ( 96 | 8259EE151FCD3BD900BF24AB /* RenderOrder */, 97 | 8259EE2C1FCD3BD900BF24AB /* RenderOrderTests */, 98 | 8259EE371FCD3BD900BF24AB /* RenderOrderUITests */, 99 | 8259EE141FCD3BD900BF24AB /* Products */, 100 | ); 101 | sourceTree = ""; 102 | }; 103 | 8259EE141FCD3BD900BF24AB /* Products */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 8259EE131FCD3BD900BF24AB /* RenderOrder.app */, 107 | 8259EE291FCD3BD900BF24AB /* RenderOrderTests.xctest */, 108 | 8259EE341FCD3BD900BF24AB /* RenderOrderUITests.xctest */, 109 | ); 110 | name = Products; 111 | sourceTree = ""; 112 | }; 113 | 8259EE151FCD3BD900BF24AB /* RenderOrder */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 8259EE161FCD3BD900BF24AB /* AppDelegate.swift */, 117 | 8259EE1A1FCD3BD900BF24AB /* GameViewController.swift */, 118 | 8259EE471FCD3C2600BF24AB /* Scene */, 119 | 8259EE461FCD3C0F00BF24AB /* image */, 120 | 8259EE1F1FCD3BD900BF24AB /* Assets.xcassets */, 121 | 8259EE1C1FCD3BD900BF24AB /* Main.storyboard */, 122 | 8259EE211FCD3BD900BF24AB /* LaunchScreen.storyboard */, 123 | 8259EE241FCD3BD900BF24AB /* Info.plist */, 124 | ); 125 | path = RenderOrder; 126 | sourceTree = ""; 127 | }; 128 | 8259EE2C1FCD3BD900BF24AB /* RenderOrderTests */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 8259EE2D1FCD3BD900BF24AB /* RenderOrderTests.swift */, 132 | 8259EE2F1FCD3BD900BF24AB /* Info.plist */, 133 | ); 134 | path = RenderOrderTests; 135 | sourceTree = ""; 136 | }; 137 | 8259EE371FCD3BD900BF24AB /* RenderOrderUITests */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 8259EE381FCD3BD900BF24AB /* RenderOrderUITests.swift */, 141 | 8259EE3A1FCD3BD900BF24AB /* Info.plist */, 142 | ); 143 | path = RenderOrderUITests; 144 | sourceTree = ""; 145 | }; 146 | 8259EE461FCD3C0F00BF24AB /* image */ = { 147 | isa = PBXGroup; 148 | children = ( 149 | 8259EE481FCD3C4700BF24AB /* Background_sky.png */, 150 | 8259EE491FCD3C4700BF24AB /* max_AO.png */, 151 | 8259EE4C1FCD3C4800BF24AB /* max_diffuse.png */, 152 | 8259EE4E1FCD3C4800BF24AB /* max_diffuseB.png */, 153 | 8259EE4A1FCD3C4700BF24AB /* max_diffuseC.png */, 154 | 8259EE4D1FCD3C4800BF24AB /* max_diffuseD.png */, 155 | 8259EE4B1FCD3C4700BF24AB /* max_roughness.png */, 156 | ); 157 | path = image; 158 | sourceTree = ""; 159 | }; 160 | 8259EE471FCD3C2600BF24AB /* Scene */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | 8259EE561FCD3C5D00BF24AB /* RenderOrder.scn */, 164 | ); 165 | path = Scene; 166 | sourceTree = ""; 167 | }; 168 | /* End PBXGroup section */ 169 | 170 | /* Begin PBXNativeTarget section */ 171 | 8259EE121FCD3BD900BF24AB /* RenderOrder */ = { 172 | isa = PBXNativeTarget; 173 | buildConfigurationList = 8259EE3D1FCD3BD900BF24AB /* Build configuration list for PBXNativeTarget "RenderOrder" */; 174 | buildPhases = ( 175 | 8259EE0F1FCD3BD900BF24AB /* Sources */, 176 | 8259EE101FCD3BD900BF24AB /* Frameworks */, 177 | 8259EE111FCD3BD900BF24AB /* Resources */, 178 | ); 179 | buildRules = ( 180 | ); 181 | dependencies = ( 182 | ); 183 | name = RenderOrder; 184 | productName = RenderOrder; 185 | productReference = 8259EE131FCD3BD900BF24AB /* RenderOrder.app */; 186 | productType = "com.apple.product-type.application"; 187 | }; 188 | 8259EE281FCD3BD900BF24AB /* RenderOrderTests */ = { 189 | isa = PBXNativeTarget; 190 | buildConfigurationList = 8259EE401FCD3BD900BF24AB /* Build configuration list for PBXNativeTarget "RenderOrderTests" */; 191 | buildPhases = ( 192 | 8259EE251FCD3BD900BF24AB /* Sources */, 193 | 8259EE261FCD3BD900BF24AB /* Frameworks */, 194 | 8259EE271FCD3BD900BF24AB /* Resources */, 195 | ); 196 | buildRules = ( 197 | ); 198 | dependencies = ( 199 | 8259EE2B1FCD3BD900BF24AB /* PBXTargetDependency */, 200 | ); 201 | name = RenderOrderTests; 202 | productName = RenderOrderTests; 203 | productReference = 8259EE291FCD3BD900BF24AB /* RenderOrderTests.xctest */; 204 | productType = "com.apple.product-type.bundle.unit-test"; 205 | }; 206 | 8259EE331FCD3BD900BF24AB /* RenderOrderUITests */ = { 207 | isa = PBXNativeTarget; 208 | buildConfigurationList = 8259EE431FCD3BD900BF24AB /* Build configuration list for PBXNativeTarget "RenderOrderUITests" */; 209 | buildPhases = ( 210 | 8259EE301FCD3BD900BF24AB /* Sources */, 211 | 8259EE311FCD3BD900BF24AB /* Frameworks */, 212 | 8259EE321FCD3BD900BF24AB /* Resources */, 213 | ); 214 | buildRules = ( 215 | ); 216 | dependencies = ( 217 | 8259EE361FCD3BD900BF24AB /* PBXTargetDependency */, 218 | ); 219 | name = RenderOrderUITests; 220 | productName = RenderOrderUITests; 221 | productReference = 8259EE341FCD3BD900BF24AB /* RenderOrderUITests.xctest */; 222 | productType = "com.apple.product-type.bundle.ui-testing"; 223 | }; 224 | /* End PBXNativeTarget section */ 225 | 226 | /* Begin PBXProject section */ 227 | 8259EE0B1FCD3BD900BF24AB /* Project object */ = { 228 | isa = PBXProject; 229 | attributes = { 230 | LastSwiftUpdateCheck = 0910; 231 | LastUpgradeCheck = 0910; 232 | ORGANIZATIONNAME = "Toshihiro Goto"; 233 | TargetAttributes = { 234 | 8259EE121FCD3BD900BF24AB = { 235 | CreatedOnToolsVersion = 9.1; 236 | ProvisioningStyle = Automatic; 237 | }; 238 | 8259EE281FCD3BD900BF24AB = { 239 | CreatedOnToolsVersion = 9.1; 240 | ProvisioningStyle = Automatic; 241 | TestTargetID = 8259EE121FCD3BD900BF24AB; 242 | }; 243 | 8259EE331FCD3BD900BF24AB = { 244 | CreatedOnToolsVersion = 9.1; 245 | ProvisioningStyle = Automatic; 246 | TestTargetID = 8259EE121FCD3BD900BF24AB; 247 | }; 248 | }; 249 | }; 250 | buildConfigurationList = 8259EE0E1FCD3BD900BF24AB /* Build configuration list for PBXProject "RenderOrder" */; 251 | compatibilityVersion = "Xcode 8.0"; 252 | developmentRegion = en; 253 | hasScannedForEncodings = 0; 254 | knownRegions = ( 255 | en, 256 | Base, 257 | ); 258 | mainGroup = 8259EE0A1FCD3BD900BF24AB; 259 | productRefGroup = 8259EE141FCD3BD900BF24AB /* Products */; 260 | projectDirPath = ""; 261 | projectRoot = ""; 262 | targets = ( 263 | 8259EE121FCD3BD900BF24AB /* RenderOrder */, 264 | 8259EE281FCD3BD900BF24AB /* RenderOrderTests */, 265 | 8259EE331FCD3BD900BF24AB /* RenderOrderUITests */, 266 | ); 267 | }; 268 | /* End PBXProject section */ 269 | 270 | /* Begin PBXResourcesBuildPhase section */ 271 | 8259EE111FCD3BD900BF24AB /* Resources */ = { 272 | isa = PBXResourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | 8259EE501FCD3C4800BF24AB /* max_AO.png in Resources */, 276 | 8259EE571FCD3C5D00BF24AB /* RenderOrder.scn in Resources */, 277 | 8259EE231FCD3BD900BF24AB /* LaunchScreen.storyboard in Resources */, 278 | 8259EE551FCD3C4800BF24AB /* max_diffuseB.png in Resources */, 279 | 8259EE511FCD3C4800BF24AB /* max_diffuseC.png in Resources */, 280 | 8259EE201FCD3BD900BF24AB /* Assets.xcassets in Resources */, 281 | 8259EE4F1FCD3C4800BF24AB /* Background_sky.png in Resources */, 282 | 8259EE1E1FCD3BD900BF24AB /* Main.storyboard in Resources */, 283 | 8259EE521FCD3C4800BF24AB /* max_roughness.png in Resources */, 284 | 8259EE541FCD3C4800BF24AB /* max_diffuseD.png in Resources */, 285 | 8259EE531FCD3C4800BF24AB /* max_diffuse.png in Resources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | 8259EE271FCD3BD900BF24AB /* Resources */ = { 290 | isa = PBXResourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | 8259EE321FCD3BD900BF24AB /* Resources */ = { 297 | isa = PBXResourcesBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | }; 303 | /* End PBXResourcesBuildPhase section */ 304 | 305 | /* Begin PBXSourcesBuildPhase section */ 306 | 8259EE0F1FCD3BD900BF24AB /* Sources */ = { 307 | isa = PBXSourcesBuildPhase; 308 | buildActionMask = 2147483647; 309 | files = ( 310 | 8259EE1B1FCD3BD900BF24AB /* GameViewController.swift in Sources */, 311 | 8259EE171FCD3BD900BF24AB /* AppDelegate.swift in Sources */, 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | }; 315 | 8259EE251FCD3BD900BF24AB /* Sources */ = { 316 | isa = PBXSourcesBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | 8259EE2E1FCD3BD900BF24AB /* RenderOrderTests.swift in Sources */, 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | }; 323 | 8259EE301FCD3BD900BF24AB /* Sources */ = { 324 | isa = PBXSourcesBuildPhase; 325 | buildActionMask = 2147483647; 326 | files = ( 327 | 8259EE391FCD3BD900BF24AB /* RenderOrderUITests.swift in Sources */, 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | }; 331 | /* End PBXSourcesBuildPhase section */ 332 | 333 | /* Begin PBXTargetDependency section */ 334 | 8259EE2B1FCD3BD900BF24AB /* PBXTargetDependency */ = { 335 | isa = PBXTargetDependency; 336 | target = 8259EE121FCD3BD900BF24AB /* RenderOrder */; 337 | targetProxy = 8259EE2A1FCD3BD900BF24AB /* PBXContainerItemProxy */; 338 | }; 339 | 8259EE361FCD3BD900BF24AB /* PBXTargetDependency */ = { 340 | isa = PBXTargetDependency; 341 | target = 8259EE121FCD3BD900BF24AB /* RenderOrder */; 342 | targetProxy = 8259EE351FCD3BD900BF24AB /* PBXContainerItemProxy */; 343 | }; 344 | /* End PBXTargetDependency section */ 345 | 346 | /* Begin PBXVariantGroup section */ 347 | 8259EE1C1FCD3BD900BF24AB /* Main.storyboard */ = { 348 | isa = PBXVariantGroup; 349 | children = ( 350 | 8259EE1D1FCD3BD900BF24AB /* Base */, 351 | ); 352 | name = Main.storyboard; 353 | sourceTree = ""; 354 | }; 355 | 8259EE211FCD3BD900BF24AB /* LaunchScreen.storyboard */ = { 356 | isa = PBXVariantGroup; 357 | children = ( 358 | 8259EE221FCD3BD900BF24AB /* Base */, 359 | ); 360 | name = LaunchScreen.storyboard; 361 | sourceTree = ""; 362 | }; 363 | /* End PBXVariantGroup section */ 364 | 365 | /* Begin XCBuildConfiguration section */ 366 | 8259EE3B1FCD3BD900BF24AB /* Debug */ = { 367 | isa = XCBuildConfiguration; 368 | buildSettings = { 369 | ALWAYS_SEARCH_USER_PATHS = NO; 370 | CLANG_ANALYZER_NONNULL = YES; 371 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 372 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 373 | CLANG_CXX_LIBRARY = "libc++"; 374 | CLANG_ENABLE_MODULES = YES; 375 | CLANG_ENABLE_OBJC_ARC = YES; 376 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 377 | CLANG_WARN_BOOL_CONVERSION = YES; 378 | CLANG_WARN_COMMA = YES; 379 | CLANG_WARN_CONSTANT_CONVERSION = YES; 380 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 381 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 382 | CLANG_WARN_EMPTY_BODY = YES; 383 | CLANG_WARN_ENUM_CONVERSION = YES; 384 | CLANG_WARN_INFINITE_RECURSION = YES; 385 | CLANG_WARN_INT_CONVERSION = YES; 386 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 388 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 389 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 390 | CLANG_WARN_STRICT_PROTOTYPES = YES; 391 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 392 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 393 | CLANG_WARN_UNREACHABLE_CODE = YES; 394 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 395 | CODE_SIGN_IDENTITY = "iPhone Developer"; 396 | COPY_PHASE_STRIP = NO; 397 | DEBUG_INFORMATION_FORMAT = dwarf; 398 | ENABLE_STRICT_OBJC_MSGSEND = YES; 399 | ENABLE_TESTABILITY = YES; 400 | GCC_C_LANGUAGE_STANDARD = gnu11; 401 | GCC_DYNAMIC_NO_PIC = NO; 402 | GCC_NO_COMMON_BLOCKS = YES; 403 | GCC_OPTIMIZATION_LEVEL = 0; 404 | GCC_PREPROCESSOR_DEFINITIONS = ( 405 | "DEBUG=1", 406 | "$(inherited)", 407 | ); 408 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 409 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 410 | GCC_WARN_UNDECLARED_SELECTOR = YES; 411 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 412 | GCC_WARN_UNUSED_FUNCTION = YES; 413 | GCC_WARN_UNUSED_VARIABLE = YES; 414 | IPHONEOS_DEPLOYMENT_TARGET = 11.1; 415 | MTL_ENABLE_DEBUG_INFO = YES; 416 | ONLY_ACTIVE_ARCH = YES; 417 | SDKROOT = iphoneos; 418 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 419 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 420 | }; 421 | name = Debug; 422 | }; 423 | 8259EE3C1FCD3BD900BF24AB /* Release */ = { 424 | isa = XCBuildConfiguration; 425 | buildSettings = { 426 | ALWAYS_SEARCH_USER_PATHS = NO; 427 | CLANG_ANALYZER_NONNULL = YES; 428 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 429 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 430 | CLANG_CXX_LIBRARY = "libc++"; 431 | CLANG_ENABLE_MODULES = YES; 432 | CLANG_ENABLE_OBJC_ARC = YES; 433 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 434 | CLANG_WARN_BOOL_CONVERSION = YES; 435 | CLANG_WARN_COMMA = YES; 436 | CLANG_WARN_CONSTANT_CONVERSION = YES; 437 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 438 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 439 | CLANG_WARN_EMPTY_BODY = YES; 440 | CLANG_WARN_ENUM_CONVERSION = YES; 441 | CLANG_WARN_INFINITE_RECURSION = YES; 442 | CLANG_WARN_INT_CONVERSION = YES; 443 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 444 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 445 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 446 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 447 | CLANG_WARN_STRICT_PROTOTYPES = YES; 448 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 449 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 450 | CLANG_WARN_UNREACHABLE_CODE = YES; 451 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 452 | CODE_SIGN_IDENTITY = "iPhone Developer"; 453 | COPY_PHASE_STRIP = NO; 454 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 455 | ENABLE_NS_ASSERTIONS = NO; 456 | ENABLE_STRICT_OBJC_MSGSEND = YES; 457 | GCC_C_LANGUAGE_STANDARD = gnu11; 458 | GCC_NO_COMMON_BLOCKS = YES; 459 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 460 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 461 | GCC_WARN_UNDECLARED_SELECTOR = YES; 462 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 463 | GCC_WARN_UNUSED_FUNCTION = YES; 464 | GCC_WARN_UNUSED_VARIABLE = YES; 465 | IPHONEOS_DEPLOYMENT_TARGET = 11.1; 466 | MTL_ENABLE_DEBUG_INFO = NO; 467 | SDKROOT = iphoneos; 468 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 469 | VALIDATE_PRODUCT = YES; 470 | }; 471 | name = Release; 472 | }; 473 | 8259EE3E1FCD3BD900BF24AB /* Debug */ = { 474 | isa = XCBuildConfiguration; 475 | buildSettings = { 476 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 477 | CODE_SIGN_STYLE = Automatic; 478 | DEVELOPMENT_TEAM = 43RPG97GKY; 479 | INFOPLIST_FILE = RenderOrder/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 481 | PRODUCT_BUNDLE_IDENTIFIER = com.toshihiroGotoh.RenderOrder; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | SWIFT_VERSION = 4.0; 484 | TARGETED_DEVICE_FAMILY = "1,2"; 485 | }; 486 | name = Debug; 487 | }; 488 | 8259EE3F1FCD3BD900BF24AB /* Release */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 492 | CODE_SIGN_STYLE = Automatic; 493 | DEVELOPMENT_TEAM = 43RPG97GKY; 494 | INFOPLIST_FILE = RenderOrder/Info.plist; 495 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 496 | PRODUCT_BUNDLE_IDENTIFIER = com.toshihiroGotoh.RenderOrder; 497 | PRODUCT_NAME = "$(TARGET_NAME)"; 498 | SWIFT_VERSION = 4.0; 499 | TARGETED_DEVICE_FAMILY = "1,2"; 500 | }; 501 | name = Release; 502 | }; 503 | 8259EE411FCD3BD900BF24AB /* Debug */ = { 504 | isa = XCBuildConfiguration; 505 | buildSettings = { 506 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 507 | BUNDLE_LOADER = "$(TEST_HOST)"; 508 | CODE_SIGN_STYLE = Automatic; 509 | DEVELOPMENT_TEAM = 43RPG97GKY; 510 | INFOPLIST_FILE = RenderOrderTests/Info.plist; 511 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 512 | PRODUCT_BUNDLE_IDENTIFIER = com.toshihiroGotoh.RenderOrderTests; 513 | PRODUCT_NAME = "$(TARGET_NAME)"; 514 | SWIFT_VERSION = 4.0; 515 | TARGETED_DEVICE_FAMILY = "1,2"; 516 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RenderOrder.app/RenderOrder"; 517 | }; 518 | name = Debug; 519 | }; 520 | 8259EE421FCD3BD900BF24AB /* Release */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 524 | BUNDLE_LOADER = "$(TEST_HOST)"; 525 | CODE_SIGN_STYLE = Automatic; 526 | DEVELOPMENT_TEAM = 43RPG97GKY; 527 | INFOPLIST_FILE = RenderOrderTests/Info.plist; 528 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 529 | PRODUCT_BUNDLE_IDENTIFIER = com.toshihiroGotoh.RenderOrderTests; 530 | PRODUCT_NAME = "$(TARGET_NAME)"; 531 | SWIFT_VERSION = 4.0; 532 | TARGETED_DEVICE_FAMILY = "1,2"; 533 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RenderOrder.app/RenderOrder"; 534 | }; 535 | name = Release; 536 | }; 537 | 8259EE441FCD3BD900BF24AB /* Debug */ = { 538 | isa = XCBuildConfiguration; 539 | buildSettings = { 540 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 541 | CODE_SIGN_STYLE = Automatic; 542 | DEVELOPMENT_TEAM = 43RPG97GKY; 543 | INFOPLIST_FILE = RenderOrderUITests/Info.plist; 544 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 545 | PRODUCT_BUNDLE_IDENTIFIER = com.toshihiroGotoh.RenderOrderUITests; 546 | PRODUCT_NAME = "$(TARGET_NAME)"; 547 | SWIFT_VERSION = 4.0; 548 | TARGETED_DEVICE_FAMILY = "1,2"; 549 | TEST_TARGET_NAME = RenderOrder; 550 | }; 551 | name = Debug; 552 | }; 553 | 8259EE451FCD3BD900BF24AB /* Release */ = { 554 | isa = XCBuildConfiguration; 555 | buildSettings = { 556 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 557 | CODE_SIGN_STYLE = Automatic; 558 | DEVELOPMENT_TEAM = 43RPG97GKY; 559 | INFOPLIST_FILE = RenderOrderUITests/Info.plist; 560 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 561 | PRODUCT_BUNDLE_IDENTIFIER = com.toshihiroGotoh.RenderOrderUITests; 562 | PRODUCT_NAME = "$(TARGET_NAME)"; 563 | SWIFT_VERSION = 4.0; 564 | TARGETED_DEVICE_FAMILY = "1,2"; 565 | TEST_TARGET_NAME = RenderOrder; 566 | }; 567 | name = Release; 568 | }; 569 | /* End XCBuildConfiguration section */ 570 | 571 | /* Begin XCConfigurationList section */ 572 | 8259EE0E1FCD3BD900BF24AB /* Build configuration list for PBXProject "RenderOrder" */ = { 573 | isa = XCConfigurationList; 574 | buildConfigurations = ( 575 | 8259EE3B1FCD3BD900BF24AB /* Debug */, 576 | 8259EE3C1FCD3BD900BF24AB /* Release */, 577 | ); 578 | defaultConfigurationIsVisible = 0; 579 | defaultConfigurationName = Release; 580 | }; 581 | 8259EE3D1FCD3BD900BF24AB /* Build configuration list for PBXNativeTarget "RenderOrder" */ = { 582 | isa = XCConfigurationList; 583 | buildConfigurations = ( 584 | 8259EE3E1FCD3BD900BF24AB /* Debug */, 585 | 8259EE3F1FCD3BD900BF24AB /* Release */, 586 | ); 587 | defaultConfigurationIsVisible = 0; 588 | defaultConfigurationName = Release; 589 | }; 590 | 8259EE401FCD3BD900BF24AB /* Build configuration list for PBXNativeTarget "RenderOrderTests" */ = { 591 | isa = XCConfigurationList; 592 | buildConfigurations = ( 593 | 8259EE411FCD3BD900BF24AB /* Debug */, 594 | 8259EE421FCD3BD900BF24AB /* Release */, 595 | ); 596 | defaultConfigurationIsVisible = 0; 597 | defaultConfigurationName = Release; 598 | }; 599 | 8259EE431FCD3BD900BF24AB /* Build configuration list for PBXNativeTarget "RenderOrderUITests" */ = { 600 | isa = XCConfigurationList; 601 | buildConfigurations = ( 602 | 8259EE441FCD3BD900BF24AB /* Debug */, 603 | 8259EE451FCD3BD900BF24AB /* Release */, 604 | ); 605 | defaultConfigurationIsVisible = 0; 606 | defaultConfigurationName = Release; 607 | }; 608 | /* End XCConfigurationList section */ 609 | }; 610 | rootObject = 8259EE0B1FCD3BD900BF24AB /* Project object */; 611 | } 612 | -------------------------------------------------------------------------------- /RenderOrder.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RenderOrder.xcodeproj/xcuserdata/toshihirogoto.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RenderOrder.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /RenderOrder/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // RenderOrder 4 | // 5 | // Created by Toshihiro Goto on 2017/11/28. 6 | // Copyright © 2017年 Toshihiro Goto. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /RenderOrder/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /RenderOrder/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /RenderOrder/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /RenderOrder/GameViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameViewController.swift 3 | // RenderOrder 4 | // 5 | // Created by Toshihiro Goto on 2017/11/28. 6 | // Copyright © 2017年 Toshihiro Goto. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import QuartzCore 11 | import SceneKit 12 | 13 | class GameViewController: UIViewController { 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | 18 | // create a new scene 19 | let scene = SCNScene(named: "RenderOrder.scn")! 20 | 21 | // create and add a camera to the scene 22 | let cameraNode = SCNNode() 23 | cameraNode.camera = SCNCamera() 24 | scene.rootNode.addChildNode(cameraNode) 25 | 26 | // place the camera 27 | cameraNode.position = SCNVector3(x: 0, y: 0, z: 15) 28 | 29 | // // create and add a light to the scene 30 | // let lightNode = SCNNode() 31 | // lightNode.light = SCNLight() 32 | // lightNode.light!.type = .omni 33 | // lightNode.position = SCNVector3(x: 0, y: 10, z: 10) 34 | // scene.rootNode.addChildNode(lightNode) 35 | // 36 | // // create and add an ambient light to the scene 37 | // let ambientLightNode = SCNNode() 38 | // ambientLightNode.light = SCNLight() 39 | // ambientLightNode.light!.type = .ambient 40 | // ambientLightNode.light!.color = UIColor.darkGray 41 | // scene.rootNode.addChildNode(ambientLightNode) 42 | 43 | // retrieve the SCNView 44 | let scnView = self.view as! SCNView 45 | 46 | // set the scene to the view 47 | scnView.scene = scene 48 | 49 | // allows the user to manipulate the camera 50 | scnView.allowsCameraControl = true 51 | 52 | // show statistics such as fps and timing information 53 | scnView.showsStatistics = true 54 | 55 | // configure the view 56 | scnView.backgroundColor = UIColor.black 57 | 58 | // add a tap gesture recognizer 59 | let tapGesture = UITapGestureRecognizer(target: self, action: #selector(handleTap(_:))) 60 | scnView.addGestureRecognizer(tapGesture) 61 | } 62 | 63 | @objc 64 | func handleTap(_ gestureRecognize: UIGestureRecognizer) { 65 | // retrieve the SCNView 66 | let scnView = self.view as! SCNView 67 | 68 | // check what nodes are tapped 69 | let p = gestureRecognize.location(in: scnView) 70 | let hitResults = scnView.hitTest(p, options: [:]) 71 | // check that we clicked on at least one object 72 | if hitResults.count > 0 { 73 | // retrieved the first clicked object 74 | let result = hitResults[0] 75 | 76 | // get its material 77 | let material = result.node.geometry!.firstMaterial! 78 | 79 | // highlight it 80 | SCNTransaction.begin() 81 | SCNTransaction.animationDuration = 0.5 82 | 83 | // on completion - unhighlight 84 | SCNTransaction.completionBlock = { 85 | SCNTransaction.begin() 86 | SCNTransaction.animationDuration = 0.5 87 | 88 | material.emission.contents = UIColor.black 89 | 90 | SCNTransaction.commit() 91 | } 92 | 93 | material.emission.contents = UIColor.red 94 | 95 | SCNTransaction.commit() 96 | } 97 | } 98 | 99 | override var shouldAutorotate: Bool { 100 | return true 101 | } 102 | 103 | override var prefersStatusBarHidden: Bool { 104 | return true 105 | } 106 | 107 | override var supportedInterfaceOrientations: UIInterfaceOrientationMask { 108 | if UIDevice.current.userInterfaceIdiom == .phone { 109 | return .allButUpsideDown 110 | } else { 111 | return .all 112 | } 113 | } 114 | 115 | override func didReceiveMemoryWarning() { 116 | super.didReceiveMemoryWarning() 117 | // Release any cached data, images, etc that aren't in use. 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /RenderOrder/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UIStatusBarHidden 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /RenderOrder/Scene/RenderOrder.scn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ToshihiroGoto/SceneKit_RenderingOrderSample/0a023b95680b353249473ca36b1e56b9cd2a6e80/RenderOrder/Scene/RenderOrder.scn -------------------------------------------------------------------------------- /RenderOrder/image/Background_sky.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ToshihiroGoto/SceneKit_RenderingOrderSample/0a023b95680b353249473ca36b1e56b9cd2a6e80/RenderOrder/image/Background_sky.png -------------------------------------------------------------------------------- /RenderOrder/image/max_AO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ToshihiroGoto/SceneKit_RenderingOrderSample/0a023b95680b353249473ca36b1e56b9cd2a6e80/RenderOrder/image/max_AO.png -------------------------------------------------------------------------------- /RenderOrder/image/max_diffuse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ToshihiroGoto/SceneKit_RenderingOrderSample/0a023b95680b353249473ca36b1e56b9cd2a6e80/RenderOrder/image/max_diffuse.png -------------------------------------------------------------------------------- /RenderOrder/image/max_diffuseB.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ToshihiroGoto/SceneKit_RenderingOrderSample/0a023b95680b353249473ca36b1e56b9cd2a6e80/RenderOrder/image/max_diffuseB.png -------------------------------------------------------------------------------- /RenderOrder/image/max_diffuseC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ToshihiroGoto/SceneKit_RenderingOrderSample/0a023b95680b353249473ca36b1e56b9cd2a6e80/RenderOrder/image/max_diffuseC.png -------------------------------------------------------------------------------- /RenderOrder/image/max_diffuseD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ToshihiroGoto/SceneKit_RenderingOrderSample/0a023b95680b353249473ca36b1e56b9cd2a6e80/RenderOrder/image/max_diffuseD.png -------------------------------------------------------------------------------- /RenderOrder/image/max_roughness.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ToshihiroGoto/SceneKit_RenderingOrderSample/0a023b95680b353249473ca36b1e56b9cd2a6e80/RenderOrder/image/max_roughness.png -------------------------------------------------------------------------------- /RenderOrderTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /RenderOrderTests/RenderOrderTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RenderOrderTests.swift 3 | // RenderOrderTests 4 | // 5 | // Created by Toshihiro Goto on 2017/11/28. 6 | // Copyright © 2017年 Toshihiro Goto. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import RenderOrder 11 | 12 | class RenderOrderTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /RenderOrderUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /RenderOrderUITests/RenderOrderUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RenderOrderUITests.swift 3 | // RenderOrderUITests 4 | // 5 | // Created by Toshihiro Goto on 2017/11/28. 6 | // Copyright © 2017年 Toshihiro Goto. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class RenderOrderUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /mov.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ToshihiroGoto/SceneKit_RenderingOrderSample/0a023b95680b353249473ca36b1e56b9cd2a6e80/mov.gif --------------------------------------------------------------------------------