├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── _config.yml ├── documentation-resources └── pixel_shader_demo_001.gif ├── logo-spritekit_shadertoy.png ├── spritekit-fragment-sandbox-ios-app.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── spritekit-fragment-sandbox-ios-app ├── AppDelegate.swift ├── Assets │ └── Assets.xcassets │ │ ├── AppIcon-1.appiconset │ │ ├── Contents.json │ │ ├── Icon-App-20x20@1x.png │ │ ├── Icon-App-20x20@2x.png │ │ ├── Icon-App-20x20@3x.png │ │ ├── Icon-App-29x29@1x.png │ │ ├── Icon-App-29x29@2x.png │ │ ├── Icon-App-29x29@3x.png │ │ ├── Icon-App-40x40@1x.png │ │ ├── Icon-App-40x40@2x.png │ │ ├── Icon-App-40x40@3x.png │ │ ├── Icon-App-57x57@1x.png │ │ ├── Icon-App-57x57@2x.png │ │ ├── Icon-App-60x60@2x.png │ │ ├── Icon-App-60x60@3x.png │ │ ├── Icon-App-72x72@1x.png │ │ ├── Icon-App-72x72@2x.png │ │ ├── Icon-App-76x76@1x.png │ │ ├── Icon-App-76x76@2x.png │ │ ├── Icon-App-83.5x83.5@2x.png │ │ ├── Icon-Small-50x50@1x.png │ │ ├── Icon-Small-50x50@2x.png │ │ └── iTunesArtwork@2x.png │ │ ├── AppIcon.appiconset │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── beach 2.imageset │ │ ├── Contents.json │ │ └── beach-healing.jpg │ │ ├── beach.imageset │ │ ├── Contents.json │ │ └── beach.png │ │ ├── dummypixel.imageset │ │ ├── Contents.json │ │ └── dummypixel.png │ │ ├── retro.imageset │ │ ├── 1.jpg │ │ └── Contents.json │ │ ├── sand.imageset │ │ ├── Contents.json │ │ └── sand.png │ │ ├── water 2 white.imageset │ │ ├── Contents.json │ │ └── water 2 white.jpg │ │ ├── water 2.imageset │ │ ├── Contents.json │ │ └── f7b434de210c0dd282fe30c0749c4a16.jpg │ │ └── water.imageset │ │ ├── Contents.json │ │ └── home-water.png ├── Extensions │ ├── SKShader+UniformUpdates.swift │ └── UISlider+Range.swift ├── Game-Scenes │ ├── Actions.sks │ └── GameScene.sks ├── Info.plist ├── Scenes │ └── GameScene.swift ├── Shaders │ ├── Filters-Effects │ │ ├── crt_retro.fsh │ │ ├── lcd_post_effect.fsh │ │ ├── water_movement.fsh │ │ ├── water_reflection.fsh │ │ └── wave.fsh │ ├── Fractals │ │ ├── GTC14-conference.fsh │ │ └── mandelbrot-recursive.fsh │ ├── Procedural │ │ ├── lightning.fsh │ │ ├── paint_noise.fsh │ │ ├── splash.fsh │ │ ├── tri_lattice6.fsh │ │ └── tron_road.fsh │ ├── Raymarching │ │ └── flame_raymarching.fsh │ └── wavy_lines_procedural.fsh ├── View-Controller │ └── GameViewController.swift └── View │ └── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── spritekit-fragment-sandbox-ios-appTests ├── Info.plist └── spritekit_fragment_sandbox_ios_appTests.swift └── spritekit-fragment-sandbox-ios-appUITests ├── Info.plist └── spritekit_fragment_sandbox_ios_appUITests.swift /.gitignore: -------------------------------------------------------------------------------- 1 | ## OS X Finder 2 | .DS_Store 3 | 4 | ## Build generated 5 | build/ 6 | DerivedData 7 | 8 | ## Various settings 9 | *.pbxuser 10 | !default.pbxuser 11 | *.mode1v3 12 | !default.mode1v3 13 | *.mode2v3 14 | !default.mode2v3 15 | *.perspectivev3 16 | !default.perspectivev3 17 | xcuserdata 18 | 19 | ## Other 20 | *.xccheckout 21 | *.moved-aside 22 | *.xcuserstate 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | 29 | # Swift Package Manager 30 | .build/ 31 | 32 | # Carthage 33 | Carthage/Build 34 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at astemireleev@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | When contributing to this repository, please first discuss the change you wish to make via issue, 4 | email, or any other method with the owners of this repository before making a change. 5 | 6 | Please note we have a code of conduct, please follow it in all your interactions with the project. 7 | 8 | ## Pull Request Process 9 | 10 | 1. Ensure any install or build dependencies are removed before the end of the layer when doing a 11 | build. 12 | 2. Update the README.md with details of changes to the interface, this includes new environment 13 | variables, exposed ports, useful file locations and container parameters. 14 | 3. Increase the version numbers in any examples files and the README.md to the new version that this 15 | Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/). 16 | 4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you 17 | do not have permission to do that, you may request the second reviewer to merge it for you. 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Astemir Eleev 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 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Status 2 | **READY/IN DEVELOPMENT/HOLD** 3 | 4 | ## Migrations 5 | YES | NO 6 | 7 | ## Description 8 | A few sentences describing the overall goals of the pull request's commits. 9 | 10 | ## Related PRs 11 | List related PRs against other branches: 12 | 13 | branch | PR 14 | ------ | ------ 15 | other_pr_production | [link]() 16 | other_pr_master | [link]() 17 | 18 | 19 | ## Todos 20 | - [ ] Tests 21 | - [ ] Documentation 22 | 23 | 24 | ## Deploy Notes 25 | Notes regarding deployment the contained body of work. These should note any 26 | db migrations, etc. 27 | 28 | ## Steps to Test or Reproduce 29 | Outline the steps to test or reproduce the PR here. 30 | 31 | ```sh 32 | git pull --prune 33 | git checkout 34 | bundle; script/server 35 | ``` 36 | 37 | 1. 38 | 39 | ## Impacted Areas in Application 40 | List general components of the application that this PR will affect: 41 | 42 | * 43 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iOS SpriteKit Shader Sandbox [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) 2 | 3 | [![Platform](https://img.shields.io/badge/platform-iOS-yellow.svg)]() 4 | [![Language](https://img.shields.io/badge/language-Swift_5.3-orange.svg)]() 5 | [![SecondaryLanguage](https://img.shields.io/badge/language-GLSL-red.svg)]() 6 | [![ThirdLanguage](https://img.shields.io/badge/language-Metal-purple.svg)]() 7 | [![Framework](https://img.shields.io/badge/frameworks-SpriteKit-ff69b4.svg)]() 8 | [![License](https://img.shields.io/badge/license-MIT-blue.svg)]() 9 | 10 | **Last Update: 18/April/2021.** 11 | 12 | ![](logo-spritekit_shadertoy.png) 13 | 14 | ### If you like the project, please give it a star ⭐ It will show the creator your appreciation and help others to discover the repo. 15 | 16 | # ✍️ About 17 | This `iOS` project showcases the application of `GLSL` and `Metal` Shaders within the `SpriteKit` framework 👾. The app functions as a testing environment to swiftly prototype and explore fragment shaders. At present, it features `12` distinct custom fragment shaders, with more being added routinely. 18 | 19 | # 📝 List of Shaders 20 | 21 | | | | 22 | :-------------------------:|:-------------------------: 23 | ![CRT Effect](https://user-images.githubusercontent.com/5098753/41338402-c37c847e-6efa-11e8-93e2-8d6fb709e697.gif) | ![LCD Effect](https://user-images.githubusercontent.com/5098753/41338403-c39c791e-6efa-11e8-80c9-3929a4e0dabe.gif) | ![GTC14](https://user-images.githubusercontent.com/5098753/36643373-6513562c-1a5b-11e8-9ba5-9fb98bdc3ceb.gif) 24 | ![Mandelbrot Recursive (Julia Set)](https://user-images.githubusercontent.com/5098753/36643375-65544cae-1a5b-11e8-966b-a0286d0d07ee.gif) | ![Tron Road](https://user-images.githubusercontent.com/5098753/36643377-6592f378-1a5b-11e8-9490-95052d900e58.gif) | ![Spots](https://user-images.githubusercontent.com/5098753/36643376-6573f86a-1a5b-11e8-802a-42d7dd168f1e.gif) 25 | ![Lattice](https://user-images.githubusercontent.com/5098753/36643374-6534de64-1a5b-11e8-83a8-96af89c84ddd.gif) | ![Flame Raymatching](https://user-images.githubusercontent.com/5098753/29877584-b6cb2c0a-8da8-11e7-950b-329fc49cd856.gif) | ![Paint Noise](https://user-images.githubusercontent.com/5098753/29831538-1b6069de-8cee-11e7-98a0-8613f7e693c8.gif) 26 | ![RGB Lighning ](https://user-images.githubusercontent.com/5098753/29831537-1b58fb86-8cee-11e7-96f6-1c024d4e0be0.gif) | ![Water Reflections](https://user-images.githubusercontent.com/5098753/29831536-1b583f48-8cee-11e7-88ad-d0c57f33139d.gif) 27 | 28 | # 👨‍💻 Author 29 | [Astemir Eleev](https://github.com/eleev) 30 | 31 | # 🔖 Licence 32 | `ios-spritekit-shader-sandbox` is available under the `MIT` license. See the [LICENSE](https://github.com/eleev/ios-spritekit-shader-sandbox/blob/master/LICENSE) file for more info. 33 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /documentation-resources/pixel_shader_demo_001.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/documentation-resources/pixel_shader_demo_001.gif -------------------------------------------------------------------------------- /logo-spritekit_shadertoy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/logo-spritekit_shadertoy.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A931F06A2044370D009FA7A6 /* lcd_post_effect.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A931F0692044370D009FA7A6 /* lcd_post_effect.fsh */; }; 11 | A931F06D20444152009FA7A6 /* crt_retro.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A931F06C20444152009FA7A6 /* crt_retro.fsh */; }; 12 | A93BA65D1F5D2C1500F22CAF /* tri_lattice6.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A93BA65C1F5D2C1500F22CAF /* tri_lattice6.fsh */; }; 13 | A9A280931F55819900F57F8D /* wave.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A9A280921F55819900F57F8D /* wave.fsh */; }; 14 | A9A280961F55931F00F57F8D /* SKShader+UniformUpdates.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A280951F55931F00F57F8D /* SKShader+UniformUpdates.swift */; }; 15 | A9A2809A1F55975500F57F8D /* lightning.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A9A280991F55975500F57F8D /* lightning.fsh */; }; 16 | A9A2809C1F55AA5B00F57F8D /* UISlider+Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A2809B1F55AA5B00F57F8D /* UISlider+Range.swift */; }; 17 | A9A2809E1F55ABE400F57F8D /* paint_noise.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A9A2809D1F55ABE400F57F8D /* paint_noise.fsh */; }; 18 | A9AC03BE2042C5D400FF8ACC /* GTC14-conference.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A9AC03BD2042C5D400FF8ACC /* GTC14-conference.fsh */; }; 19 | A9AC03D020430C4500FF8ACC /* pixel_shader_demo_001.gif in Resources */ = {isa = PBXBuildFile; fileRef = A9AC03CF20430C4500FF8ACC /* pixel_shader_demo_001.gif */; }; 20 | A9AC03DD204315D400FF8ACC /* spritekit_fragment_sandbox_ios_appTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9AC03DC204315D400FF8ACC /* spritekit_fragment_sandbox_ios_appTests.swift */; }; 21 | A9AC03EB204315E300FF8ACC /* spritekit_fragment_sandbox_ios_appUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9AC03EA204315E300FF8ACC /* spritekit_fragment_sandbox_ios_appUITests.swift */; }; 22 | A9BA44651F5D61C50008BAE1 /* splash.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A9BA44641F5D61C50008BAE1 /* splash.fsh */; }; 23 | A9BFCAFB1F542788008FCF4E /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BFCAFA1F542788008FCF4E /* AppDelegate.swift */; }; 24 | A9BFCAFD1F542788008FCF4E /* GameScene.sks in Resources */ = {isa = PBXBuildFile; fileRef = A9BFCAFC1F542788008FCF4E /* GameScene.sks */; }; 25 | A9BFCAFF1F542788008FCF4E /* Actions.sks in Resources */ = {isa = PBXBuildFile; fileRef = A9BFCAFE1F542788008FCF4E /* Actions.sks */; }; 26 | A9BFCB011F542788008FCF4E /* GameScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BFCB001F542788008FCF4E /* GameScene.swift */; }; 27 | A9BFCB031F542788008FCF4E /* GameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BFCB021F542788008FCF4E /* GameViewController.swift */; }; 28 | A9BFCB061F542788008FCF4E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9BFCB041F542788008FCF4E /* Main.storyboard */; }; 29 | A9BFCB081F542788008FCF4E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A9BFCB071F542788008FCF4E /* Assets.xcassets */; }; 30 | A9BFCB0B1F542788008FCF4E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A9BFCB091F542788008FCF4E /* LaunchScreen.storyboard */; }; 31 | A9BFCB321F543955008FCF4E /* .gitignore in Resources */ = {isa = PBXBuildFile; fileRef = A9BFCB311F543955008FCF4E /* .gitignore */; }; 32 | A9BFCB331F543CB0008FCF4E /* water_movement.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A9BFCB2F1F54391A008FCF4E /* water_movement.fsh */; }; 33 | A9BFCB341F543CB0008FCF4E /* water_reflection.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A9BFCB301F54391A008FCF4E /* water_reflection.fsh */; }; 34 | A9D160312042BF87003722C8 /* mandelbrot-recursive.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A9D160302042BF87003722C8 /* mandelbrot-recursive.fsh */; }; 35 | A9E1D513204179F300CBD08F /* tron_road.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A9E1D512204179F300CBD08F /* tron_road.fsh */; }; 36 | A9E938B41F56FF44002229EF /* flame_raymarching.fsh in Resources */ = {isa = PBXBuildFile; fileRef = A9E938B31F56FF44002229EF /* flame_raymarching.fsh */; }; 37 | /* End PBXBuildFile section */ 38 | 39 | /* Begin PBXContainerItemProxy section */ 40 | A9AC03DF204315D400FF8ACC /* PBXContainerItemProxy */ = { 41 | isa = PBXContainerItemProxy; 42 | containerPortal = A9BFCAEF1F542788008FCF4E /* Project object */; 43 | proxyType = 1; 44 | remoteGlobalIDString = A9BFCAF61F542788008FCF4E; 45 | remoteInfo = "spritekit-fragment-sandbox-ios-app"; 46 | }; 47 | A9AC03ED204315E300FF8ACC /* PBXContainerItemProxy */ = { 48 | isa = PBXContainerItemProxy; 49 | containerPortal = A9BFCAEF1F542788008FCF4E /* Project object */; 50 | proxyType = 1; 51 | remoteGlobalIDString = A9BFCAF61F542788008FCF4E; 52 | remoteInfo = "spritekit-fragment-sandbox-ios-app"; 53 | }; 54 | /* End PBXContainerItemProxy section */ 55 | 56 | /* Begin PBXFileReference section */ 57 | A931F0692044370D009FA7A6 /* lcd_post_effect.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = lcd_post_effect.fsh; sourceTree = ""; }; 58 | A931F06C20444152009FA7A6 /* crt_retro.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = crt_retro.fsh; sourceTree = ""; }; 59 | A93BA65C1F5D2C1500F22CAF /* tri_lattice6.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = tri_lattice6.fsh; sourceTree = ""; }; 60 | A9A280921F55819900F57F8D /* wave.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = wave.fsh; sourceTree = ""; }; 61 | A9A280951F55931F00F57F8D /* SKShader+UniformUpdates.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "SKShader+UniformUpdates.swift"; sourceTree = ""; }; 62 | A9A280991F55975500F57F8D /* lightning.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = lightning.fsh; sourceTree = ""; }; 63 | A9A2809B1F55AA5B00F57F8D /* UISlider+Range.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UISlider+Range.swift"; sourceTree = ""; }; 64 | A9A2809D1F55ABE400F57F8D /* paint_noise.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = paint_noise.fsh; sourceTree = ""; }; 65 | A9AC03BD2042C5D400FF8ACC /* GTC14-conference.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = "GTC14-conference.fsh"; sourceTree = ""; }; 66 | A9AC03CF20430C4500FF8ACC /* pixel_shader_demo_001.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = pixel_shader_demo_001.gif; sourceTree = ""; }; 67 | A9AC03DA204315D400FF8ACC /* spritekit-fragment-sandbox-ios-appTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "spritekit-fragment-sandbox-ios-appTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | A9AC03DC204315D400FF8ACC /* spritekit_fragment_sandbox_ios_appTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = spritekit_fragment_sandbox_ios_appTests.swift; sourceTree = ""; }; 69 | A9AC03DE204315D400FF8ACC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 70 | A9AC03E8204315E300FF8ACC /* spritekit-fragment-sandbox-ios-appUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "spritekit-fragment-sandbox-ios-appUITests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | A9AC03EA204315E300FF8ACC /* spritekit_fragment_sandbox_ios_appUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = spritekit_fragment_sandbox_ios_appUITests.swift; sourceTree = ""; }; 72 | A9AC03EC204315E300FF8ACC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 73 | A9BA44641F5D61C50008BAE1 /* splash.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = splash.fsh; sourceTree = ""; }; 74 | A9BFCAF71F542788008FCF4E /* spritekit-fragment-sandbox-ios-app.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "spritekit-fragment-sandbox-ios-app.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 75 | A9BFCAFA1F542788008FCF4E /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 76 | A9BFCAFC1F542788008FCF4E /* GameScene.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = GameScene.sks; sourceTree = ""; }; 77 | A9BFCAFE1F542788008FCF4E /* Actions.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Actions.sks; sourceTree = ""; }; 78 | A9BFCB001F542788008FCF4E /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = ""; }; 79 | A9BFCB021F542788008FCF4E /* GameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameViewController.swift; sourceTree = ""; }; 80 | A9BFCB051F542788008FCF4E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 81 | A9BFCB071F542788008FCF4E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 82 | A9BFCB0A1F542788008FCF4E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 83 | A9BFCB0C1F542788008FCF4E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 84 | A9BFCB2F1F54391A008FCF4E /* water_movement.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = water_movement.fsh; sourceTree = ""; }; 85 | A9BFCB301F54391A008FCF4E /* water_reflection.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = water_reflection.fsh; sourceTree = ""; }; 86 | A9BFCB311F543955008FCF4E /* .gitignore */ = {isa = PBXFileReference; lastKnownFileType = text; path = .gitignore; sourceTree = ""; }; 87 | A9D160302042BF87003722C8 /* mandelbrot-recursive.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = "mandelbrot-recursive.fsh"; sourceTree = ""; }; 88 | A9E1D512204179F300CBD08F /* tron_road.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = tron_road.fsh; sourceTree = ""; }; 89 | A9E938B31F56FF44002229EF /* flame_raymarching.fsh */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.glsl; path = flame_raymarching.fsh; sourceTree = ""; }; 90 | /* End PBXFileReference section */ 91 | 92 | /* Begin PBXFrameworksBuildPhase section */ 93 | A9AC03D7204315D400FF8ACC /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | A9AC03E5204315E300FF8ACC /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | ); 105 | runOnlyForDeploymentPostprocessing = 0; 106 | }; 107 | A9BFCAF41F542788008FCF4E /* Frameworks */ = { 108 | isa = PBXFrameworksBuildPhase; 109 | buildActionMask = 2147483647; 110 | files = ( 111 | ); 112 | runOnlyForDeploymentPostprocessing = 0; 113 | }; 114 | /* End PBXFrameworksBuildPhase section */ 115 | 116 | /* Begin PBXGroup section */ 117 | A931F06E2044438D009FA7A6 /* Filters-Effects */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | A9BFCB2F1F54391A008FCF4E /* water_movement.fsh */, 121 | A9BFCB301F54391A008FCF4E /* water_reflection.fsh */, 122 | A9A280921F55819900F57F8D /* wave.fsh */, 123 | A931F0692044370D009FA7A6 /* lcd_post_effect.fsh */, 124 | A931F06C20444152009FA7A6 /* crt_retro.fsh */, 125 | ); 126 | path = "Filters-Effects"; 127 | sourceTree = ""; 128 | }; 129 | A931F06F204443D7009FA7A6 /* Fractals */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | A9D160302042BF87003722C8 /* mandelbrot-recursive.fsh */, 133 | A9AC03BD2042C5D400FF8ACC /* GTC14-conference.fsh */, 134 | ); 135 | path = Fractals; 136 | sourceTree = ""; 137 | }; 138 | A931F070204443E3009FA7A6 /* Procedural */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | A9A280991F55975500F57F8D /* lightning.fsh */, 142 | A9A2809D1F55ABE400F57F8D /* paint_noise.fsh */, 143 | A93BA65C1F5D2C1500F22CAF /* tri_lattice6.fsh */, 144 | A9BA44641F5D61C50008BAE1 /* splash.fsh */, 145 | A9E1D512204179F300CBD08F /* tron_road.fsh */, 146 | ); 147 | path = Procedural; 148 | sourceTree = ""; 149 | }; 150 | A931F0712044440C009FA7A6 /* Raymarching */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | A9E938B31F56FF44002229EF /* flame_raymarching.fsh */, 154 | ); 155 | path = Raymarching; 156 | sourceTree = ""; 157 | }; 158 | A9A280941F5592D700F57F8D /* Extensions */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | A9A280951F55931F00F57F8D /* SKShader+UniformUpdates.swift */, 162 | A9A2809B1F55AA5B00F57F8D /* UISlider+Range.swift */, 163 | ); 164 | path = Extensions; 165 | sourceTree = ""; 166 | }; 167 | A9AC03BF2042E89E00FF8ACC /* View-Controller */ = { 168 | isa = PBXGroup; 169 | children = ( 170 | A9BFCB021F542788008FCF4E /* GameViewController.swift */, 171 | ); 172 | path = "View-Controller"; 173 | sourceTree = ""; 174 | }; 175 | A9AC03C02042E8AC00FF8ACC /* Scenes */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | A9BFCB001F542788008FCF4E /* GameScene.swift */, 179 | ); 180 | path = Scenes; 181 | sourceTree = ""; 182 | }; 183 | A9AC03C12042E8B600FF8ACC /* Assets */ = { 184 | isa = PBXGroup; 185 | children = ( 186 | A9BFCB071F542788008FCF4E /* Assets.xcassets */, 187 | ); 188 | path = Assets; 189 | sourceTree = ""; 190 | }; 191 | A9AC03C22042E8C400FF8ACC /* View */ = { 192 | isa = PBXGroup; 193 | children = ( 194 | A9BFCB041F542788008FCF4E /* Main.storyboard */, 195 | A9BFCB091F542788008FCF4E /* LaunchScreen.storyboard */, 196 | ); 197 | path = View; 198 | sourceTree = ""; 199 | }; 200 | A9AC03C32042E8DB00FF8ACC /* Game-Scenes */ = { 201 | isa = PBXGroup; 202 | children = ( 203 | A9BFCAFC1F542788008FCF4E /* GameScene.sks */, 204 | A9BFCAFE1F542788008FCF4E /* Actions.sks */, 205 | ); 206 | path = "Game-Scenes"; 207 | sourceTree = ""; 208 | }; 209 | A9AC03CE20430C4500FF8ACC /* documentation-resources */ = { 210 | isa = PBXGroup; 211 | children = ( 212 | A9AC03CF20430C4500FF8ACC /* pixel_shader_demo_001.gif */, 213 | ); 214 | path = "documentation-resources"; 215 | sourceTree = ""; 216 | }; 217 | A9AC03DB204315D400FF8ACC /* spritekit-fragment-sandbox-ios-appTests */ = { 218 | isa = PBXGroup; 219 | children = ( 220 | A9AC03DC204315D400FF8ACC /* spritekit_fragment_sandbox_ios_appTests.swift */, 221 | A9AC03DE204315D400FF8ACC /* Info.plist */, 222 | ); 223 | path = "spritekit-fragment-sandbox-ios-appTests"; 224 | sourceTree = ""; 225 | }; 226 | A9AC03E9204315E300FF8ACC /* spritekit-fragment-sandbox-ios-appUITests */ = { 227 | isa = PBXGroup; 228 | children = ( 229 | A9AC03EA204315E300FF8ACC /* spritekit_fragment_sandbox_ios_appUITests.swift */, 230 | A9AC03EC204315E300FF8ACC /* Info.plist */, 231 | ); 232 | path = "spritekit-fragment-sandbox-ios-appUITests"; 233 | sourceTree = ""; 234 | }; 235 | A9BFCAEE1F542788008FCF4E = { 236 | isa = PBXGroup; 237 | children = ( 238 | A9AC03CE20430C4500FF8ACC /* documentation-resources */, 239 | A9BFCB311F543955008FCF4E /* .gitignore */, 240 | A9BFCAF91F542788008FCF4E /* spritekit-fragment-sandbox-ios-app */, 241 | A9AC03DB204315D400FF8ACC /* spritekit-fragment-sandbox-ios-appTests */, 242 | A9AC03E9204315E300FF8ACC /* spritekit-fragment-sandbox-ios-appUITests */, 243 | A9BFCAF81F542788008FCF4E /* Products */, 244 | ); 245 | sourceTree = ""; 246 | }; 247 | A9BFCAF81F542788008FCF4E /* Products */ = { 248 | isa = PBXGroup; 249 | children = ( 250 | A9BFCAF71F542788008FCF4E /* spritekit-fragment-sandbox-ios-app.app */, 251 | A9AC03DA204315D400FF8ACC /* spritekit-fragment-sandbox-ios-appTests.xctest */, 252 | A9AC03E8204315E300FF8ACC /* spritekit-fragment-sandbox-ios-appUITests.xctest */, 253 | ); 254 | name = Products; 255 | sourceTree = ""; 256 | }; 257 | A9BFCAF91F542788008FCF4E /* spritekit-fragment-sandbox-ios-app */ = { 258 | isa = PBXGroup; 259 | children = ( 260 | A9AC03C32042E8DB00FF8ACC /* Game-Scenes */, 261 | A9AC03C22042E8C400FF8ACC /* View */, 262 | A9AC03C12042E8B600FF8ACC /* Assets */, 263 | A9AC03C02042E8AC00FF8ACC /* Scenes */, 264 | A9AC03BF2042E89E00FF8ACC /* View-Controller */, 265 | A9A280941F5592D700F57F8D /* Extensions */, 266 | A9BFCB2E1F543906008FCF4E /* Shaders */, 267 | A9BFCAFA1F542788008FCF4E /* AppDelegate.swift */, 268 | A9BFCB0C1F542788008FCF4E /* Info.plist */, 269 | ); 270 | path = "spritekit-fragment-sandbox-ios-app"; 271 | sourceTree = ""; 272 | }; 273 | A9BFCB2E1F543906008FCF4E /* Shaders */ = { 274 | isa = PBXGroup; 275 | children = ( 276 | A931F0712044440C009FA7A6 /* Raymarching */, 277 | A931F070204443E3009FA7A6 /* Procedural */, 278 | A931F06F204443D7009FA7A6 /* Fractals */, 279 | A931F06E2044438D009FA7A6 /* Filters-Effects */, 280 | ); 281 | path = Shaders; 282 | sourceTree = ""; 283 | }; 284 | /* End PBXGroup section */ 285 | 286 | /* Begin PBXNativeTarget section */ 287 | A9AC03D9204315D400FF8ACC /* spritekit-fragment-sandbox-ios-appTests */ = { 288 | isa = PBXNativeTarget; 289 | buildConfigurationList = A9AC03E1204315D400FF8ACC /* Build configuration list for PBXNativeTarget "spritekit-fragment-sandbox-ios-appTests" */; 290 | buildPhases = ( 291 | A9AC03D6204315D400FF8ACC /* Sources */, 292 | A9AC03D7204315D400FF8ACC /* Frameworks */, 293 | A9AC03D8204315D400FF8ACC /* Resources */, 294 | ); 295 | buildRules = ( 296 | ); 297 | dependencies = ( 298 | A9AC03E0204315D400FF8ACC /* PBXTargetDependency */, 299 | ); 300 | name = "spritekit-fragment-sandbox-ios-appTests"; 301 | productName = "spritekit-fragment-sandbox-ios-appTests"; 302 | productReference = A9AC03DA204315D400FF8ACC /* spritekit-fragment-sandbox-ios-appTests.xctest */; 303 | productType = "com.apple.product-type.bundle.unit-test"; 304 | }; 305 | A9AC03E7204315E300FF8ACC /* spritekit-fragment-sandbox-ios-appUITests */ = { 306 | isa = PBXNativeTarget; 307 | buildConfigurationList = A9AC03EF204315E300FF8ACC /* Build configuration list for PBXNativeTarget "spritekit-fragment-sandbox-ios-appUITests" */; 308 | buildPhases = ( 309 | A9AC03E4204315E300FF8ACC /* Sources */, 310 | A9AC03E5204315E300FF8ACC /* Frameworks */, 311 | A9AC03E6204315E300FF8ACC /* Resources */, 312 | ); 313 | buildRules = ( 314 | ); 315 | dependencies = ( 316 | A9AC03EE204315E300FF8ACC /* PBXTargetDependency */, 317 | ); 318 | name = "spritekit-fragment-sandbox-ios-appUITests"; 319 | productName = "spritekit-fragment-sandbox-ios-appUITests"; 320 | productReference = A9AC03E8204315E300FF8ACC /* spritekit-fragment-sandbox-ios-appUITests.xctest */; 321 | productType = "com.apple.product-type.bundle.ui-testing"; 322 | }; 323 | A9BFCAF61F542788008FCF4E /* spritekit-fragment-sandbox-ios-app */ = { 324 | isa = PBXNativeTarget; 325 | buildConfigurationList = A9BFCB251F542788008FCF4E /* Build configuration list for PBXNativeTarget "spritekit-fragment-sandbox-ios-app" */; 326 | buildPhases = ( 327 | A9BFCAF31F542788008FCF4E /* Sources */, 328 | A9BFCAF41F542788008FCF4E /* Frameworks */, 329 | A9BFCAF51F542788008FCF4E /* Resources */, 330 | ); 331 | buildRules = ( 332 | ); 333 | dependencies = ( 334 | ); 335 | name = "spritekit-fragment-sandbox-ios-app"; 336 | productName = PixelShaderDemo; 337 | productReference = A9BFCAF71F542788008FCF4E /* spritekit-fragment-sandbox-ios-app.app */; 338 | productType = "com.apple.product-type.application"; 339 | }; 340 | /* End PBXNativeTarget section */ 341 | 342 | /* Begin PBXProject section */ 343 | A9BFCAEF1F542788008FCF4E /* Project object */ = { 344 | isa = PBXProject; 345 | attributes = { 346 | LastSwiftUpdateCheck = 0920; 347 | LastUpgradeCheck = 1240; 348 | ORGANIZATIONNAME = "Astemir Eleev"; 349 | TargetAttributes = { 350 | A9AC03D9204315D400FF8ACC = { 351 | CreatedOnToolsVersion = 9.2; 352 | LastSwiftMigration = 1020; 353 | ProvisioningStyle = Automatic; 354 | TestTargetID = A9BFCAF61F542788008FCF4E; 355 | }; 356 | A9AC03E7204315E300FF8ACC = { 357 | CreatedOnToolsVersion = 9.2; 358 | LastSwiftMigration = 1020; 359 | ProvisioningStyle = Automatic; 360 | TestTargetID = A9BFCAF61F542788008FCF4E; 361 | }; 362 | A9BFCAF61F542788008FCF4E = { 363 | CreatedOnToolsVersion = 9.0; 364 | LastSwiftMigration = 1020; 365 | ProvisioningStyle = Automatic; 366 | }; 367 | }; 368 | }; 369 | buildConfigurationList = A9BFCAF21F542788008FCF4E /* Build configuration list for PBXProject "spritekit-fragment-sandbox-ios-app" */; 370 | compatibilityVersion = "Xcode 8.0"; 371 | developmentRegion = en; 372 | hasScannedForEncodings = 0; 373 | knownRegions = ( 374 | en, 375 | Base, 376 | ); 377 | mainGroup = A9BFCAEE1F542788008FCF4E; 378 | productRefGroup = A9BFCAF81F542788008FCF4E /* Products */; 379 | projectDirPath = ""; 380 | projectRoot = ""; 381 | targets = ( 382 | A9BFCAF61F542788008FCF4E /* spritekit-fragment-sandbox-ios-app */, 383 | A9AC03D9204315D400FF8ACC /* spritekit-fragment-sandbox-ios-appTests */, 384 | A9AC03E7204315E300FF8ACC /* spritekit-fragment-sandbox-ios-appUITests */, 385 | ); 386 | }; 387 | /* End PBXProject section */ 388 | 389 | /* Begin PBXResourcesBuildPhase section */ 390 | A9AC03D8204315D400FF8ACC /* Resources */ = { 391 | isa = PBXResourcesBuildPhase; 392 | buildActionMask = 2147483647; 393 | files = ( 394 | ); 395 | runOnlyForDeploymentPostprocessing = 0; 396 | }; 397 | A9AC03E6204315E300FF8ACC /* Resources */ = { 398 | isa = PBXResourcesBuildPhase; 399 | buildActionMask = 2147483647; 400 | files = ( 401 | ); 402 | runOnlyForDeploymentPostprocessing = 0; 403 | }; 404 | A9BFCAF51F542788008FCF4E /* Resources */ = { 405 | isa = PBXResourcesBuildPhase; 406 | buildActionMask = 2147483647; 407 | files = ( 408 | A9A2809A1F55975500F57F8D /* lightning.fsh in Resources */, 409 | A9AC03BE2042C5D400FF8ACC /* GTC14-conference.fsh in Resources */, 410 | A9BFCB331F543CB0008FCF4E /* water_movement.fsh in Resources */, 411 | A9BFCB341F543CB0008FCF4E /* water_reflection.fsh in Resources */, 412 | A9BFCB061F542788008FCF4E /* Main.storyboard in Resources */, 413 | A9D160312042BF87003722C8 /* mandelbrot-recursive.fsh in Resources */, 414 | A931F06A2044370D009FA7A6 /* lcd_post_effect.fsh in Resources */, 415 | A9BFCAFD1F542788008FCF4E /* GameScene.sks in Resources */, 416 | A931F06D20444152009FA7A6 /* crt_retro.fsh in Resources */, 417 | A9A2809E1F55ABE400F57F8D /* paint_noise.fsh in Resources */, 418 | A9E938B41F56FF44002229EF /* flame_raymarching.fsh in Resources */, 419 | A9BFCB081F542788008FCF4E /* Assets.xcassets in Resources */, 420 | A9BA44651F5D61C50008BAE1 /* splash.fsh in Resources */, 421 | A9AC03D020430C4500FF8ACC /* pixel_shader_demo_001.gif in Resources */, 422 | A93BA65D1F5D2C1500F22CAF /* tri_lattice6.fsh in Resources */, 423 | A9BFCB0B1F542788008FCF4E /* LaunchScreen.storyboard in Resources */, 424 | A9BFCB321F543955008FCF4E /* .gitignore in Resources */, 425 | A9E1D513204179F300CBD08F /* tron_road.fsh in Resources */, 426 | A9A280931F55819900F57F8D /* wave.fsh in Resources */, 427 | A9BFCAFF1F542788008FCF4E /* Actions.sks in Resources */, 428 | ); 429 | runOnlyForDeploymentPostprocessing = 0; 430 | }; 431 | /* End PBXResourcesBuildPhase section */ 432 | 433 | /* Begin PBXSourcesBuildPhase section */ 434 | A9AC03D6204315D400FF8ACC /* Sources */ = { 435 | isa = PBXSourcesBuildPhase; 436 | buildActionMask = 2147483647; 437 | files = ( 438 | A9AC03DD204315D400FF8ACC /* spritekit_fragment_sandbox_ios_appTests.swift in Sources */, 439 | ); 440 | runOnlyForDeploymentPostprocessing = 0; 441 | }; 442 | A9AC03E4204315E300FF8ACC /* Sources */ = { 443 | isa = PBXSourcesBuildPhase; 444 | buildActionMask = 2147483647; 445 | files = ( 446 | A9AC03EB204315E300FF8ACC /* spritekit_fragment_sandbox_ios_appUITests.swift in Sources */, 447 | ); 448 | runOnlyForDeploymentPostprocessing = 0; 449 | }; 450 | A9BFCAF31F542788008FCF4E /* Sources */ = { 451 | isa = PBXSourcesBuildPhase; 452 | buildActionMask = 2147483647; 453 | files = ( 454 | A9A2809C1F55AA5B00F57F8D /* UISlider+Range.swift in Sources */, 455 | A9BFCB011F542788008FCF4E /* GameScene.swift in Sources */, 456 | A9BFCB031F542788008FCF4E /* GameViewController.swift in Sources */, 457 | A9A280961F55931F00F57F8D /* SKShader+UniformUpdates.swift in Sources */, 458 | A9BFCAFB1F542788008FCF4E /* AppDelegate.swift in Sources */, 459 | ); 460 | runOnlyForDeploymentPostprocessing = 0; 461 | }; 462 | /* End PBXSourcesBuildPhase section */ 463 | 464 | /* Begin PBXTargetDependency section */ 465 | A9AC03E0204315D400FF8ACC /* PBXTargetDependency */ = { 466 | isa = PBXTargetDependency; 467 | target = A9BFCAF61F542788008FCF4E /* spritekit-fragment-sandbox-ios-app */; 468 | targetProxy = A9AC03DF204315D400FF8ACC /* PBXContainerItemProxy */; 469 | }; 470 | A9AC03EE204315E300FF8ACC /* PBXTargetDependency */ = { 471 | isa = PBXTargetDependency; 472 | target = A9BFCAF61F542788008FCF4E /* spritekit-fragment-sandbox-ios-app */; 473 | targetProxy = A9AC03ED204315E300FF8ACC /* PBXContainerItemProxy */; 474 | }; 475 | /* End PBXTargetDependency section */ 476 | 477 | /* Begin PBXVariantGroup section */ 478 | A9BFCB041F542788008FCF4E /* Main.storyboard */ = { 479 | isa = PBXVariantGroup; 480 | children = ( 481 | A9BFCB051F542788008FCF4E /* Base */, 482 | ); 483 | name = Main.storyboard; 484 | sourceTree = ""; 485 | }; 486 | A9BFCB091F542788008FCF4E /* LaunchScreen.storyboard */ = { 487 | isa = PBXVariantGroup; 488 | children = ( 489 | A9BFCB0A1F542788008FCF4E /* Base */, 490 | ); 491 | name = LaunchScreen.storyboard; 492 | sourceTree = ""; 493 | }; 494 | /* End PBXVariantGroup section */ 495 | 496 | /* Begin XCBuildConfiguration section */ 497 | A9AC03E2204315D400FF8ACC /* Debug */ = { 498 | isa = XCBuildConfiguration; 499 | buildSettings = { 500 | BUNDLE_LOADER = "$(TEST_HOST)"; 501 | CODE_SIGN_STYLE = Automatic; 502 | DEVELOPMENT_TEAM = T3K58FE38R; 503 | INFOPLIST_FILE = "spritekit-fragment-sandbox-ios-appTests/Info.plist"; 504 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 505 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 506 | PRODUCT_BUNDLE_IDENTIFIER = "eleev.astemir.spritekit-fragment-sandbox-ios-appTests"; 507 | PRODUCT_NAME = "$(TARGET_NAME)"; 508 | SWIFT_VERSION = 5.0; 509 | TARGETED_DEVICE_FAMILY = "1,2"; 510 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/spritekit-fragment-sandbox-ios-app.app/spritekit-fragment-sandbox-ios-app"; 511 | }; 512 | name = Debug; 513 | }; 514 | A9AC03E3204315D400FF8ACC /* Release */ = { 515 | isa = XCBuildConfiguration; 516 | buildSettings = { 517 | BUNDLE_LOADER = "$(TEST_HOST)"; 518 | CODE_SIGN_STYLE = Automatic; 519 | DEVELOPMENT_TEAM = T3K58FE38R; 520 | INFOPLIST_FILE = "spritekit-fragment-sandbox-ios-appTests/Info.plist"; 521 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 522 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 523 | PRODUCT_BUNDLE_IDENTIFIER = "eleev.astemir.spritekit-fragment-sandbox-ios-appTests"; 524 | PRODUCT_NAME = "$(TARGET_NAME)"; 525 | SWIFT_VERSION = 5.0; 526 | TARGETED_DEVICE_FAMILY = "1,2"; 527 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/spritekit-fragment-sandbox-ios-app.app/spritekit-fragment-sandbox-ios-app"; 528 | }; 529 | name = Release; 530 | }; 531 | A9AC03F0204315E300FF8ACC /* Debug */ = { 532 | isa = XCBuildConfiguration; 533 | buildSettings = { 534 | CODE_SIGN_STYLE = Automatic; 535 | DEVELOPMENT_TEAM = T3K58FE38R; 536 | INFOPLIST_FILE = "spritekit-fragment-sandbox-ios-appUITests/Info.plist"; 537 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 538 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 539 | PRODUCT_BUNDLE_IDENTIFIER = "eleev.astemir.spritekit-fragment-sandbox-ios-appUITests"; 540 | PRODUCT_NAME = "$(TARGET_NAME)"; 541 | SWIFT_VERSION = 5.0; 542 | TARGETED_DEVICE_FAMILY = "1,2"; 543 | TEST_TARGET_NAME = "spritekit-fragment-sandbox-ios-app"; 544 | }; 545 | name = Debug; 546 | }; 547 | A9AC03F1204315E300FF8ACC /* Release */ = { 548 | isa = XCBuildConfiguration; 549 | buildSettings = { 550 | CODE_SIGN_STYLE = Automatic; 551 | DEVELOPMENT_TEAM = T3K58FE38R; 552 | INFOPLIST_FILE = "spritekit-fragment-sandbox-ios-appUITests/Info.plist"; 553 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 554 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 555 | PRODUCT_BUNDLE_IDENTIFIER = "eleev.astemir.spritekit-fragment-sandbox-ios-appUITests"; 556 | PRODUCT_NAME = "$(TARGET_NAME)"; 557 | SWIFT_VERSION = 5.0; 558 | TARGETED_DEVICE_FAMILY = "1,2"; 559 | TEST_TARGET_NAME = "spritekit-fragment-sandbox-ios-app"; 560 | }; 561 | name = Release; 562 | }; 563 | A9BFCB231F542788008FCF4E /* Debug */ = { 564 | isa = XCBuildConfiguration; 565 | buildSettings = { 566 | ALWAYS_SEARCH_USER_PATHS = NO; 567 | CLANG_ANALYZER_NONNULL = YES; 568 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 569 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 570 | CLANG_CXX_LIBRARY = "libc++"; 571 | CLANG_ENABLE_MODULES = YES; 572 | CLANG_ENABLE_OBJC_ARC = YES; 573 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 574 | CLANG_WARN_BOOL_CONVERSION = YES; 575 | CLANG_WARN_COMMA = YES; 576 | CLANG_WARN_CONSTANT_CONVERSION = YES; 577 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 578 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 579 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 580 | CLANG_WARN_EMPTY_BODY = YES; 581 | CLANG_WARN_ENUM_CONVERSION = YES; 582 | CLANG_WARN_INFINITE_RECURSION = YES; 583 | CLANG_WARN_INT_CONVERSION = YES; 584 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 585 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 586 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 587 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 588 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 589 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 590 | CLANG_WARN_STRICT_PROTOTYPES = YES; 591 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 592 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 593 | CLANG_WARN_UNREACHABLE_CODE = YES; 594 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 595 | CODE_SIGN_IDENTITY = "iPhone Developer"; 596 | COPY_PHASE_STRIP = NO; 597 | DEBUG_INFORMATION_FORMAT = dwarf; 598 | ENABLE_STRICT_OBJC_MSGSEND = YES; 599 | ENABLE_TESTABILITY = YES; 600 | GCC_C_LANGUAGE_STANDARD = gnu11; 601 | GCC_DYNAMIC_NO_PIC = NO; 602 | GCC_NO_COMMON_BLOCKS = YES; 603 | GCC_OPTIMIZATION_LEVEL = 0; 604 | GCC_PREPROCESSOR_DEFINITIONS = ( 605 | "DEBUG=1", 606 | "$(inherited)", 607 | ); 608 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 609 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 610 | GCC_WARN_UNDECLARED_SELECTOR = YES; 611 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 612 | GCC_WARN_UNUSED_FUNCTION = YES; 613 | GCC_WARN_UNUSED_VARIABLE = YES; 614 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 615 | MTL_ENABLE_DEBUG_INFO = YES; 616 | ONLY_ACTIVE_ARCH = YES; 617 | SDKROOT = iphoneos; 618 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 619 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 620 | }; 621 | name = Debug; 622 | }; 623 | A9BFCB241F542788008FCF4E /* Release */ = { 624 | isa = XCBuildConfiguration; 625 | buildSettings = { 626 | ALWAYS_SEARCH_USER_PATHS = NO; 627 | CLANG_ANALYZER_NONNULL = YES; 628 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 629 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 630 | CLANG_CXX_LIBRARY = "libc++"; 631 | CLANG_ENABLE_MODULES = YES; 632 | CLANG_ENABLE_OBJC_ARC = YES; 633 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 634 | CLANG_WARN_BOOL_CONVERSION = YES; 635 | CLANG_WARN_COMMA = YES; 636 | CLANG_WARN_CONSTANT_CONVERSION = YES; 637 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 638 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 639 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 640 | CLANG_WARN_EMPTY_BODY = YES; 641 | CLANG_WARN_ENUM_CONVERSION = YES; 642 | CLANG_WARN_INFINITE_RECURSION = YES; 643 | CLANG_WARN_INT_CONVERSION = YES; 644 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 645 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 646 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 647 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 648 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 649 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 650 | CLANG_WARN_STRICT_PROTOTYPES = YES; 651 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 652 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 653 | CLANG_WARN_UNREACHABLE_CODE = YES; 654 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 655 | CODE_SIGN_IDENTITY = "iPhone Developer"; 656 | COPY_PHASE_STRIP = NO; 657 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 658 | ENABLE_NS_ASSERTIONS = NO; 659 | ENABLE_STRICT_OBJC_MSGSEND = YES; 660 | GCC_C_LANGUAGE_STANDARD = gnu11; 661 | GCC_NO_COMMON_BLOCKS = YES; 662 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 663 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 664 | GCC_WARN_UNDECLARED_SELECTOR = YES; 665 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 666 | GCC_WARN_UNUSED_FUNCTION = YES; 667 | GCC_WARN_UNUSED_VARIABLE = YES; 668 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 669 | MTL_ENABLE_DEBUG_INFO = NO; 670 | SDKROOT = iphoneos; 671 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 672 | VALIDATE_PRODUCT = YES; 673 | }; 674 | name = Release; 675 | }; 676 | A9BFCB261F542788008FCF4E /* Debug */ = { 677 | isa = XCBuildConfiguration; 678 | buildSettings = { 679 | ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-1"; 680 | CODE_SIGN_STYLE = Automatic; 681 | DEVELOPMENT_TEAM = ""; 682 | INFOPLIST_FILE = "$(SRCROOT)/spritekit-fragment-sandbox-ios-app/Info.plist"; 683 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 684 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 685 | MARKETING_VERSION = 1.3.1; 686 | PRODUCT_BUNDLE_IDENTIFIER = "astemir.eleev.spritekit-fragment-sandbox-ios-app"; 687 | PRODUCT_NAME = "$(TARGET_NAME)"; 688 | SWIFT_VERSION = 5.0; 689 | TARGETED_DEVICE_FAMILY = "1,2"; 690 | }; 691 | name = Debug; 692 | }; 693 | A9BFCB271F542788008FCF4E /* Release */ = { 694 | isa = XCBuildConfiguration; 695 | buildSettings = { 696 | ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-1"; 697 | CODE_SIGN_STYLE = Automatic; 698 | DEVELOPMENT_TEAM = ""; 699 | INFOPLIST_FILE = "$(SRCROOT)/spritekit-fragment-sandbox-ios-app/Info.plist"; 700 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 701 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 702 | MARKETING_VERSION = 1.3.1; 703 | PRODUCT_BUNDLE_IDENTIFIER = "astemir.eleev.spritekit-fragment-sandbox-ios-app"; 704 | PRODUCT_NAME = "$(TARGET_NAME)"; 705 | SWIFT_VERSION = 5.0; 706 | TARGETED_DEVICE_FAMILY = "1,2"; 707 | }; 708 | name = Release; 709 | }; 710 | /* End XCBuildConfiguration section */ 711 | 712 | /* Begin XCConfigurationList section */ 713 | A9AC03E1204315D400FF8ACC /* Build configuration list for PBXNativeTarget "spritekit-fragment-sandbox-ios-appTests" */ = { 714 | isa = XCConfigurationList; 715 | buildConfigurations = ( 716 | A9AC03E2204315D400FF8ACC /* Debug */, 717 | A9AC03E3204315D400FF8ACC /* Release */, 718 | ); 719 | defaultConfigurationIsVisible = 0; 720 | defaultConfigurationName = Release; 721 | }; 722 | A9AC03EF204315E300FF8ACC /* Build configuration list for PBXNativeTarget "spritekit-fragment-sandbox-ios-appUITests" */ = { 723 | isa = XCConfigurationList; 724 | buildConfigurations = ( 725 | A9AC03F0204315E300FF8ACC /* Debug */, 726 | A9AC03F1204315E300FF8ACC /* Release */, 727 | ); 728 | defaultConfigurationIsVisible = 0; 729 | defaultConfigurationName = Release; 730 | }; 731 | A9BFCAF21F542788008FCF4E /* Build configuration list for PBXProject "spritekit-fragment-sandbox-ios-app" */ = { 732 | isa = XCConfigurationList; 733 | buildConfigurations = ( 734 | A9BFCB231F542788008FCF4E /* Debug */, 735 | A9BFCB241F542788008FCF4E /* Release */, 736 | ); 737 | defaultConfigurationIsVisible = 0; 738 | defaultConfigurationName = Release; 739 | }; 740 | A9BFCB251F542788008FCF4E /* Build configuration list for PBXNativeTarget "spritekit-fragment-sandbox-ios-app" */ = { 741 | isa = XCConfigurationList; 742 | buildConfigurations = ( 743 | A9BFCB261F542788008FCF4E /* Debug */, 744 | A9BFCB271F542788008FCF4E /* Release */, 745 | ); 746 | defaultConfigurationIsVisible = 0; 747 | defaultConfigurationName = Release; 748 | }; 749 | /* End XCConfigurationList section */ 750 | }; 751 | rootObject = A9BFCAEF1F542788008FCF4E /* Project object */; 752 | } 753 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // PixelShaderDemo 4 | // 5 | // Created by Astemir Eleev on 28/08/2017. 6 | // Copyright © 2017 Astemir Eleev. 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: [UIApplication.LaunchOptionsKey: 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 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "57x57", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-57x57@1x.png", 49 | "scale" : "1x" 50 | }, 51 | { 52 | "size" : "57x57", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-57x57@2x.png", 55 | "scale" : "2x" 56 | }, 57 | { 58 | "size" : "60x60", 59 | "idiom" : "iphone", 60 | "filename" : "Icon-App-60x60@2x.png", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "size" : "60x60", 65 | "idiom" : "iphone", 66 | "filename" : "Icon-App-60x60@3x.png", 67 | "scale" : "3x" 68 | }, 69 | { 70 | "size" : "20x20", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-20x20@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "20x20", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-20x20@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "29x29", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-29x29@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "29x29", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-29x29@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "40x40", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-40x40@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "40x40", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-40x40@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "50x50", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-Small-50x50@1x.png", 109 | "scale" : "1x" 110 | }, 111 | { 112 | "size" : "50x50", 113 | "idiom" : "ipad", 114 | "filename" : "Icon-Small-50x50@2x.png", 115 | "scale" : "2x" 116 | }, 117 | { 118 | "size" : "72x72", 119 | "idiom" : "ipad", 120 | "filename" : "Icon-App-72x72@1x.png", 121 | "scale" : "1x" 122 | }, 123 | { 124 | "size" : "72x72", 125 | "idiom" : "ipad", 126 | "filename" : "Icon-App-72x72@2x.png", 127 | "scale" : "2x" 128 | }, 129 | { 130 | "size" : "76x76", 131 | "idiom" : "ipad", 132 | "filename" : "Icon-App-76x76@1x.png", 133 | "scale" : "1x" 134 | }, 135 | { 136 | "size" : "76x76", 137 | "idiom" : "ipad", 138 | "filename" : "Icon-App-76x76@2x.png", 139 | "scale" : "2x" 140 | }, 141 | { 142 | "size" : "83.5x83.5", 143 | "idiom" : "ipad", 144 | "filename" : "Icon-App-83.5x83.5@2x.png", 145 | "scale" : "2x" 146 | }, 147 | { 148 | "size" : "1024x1024", 149 | "idiom" : "ios-marketing", 150 | "filename" : "iTunesArtwork@2x.png", 151 | "scale" : "1x" 152 | } 153 | ], 154 | "info" : { 155 | "version" : 1, 156 | "author" : "xcode" 157 | } 158 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-72x72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-72x72@1x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-72x72@2x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-Small-50x50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-Small-50x50@1x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-Small-50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/Icon-Small-50x50@2x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/iTunesArtwork@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/AppIcon-1.appiconset/iTunesArtwork@2x.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/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 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/beach 2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "beach-healing.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/beach 2.imageset/beach-healing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/beach 2.imageset/beach-healing.jpg -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/beach.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "beach.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/beach.imageset/beach.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/beach.imageset/beach.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/dummypixel.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "dummypixel.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/dummypixel.imageset/dummypixel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/dummypixel.imageset/dummypixel.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/retro.imageset/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/retro.imageset/1.jpg -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/retro.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "1.jpg", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/sand.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "sand.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/sand.imageset/sand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/sand.imageset/sand.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/water 2 white.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "water 2 white.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/water 2 white.imageset/water 2 white.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/water 2 white.imageset/water 2 white.jpg -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/water 2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "f7b434de210c0dd282fe30c0749c4a16.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/water 2.imageset/f7b434de210c0dd282fe30c0749c4a16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/water 2.imageset/f7b434de210c0dd282fe30c0749c4a16.jpg -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/water.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "home-water.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/water.imageset/home-water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Assets/Assets.xcassets/water.imageset/home-water.png -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Extensions/SKShader+UniformUpdates.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SKShader+UniformUpdates.swift 3 | // PixelShaderDemo 4 | // 5 | // Created by Astemir Eleev on 29/08/2017. 6 | // Copyright © 2017 Astemir Eleev. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import SpriteKit 11 | 12 | 13 | // MARK: - Adds supprot for uniform update methods 14 | extension SKShader { 15 | 16 | @discardableResult func updateUniform(named name: String, for value: Float) -> Bool { 17 | guard let uniform = self.uniformNamed(name) else { return false } 18 | uniform.floatValue = value 19 | update(uniform: uniform, named: name) 20 | return true 21 | } 22 | 23 | @discardableResult func updateUniform(named name: String, for vector: SIMD2) -> Bool { 24 | guard let uniform = self.uniformNamed(name) else { return false } 25 | uniform.vectorFloat2Value = vector 26 | update(uniform: uniform, named: name) 27 | return true 28 | } 29 | 30 | @discardableResult func updateUniform(named name: String, for vector: SIMD3) -> Bool { 31 | guard let uniform = self.uniformNamed(name) else { return false } 32 | uniform.vectorFloat3Value = vector 33 | update(uniform: uniform, named: name) 34 | return true 35 | } 36 | 37 | @discardableResult func updateUniform(named name: String, for texture: SKTexture) -> Bool { 38 | guard let uniform = self.uniformNamed(name) else { return false } 39 | uniform.textureValue = texture 40 | update(uniform: uniform, named: name) 41 | return true 42 | } 43 | 44 | func update(uniform: SKUniform, named name: String) { 45 | self.removeUniformNamed(name) 46 | self.addUniform(uniform) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Extensions/UISlider+Range.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UISlider+Range.swift 3 | // PixelShaderDemo 4 | // 5 | // Created by Astemir Eleev on 29/08/2017. 6 | // Copyright © 2017 Astemir Eleev. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // MARK: - Adds support for concenience methods for managing allowed ranges without calling all the required methods in the client code 12 | extension UISlider { 13 | func setAllowedValueRange(min: Float, max: Float) { 14 | self.minimumValue = min 15 | self.maximumValue = max 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Game-Scenes/Actions.sks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Game-Scenes/Actions.sks -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Game-Scenes/GameScene.sks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eleev/ios-spritekit-shader-sandbox/c9af50c1ea69a6530b103134b54f36ff75d1bb34/spritekit-fragment-sandbox-ios-app/Game-Scenes/GameScene.sks -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Fragment Sandbox 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UIRequiresFullScreen 34 | 35 | UIStatusBarHidden 36 | 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Scenes/GameScene.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameScene.swift 3 | // PixelShaderDemo 4 | // 5 | // Created by Astemir Eleev on 28/08/2017. 6 | // Copyright © 2017 Astemir Eleev. All rights reserved. 7 | // 8 | 9 | import SpriteKit 10 | import GameplayKit 11 | 12 | class GameScene: SKScene { 13 | 14 | private var label : SKLabelNode? 15 | private var spinnyNode : SKShapeNode? 16 | private var shaderContainer: SKSpriteNode? 17 | private var touch: UITouch? 18 | 19 | // MARK: - Lifecycle 20 | 21 | override func didMove(to view: SKView) { 22 | 23 | createNode(for: "sand") 24 | 25 | /* 26 | // Create shape node to use during mouse interaction 27 | let w = (self.size.width + self.size.height) * 0.05 28 | self.spinnyNode = SKShapeNode.init(rectOf: CGSize.init(width: w, height: w), cornerRadius: w * 0.3) 29 | 30 | if let spinnyNode = self.spinnyNode { 31 | spinnyNode.lineWidth = 2.5 32 | 33 | spinnyNode.run(SKAction.repeatForever(SKAction.rotate(byAngle: CGFloat(Double.pi), duration: 1))) 34 | spinnyNode.run(SKAction.sequence([SKAction.wait(forDuration: 0.5), 35 | SKAction.fadeOut(withDuration: 0.5), 36 | SKAction.removeFromParent()])) 37 | } 38 | */ 39 | } 40 | 41 | 42 | override func update(_ currentTime: TimeInterval) { 43 | // Called before each frame is rendered 44 | } 45 | 46 | // MARK: - Touch handling 47 | 48 | private func updateFingerPosition(_ position: CGPoint) { 49 | func clamp(value: CGFloat) -> CGFloat { 50 | let min: CGFloat = -1.0 51 | let max: CGFloat = 10.0 52 | return (value - min) / (max - min) 53 | } 54 | 55 | let positionX = clamp(value: position.x / 100) 56 | let positionY = clamp(value: position.y / 500) 57 | 58 | let point = SIMD2([Float(positionX), Float(positionY)]) 59 | shaderContainer?.shader?.updateUniform(named: "finger", for: point) 60 | 61 | debugPrint("finger position: ", positionX, positionY) 62 | } 63 | 64 | func touchDown(atPoint pos : CGPoint) { 65 | updateFingerPosition(pos) 66 | } 67 | 68 | func touchMoved(toPoint pos : CGPoint) { 69 | updateFingerPosition(pos) 70 | } 71 | 72 | func touchUp(atPoint pos : CGPoint) { 73 | updateFingerPosition(pos) 74 | } 75 | 76 | override func touchesBegan(_ touches: Set, with event: UIEvent?) { 77 | for t in touches { self.touchDown(atPoint: t.location(in: self)) } 78 | } 79 | 80 | override func touchesMoved(_ touches: Set, with event: UIEvent?) { 81 | for t in touches { self.touchMoved(toPoint: t.location(in: self)) } 82 | } 83 | 84 | override func touchesEnded(_ touches: Set, with event: UIEvent?) { 85 | for t in touches { self.touchUp(atPoint: t.location(in: self)) } 86 | } 87 | 88 | override func touchesCancelled(_ touches: Set, with event: UIEvent?) { 89 | for t in touches { self.touchUp(atPoint: t.location(in: self)) } 90 | } 91 | 92 | 93 | // MARK: - Methods 94 | 95 | // MARK: - Control methods 96 | 97 | @discardableResult func updateReflectionIterations(for value: Float) -> Bool? { 98 | return shaderContainer?.shader?.updateUniform(named: "iterations", for: value) 99 | } 100 | 101 | @discardableResult func updateRGBLightningEnergyTiming(for value: Float) -> Bool? { 102 | return shaderContainer?.shader?.updateUniform(named: "speed", for: value) 103 | } 104 | 105 | @discardableResult func updateSplashIterations(for value: Float) -> Bool? { 106 | return shaderContainer?.shader?.updateUniform(named: "u_iterations", for: value) 107 | } 108 | 109 | @discardableResult func updateMandelbrotIterations(for value: Float) -> Bool? { 110 | return shaderContainer?.shader?.updateUniform(named: "iterations", for: value) 111 | } 112 | 113 | @discardableResult func updateGTC14(for value: Float) -> Bool? { 114 | return shaderContainer?.shader?.updateUniform(named: "iterations", for: value) 115 | } 116 | 117 | @discardableResult func updateCRTRetroEffect(for value: Float) -> Bool? { 118 | return shaderContainer?.shader?.updateUniform(named: "u_color_scale", for: value) 119 | } 120 | 121 | @discardableResult func updateLCDPostEffect(for value: Float) -> Bool? { 122 | return shaderContainer?.shader?.updateUniform(named: "u_color_darkening", for: value) 123 | } 124 | 125 | // MARK: - Container methods 126 | 127 | func waterReflection() { 128 | let shaderContainerMovement = createShaderContainer() 129 | createMovementShader(shaderContainerMovement, for: "sand") 130 | 131 | shaderContainer = createShaderContainer() 132 | createReflectionShader(shaderContainer!) 133 | } 134 | 135 | func waterMovement() { 136 | shaderContainer = createShaderContainer() 137 | createWaveShader(shaderContainer!) 138 | } 139 | 140 | func rgbLighningEnergy() { 141 | shaderContainer = createShaderContainer() 142 | createLightningShader(shaderContainer!) 143 | } 144 | 145 | func paintNoise() { 146 | shaderContainer = createShaderContainer() 147 | createPaintNoiseShader(shaderContainer!) 148 | } 149 | 150 | func flameShader() { 151 | shaderContainer = createShaderContainer() 152 | createFlameDistanceShader(shaderContainer!) 153 | } 154 | 155 | func lattice6Shader() { 156 | shaderContainer = createShaderContainer() 157 | createTriLattice6Shader(shaderContainer!) 158 | } 159 | 160 | func splashShader() { 161 | shaderContainer = createShaderContainer() 162 | createSplashShader(shaderContainer!) 163 | } 164 | 165 | func tronRoadShader() { 166 | shaderContainer = createShaderContainer() 167 | createTronRoad(shaderContainer!) 168 | } 169 | 170 | func mandelbrotRecursive() { 171 | shaderContainer = createShaderContainer() 172 | createMandelbroRecursize(shaderContainer!) 173 | } 174 | 175 | func gtc14() { 176 | shaderContainer = createShaderContainer() 177 | createGTC14(shaderContainer!) 178 | } 179 | 180 | func LCDPostEffect() { 181 | shaderContainer = createShaderContainer() 182 | createLCDPostEffect(shaderContainer!) 183 | } 184 | 185 | func CRTretroEffect() { 186 | shaderContainer = createShaderContainer() 187 | createCRTRetroEffect(shaderContainer!) 188 | } 189 | 190 | // MARK: - Utility 191 | 192 | private func createShaderContainer(from imageNamed: String = "dummypixel.png") -> SKSpriteNode { 193 | let width = self.frame.size.width 194 | let height = self.frame.size.height 195 | let position = CGPoint(x: width / 2, y: height / 2) 196 | let size = CGSize(width: width, height: height) 197 | 198 | // Create a container sprite for the shader that makes the movement 199 | let shaderContainer = SKSpriteNode(imageNamed: imageNamed) 200 | shaderContainer.position = position 201 | shaderContainer.size = size 202 | self.addChild(shaderContainer) 203 | return shaderContainer 204 | } 205 | 206 | private func createMovementShader(_ shaderContainer: SKSpriteNode, for imageNamed: String = "sand.png") { 207 | let multiplier: CGFloat = 1.5 208 | let size = getSceneResolution(multiplier: multiplier) 209 | 210 | let moveShader = SKShader(fileNamed: "water_movement.fsh") 211 | moveShader.uniforms = [ 212 | SKUniform(name: "size", vectorFloat3: size), 213 | SKUniform(name: "customTexture", texture: SKTexture(imageNamed: imageNamed)) 214 | ] 215 | shaderContainer.shader = moveShader 216 | } 217 | 218 | private func createReflectionShader(_ shaderContainer: SKSpriteNode) { 219 | let size = getSceneResolution() 220 | let iterations: Float = 4 221 | 222 | let reflectShader = SKShader(fileNamed: "water_reflection.fsh") 223 | reflectShader.uniforms = [ 224 | SKUniform(name: "size", vectorFloat3: size), 225 | SKUniform(name: "iterations", float: iterations) 226 | ] 227 | shaderContainer.shader = reflectShader 228 | } 229 | 230 | private func createWaveShader(_ shaderContainer: SKSpriteNode, for imageNamed: String = "sand.png") { 231 | let size = getSceneResolution() 232 | 233 | let waterShader = SKShader(fileNamed: "wave.fsh") 234 | waterShader.uniforms = [ 235 | SKUniform(name: "size", vectorFloat3: size), 236 | SKUniform(name: "customTexture", texture: SKTexture(imageNamed: imageNamed)) 237 | ] 238 | shaderContainer.shader = waterShader 239 | } 240 | 241 | private func createLightningShader(_ shaderContainer: SKSpriteNode) { 242 | let size = getSceneResolution() 243 | let speed: Float = 20.0 244 | 245 | let lightningShader = SKShader(fileNamed: "lightning.fsh") 246 | lightningShader.uniforms = [ 247 | SKUniform(name: "resolution", vectorFloat3: size), 248 | SKUniform(name: "speed", float: speed) 249 | ] 250 | shaderContainer.shader = lightningShader 251 | } 252 | 253 | private func createPaintNoiseShader(_ shaderContainer: SKSpriteNode) { 254 | let size = getSceneResolution() 255 | let finger = SIMD2([0.23, 0.1]) 256 | 257 | let paintNoiseShader = SKShader(fileNamed: "paint_noise.fsh") 258 | paintNoiseShader.uniforms = [ 259 | SKUniform(name: "resolution", vectorFloat3: size), 260 | SKUniform(name: "finger", vectorFloat2: finger) 261 | ] 262 | shaderContainer.shader = paintNoiseShader 263 | } 264 | 265 | private func createFlameDistanceShader(_ shaderContainer: SKSpriteNode) { 266 | let size = getSceneResolution() 267 | let iterations: Float = 64.0 268 | 269 | let flameShader = SKShader(fileNamed: "flame_raymarching.fsh") 270 | flameShader.uniforms = [ 271 | SKUniform(name: "resolution", vectorFloat3: size), 272 | SKUniform(name: "iterations", float: iterations) 273 | ] 274 | shaderContainer.shader = flameShader 275 | } 276 | 277 | private func createTriLattice6Shader(_ shaderContainer: SKSpriteNode) { 278 | let size = getSceneResolution() 279 | 280 | let latticeShasder = SKShader(fileNamed: "tri_lattice6.fsh") 281 | latticeShasder.uniforms = [ 282 | SKUniform(name: "resolution", vectorFloat3: size) 283 | ] 284 | shaderContainer.shader = latticeShasder 285 | } 286 | 287 | private func createSplashShader(_ shaderContainer: SKSpriteNode, for imageNamed: String = "sand.png") { 288 | let size = getSceneResolution() 289 | let u_date = SIMD4([0, 0, 0, Float(arc4random_uniform(70) + 1)]) 290 | 291 | let splashShader = SKShader(fileNamed: "splash.fsh") 292 | splashShader.uniforms = [ 293 | SKUniform(name: "u_resolution", vectorFloat3: size), 294 | SKUniform(name: "u_date", vectorFloat4: u_date), 295 | SKUniform(name: "u_left_distribution", float: Float.randomFloat(min: 0.125, max: 3.95)), 296 | SKUniform(name: "u_right_distribution", float: Float.randomFloat(min: 0.125, max: 3.95)), 297 | SKUniform(name: "u_iterations", float: Float(arc4random_uniform(40) + 8)), 298 | SKUniform(name: "u_image", texture: SKTexture(imageNamed: imageNamed)) 299 | ] 300 | shaderContainer.shader = splashShader 301 | } 302 | 303 | private func createTronRoad(_ shaderContainer: SKSpriteNode) { 304 | let size = getSceneResolution() 305 | 306 | let tronRoadShader = SKShader(fileNamed: "tron_road.fsh") 307 | tronRoadShader.uniforms = [ 308 | SKUniform(name: "u_resolution", vectorFloat3: size) 309 | ] 310 | shaderContainer.shader = tronRoadShader 311 | } 312 | 313 | private func createMandelbroRecursize(_ shaderContainer: SKSpriteNode) { 314 | let size = getSceneResolution() 315 | let iterations: Float = 64 316 | 317 | let tronRoadShader = SKShader(fileNamed: "mandelbrot-recursive.fsh") 318 | tronRoadShader.uniforms = [ 319 | SKUniform(name: "u_resolution", vectorFloat3: size), 320 | SKUniform(name: "iterations", float: iterations) 321 | ] 322 | shaderContainer.shader = tronRoadShader 323 | } 324 | 325 | private func createGTC14(_ shaderContainer: SKSpriteNode) { 326 | let size = getSceneResolution() 327 | let iterations: Float = 100 328 | 329 | let tronRoadShader = SKShader(fileNamed: "GTC14-conference.fsh") 330 | tronRoadShader.uniforms = [ 331 | SKUniform(name: "u_resolution", vectorFloat3: size), 332 | SKUniform(name: "iterations", float: iterations) 333 | ] 334 | shaderContainer.shader = tronRoadShader 335 | } 336 | 337 | private func createLCDPostEffect(_ shaderContainer: SKSpriteNode, for imageNamed: String = "retro.jpg") { 338 | let size = getSceneResolution() 339 | 340 | let waterShader = SKShader(fileNamed: "lcd_post_effect.fsh") 341 | waterShader.uniforms = [ 342 | SKUniform(name: "u_resolution", vectorFloat3: size), 343 | SKUniform(name: "u_texture0", texture: SKTexture(imageNamed: imageNamed)), 344 | SKUniform(name: "u_color_darkening", float: 0.25) 345 | ] 346 | shaderContainer.shader = waterShader 347 | } 348 | 349 | private func createCRTRetroEffect(_ shaderContainer: SKSpriteNode, for imageNamed: String = "retro.jpg") { 350 | let size = getSceneResolution() 351 | 352 | let waterShader = SKShader(fileNamed: "crt_retro.fsh") 353 | waterShader.uniforms = [ 354 | SKUniform(name: "u_resolution", vectorFloat3: size), 355 | SKUniform(name: "u_texture0", texture: SKTexture(imageNamed: imageNamed)), 356 | SKUniform(name: "u_color_scale", float: 1.27) 357 | ] 358 | shaderContainer.shader = waterShader 359 | } 360 | 361 | // MARK: - Utility methods 362 | 363 | private func getSceneResolution(multiplier: CGFloat = 1.0) -> SIMD3 { 364 | let width = Float(self.frame.size.width * multiplier) 365 | let height = Float(self.frame.size.height * multiplier) 366 | let size = SIMD3([width, height, 0]) 367 | return size 368 | } 369 | 370 | private func createNode(for name: String) { 371 | let beach = SKSpriteNode(imageNamed: name) 372 | beach.size = self.size 373 | beach.position = CGPoint(x: self.frame.size.width / 2, y: self.frame.size.height / 2) 374 | self.addChild(beach) 375 | } 376 | 377 | } 378 | 379 | extension Float { 380 | static func randomFloat(min: Float, max: Float) -> Float { 381 | return (Float(arc4random()) / 4294967296 /* 0xFFFFFFFF */) * (max - min) + min 382 | } 383 | } 384 | 385 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Filters-Effects/crt_retro.fsh: -------------------------------------------------------------------------------- 1 | void main(void) { 2 | vec2 uv = gl_FragCoord.xy / u_resolution.xy; 3 | uv = vec2(uv.x, 1.0 - uv.y); 4 | 5 | // per row offset 6 | float f = sin( uv.y * 320.0 * 3.14 ); 7 | // scale to per pixel 8 | float o = f * (0.35 / 320.0); 9 | // scale for subtle effect 10 | // 0.97 11 | float s = f * .03 + u_color_scale; 12 | // scan line fading 13 | float l = sin( u_time * 32. )*.03 + 0.97; 14 | // sample in 3 colour offset 15 | float r = texture2D( u_texture0, vec2( uv.x+o, uv.y+o ) ).x; 16 | float g = texture2D( u_texture0, vec2( uv.x-o, uv.y+o ) ).y; 17 | float b = texture2D( u_texture0, vec2( uv.x , uv.y-o ) ).z; 18 | // combine as 19 | gl_FragColor = vec4( r*0.7, g, b*0.9, l)*l*s; 20 | } 21 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Filters-Effects/lcd_post_effect.fsh: -------------------------------------------------------------------------------- 1 | void main(void) { 2 | // Get pos relative to 0-1 screen space 3 | vec2 uv = gl_FragCoord.xy / u_resolution.xy;; 4 | // Flip image along y axis 5 | uv = vec2(uv.x, 1.0 - uv.y); 6 | 7 | // Map texture to 0-1 space 8 | vec4 texColor = texture2D(u_texture0,uv); 9 | 10 | // Default lcd colour (affects brightness) 11 | float pb = 0.4; 12 | vec4 lcdColor = vec4(pb,pb,pb,1.0); 13 | 14 | // Change every 1st, 2nd, and 3rd vertical strip to RGB respectively 15 | int px = int(mod(gl_FragCoord.x,3.0)); 16 | if (px == 1) lcdColor.r = 1.0; 17 | else if (px == 2) lcdColor.g = 1.0; 18 | else lcdColor.b = 1.0; 19 | 20 | // Darken every 3rd horizontal strip for scanline 21 | float sclV = u_color_darkening; 22 | if (int(mod(gl_FragCoord.y,3.0)) == 0) lcdColor.rgb = vec3(sclV,sclV,sclV); 23 | 24 | 25 | gl_FragColor = texColor*lcdColor; 26 | } 27 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Filters-Effects/water_movement.fsh: -------------------------------------------------------------------------------- 1 | void main(void) { 2 | 3 | vec2 uv = gl_FragCoord.xy / size.xy; 4 | 5 | uv.y += (cos((uv.y + (u_time * 0.08)) * 85.0) * 0.0019) + 6 | (cos((uv.y + (u_time * 0.1)) * 10.0) * 0.002); 7 | 8 | uv.x += (sin((uv.y + (u_time * 0.13)) * 55.0) * 0.0029) + 9 | (sin((uv.y + (u_time * 0.1)) * 15.0) * 0.002); 10 | 11 | vec4 texColor = texture2D(customTexture, uv); 12 | gl_FragColor = texColor; 13 | } 14 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Filters-Effects/water_reflection.fsh: -------------------------------------------------------------------------------- 1 | void main(void) { 2 | 3 | float time = u_time * .25; 4 | vec2 sp = gl_FragCoord.xy / size.xy; 5 | vec2 p = sp * 6.0 - 20.0; 6 | vec2 i = p; 7 | float c = 1.0; 8 | float inten = .05; 9 | 10 | for (int n = 0; n < iterations; n++) { 11 | float t = time * (1.0 - (3.5 / float(n+1))); 12 | i = p + vec2(cos(t - i.x) + sin(t + i.y), sin(t - i.y) + cos(t + i.x)); 13 | c += 1.0 / length(vec2(p.x / (sin(i.x + t) / inten), p.y / (cos(i.y + t) / inten))); 14 | } 15 | 16 | c /= float(5); 17 | c = 1.5-sqrt(c); 18 | vec3 colour = vec3(pow(abs(c), 15.0)); 19 | 20 | gl_FragColor = vec4(clamp(colour + vec3(0.0, 0.17, 0.3), 0.0, .5), 0.2); 21 | } 22 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Filters-Effects/wave.fsh: -------------------------------------------------------------------------------- 1 | void main(void) { 2 | 3 | vec2 uv = gl_FragCoord.xy / size.xy; 4 | 5 | uv.y += (cos((uv.y + (u_time * 0.04)) * 45.0) * 0.0019) + 6 | (cos((uv.y + (u_time * 0.1)) * 10.0) * 0.002); 7 | 8 | uv.x += (sin((uv.y + (u_time * 0.07)) * 15.0) * 0.0029) + 9 | (sin((uv.y + (u_time * 0.1)) * 15.0) * 0.002); 10 | 11 | gl_FragColor = texture2D(customTexture, uv); 12 | } 13 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Fractals/GTC14-conference.fsh: -------------------------------------------------------------------------------- 1 | // Created by inigo quilez - iq/2014 2 | // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. 3 | 4 | // Live coded demo during out talk at GTC 2014. Seee here for comentary: 5 | // http://on-demand.gputechconf.com/gtc/2014/video/S4550-shadertoy-fragment-shader.mp4 6 | 7 | // Adopted for SprieKit + iOS 10.0 by Astemir Eleev 8 | 9 | float map(vec3 p, float time) { 10 | 11 | vec3 q = mod( p+2.0, 4.0 ) - 2.0; 12 | 13 | float d1 = length( q ) - 1.0; 14 | 15 | d1 += 0.1*sin(10.0*p.x)*sin(10.0*p.y + time)*sin(10.0*p.z); 16 | 17 | float d2 = p.y + 1.0; 18 | 19 | float k = 1.5; 20 | float h = clamp( 0.5 + 0.5*(d1-d2)/k, 0.0, 1.0 ); 21 | return mix( d1, d2, h ) - k*h*(1.0-h); 22 | } 23 | 24 | vec3 calcNormal(vec3 p, float time ) { 25 | vec2 e = vec2( 0.0001, 0.0 ); 26 | 27 | return normalize( vec3( map(p+e.xyy, time) - map(p-e.xyy, time), 28 | map(p+e.yxy, time) - map(p-e.yxy, time), 29 | map(p+e.yyx, time) - map(p-e.yyx, time) ) ); 30 | } 31 | 32 | void main(void) { 33 | vec2 uv = gl_FragCoord.xy / u_resolution.xy; 34 | // flip picture with respect to the drawing method 35 | vec2 p = -1.0 + 2.0 * vec2(uv.x, 1.0 - uv.y); 36 | p.x *= u_resolution.x/u_resolution.y; 37 | 38 | vec3 ro = vec3( 0.0, 0.0, 2.0 ); 39 | vec3 rd = normalize( vec3(p, -1.0) ); 40 | vec3 col = vec3(0.0); 41 | 42 | float tmax = 20.0; 43 | float h = 1.0; 44 | float t = 0.0; 45 | 46 | for( int i=0; itmax ) break; 48 | h = map( ro + t*rd, u_time); 49 | t += h; 50 | } 51 | 52 | vec3 lig = vec3(0.5773); 53 | 54 | if( t 0; ++i ) { 35 | // Limiting the number of iterations that draws a fixed number of lighning paths per lightning 36 | if(i > int(lim)) break; 37 | float val = float(i); 38 | 39 | float pct = val / lim; 40 | 41 | // Lighning paths drawing 42 | float t = abs(pct * pct / ((uv.x - sin(u_time * 2. - uv.y) / 2. + fbm( uv + (-u_time * speed) / val)) * (lim * 15.0))); 43 | float u = abs(pct * pct / ((uv.x - sin(-u_time * 2. - uv.y) / 2. + fbm( uv + (u_time * speed) / val)) * (lim * 15.0))); 44 | float v = abs(pct * pct / ((uv.x - cos(u_time * 2. - uv.x) / 2. + fbm( uv + (u_time * speed) / val)) * (lim * 15.0))); 45 | 46 | // Coloring the lighning paths 47 | finalColor += t * vec3(pct + .75, 1., 1.0); 48 | finalColor += u * vec3(1., pct + .75, 1.0); 49 | finalColor += v * vec3(1., 1., pct + .75); 50 | } 51 | 52 | gl_FragColor = vec4(finalColor, 1.0 ); 53 | } 54 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Procedural/paint_noise.fsh: -------------------------------------------------------------------------------- 1 | void main() { 2 | vec3 p = vec3((gl_FragCoord.xy) / (resolution.y), finger.x); 3 | 4 | for (int i = 0; i < 50; i++){ 5 | p.xzy = vec3(1.3, 0.999, 0.7) * (abs((abs(p) / dot(p, p) - vec3(1.0, 1.0, finger.y * 0.5)))); 6 | } 7 | 8 | gl_FragColor = vec4(p, 1.0); 9 | } 10 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Procedural/splash.fsh: -------------------------------------------------------------------------------- 1 | #define extent 3.5 2 | 3 | float pattern(vec4 date) { 4 | return sin(1.+fract(.7971*floor(date.w/2.))); 5 | } 6 | 7 | float magicBox(vec3 p, vec4 date, float iterations) { 8 | vec3 uvw = p; 9 | p = 1. - abs(1. - mod(uvw, 2.)); 10 | float lL = length(p), nL = lL, tot = 0., c = pattern(date); 11 | 12 | for (int i=0; i < iterations; i++) { 13 | p = abs(p)/(lL*lL) - c; 14 | nL = length(p); 15 | tot += abs(nL-lL); 16 | lL = nL; 17 | } 18 | 19 | return tot; 20 | } 21 | 22 | void main(void) {; 23 | vec2 s = u_resolution.xy; 24 | vec2 uv = (gl_FragCoord.xy - u_resolution.xy / 2.5) / u_resolution.y * 7.; 25 | 26 | float a = 0.; 27 | // Used to differentiate splash sides with respect to x axes 28 | // if (uv.x >= 0.) a = atan(uv.x, uv.y) * 1.275; 29 | // if (uv.x < 0.) a = 3.14159 - atan(-uv.x, -uv.y) * 1.66; 30 | // a = 3.14159 - atan(-uv.x, -uv.y) * 5.66; 31 | 32 | if (uv.x >= 0.) a = atan(uv.x, uv.y) * u_left_distribution; 33 | if (uv.x < 0.) a = 3.14159 - atan(uv.x, uv.y) * u_right_distribution; 34 | 35 | float date = u_date.w; 36 | float t = date; 37 | 38 | t = exp(t * 50. - 10.); 39 | if (t>extent) t = extent; 40 | 41 | float fc = magicBox(vec3(uv,a), date, u_iterations) + 1.; 42 | fc = 1. - smoothstep(fc, fc + 0.001, t / dot(uv,uv)); 43 | 44 | vec3 tex = texture2D(u_image, gl_FragCoord.xy / s).rgb; 45 | vec3 splash = vec3(1.-fc) * vec3(.42, .05, .08); 46 | 47 | vec3 mixed = mix(tex, splash, (splash.r == 0.? 0. : 1.)); 48 | gl_FragColor = vec4(mixed, 1.0); 49 | } 50 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Procedural/tri_lattice6.fsh: -------------------------------------------------------------------------------- 1 | // Original Author: Keijiro Takahashi 2 | // Original Source: https://github.com/keijiro/ShaderSketches/blob/master/Fragment/TriLattice6.glsl 3 | // Modified and Abopted for SpriteKit+iOS 10.0 by: Astemir Eleev (https://github.com/jVirus) 4 | 5 | float rand(vec2 uv) { 6 | return fract(sin(dot(uv, vec2(112.9898, 78.233))) * 43758.5453); 7 | } 8 | 9 | vec2 uv2tri(vec2 uv) { 10 | float sx = uv.x - uv.y / 2.; // skewed x 11 | float offs = step(fract(1. - uv.y), fract(sx)); 12 | return vec2(floor(sx) * 2. + offs, floor(uv.y)); 13 | } 14 | 15 | void main(void) { 16 | vec2 uv = (gl_FragCoord.xy - resolution.xy / 2.) / resolution.y * 8.; 17 | 18 | vec3 p = vec3(dot(uv, vec2(1., 0.5)), dot(uv, vec2(-1., 0.5)), uv.y); 19 | vec3 p1 = fract(+p); 20 | vec3 p2 = fract(-p); 21 | 22 | float d1 = min(min(p1.x, p1.y), p1.z); 23 | float d2 = min(min(p2.x, p2.y), p2.z); 24 | float d = min(d1, d2); 25 | 26 | vec2 tri = uv2tri(uv); 27 | float r = rand(tri) * 2. + tri.x / 16. + u_time * 2.; 28 | float c = step(0.2 + sin(r) * 0.2, d); 29 | 30 | gl_FragColor = vec4(c, c, c, 1); 31 | } 32 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Procedural/tron_road.fsh: -------------------------------------------------------------------------------- 1 | #define tri(t, scale, shift) ( abs(t * 2. - 1.) - shift ) * (scale) 2 | 3 | float smin( float a, float b, float k ) 4 | { 5 | float h = clamp( 0.5+0.5*(b-a)/k, 0.0, 1.0 ); 6 | return mix( b, a, h ) - k*h*(1.0-h); 7 | } 8 | 9 | void main(void) 10 | { 11 | vec2 R = u_resolution.xy, 12 | uv = ( gl_FragCoord.xy - .5 * R ) / R.y + .5; 13 | 14 | // flip the image along y axis 15 | uv = vec2(uv.x, 1.0 - uv.y); 16 | 17 | // sun 18 | float dist = length(uv-vec2(0.5,0.5)); 19 | float divisions = 6.0; 20 | float divisionsShift= 0.5; 21 | 22 | float pattern = tri(fract(( uv.y + 0.5)* 20.0), 2.0/ divisions, divisionsShift)- (-uv.y + 0.26) * 0.85; 23 | float sunOutline = smoothstep( 0.0,-0.015, max( dist - 0.315, -pattern)) ; 24 | 25 | vec3 c = sunOutline * mix(vec3( 4.0, 0.0, 0.2), vec3(1.0, 1.1, 0.0), uv.y); 26 | 27 | // glow 28 | float glow = max(0.0, 1.0 - dist * 1.25); 29 | glow = min(glow * glow * glow, 0.325); 30 | c += glow * vec3(1.5, 0.3, (sin(u_time)+ 1.0)) * 1.1; 31 | 32 | 33 | vec2 ground; 34 | 35 | vec2 planeuv = uv; 36 | 37 | planeuv.x = (planeuv.x - 0.5) * (-planeuv.y) + 0.5; 38 | // planeuv.y *= planeuv.y; 39 | 40 | planeuv.y += (u_time ) * 0.13; 41 | ground.x = tri(fract(( planeuv.x + 0.5)* 10.0), 1.0/10.0, 0.0); 42 | ground.y = tri(fract(( planeuv.y + 0.5)* 10.0), 1.0/10.0, 0.0); 43 | 44 | float groud_lines = smin(ground.x,ground.y, 0.015); 45 | float ground_glow = smin(ground.x,ground.y, 0.06); 46 | 47 | float ground_line_color = smoothstep( 0.01,-0.01, groud_lines); 48 | float ground_color = smoothstep( 0.08,-0.0, ground_glow); 49 | c = vec3(1.5,2,1) * ground_line_color + vec3(0.1,0.2,0.4) *ground_color; 50 | gl_FragColor = vec4(c,1.0); 51 | } 52 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/Raymarching/flame_raymarching.fsh: -------------------------------------------------------------------------------- 1 | 2 | 3 | float hash(vec2 p) { 4 | vec3 p2 = vec3(p.xy, 1.0); 5 | return fract(sin(dot(p2, vec3(40., 60., 80.))) * 10000.); 6 | } 7 | 8 | float noise2d(vec2 p) { 9 | vec2 i = floor(p); 10 | vec2 f = fract(p); 11 | f *= f * (3.0 - 2.0 * f); 12 | 13 | return mix(mix(hash(i + vec2(0.,0.)), hash(i + vec2(1., 0.)), f.x), 14 | mix(hash(i + vec2(0.,1.)), hash(i + vec2(1., 1.)), f.x), 15 | f.y); 16 | } 17 | 18 | float noise(vec3 p) { 19 | vec3 i = floor(p); 20 | vec4 a = dot(i, vec3(1., 57., 21.)) + vec4(0., 57., 21., 78.); 21 | vec3 f = cos((p - i) * acos(-1.)) * (-.5) + .5; 22 | a = mix(sin(cos(a) * a), sin(cos(1.+a) * (1. + a)), f.x); 23 | a.xy = mix(a.xz, a.yw, f.y); 24 | return mix(a.x, a.y, f.z); 25 | } 26 | 27 | float sphere(vec3 p, vec4 spr) { 28 | return length(spr.xyz - p) - spr.w; 29 | } 30 | 31 | float flame(vec3 p, float time) { 32 | float d = sphere(p * vec3(1.,.5, 1.), vec4(.0,-1., .0,1.)); 33 | // return d + (noise(p + vec3(.0, time * 2., .0)) + noise(p * 3.) * .5) * .25 * (p.y); 34 | return d + (noise2d(p.xy + vec2(.0, time * 2.)) + noise2d(p.xy * 3.) * .5) * .25 * (p.y); 35 | 36 | } 37 | 38 | float scene(vec3 p, float time) { 39 | return min(100.-length(p) , abs(flame(p, time)) ); 40 | } 41 | 42 | vec4 raymarch(float num, vec3 org, vec3 dir, float time) { 43 | float d = 0.0, glow = 0.0, eps = 0.02; 44 | vec3 p = org; 45 | bool glowed = false; 46 | 47 | for(int i=0; i < num; i++) { 48 | d = scene(p, time) + eps; 49 | p += d * dir; 50 | 51 | if( d > eps ) { 52 | if(flame(p, time) < .0) 53 | glowed = true; 54 | if(glowed) 55 | glow = float(i) / num; 56 | } 57 | } 58 | return vec4(p, glow); 59 | } 60 | 61 | void main(void) { 62 | vec2 v = -1.0 + 3.0 * gl_FragCoord.xy / resolution.xy; 63 | v.x *= resolution.x / resolution.y; 64 | 65 | vec3 org = vec3(0., -4.5, 5.0); 66 | vec3 dir = normalize(vec3(v.x * 1.6, v.y, -1.5)); 67 | 68 | float time = u_time; 69 | 70 | vec4 p = raymarch(iterations, org, dir, time); 71 | float glow = p.w; 72 | 73 | vec4 col = mix(vec4(1., .5, .1, 1.), vec4(0.1, .5, 1., 1.), p.y * .02 + .4); 74 | 75 | gl_FragColor = mix(vec4(0.), col, pow(glow * 2., 4.)); 76 | } 77 | 78 | 79 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/Shaders/wavy_lines_procedural.fsh: -------------------------------------------------------------------------------- 1 | 2 | 3 | #define PI 3.14159265359 4 | #define FOV (PI*0.4) 5 | 6 | #define rot(a) mat2(cos(a+PI*vec4(0,1.5,0.5,0))) 7 | 8 | // hash function for dithering 9 | vec3 hash33(vec3 p3) { 10 | p3 = fract(p3 * vec3(.1031, .1030, .0973)); 11 | p3 += dot(p3, p3.yxz+19.19); 12 | return fract((p3.xxy + p3.yxx)*p3.zyx); 13 | } 14 | 15 | // parametric equation for the path of a single strand 16 | // https://en.wikipedia.org/wiki/Braiding_machine 17 | vec2 path( float x ) { 18 | float v = step(fract(x), 0.5)*2.0-1.0; 19 | float th = (mod(x, 0.5)*2.0)*-2.0*PI*v; 20 | return vec2(v*cos(th)*0.5+v*-0.5, v*sin(th)*0.5); 21 | } 22 | 23 | // main distance function 24 | float de( vec3 p, out float id ) { 25 | 26 | float sky = 10.0-length(p.xy); 27 | p.z *= 0.07; 28 | 29 | vec2 inS = vec2(0); 30 | float scale = 1.0; 31 | id = 0.0; 32 | 33 | for (int i = 0 ; i < 3 ; i++) { 34 | 35 | // figure out the path of the 3 strands 36 | vec2 inA = p.xy - path(p.z)*scale; 37 | vec2 inB = p.xy - path(p.z + (1.0/3.0))*scale; 38 | vec2 inC = p.xy - path(p.z + (2.0/3.0))*scale; 39 | 40 | // pick the closest center 41 | float dA = dot(inA, inA); 42 | float dB = dot(inB, inB); 43 | float dC = dot(inC, inC); 44 | if (dA < dB && dA < dC) { 45 | inS = inA; 46 | } else if (dB < dC) { 47 | inS = inB; 48 | id += pow(3.0, float(i)); 49 | } else { 50 | inS = inC; 51 | id += 2.0*pow(3.0, float(i)); 52 | } 53 | 54 | p.z /= scale; 55 | p.xy = inS; 56 | scale *= 0.3; 57 | 58 | } 59 | 60 | // base primitive is a cylinder 61 | float de = length(inS) - 1.5*scale; 62 | 63 | // compare the distance to the sky 64 | if (sky < de) { 65 | id = -1.0; 66 | return sky; 67 | } 68 | 69 | return de; 70 | 71 | } 72 | 73 | void mainImage( out vec4 fragColor, in vec2 fragCoord ) { 74 | 75 | vec2 uv = (fragCoord.xy - iResolution.xy*0.5) / iResolution.x; 76 | vec3 from = vec3(0, -4.3, 0); 77 | vec3 dir = normalize(vec3(uv.x, 1.0 / tan(FOV*0.5), uv.y)); 78 | 79 | 80 | vec2 mouse= (iMouse.xy - iResolution.xy * 0.5) / iResolution.x; 81 | if (iMouse.z < 1.0) mouse = vec2(0.0); 82 | mat2 rotx = rot(-mouse.x*4.0); 83 | mat2 roty = rot(mouse.y*3.0); 84 | from.yz *= roty; 85 | from.xy *= rotx; 86 | dir.yz *= roty; 87 | dir.xy *= rotx; 88 | from.z += iTime; 89 | 90 | // dithering 91 | vec3 dither = hash33(vec3(fragCoord.xy, iFrame)); 92 | 93 | // get the sine of the angular extent of a pixel 94 | float sinPix = sin(FOV / iResolution.x); 95 | // accumulate color front to back 96 | vec4 acc = vec4(0, 0, 0, 1); 97 | 98 | float id = 0.0; 99 | float totdist = 0.0; 100 | totdist += dither.r*de(from, id)*0.4; 101 | 102 | for (int i = 0 ; i < 200 ; i++) { 103 | vec3 p = from + totdist * dir; 104 | float dist = de(p, id); 105 | 106 | // compute color 107 | vec3 color = vec3(sin(id)*0.3+0.7); 108 | if (id < -0.5) color = vec3(0.2); 109 | else if (id < 0.5) color = vec3(0.6, 0.1, 0.1); 110 | color *= pow(1.0 - float(i)/200.0, 6.0); 111 | 112 | // cone trace the surface 113 | float prox = dist / (totdist*sinPix); 114 | float alpha = clamp(prox * -0.5 + 0.5, 0.0, 1.0); 115 | 116 | if (alpha > 0.01) { 117 | // accumulate color 118 | acc.rgb += acc.a * (alpha*color.rgb); 119 | acc.a *= (1.0 - alpha); 120 | } 121 | 122 | // hit a surface, stop 123 | if (acc.a < 0.01) { 124 | break; 125 | } 126 | 127 | // continue forward 128 | totdist += abs(dist*0.4); 129 | } 130 | 131 | fragColor.rgb = acc.rgb + (dither - 0.5)*0.01; 132 | fragColor.a = 1.0; 133 | } 134 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/View-Controller/GameViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GameViewController.swift 3 | // PixelShaderDemo 4 | // 5 | // Created by Astemir Eleev on 28/08/2017. 6 | // Copyright © 2017 Astemir Eleev. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SpriteKit 11 | import GameplayKit 12 | 13 | enum SceneTypes { 14 | typealias ShaderUniformRange = (min: Float, max: Float) 15 | 16 | case rgbLighning 17 | case waterReflection 18 | case water 19 | case paintNoise 20 | case flame 21 | case lattice6 22 | case splash 23 | case tron_road 24 | case mandelbrot_recursive 25 | case gtc14 26 | case ldc_post_effect 27 | case crt_retro_effect 28 | case none 29 | 30 | func shaderRange() -> ShaderUniformRange { 31 | switch self { 32 | case .none: 33 | return (min: 0, max: 0) 34 | case .rgbLighning: 35 | return (min: 0, max: 80) 36 | case .water: 37 | return (min: 0, max: 10) 38 | case .waterReflection: 39 | return (min: 0, max: 8) 40 | case .paintNoise: 41 | return (min: 0, max: 100) 42 | case .lattice6: 43 | return (min: 0, max: 100) 44 | case .splash: 45 | return (min: 0, max: 150) 46 | case .flame: 47 | return (min: 0, max: 100) 48 | case .tron_road: 49 | return (min: 0, max: 200) 50 | case .mandelbrot_recursive: 51 | return (min: 0, max: 100) 52 | case .gtc14: 53 | return (min: 0, max: 100) 54 | case .ldc_post_effect: 55 | return (min: 0, max: 20) 56 | case .crt_retro_effect: 57 | return (min: -2, max: 10) 58 | } 59 | } 60 | } 61 | 62 | class GameViewController: UIViewController { 63 | 64 | // MARK: - Outlets 65 | 66 | @IBOutlet weak var skView: SKView! 67 | 68 | // MARK: - Properties 69 | 70 | var scene: GameScene? 71 | var currentScene: SceneTypes = .none { 72 | didSet { 73 | // requires implementation 74 | } 75 | } 76 | 77 | // MARK: - Lifecycle 78 | 79 | override func viewDidLoad() { 80 | super.viewDidLoad() 81 | 82 | // Load the SKScene from 'GameScene.sks' 83 | if let scene = SKScene(fileNamed: "GameScene") { 84 | // Set the scale mode to scale to fit the window 85 | scene.scaleMode = .aspectFill 86 | 87 | // Present the scene 88 | skView.presentScene(scene) 89 | 90 | self.scene = scene as? GameScene 91 | } 92 | 93 | skView.ignoresSiblingOrder = true 94 | skView.showsFPS = true 95 | skView.showsNodeCount = true 96 | } 97 | 98 | override var shouldAutorotate: Bool { 99 | return true 100 | } 101 | 102 | override var supportedInterfaceOrientations: UIInterfaceOrientationMask { 103 | return .portrait 104 | 105 | // Used for cases when separete interface orientations are supported for differetn types of devices e.g. iPhone or iPad for instance 106 | /* 107 | if UIDevice.current.userInterfaceIdiom == .phone { 108 | return .allButUpsideDown 109 | } else { 110 | return .all 111 | } 112 | */ 113 | } 114 | 115 | override var prefersStatusBarHidden: Bool { 116 | return true 117 | } 118 | 119 | // MARK: - Actions 120 | 121 | @IBAction func iterationsSliderAction(_ sender: UISlider) { 122 | let shaderRange = currentScene.shaderRange() 123 | sender.setAllowedValueRange(min: shaderRange.min, max: shaderRange.max) 124 | 125 | let value = sender.value 126 | 127 | switch currentScene { 128 | case .rgbLighning: 129 | scene?.updateRGBLightningEnergyTiming(for: value) 130 | case .waterReflection, .flame: 131 | scene?.updateReflectionIterations(for: value) 132 | case .splash: 133 | scene?.updateSplashIterations(for: value) 134 | case .mandelbrot_recursive: 135 | scene?.updateMandelbrotIterations(for: value) 136 | case .gtc14: 137 | scene?.updateGTC14(for: value) 138 | case .crt_retro_effect: 139 | scene?.updateCRTRetroEffect(for: value) 140 | case .ldc_post_effect: 141 | scene?.updateLCDPostEffect(for: value) 142 | case .tron_road: 143 | fallthrough 144 | case .water: 145 | fallthrough 146 | case .paintNoise: 147 | fallthrough 148 | case .lattice6: 149 | fallthrough 150 | case .none: 151 | break 152 | 153 | } 154 | } 155 | 156 | // MARK: - Butto actions 157 | 158 | @IBAction func rgbLighningAction(_ sender: UIButton) { 159 | scene?.removeAllChildren() 160 | scene?.rgbLighningEnergy() 161 | currentScene = .rgbLighning 162 | } 163 | 164 | @IBAction func waterReflectionAction(_ sender: UIButton) { 165 | scene?.removeAllChildren() 166 | scene?.waterReflection() 167 | currentScene = .waterReflection 168 | } 169 | 170 | @IBAction func waterAction(_ sender: UIButton) { 171 | scene?.removeAllChildren() 172 | scene?.waterMovement() 173 | currentScene = .water 174 | } 175 | 176 | @IBAction func noisePaintAction(_ sender: UIButton) { 177 | scene?.removeAllChildren() 178 | scene?.paintNoise() 179 | currentScene = .paintNoise 180 | } 181 | 182 | @IBAction func flameAction(_ sender: UIButton) { 183 | scene?.removeAllChildren() 184 | scene?.flameShader() 185 | currentScene = .flame 186 | } 187 | 188 | @IBAction func lattice6Action(_ sender: UIButton) { 189 | scene?.removeAllChildren() 190 | scene?.lattice6Shader() 191 | currentScene = .lattice6 192 | } 193 | 194 | @IBAction func splashAction(_ sender: UIButton) { 195 | scene?.removeAllChildren() 196 | scene?.splashShader() 197 | currentScene = .splash 198 | } 199 | 200 | @IBAction func jqRaymarching(_ sender: UIButton) { 201 | scene?.removeAllChildren() 202 | scene?.tronRoadShader() 203 | currentScene = .tron_road 204 | } 205 | 206 | @IBAction func mandelbrotRecursive(_ sender: UIButton) { 207 | scene?.removeAllChildren() 208 | scene?.mandelbrotRecursive() 209 | currentScene = .mandelbrot_recursive 210 | } 211 | 212 | @IBAction func gtc14(_ sender: UIButton) { 213 | scene?.removeAllChildren() 214 | scene?.gtc14() 215 | currentScene = .gtc14 216 | } 217 | 218 | @IBAction func LCDPostEffect(_ sender: UIButton) { 219 | scene?.removeAllChildren() 220 | scene?.LCDPostEffect() 221 | currentScene = .ldc_post_effect 222 | } 223 | 224 | @IBAction func CRTRetroEffect(_ sender: UIButton) { 225 | scene?.removeAllChildren() 226 | scene?.CRTretroEffect() 227 | currentScene = .crt_retro_effect 228 | } 229 | } 230 | 231 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/View/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 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-app/View/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 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 51 | 67 | 83 | 99 | 115 | 125 | 135 | 145 | 155 | 165 | 175 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-appTests/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 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-appTests/spritekit_fragment_sandbox_ios_appTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // spritekit_fragment_sandbox_ios_appTests.swift 3 | // spritekit-fragment-sandbox-ios-appTests 4 | // 5 | // Created by Astemir Eleev on 25/02/2018. 6 | // Copyright © 2018 Astemir Eleev. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class spritekit_fragment_sandbox_ios_appTests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | // Put setup code here. This method is called before the invocation of each test method in the class. 16 | } 17 | 18 | override func tearDown() { 19 | // Put teardown code here. This method is called after the invocation of each test method in the class. 20 | super.tearDown() 21 | } 22 | 23 | func testExample() { 24 | // This is an example of a functional test case. 25 | // Use XCTAssert and related functions to verify your tests produce the correct results. 26 | } 27 | 28 | func testPerformanceExample() { 29 | // This is an example of a performance test case. 30 | self.measure { 31 | // Put the code you want to measure the time of here. 32 | } 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-appUITests/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 | -------------------------------------------------------------------------------- /spritekit-fragment-sandbox-ios-appUITests/spritekit_fragment_sandbox_ios_appUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // spritekit_fragment_sandbox_ios_appUITests.swift 3 | // spritekit-fragment-sandbox-ios-appUITests 4 | // 5 | // Created by Astemir Eleev on 25/02/2018. 6 | // Copyright © 2018 Astemir Eleev. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class spritekit_fragment_sandbox_ios_appUITests: 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 | --------------------------------------------------------------------------------