├── .clang-format ├── .gitignore ├── .swiftformat ├── Assets ├── Data │ └── Elements.json ├── Parameters │ ├── Colors.json │ ├── Controls.json │ ├── Line Material.json │ ├── Masses.json │ ├── Particles.json │ ├── Point Material.json │ ├── Post Processing.json │ ├── Sprite Material.json │ └── Video Material.json ├── Pipelines │ ├── Compute │ │ ├── Attraction.metal │ │ ├── Damping.metal │ │ └── Shaders.metal │ ├── Line │ │ └── Shaders.metal │ ├── Point │ │ └── Shaders.metal │ ├── Post │ │ └── Shaders.metal │ ├── Sprite │ │ └── Shaders.metal │ └── Types.metal └── Presets │ ├── Body │ └── Parameters │ │ ├── Colors.json │ │ ├── Controls.json │ │ ├── Line Material.json │ │ ├── Masses.json │ │ ├── Particles.json │ │ ├── Point Material.json │ │ ├── Sprite Material.json │ │ └── Video Material.json │ ├── Grid │ └── Parameters │ │ ├── Colors.json │ │ ├── Controls.json │ │ ├── Line Material.json │ │ ├── Masses.json │ │ ├── Particles.json │ │ ├── Point Material.json │ │ ├── Sprite Material.json │ │ └── Video Material.json │ ├── Orbit │ └── Parameters │ │ ├── Colors.json │ │ ├── Controls.json │ │ ├── Line Material.json │ │ ├── Masses.json │ │ ├── Particles.json │ │ ├── Point Material.json │ │ ├── Sprite Material.json │ │ └── Video Material.json │ └── Stream │ └── Parameters │ ├── Colors.json │ ├── Controls.json │ ├── Line Material.json │ ├── Masses.json │ ├── Particles.json │ ├── Point Material.json │ ├── Sprite Material.json │ └── Video Material.json ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── Podfile ├── Podfile.lock ├── README.md ├── SharingElements.entitlements ├── SharingElements.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── SharingElements.xcscheme ├── SharingElements.xcworkspace └── contents.xcworkspacedata ├── Source ├── Materials │ ├── LineMaterial.swift │ └── PointMaterial.swift ├── Meshes │ ├── DataMesh.swift │ ├── LineMesh.swift │ └── PointMesh.swift ├── Renderer │ ├── Renderer+Camera.swift │ ├── Renderer+Compute.swift │ ├── Renderer+Inspector.swift │ ├── Renderer+LiveCode.swift │ ├── Renderer+Observers.swift │ ├── Renderer+Save+Load.swift │ └── Renderer.swift ├── Utilities │ ├── Element.swift │ ├── Elements.swift │ └── Paths.swift └── macOS │ ├── AppDelegate.swift │ ├── Info.plist │ └── MainMenu.xib └── docs ├── 001_firstScenes ├── index.html └── sketch.js ├── 002_firstParticles ├── index.html └── sketch.js ├── 003_firstBodyTrack ├── index.html └── sketch.js ├── 004_firstProperElements ├── index.html └── sketch.js ├── 005_stressTestForM1 ├── index.html └── sketch.js ├── img ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── scene_01.png ├── scene_02.png ├── scene_03.png └── scene_04.png ├── index.html ├── js ├── dat.gui.js ├── matter-wrap.js ├── matter-wrap.min.js ├── matter.js ├── matter.min.js ├── ml5.js ├── ml5.min.js ├── p5.gui.js ├── p5.js ├── p5.min.js ├── p5.sound.js ├── p5.sound.min.js ├── quicksettings.js └── scenemanager.js └── site.webmanifest /.clang-format: -------------------------------------------------------------------------------- 1 | # This is intended to conform to the Cocoa coding style (http://cocoa.apple.com/Cocoa%20Coding%20Style.html) 2 | BasedOnStyle: WebKit 3 | SortIncludes: false 4 | BreakBeforeBraces: Attach 5 | Standard: Cpp11 6 | IndentCaseLabels: true 7 | DerivePointerAlignment: false 8 | PointerAlignment: Right 9 | AlignAfterOpenBracket: Align 10 | AlignOperands: true 11 | AlignTrailingComments: true 12 | AllowShortBlocksOnASingleLine: true 13 | AllowShortCaseLabelsOnASingleLine: true 14 | AllowShortIfStatementsOnASingleLine: true 15 | BreakBeforeBinaryOperators: None 16 | BreakConstructorInitializersBeforeComma: false 17 | NamespaceIndentation: All 18 | ColumnLimit: 100 19 | IndentWidth: 4 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | .idea/ 9 | 10 | ## Bundler 11 | vendor/ 12 | 13 | ## Various settings 14 | *.pbxuser 15 | !default.pbxuser 16 | *.mode1v3 17 | !default.mode1v3 18 | *.mode2v3 19 | !default.mode2v3 20 | *.perspectivev3 21 | !default.perspectivev3 22 | xcuserdata/ 23 | 24 | ## Other 25 | *.moved-aside 26 | *.xccheckout 27 | *.xcscmblueprint 28 | 29 | ## Obj-C/Swift specific 30 | *.hmap 31 | *.ipa 32 | *.dSYM.zip 33 | *.dSYM 34 | .githooks/ 35 | 36 | # CocoaPods 37 | # 38 | # We recommend against adding the Pods directory to your .gitignore. However 39 | # you should judge for yourself, the pros and cons are mentioned at: 40 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 41 | # 42 | Pods/ 43 | 44 | # Carthage 45 | # 46 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 47 | # Carthage/Checkouts 48 | 49 | Carthage/Build 50 | 51 | # fastlane 52 | # 53 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 54 | # screenshots whenever they are needed. 55 | # For more information about the recommended setup visit: 56 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 57 | 58 | fastlane/report.xml 59 | fastlane/Preview.html 60 | fastlane/screenshots/**/*.png 61 | fastlane/test_output 62 | 63 | # Code Injection 64 | # 65 | # After new code Injection tools there's a generated folder /iOSInjectionProject 66 | # https://github.com/johnno1962/injectionforxcode 67 | 68 | iOSInjectionProject/ 69 | 70 | # Compiled Object files 71 | *.slo 72 | *.lo 73 | *.o 74 | *.obj 75 | 76 | # Precompiled Headers 77 | *.gch 78 | *.pch 79 | 80 | # Compiled Dynamic libraries 81 | *.so 82 | *.dylib 83 | *.dll 84 | 85 | # Fortran module files 86 | *.mod 87 | 88 | # Compiled Static libraries 89 | *.lai 90 | *.la 91 | *.a 92 | *.lib 93 | 94 | # Executables 95 | *.exe 96 | *.out 97 | *.app 98 | 99 | # Xcode 100 | .DS_Store 101 | build/ 102 | *.pbxuser 103 | !default.pbxuser 104 | *.mode1v3 105 | !default.mode1v3 106 | *.mode2v3 107 | !default.mode2v3 108 | *.perspectivev3 109 | !default.perspectivev3 110 | # *.xcworkspace 111 | !default.xcworkspace 112 | xcuserdata 113 | profile 114 | *.moved-aside 115 | DerivedData 116 | .idea/ 117 | # Pods - for those of you who use CocoaPods 118 | Pods 119 | 120 | assets/Models 121 | assets/Video/* 122 | assets/Renders/* 123 | assets/Models/* 124 | *.dropbox 125 | 126 | node_modules/* 127 | package-lock.json 128 | 129 | .DS_Store 130 | applet 131 | application.linux-arm64 132 | application.linux-armv6hf 133 | application.linux32 134 | application.linux64 135 | application.windows32 136 | application.windows64 137 | application.macosx 138 | out 139 | Podfile.lock 140 | BodyElements.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist 141 | Podfile.lock 142 | -------------------------------------------------------------------------------- /.swiftformat: -------------------------------------------------------------------------------- 1 | --disable blankLinesAtEndOfScope,blankLinesAtStartOfScope -------------------------------------------------------------------------------- /Assets/Data/Elements.json: -------------------------------------------------------------------------------- 1 | { 2 | "elements": [{ 3 | "name":"Oxygen", 4 | "symbol":"O", 5 | "mass":0.65, 6 | "atoms":24 7 | }, 8 | { 9 | "name":"Carbon", 10 | "symbol":"C", 11 | "mass":0.18, 12 | "atoms":12 13 | }, 14 | { 15 | "name":"Hydrogen", 16 | "symbol":"H", 17 | "mass":0.10, 18 | "atoms":62 19 | }, 20 | { 21 | "name":"Nitrogen", 22 | "symbol":"N", 23 | "mass":0.03, 24 | "atoms":1.1 25 | }, 26 | { 27 | "name":"Calcium", 28 | "symbol":"Ca", 29 | "mass":0.01, 30 | "atoms":0.22 31 | }, 32 | {"name":"Phosphorus", 33 | "symbol":"P", 34 | "mass":0.01, 35 | "atoms":0.22 36 | }, 37 | {"name":"Potassium", 38 | "symbol":"K", 39 | "mass":0.00200000, 40 | "atoms":0.033 41 | }, 42 | {"name":"Sulfur", 43 | "symbol":"S", 44 | "mass":0.00250000, 45 | "atoms":0.038 46 | }, 47 | {"name":"Sodium", 48 | "symbol":"Na", 49 | "mass":0.00150000, 50 | "atoms":0.037 51 | }, 52 | {"name":"Chlorine", 53 | "symbol":"Cl", 54 | "mass":0.00150000, 55 | "atoms":0.024 56 | }, 57 | {"name":"Magnesium", 58 | "symbol":"Mg", 59 | "mass":0.00050000, 60 | "atoms":0.007 61 | }, 62 | {"name":"Iron", 63 | "symbol":"Fe", 64 | "mass":0.00006000, 65 | "atoms":0.00067 66 | }, 67 | {"name":"Fluorine", 68 | "symbol":"F", 69 | "mass":0.00003700, 70 | "atoms":0.0012 71 | }, 72 | {"name":"Zinc", 73 | "symbol":"Zn", 74 | "mass":0.00003200, 75 | "atoms":0.00031 76 | }, 77 | {"name":"Silicon", 78 | "symbol":"Si", 79 | "mass":0.00002000, 80 | "atoms":0.0058 81 | }, 82 | {"name":"Gallium", 83 | "symbol":"Ga", 84 | "mass":0.00000490, 85 | "atoms":0.0007 86 | }, 87 | {"name":"Rubidium", 88 | "symbol":"Rb", 89 | "mass":0.00000460, 90 | "atoms":0.000033 91 | }, 92 | {"name":"Strontium", 93 | "symbol":"Sr", 94 | "mass":0.00000460, 95 | "atoms":0.000033 96 | }, 97 | {"name":"Bromine", 98 | "symbol":"Br", 99 | "mass":0.00000290, 100 | "atoms":0.00003 101 | }, 102 | {"name":"Lead", 103 | "symbol":"Pb", 104 | "mass":0.00000170, 105 | "atoms":0.0000045 106 | }, 107 | {"name":"Copper", 108 | "symbol":"Cu", 109 | "mass":0.00000100, 110 | "atoms":0.0000104 111 | }] 112 | } 113 | -------------------------------------------------------------------------------- /Assets/Parameters/Controls.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Background", 9 | "w" : 1, 10 | "x" : 0, 11 | "maxY" : 1, 12 | "y" : 0, 13 | "minY" : 0, 14 | "z" : 0, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "bool", 24 | "base" : { 25 | "controlType" : "toggle", 26 | "label" : "Post Process", 27 | "value" : false 28 | } 29 | }, 30 | { 31 | "type" : "string", 32 | "base" : { 33 | "label" : "Blending", 34 | "value" : "Alpha", 35 | "options" : [ 36 | "Additive", 37 | "Alpha", 38 | "Subtract" 39 | ], 40 | "controlType" : "dropdown" 41 | } 42 | }, 43 | { 44 | "type" : "bool", 45 | "base" : { 46 | "controlType" : "toggle", 47 | "label" : "Fullscreen", 48 | "value" : false 49 | } 50 | }, 51 | { 52 | "type" : "string", 53 | "base" : { 54 | "label" : "Video Input", 55 | "value" : "BRIO 4K Stream Edition", 56 | "options" : [ 57 | "BRIO 4K Stream Edition" 58 | ], 59 | "controlType" : "dropdown" 60 | } 61 | }, 62 | { 63 | "type" : "bool", 64 | "base" : { 65 | "controlType" : "toggle", 66 | "label" : "Show Video", 67 | "value" : false 68 | } 69 | }, 70 | { 71 | "type" : "bool", 72 | "base" : { 73 | "controlType" : "toggle", 74 | "label" : "Flip Video", 75 | "value" : true 76 | } 77 | }, 78 | { 79 | "type" : "bool", 80 | "base" : { 81 | "controlType" : "toggle", 82 | "label" : "Update Pose", 83 | "value" : true 84 | } 85 | }, 86 | { 87 | "type" : "bool", 88 | "base" : { 89 | "controlType" : "toggle", 90 | "label" : "Fake Pose", 91 | "value" : false 92 | } 93 | }, 94 | { 95 | "type" : "bool", 96 | "base" : { 97 | "controlType" : "toggle", 98 | "label" : "Show Points", 99 | "value" : false 100 | } 101 | }, 102 | { 103 | "type" : "bool", 104 | "base" : { 105 | "controlType" : "toggle", 106 | "label" : "Show Lines", 107 | "value" : false 108 | } 109 | }, 110 | { 111 | "type" : "string", 112 | "base" : { 113 | "label" : "Particle Count", 114 | "value" : "1024 x 1024", 115 | "options" : [ 116 | "256 x 256", 117 | "512 x 512", 118 | "1024 x 1024" 119 | ], 120 | "controlType" : "dropdown" 121 | } 122 | }, 123 | { 124 | "type" : "bool", 125 | "base" : { 126 | "controlType" : "button", 127 | "label" : "Reset Particles", 128 | "value" : false 129 | } 130 | }, 131 | { 132 | "type" : "bool", 133 | "base" : { 134 | "controlType" : "toggle", 135 | "label" : "Update Particles", 136 | "value" : true 137 | } 138 | }, 139 | { 140 | "type" : "bool", 141 | "base" : { 142 | "controlType" : "toggle", 143 | "label" : "Show Particles", 144 | "value" : true 145 | } 146 | }, 147 | { 148 | "type" : "float2", 149 | "base" : { 150 | "maxX" : 1, 151 | "controlType" : "inputfield", 152 | "x" : 0, 153 | "y" : 0, 154 | "maxY" : 1, 155 | "minX" : 0, 156 | "label" : "Camera Offset", 157 | "minY" : 0 158 | } 159 | }, 160 | { 161 | "type" : "float", 162 | "base" : { 163 | "label" : "Hip Extension", 164 | "value" : 5.648226261138916, 165 | "min" : 0, 166 | "controlType" : "slider", 167 | "max" : 500 168 | } 169 | } 170 | ] 171 | } -------------------------------------------------------------------------------- /Assets/Parameters/Line Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 1, 11 | "maxY" : 1, 12 | "y" : 0, 13 | "minY" : 0, 14 | "z" : 0.61564642190933228, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float4", 24 | "base" : { 25 | "maxZ" : 1, 26 | "minZ" : 0, 27 | "label" : "Resolution", 28 | "w" : 1, 29 | "x" : 1920, 30 | "maxY" : 1, 31 | "y" : 1080, 32 | "minY" : 0, 33 | "z" : 1.7777777910232544, 34 | "maxX" : 1, 35 | "controlType" : "none", 36 | "minX" : 0, 37 | "maxW" : 1, 38 | "minW" : 0 39 | } 40 | }, 41 | { 42 | "type" : "float3", 43 | "base" : { 44 | "controlType" : "none", 45 | "x" : 0, 46 | "maxX" : 1, 47 | "y" : 0, 48 | "maxY" : 1, 49 | "minX" : 0, 50 | "z" : 1000, 51 | "minZ" : 0, 52 | "label" : "Camera Position", 53 | "minY" : 0, 54 | "maxZ" : 1 55 | } 56 | }, 57 | { 58 | "type" : "float3", 59 | "base" : { 60 | "controlType" : "none", 61 | "x" : 0.73637962341308594, 62 | "maxX" : 1, 63 | "y" : 0, 64 | "maxY" : 1, 65 | "minX" : 0, 66 | "z" : 0, 67 | "minZ" : 0, 68 | "label" : "Camera Right", 69 | "minY" : 0, 70 | "maxZ" : 1 71 | } 72 | }, 73 | { 74 | "type" : "float3", 75 | "base" : { 76 | "controlType" : "none", 77 | "x" : 0, 78 | "maxX" : 1, 79 | "y" : 0.41421353816986084, 80 | "maxY" : 1, 81 | "minX" : 0, 82 | "z" : 0, 83 | "minZ" : 0, 84 | "label" : "Camera Up", 85 | "minY" : 0, 86 | "maxZ" : 1 87 | } 88 | }, 89 | { 90 | "type" : "float3", 91 | "base" : { 92 | "controlType" : "none", 93 | "x" : 0, 94 | "maxX" : 1, 95 | "y" : 0, 96 | "maxY" : 1, 97 | "minX" : 0, 98 | "z" : -1, 99 | "minZ" : 0, 100 | "label" : "Camera Forward", 101 | "minY" : 0, 102 | "maxZ" : 1 103 | } 104 | }, 105 | { 106 | "type" : "float2", 107 | "base" : { 108 | "maxX" : 1, 109 | "controlType" : "none", 110 | "x" : 0.0099999997764825821, 111 | "y" : 4000, 112 | "maxY" : 1, 113 | "minX" : 0, 114 | "label" : "Near Far", 115 | "minY" : 0 116 | } 117 | }, 118 | { 119 | "type" : "float2", 120 | "base" : { 121 | "maxX" : 1, 122 | "controlType" : "none", 123 | "x" : 1.0000025033950806, 124 | "y" : 0.010000024922192097, 125 | "maxY" : 1, 126 | "minX" : 0, 127 | "label" : "Camera Depth", 128 | "minY" : 0 129 | } 130 | }, 131 | { 132 | "type" : "float", 133 | "base" : { 134 | "label" : "Line Width", 135 | "value" : 8, 136 | "min" : 0, 137 | "controlType" : "slider", 138 | "max" : 20 139 | } 140 | } 141 | ] 142 | } -------------------------------------------------------------------------------- /Assets/Parameters/Masses.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float", 5 | "base" : { 6 | "label" : "Oxygen Mass", 7 | "value" : 0.64999997615814209, 8 | "min" : 0, 9 | "controlType" : "inputfield", 10 | "max" : 1 11 | } 12 | }, 13 | { 14 | "type" : "float", 15 | "base" : { 16 | "label" : "Carbon Mass", 17 | "value" : 0.18500000238418579, 18 | "min" : 0, 19 | "controlType" : "inputfield", 20 | "max" : 1 21 | } 22 | }, 23 | { 24 | "type" : "float", 25 | "base" : { 26 | "label" : "Hydrogen Mass", 27 | "value" : 0.094999998807907104, 28 | "min" : 0, 29 | "controlType" : "inputfield", 30 | "max" : 1 31 | } 32 | }, 33 | { 34 | "type" : "float", 35 | "base" : { 36 | "label" : "Nitrogen Mass", 37 | "value" : 0.032000001519918442, 38 | "min" : 0, 39 | "controlType" : "inputfield", 40 | "max" : 1 41 | } 42 | }, 43 | { 44 | "type" : "float", 45 | "base" : { 46 | "label" : "Calcium Mass", 47 | "value" : 0.014999999664723873, 48 | "min" : 0, 49 | "controlType" : "inputfield", 50 | "max" : 1 51 | } 52 | }, 53 | { 54 | "type" : "float", 55 | "base" : { 56 | "label" : "Phosphorus Mass", 57 | "value" : 0.0099999997764825821, 58 | "min" : 0, 59 | "controlType" : "inputfield", 60 | "max" : 1 61 | } 62 | }, 63 | { 64 | "type" : "float", 65 | "base" : { 66 | "label" : "Potassium Mass", 67 | "value" : 0.0040000001899898052, 68 | "min" : 0, 69 | "controlType" : "inputfield", 70 | "max" : 1 71 | } 72 | }, 73 | { 74 | "type" : "float", 75 | "base" : { 76 | "label" : "Sulfur Mass", 77 | "value" : 0.0030000000260770321, 78 | "min" : 0, 79 | "controlType" : "inputfield", 80 | "max" : 1 81 | } 82 | }, 83 | { 84 | "type" : "float", 85 | "base" : { 86 | "label" : "Sodium Mass", 87 | "value" : 0.0020000000949949026, 88 | "min" : 0, 89 | "controlType" : "inputfield", 90 | "max" : 1 91 | } 92 | }, 93 | { 94 | "type" : "float", 95 | "base" : { 96 | "label" : "Chlorine Mass", 97 | "value" : 0.0020000000949949026, 98 | "min" : 0, 99 | "controlType" : "inputfield", 100 | "max" : 1 101 | } 102 | }, 103 | { 104 | "type" : "float", 105 | "base" : { 106 | "label" : "Magnesium Mass", 107 | "value" : 0.0010000000474974513, 108 | "min" : 0, 109 | "controlType" : "inputfield", 110 | "max" : 1 111 | } 112 | }, 113 | { 114 | "type" : "float", 115 | "base" : { 116 | "label" : "Iron Mass", 117 | "value" : 5.9999996437909431e-07, 118 | "min" : 0, 119 | "controlType" : "inputfield", 120 | "max" : 1 121 | } 122 | }, 123 | { 124 | "type" : "float", 125 | "base" : { 126 | "label" : "Fluorine Mass", 127 | "value" : 3.700000092976552e-07, 128 | "min" : 0, 129 | "controlType" : "inputfield", 130 | "max" : 1 131 | } 132 | }, 133 | { 134 | "type" : "float", 135 | "base" : { 136 | "label" : "Zinc Mass", 137 | "value" : 3.1999999805520929e-07, 138 | "min" : 0, 139 | "controlType" : "inputfield", 140 | "max" : 1 141 | } 142 | }, 143 | { 144 | "type" : "float", 145 | "base" : { 146 | "label" : "Silicon Mass", 147 | "value" : 1.9999998812636477e-07, 148 | "min" : 0, 149 | "controlType" : "inputfield", 150 | "max" : 1 151 | } 152 | }, 153 | { 154 | "type" : "float", 155 | "base" : { 156 | "label" : "Gallium Mass", 157 | "value" : 4.90000005015645e-08, 158 | "min" : 0, 159 | "controlType" : "inputfield", 160 | "max" : 1 161 | } 162 | }, 163 | { 164 | "type" : "float", 165 | "base" : { 166 | "label" : "Rubidium Mass", 167 | "value" : 4.6000000253343387e-08, 168 | "min" : 0, 169 | "controlType" : "inputfield", 170 | "max" : 1 171 | } 172 | }, 173 | { 174 | "type" : "float", 175 | "base" : { 176 | "label" : "Strontium Mass", 177 | "value" : 4.6000000253343387e-08, 178 | "min" : 0, 179 | "controlType" : "inputfield", 180 | "max" : 1 181 | } 182 | }, 183 | { 184 | "type" : "float", 185 | "base" : { 186 | "label" : "Bromine Mass", 187 | "value" : 2.900000062311392e-08, 188 | "min" : 0, 189 | "controlType" : "inputfield", 190 | "max" : 1 191 | } 192 | }, 193 | { 194 | "type" : "float", 195 | "base" : { 196 | "label" : "Lead Mass", 197 | "value" : 1.6999999630229468e-08, 198 | "min" : 0, 199 | "controlType" : "inputfield", 200 | "max" : 1 201 | } 202 | }, 203 | { 204 | "type" : "float", 205 | "base" : { 206 | "label" : "Copper Mass", 207 | "value" : 7.2000000272964826e-07, 208 | "min" : 0, 209 | "controlType" : "inputfield", 210 | "max" : 1 211 | } 212 | } 213 | ] 214 | } -------------------------------------------------------------------------------- /Assets/Parameters/Particles.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "int", 5 | "base" : { 6 | "label" : "Count", 7 | "value" : 1048576, 8 | "min" : 0, 9 | "controlType" : "none", 10 | "max" : 100 11 | } 12 | }, 13 | { 14 | "type" : "float", 15 | "base" : { 16 | "label" : "Time", 17 | "value" : 263434.59375, 18 | "min" : 0, 19 | "controlType" : "none", 20 | "max" : 1 21 | } 22 | }, 23 | { 24 | "type" : "float", 25 | "base" : { 26 | "label" : "Point Size", 27 | "value" : 3.0033783912658691, 28 | "min" : 0, 29 | "controlType" : "slider", 30 | "max" : 32 31 | } 32 | }, 33 | { 34 | "type" : "float2", 35 | "base" : { 36 | "maxX" : 1, 37 | "controlType" : "none", 38 | "x" : 1539.0621337890625, 39 | "y" : 828.42706298828125, 40 | "maxY" : 1, 41 | "minX" : 0, 42 | "label" : "Grid Size", 43 | "minY" : 0 44 | } 45 | }, 46 | { 47 | "type" : "float", 48 | "base" : { 49 | "label" : "Curl Scale", 50 | "value" : 0.0020560596603900194, 51 | "min" : 0, 52 | "controlType" : "slider", 53 | "max" : 0.05000000074505806 54 | } 55 | }, 56 | { 57 | "type" : "float", 58 | "base" : { 59 | "label" : "Curl Speed", 60 | "value" : 0.039977476000785828, 61 | "min" : 0, 62 | "controlType" : "slider", 63 | "max" : 1 64 | } 65 | }, 66 | { 67 | "type" : "float", 68 | "base" : { 69 | "label" : "Curl", 70 | "value" : 0.39963400363922119, 71 | "min" : 0, 72 | "controlType" : "slider", 73 | "max" : 1 74 | } 75 | }, 76 | { 77 | "type" : "float", 78 | "base" : { 79 | "label" : "Body", 80 | "value" : 1, 81 | "min" : 0, 82 | "controlType" : "slider", 83 | "max" : 1 84 | } 85 | }, 86 | { 87 | "type" : "float", 88 | "base" : { 89 | "label" : "Stream", 90 | "value" : 0.89771604537963867, 91 | "min" : 0, 92 | "controlType" : "slider", 93 | "max" : 1 94 | } 95 | }, 96 | { 97 | "type" : "float", 98 | "base" : { 99 | "label" : "Damping", 100 | "value" : 0.40299481153488159, 101 | "min" : 0, 102 | "controlType" : "slider", 103 | "max" : 1 104 | } 105 | }, 106 | { 107 | "type" : "float", 108 | "base" : { 109 | "label" : "Dt", 110 | "value" : 1, 111 | "min" : 0, 112 | "controlType" : "slider", 113 | "max" : 1 114 | } 115 | }, 116 | { 117 | "type" : "float", 118 | "base" : { 119 | "label" : "Dwell Time", 120 | "value" : 20, 121 | "min" : 0, 122 | "controlType" : "inputfield", 123 | "max" : 1 124 | } 125 | }, 126 | { 127 | "type" : "float", 128 | "base" : { 129 | "label" : "Delta Time", 130 | "value" : 0.033730983734130859, 131 | "min" : 0, 132 | "controlType" : "none", 133 | "max" : 1 134 | } 135 | }, 136 | { 137 | "type" : "int", 138 | "base" : { 139 | "label" : "Points", 140 | "value" : 9, 141 | "min" : 0, 142 | "controlType" : "none", 143 | "max" : 100 144 | } 145 | }, 146 | { 147 | "type" : "int", 148 | "base" : { 149 | "label" : "Lines", 150 | "value" : 4, 151 | "min" : 0, 152 | "controlType" : "none", 153 | "max" : 100 154 | } 155 | } 156 | ] 157 | } -------------------------------------------------------------------------------- /Assets/Parameters/Point Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 0, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 0, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float", 24 | "base" : { 25 | "label" : "Point Size", 26 | "value" : 16, 27 | "min" : 0, 28 | "controlType" : "slider", 29 | "max" : 16 30 | } 31 | }, 32 | { 33 | "type" : "float", 34 | "base" : { 35 | "label" : "Aspect", 36 | "value" : 0, 37 | "min" : 0, 38 | "controlType" : "none", 39 | "max" : 1 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /Assets/Parameters/Post Processing.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float2", 5 | "base" : { 6 | "maxX" : 1, 7 | "controlType" : "none", 8 | "x" : 1189, 9 | "y" : 640, 10 | "maxY" : 1, 11 | "minX" : 0, 12 | "label" : "Resolution", 13 | "minY" : 0 14 | } 15 | }, 16 | { 17 | "type" : "float", 18 | "base" : { 19 | "label" : "Time", 20 | "value" : 263434.59375, 21 | "min" : 0, 22 | "controlType" : "none", 23 | "max" : 1 24 | } 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /Assets/Parameters/Sprite Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 0.9999045729637146, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 0.99988085031509399, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float", 24 | "base" : { 25 | "label" : "Sigma", 26 | "value" : 0.32499998807907104, 27 | "min" : 0, 28 | "controlType" : "slider", 29 | "max" : 1 30 | } 31 | }, 32 | { 33 | "type" : "float", 34 | "base" : { 35 | "label" : "Power", 36 | "value" : 0.32499998807907104, 37 | "min" : 0, 38 | "controlType" : "slider", 39 | "max" : 1 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /Assets/Parameters/Video Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 1, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 1, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /Assets/Pipelines/Compute/Attraction.metal: -------------------------------------------------------------------------------- 1 | float3 attractionForce(float3 pos, float3 center) { 2 | return center - pos; 3 | } 4 | 5 | float3 sphericalForce(float3 pos, float3 center, float radius) { 6 | float3 pointOnSphere = radius * normalize(pos); 7 | return attractionForce(pos, pointOnSphere); 8 | } 9 | -------------------------------------------------------------------------------- /Assets/Pipelines/Compute/Damping.metal: -------------------------------------------------------------------------------- 1 | float3 dampingForce(float3 velocity, float damping) { 2 | return -damping * velocity; 3 | } 4 | -------------------------------------------------------------------------------- /Assets/Pipelines/Line/Shaders.metal: -------------------------------------------------------------------------------- 1 | #include "Library/Shapes.metal" 2 | #include "Library/Pi.metal" 3 | #include "Library/Csg.metal" 4 | 5 | #define MAX_STEPS 64 6 | #define MIN_DIST 0.0 7 | #define MAX_DIST 5000.0 8 | #define SURF_DIST 0.001 9 | #define EPSILON 0.001 10 | 11 | typedef struct { 12 | float4 color; // color 13 | float4 resolution; 14 | float3 cameraPosition; 15 | float3 cameraRight; 16 | float3 cameraUp; 17 | float3 cameraForward; 18 | float2 nearFar; 19 | float2 cameraDepth; 20 | float lineWidth; // slider,0,20,5 21 | } LineUniforms; 22 | 23 | typedef struct { 24 | float4 position [[position]]; 25 | float4 startPosition [[flat]]; 26 | float4 endPosition [[flat]]; 27 | float lineWidth [[flat]]; 28 | } CustomVertexData; 29 | 30 | float scene(float3 p, float3 sp, float3 ep, float lw) { 31 | return Line(p, sp, ep) - lw; 32 | } 33 | 34 | float3 getNormal(float3 p, float3 sp, float3 ep, float lw) { 35 | const float d = scene(p, sp, ep, lw); 36 | const float3 e = float3(EPSILON, 0.0, 0.0); 37 | const float3 gradient = d - float3(scene(p - e.xyy, sp, ep, lw), scene(p - e.yxy, sp, ep, lw), scene(p - e.yyx, sp, ep, lw)); 38 | return normalize(gradient); 39 | } 40 | 41 | float render(float3 ro, float3 rd, float3 sp, float3 ep, float lw) { 42 | float d = 0.0; 43 | for (int i = 0; i < MAX_STEPS; i++) { 44 | const float3 p = ro + rd * d; 45 | const float dist = scene(p, sp, ep, lw); 46 | d += dist; 47 | if (dist > MAX_DIST || abs(dist) < SURF_DIST) { 48 | break; 49 | } 50 | } 51 | return d; 52 | } 53 | 54 | vertex CustomVertexData lineVertex( 55 | uint id [[instance_id]], 56 | Vertex in [[stage_in]], 57 | constant VertexUniforms &vertexUniforms [[buffer(VertexBufferVertexUniforms)]], 58 | constant LineUniforms &uniforms [[buffer(VertexBufferMaterialUniforms)]], 59 | constant float3 *points [[buffer(VertexBufferCustom0)]]) { 60 | CustomVertexData out; 61 | 62 | const int index = (int)id * 2; 63 | const float2 uv = in.uv.xy; 64 | const float aspect = uniforms.resolution.z; 65 | 66 | const float4x4 mvp = vertexUniforms.modelViewProjectionMatrix; 67 | 68 | const float4 _p0 = float4(points[index], 1.0); 69 | const float4 _p1 = float4(points[index + 1], 1.0); 70 | 71 | const float4 p0 = mvp * _p0; 72 | const float4 p1 = mvp * _p1; 73 | 74 | float4 position = mix(p0, p1, uv.x); 75 | 76 | const float2 p0Screen = p0.xy; 77 | const float2 p1Screen = p1.xy; 78 | 79 | float2 dir = normalize(p1Screen - p0Screen); 80 | dir.y /= aspect; 81 | const float2 dirInv = float2(-dir.y, dir.x); 82 | 83 | const float height = uniforms.lineWidth; 84 | 85 | float4 offset = float4(height * mix(dirInv, -dirInv, uv.y), 0.0, 0.0); 86 | offset += float4(height * mix(-dir, dir, uv.x) + height * mix(dirInv, -dirInv, uv.y), 0.0, 0.0); 87 | 88 | out.position = position + offset; 89 | out.startPosition = vertexUniforms.modelMatrix * _p0; 90 | out.endPosition = vertexUniforms.modelMatrix * _p1; 91 | out.lineWidth = height; 92 | return out; 93 | } 94 | 95 | struct FragOut { 96 | float4 color [[color(0)]]; 97 | float depth [[depth(any)]]; 98 | }; 99 | 100 | fragment FragOut lineFragment(CustomVertexData in [[stage_in]], 101 | constant LineUniforms &uniforms [[buffer(FragmentBufferMaterialUniforms)]], 102 | constant float4x4 *view [[buffer(FragmentBufferCustom0)]]) { 103 | const float2 cameraDepth = uniforms.cameraDepth; 104 | const float a = cameraDepth.x; 105 | const float b = cameraDepth.y; 106 | 107 | const float lw = in.lineWidth * 0.25; 108 | const float4 color = uniforms.color; 109 | float2 uv = 2.0 * (in.position.xy / uniforms.resolution.xy) - 1.0; 110 | uv.y *= -1.0; 111 | 112 | const float3 ro = uniforms.cameraPosition; 113 | const float3 rd = normalize(uv.x * uniforms.cameraRight + uv.y * uniforms.cameraUp + uniforms.cameraForward); 114 | 115 | const float3 startPosition = in.startPosition.xyz; 116 | const float3 endPosition = in.endPosition.xyz; 117 | 118 | const float d = render(ro, rd, startPosition, endPosition, lw); 119 | const float3 p = ro + rd * d; 120 | 121 | if (d >= MAX_DIST) { 122 | discard_fragment(); 123 | } 124 | 125 | FragOut out; 126 | 127 | constant float4x4 &viewMatrix = (*view); 128 | const float4 ep = viewMatrix * float4(p, 1.0); 129 | out.depth = 1.0 - (a + b / ep.z); 130 | out.color = color; 131 | return out; 132 | } 133 | -------------------------------------------------------------------------------- /Assets/Pipelines/Point/Shaders.metal: -------------------------------------------------------------------------------- 1 | #include "Library/Shapes.metal" 2 | 3 | typedef struct { 4 | float4 color; //color 5 | float pointSize; //slider,0,16,8 6 | float aspect; 7 | } PointUniforms; 8 | 9 | typedef struct { 10 | float4 position [[position]]; 11 | float pointSize [[point_size]]; 12 | } CustomVertexData; 13 | 14 | vertex CustomVertexData pointVertex( uint id [[instance_id]], 15 | Vertex in [[stage_in]], 16 | constant VertexUniforms &vertexUniforms [[buffer( VertexBufferVertexUniforms )]], 17 | constant PointUniforms &point [[buffer( VertexBufferMaterialUniforms )]], 18 | constant float3 *vertices [[buffer( VertexBufferCustom0 )]] ) 19 | { 20 | CustomVertexData out; 21 | const int index = (int)id; 22 | const float3 v0 = vertices[index]; 23 | out.position = vertexUniforms.modelViewProjectionMatrix * float4( v0, 1.0 ); 24 | out.pointSize = point.pointSize; 25 | return out; 26 | } 27 | 28 | fragment float4 pointFragment( CustomVertexData in [[stage_in]], 29 | const float2 puv [[point_coord]], 30 | constant PointUniforms &uniforms [[buffer( FragmentBufferMaterialUniforms )]] ) 31 | { 32 | const float2 uv = 2.0 * puv - 1.0; 33 | const float softness = 0.175; 34 | float result = Circle( uv, 1.0 - softness ); 35 | result = 1.0 - smoothstep( 0.0, softness, result ); 36 | if( result <= 0.0 ) { 37 | discard_fragment(); 38 | } 39 | const float4 color = uniforms.color; 40 | return float4( color.rgb, color.a * result ); 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Pipelines/Post/Shaders.metal: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | float2 resolution; 3 | float time; 4 | } PostUniforms; 5 | 6 | fragment float4 postFragment(VertexData in [[stage_in]], 7 | constant PostUniforms &uniforms [[buffer(FragmentBufferMaterialUniforms)]], 8 | texture2d renderTex [[texture(FragmentTextureCustom0)]]) { 9 | constexpr sampler s = sampler(min_filter::linear, mag_filter::linear); 10 | const float4 sample = renderTex.sample(s, in.uv); 11 | return sample; 12 | } 13 | -------------------------------------------------------------------------------- /Assets/Pipelines/Sprite/Shaders.metal: -------------------------------------------------------------------------------- 1 | #include "../Types.metal" 2 | #include "Library/Gaussian.metal" 3 | 4 | typedef struct { 5 | float4 color; //color 6 | float sigma; //slider 7 | float power; //slider 8 | } SpriteUniforms; 9 | 10 | typedef struct { 11 | float4 position [[position]]; 12 | float4 color [[flat]]; 13 | float pointSize [[point_size]]; 14 | } CustomVertexData; 15 | 16 | vertex CustomVertexData spriteVertex(uint instanceID [[instance_id]], 17 | Vertex in [[stage_in]], 18 | constant VertexUniforms &vertexUniforms [[buffer(VertexBufferVertexUniforms)]], 19 | constant SpriteUniforms &uniforms [[buffer(VertexBufferMaterialUniforms)]], 20 | const device Particle *particles [[buffer(VertexBufferCustom0)]]) { 21 | Particle particle = particles[instanceID]; 22 | CustomVertexData out; 23 | out.position = vertexUniforms.modelViewProjectionMatrix * (in.position + float4(particle.position.xyz, 0.0)); 24 | out.color = particle.color; 25 | out.pointSize = particle.position.w; 26 | return out; 27 | } 28 | 29 | fragment float4 spriteFragment(CustomVertexData in [[stage_in]], 30 | const float2 puv [[point_coord]], 31 | constant SpriteUniforms &uniforms [[buffer(FragmentBufferMaterialUniforms)]]) { 32 | const float2 uv = 2.0 * puv - 1.0; 33 | const float dist = length(uv); 34 | const float result = gaussian(dist, uniforms.sigma, uniforms.power); 35 | return uniforms.color * float4(in.color.rgb, in.color.a * result); 36 | } 37 | -------------------------------------------------------------------------------- /Assets/Pipelines/Types.metal: -------------------------------------------------------------------------------- 1 | typedef struct { 2 | float4 color; //color 3 | float4 position; // px, py, pz, point size 4 | float4 velocity; // vx, vy, vz, mass 5 | float life; 6 | int elementIndex; 7 | } Particle; 8 | -------------------------------------------------------------------------------- /Assets/Presets/Body/Parameters/Colors.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Oxygen", 9 | "w" : 1, 10 | "x" : 0, 11 | "maxY" : 1, 12 | "y" : 0.66270703077316284, 13 | "minY" : 0, 14 | "z" : 0.94407570362091064, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float4", 24 | "base" : { 25 | "maxZ" : 1, 26 | "minZ" : 0, 27 | "label" : "Carbon", 28 | "w" : 1, 29 | "x" : 1, 30 | "maxY" : 1, 31 | "y" : 0, 32 | "minY" : 0, 33 | "z" : 0.77667254209518433, 34 | "maxX" : 1, 35 | "controlType" : "colorpicker", 36 | "minX" : 0, 37 | "maxW" : 1, 38 | "minW" : 0 39 | } 40 | }, 41 | { 42 | "type" : "float4", 43 | "base" : { 44 | "maxZ" : 1, 45 | "minZ" : 0, 46 | "label" : "Hydrogen", 47 | "w" : 1, 48 | "x" : 1, 49 | "maxY" : 1, 50 | "y" : 0.16896530985832214, 51 | "minY" : 0, 52 | "z" : 0, 53 | "maxX" : 1, 54 | "controlType" : "colorpicker", 55 | "minX" : 0, 56 | "maxW" : 1, 57 | "minW" : 0 58 | } 59 | }, 60 | { 61 | "type" : "float4", 62 | "base" : { 63 | "maxZ" : 1, 64 | "minZ" : 0, 65 | "label" : "Nitrogen", 66 | "w" : 1, 67 | "x" : 0.55634254217147827, 68 | "maxY" : 1, 69 | "y" : 0.97934550046920776, 70 | "minY" : 0, 71 | "z" : 0, 72 | "maxX" : 1, 73 | "controlType" : "colorpicker", 74 | "minX" : 0, 75 | "maxW" : 1, 76 | "minW" : 0 77 | } 78 | }, 79 | { 80 | "type" : "float4", 81 | "base" : { 82 | "maxZ" : 1, 83 | "minZ" : 0, 84 | "label" : "Calcium", 85 | "w" : 1, 86 | "x" : 0, 87 | "maxY" : 1, 88 | "y" : 0.97680455446243286, 89 | "minY" : 0, 90 | "z" : 0, 91 | "maxX" : 1, 92 | "controlType" : "colorpicker", 93 | "minX" : 0, 94 | "maxW" : 1, 95 | "minW" : 0 96 | } 97 | }, 98 | { 99 | "type" : "float4", 100 | "base" : { 101 | "maxZ" : 1, 102 | "minZ" : 0, 103 | "label" : "Phosphorus", 104 | "w" : 1, 105 | "x" : 0, 106 | "maxY" : 1, 107 | "y" : 1, 108 | "minY" : 0, 109 | "z" : 0, 110 | "maxX" : 1, 111 | "controlType" : "colorpicker", 112 | "minX" : 0, 113 | "maxW" : 1, 114 | "minW" : 0 115 | } 116 | }, 117 | { 118 | "type" : "float4", 119 | "base" : { 120 | "maxZ" : 1, 121 | "minZ" : 0, 122 | "label" : "Potassium", 123 | "w" : 1, 124 | "x" : 0, 125 | "maxY" : 1, 126 | "y" : 0.58980089426040649, 127 | "minY" : 0, 128 | "z" : 1, 129 | "maxX" : 1, 130 | "controlType" : "colorpicker", 131 | "minX" : 0, 132 | "maxW" : 1, 133 | "minW" : 0 134 | } 135 | }, 136 | { 137 | "type" : "float4", 138 | "base" : { 139 | "maxZ" : 1, 140 | "minZ" : 0, 141 | "label" : "Sulfur", 142 | "w" : 1, 143 | "x" : 0.016804177314043045, 144 | "maxY" : 1, 145 | "y" : 0.19835099577903748, 146 | "minY" : 0, 147 | "z" : 1, 148 | "maxX" : 1, 149 | "controlType" : "colorpicker", 150 | "minX" : 0, 151 | "maxW" : 1, 152 | "minW" : 0 153 | } 154 | }, 155 | { 156 | "type" : "float4", 157 | "base" : { 158 | "maxZ" : 1, 159 | "minZ" : 0, 160 | "label" : "Sodium", 161 | "w" : 1, 162 | "x" : 0.5818830132484436, 163 | "maxY" : 1, 164 | "y" : 0.21569153666496277, 165 | "minY" : 0, 166 | "z" : 1, 167 | "maxX" : 1, 168 | "controlType" : "colorpicker", 169 | "minX" : 0, 170 | "maxW" : 1, 171 | "minW" : 0 172 | } 173 | }, 174 | { 175 | "type" : "float4", 176 | "base" : { 177 | "maxZ" : 1, 178 | "minZ" : 0, 179 | "label" : "Chlorine", 180 | "w" : 1, 181 | "x" : 1, 182 | "maxY" : 1, 183 | "y" : 0.25279238820075989, 184 | "minY" : 0, 185 | "z" : 1, 186 | "maxX" : 1, 187 | "controlType" : "colorpicker", 188 | "minX" : 0, 189 | "maxW" : 1, 190 | "minW" : 0 191 | } 192 | }, 193 | { 194 | "type" : "float4", 195 | "base" : { 196 | "maxZ" : 1, 197 | "minZ" : 0, 198 | "label" : "Magnesium", 199 | "w" : 1, 200 | "x" : 1, 201 | "maxY" : 1, 202 | "y" : 0.18573886156082153, 203 | "minY" : 0, 204 | "z" : 0.5733950138092041, 205 | "maxX" : 1, 206 | "controlType" : "colorpicker", 207 | "minX" : 0, 208 | "maxW" : 1, 209 | "minW" : 0 210 | } 211 | } 212 | ] 213 | } -------------------------------------------------------------------------------- /Assets/Presets/Body/Parameters/Controls.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Background", 9 | "w" : 1, 10 | "x" : 0.96070021390914917, 11 | "maxY" : 1, 12 | "y" : 0.96083825826644897, 13 | "minY" : 0, 14 | "z" : 0.96067017316818237, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "string", 24 | "base" : { 25 | "label" : "Blending", 26 | "value" : "Alpha", 27 | "options" : [ 28 | "Additive", 29 | "Alpha", 30 | "Subtract" 31 | ], 32 | "controlType" : "dropdown" 33 | } 34 | }, 35 | { 36 | "type" : "bool", 37 | "base" : { 38 | "controlType" : "toggle", 39 | "label" : "Fullscreen", 40 | "value" : false 41 | } 42 | }, 43 | { 44 | "type" : "string", 45 | "base" : { 46 | "label" : "Video Input", 47 | "value" : "Logitech BRIO", 48 | "options" : [ 49 | "FaceTime HD ", 50 | "Logitech BRIO" 51 | ], 52 | "controlType" : "dropdown" 53 | } 54 | }, 55 | { 56 | "type" : "bool", 57 | "base" : { 58 | "controlType" : "toggle", 59 | "label" : "Show Video", 60 | "value" : false 61 | } 62 | }, 63 | { 64 | "type" : "bool", 65 | "base" : { 66 | "controlType" : "toggle", 67 | "label" : "Flip Video", 68 | "value" : true 69 | } 70 | }, 71 | { 72 | "type" : "bool", 73 | "base" : { 74 | "controlType" : "toggle", 75 | "label" : "Update Pose", 76 | "value" : false 77 | } 78 | }, 79 | { 80 | "type" : "bool", 81 | "base" : { 82 | "controlType" : "toggle", 83 | "label" : "Fake Pose", 84 | "value" : true 85 | } 86 | }, 87 | { 88 | "type" : "bool", 89 | "base" : { 90 | "controlType" : "toggle", 91 | "label" : "Show Points", 92 | "value" : false 93 | } 94 | }, 95 | { 96 | "type" : "bool", 97 | "base" : { 98 | "controlType" : "toggle", 99 | "label" : "Show Lines", 100 | "value" : false 101 | } 102 | }, 103 | { 104 | "type" : "int", 105 | "base" : { 106 | "label" : "Particle Count", 107 | "value" : 262144, 108 | "min" : 0, 109 | "controlType" : "inputfield", 110 | "max" : 100 111 | } 112 | }, 113 | { 114 | "type" : "bool", 115 | "base" : { 116 | "controlType" : "button", 117 | "label" : "Reset Particles", 118 | "value" : false 119 | } 120 | }, 121 | { 122 | "type" : "bool", 123 | "base" : { 124 | "controlType" : "toggle", 125 | "label" : "Update Particles", 126 | "value" : true 127 | } 128 | }, 129 | { 130 | "type" : "bool", 131 | "base" : { 132 | "controlType" : "toggle", 133 | "label" : "Show Particles", 134 | "value" : true 135 | } 136 | } 137 | ] 138 | } -------------------------------------------------------------------------------- /Assets/Presets/Body/Parameters/Line Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 1, 11 | "maxY" : 1, 12 | "y" : 0, 13 | "minY" : 0, 14 | "z" : 0.61564642190933228, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float4", 24 | "base" : { 25 | "maxZ" : 1, 26 | "minZ" : 0, 27 | "label" : "Resolution", 28 | "w" : 2, 29 | "x" : 5428, 30 | "maxY" : 1, 31 | "y" : 1512, 32 | "minY" : 0, 33 | "z" : 3.589946985244751, 34 | "maxX" : 1, 35 | "controlType" : "none", 36 | "minX" : 0, 37 | "maxW" : 1, 38 | "minW" : 0 39 | } 40 | }, 41 | { 42 | "type" : "float3", 43 | "base" : { 44 | "controlType" : "none", 45 | "x" : 0, 46 | "maxX" : 1, 47 | "y" : 0, 48 | "maxY" : 1, 49 | "minX" : 0, 50 | "z" : 1000, 51 | "minZ" : 0, 52 | "label" : "Camera Position", 53 | "minY" : 0, 54 | "maxZ" : 1 55 | } 56 | }, 57 | { 58 | "type" : "float3", 59 | "base" : { 60 | "controlType" : "none", 61 | "x" : 1.4870045185089111, 62 | "maxX" : 1, 63 | "y" : 0, 64 | "maxY" : 1, 65 | "minX" : 0, 66 | "z" : 0, 67 | "minZ" : 0, 68 | "label" : "Camera Right", 69 | "minY" : 0, 70 | "maxZ" : 1 71 | } 72 | }, 73 | { 74 | "type" : "float3", 75 | "base" : { 76 | "controlType" : "none", 77 | "x" : 0, 78 | "maxX" : 1, 79 | "y" : 0.41421350836753845, 80 | "maxY" : 1, 81 | "minX" : 0, 82 | "z" : 0, 83 | "minZ" : 0, 84 | "label" : "Camera Up", 85 | "minY" : 0, 86 | "maxZ" : 1 87 | } 88 | }, 89 | { 90 | "type" : "float3", 91 | "base" : { 92 | "controlType" : "none", 93 | "x" : 0, 94 | "maxX" : 1, 95 | "y" : 0, 96 | "maxY" : 1, 97 | "minX" : 0, 98 | "z" : -0.99999994039535522, 99 | "minZ" : 0, 100 | "label" : "Camera Forward", 101 | "minY" : 0, 102 | "maxZ" : 1 103 | } 104 | }, 105 | { 106 | "type" : "float2", 107 | "base" : { 108 | "maxX" : 1, 109 | "controlType" : "none", 110 | "x" : 0.0099999997764825821, 111 | "y" : 4000, 112 | "maxY" : 1, 113 | "minX" : 0, 114 | "label" : "Near Far", 115 | "minY" : 0 116 | } 117 | }, 118 | { 119 | "type" : "float2", 120 | "base" : { 121 | "maxX" : 1, 122 | "controlType" : "none", 123 | "x" : 1.0000025033950806, 124 | "y" : 0.010000024922192097, 125 | "maxY" : 1, 126 | "minX" : 0, 127 | "label" : "Camera Depth", 128 | "minY" : 0 129 | } 130 | }, 131 | { 132 | "type" : "float", 133 | "base" : { 134 | "label" : "Line Width", 135 | "value" : 8, 136 | "min" : 0, 137 | "controlType" : "slider", 138 | "max" : 20 139 | } 140 | } 141 | ] 142 | } -------------------------------------------------------------------------------- /Assets/Presets/Body/Parameters/Masses.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float", 5 | "base" : { 6 | "label" : "Oxygen Mass", 7 | "value" : 0.64999997615814209, 8 | "min" : 0, 9 | "controlType" : "inputfield", 10 | "max" : 1 11 | } 12 | }, 13 | { 14 | "type" : "float", 15 | "base" : { 16 | "label" : "Carbon Mass", 17 | "value" : 0.18500000238418579, 18 | "min" : 0, 19 | "controlType" : "inputfield", 20 | "max" : 1 21 | } 22 | }, 23 | { 24 | "type" : "float", 25 | "base" : { 26 | "label" : "Hydrogen Mass", 27 | "value" : 0.094999998807907104, 28 | "min" : 0, 29 | "controlType" : "inputfield", 30 | "max" : 1 31 | } 32 | }, 33 | { 34 | "type" : "float", 35 | "base" : { 36 | "label" : "Nitrogen Mass", 37 | "value" : 0.032000001519918442, 38 | "min" : 0, 39 | "controlType" : "inputfield", 40 | "max" : 1 41 | } 42 | }, 43 | { 44 | "type" : "float", 45 | "base" : { 46 | "label" : "Calcium Mass", 47 | "value" : 0.014999999664723873, 48 | "min" : 0, 49 | "controlType" : "inputfield", 50 | "max" : 1 51 | } 52 | }, 53 | { 54 | "type" : "float", 55 | "base" : { 56 | "label" : "Phosphorus Mass", 57 | "value" : 0.0099999997764825821, 58 | "min" : 0, 59 | "controlType" : "inputfield", 60 | "max" : 1 61 | } 62 | }, 63 | { 64 | "type" : "float", 65 | "base" : { 66 | "label" : "Potassium Mass", 67 | "value" : 0.0040000001899898052, 68 | "min" : 0, 69 | "controlType" : "inputfield", 70 | "max" : 1 71 | } 72 | }, 73 | { 74 | "type" : "float", 75 | "base" : { 76 | "label" : "Sulfur Mass", 77 | "value" : 0.0030000000260770321, 78 | "min" : 0, 79 | "controlType" : "inputfield", 80 | "max" : 1 81 | } 82 | }, 83 | { 84 | "type" : "float", 85 | "base" : { 86 | "label" : "Sodium Mass", 87 | "value" : 0.0020000000949949026, 88 | "min" : 0, 89 | "controlType" : "inputfield", 90 | "max" : 1 91 | } 92 | }, 93 | { 94 | "type" : "float", 95 | "base" : { 96 | "label" : "Chlorine Mass", 97 | "value" : 0.0020000000949949026, 98 | "min" : 0, 99 | "controlType" : "inputfield", 100 | "max" : 1 101 | } 102 | }, 103 | { 104 | "type" : "float", 105 | "base" : { 106 | "label" : "Magnesium Mass", 107 | "value" : 0.0010000000474974513, 108 | "min" : 0, 109 | "controlType" : "inputfield", 110 | "max" : 1 111 | } 112 | } 113 | ] 114 | } -------------------------------------------------------------------------------- /Assets/Presets/Body/Parameters/Particles.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "int", 5 | "base" : { 6 | "label" : "Count", 7 | "value" : 262144, 8 | "min" : 0, 9 | "controlType" : "none", 10 | "max" : 100 11 | } 12 | }, 13 | { 14 | "type" : "float", 15 | "base" : { 16 | "label" : "Time", 17 | "value" : 1067.872314453125, 18 | "min" : 0, 19 | "controlType" : "none", 20 | "max" : 1 21 | } 22 | }, 23 | { 24 | "type" : "float", 25 | "base" : { 26 | "label" : "Point Size", 27 | "value" : 8, 28 | "min" : 0, 29 | "controlType" : "slider", 30 | "max" : 32 31 | } 32 | }, 33 | { 34 | "type" : "float2", 35 | "base" : { 36 | "maxX" : 1, 37 | "controlType" : "none", 38 | "x" : 2705.596923828125, 39 | "y" : 828.42706298828125, 40 | "maxY" : 1, 41 | "minX" : 0, 42 | "label" : "Grid Size", 43 | "minY" : 0 44 | } 45 | }, 46 | { 47 | "type" : "float", 48 | "base" : { 49 | "label" : "Curl Scale", 50 | "value" : 0.0049292421899735928, 51 | "min" : 0, 52 | "controlType" : "slider", 53 | "max" : 0.05000000074505806 54 | } 55 | }, 56 | { 57 | "type" : "float", 58 | "base" : { 59 | "label" : "Curl Speed", 60 | "value" : 0.20599924027919769, 61 | "min" : 0, 62 | "controlType" : "slider", 63 | "max" : 1 64 | } 65 | }, 66 | { 67 | "type" : "float", 68 | "base" : { 69 | "label" : "Curl", 70 | "value" : 0.11792523413896561, 71 | "min" : 0, 72 | "controlType" : "slider", 73 | "max" : 1 74 | } 75 | }, 76 | { 77 | "type" : "float", 78 | "base" : { 79 | "label" : "Homing", 80 | "value" : 0, 81 | "min" : 0, 82 | "controlType" : "slider", 83 | "max" : 1 84 | } 85 | }, 86 | { 87 | "type" : "float", 88 | "base" : { 89 | "label" : "Body", 90 | "value" : 1, 91 | "min" : 0, 92 | "controlType" : "slider", 93 | "max" : 1 94 | } 95 | }, 96 | { 97 | "type" : "float", 98 | "base" : { 99 | "label" : "Stream", 100 | "value" : 0, 101 | "min" : 0, 102 | "controlType" : "slider", 103 | "max" : 1 104 | } 105 | }, 106 | { 107 | "type" : "float", 108 | "base" : { 109 | "label" : "Spherical", 110 | "value" : 0, 111 | "min" : 0, 112 | "controlType" : "slider", 113 | "max" : 1 114 | } 115 | }, 116 | { 117 | "type" : "float", 118 | "base" : { 119 | "label" : "Radius", 120 | "value" : 0, 121 | "min" : 0, 122 | "controlType" : "slider", 123 | "max" : 1000 124 | } 125 | }, 126 | { 127 | "type" : "float", 128 | "base" : { 129 | "label" : "Damping", 130 | "value" : 0.02500000037252903, 131 | "min" : 0, 132 | "controlType" : "slider", 133 | "max" : 1 134 | } 135 | }, 136 | { 137 | "type" : "float", 138 | "base" : { 139 | "label" : "Delta Time", 140 | "value" : 0.016746997833251953, 141 | "min" : 0, 142 | "controlType" : "none", 143 | "max" : 1 144 | } 145 | }, 146 | { 147 | "type" : "int", 148 | "base" : { 149 | "label" : "Points", 150 | "value" : 19, 151 | "min" : 0, 152 | "controlType" : "none", 153 | "max" : 100 154 | } 155 | }, 156 | { 157 | "type" : "int", 158 | "base" : { 159 | "label" : "Lines", 160 | "value" : 21, 161 | "min" : 0, 162 | "controlType" : "none", 163 | "max" : 100 164 | } 165 | } 166 | ] 167 | } -------------------------------------------------------------------------------- /Assets/Presets/Body/Parameters/Point Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 0, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 0, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float", 24 | "base" : { 25 | "label" : "Point Size", 26 | "value" : 16, 27 | "min" : 0, 28 | "controlType" : "slider", 29 | "max" : 16 30 | } 31 | }, 32 | { 33 | "type" : "float", 34 | "base" : { 35 | "label" : "Aspect", 36 | "value" : 0, 37 | "min" : 0, 38 | "controlType" : "none", 39 | "max" : 1 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /Assets/Presets/Body/Parameters/Sprite Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 0.9999045729637146, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 0.99988085031509399, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float", 24 | "base" : { 25 | "label" : "Sigma", 26 | "value" : 0.32499998807907104, 27 | "min" : 0, 28 | "controlType" : "slider", 29 | "max" : 1 30 | } 31 | }, 32 | { 33 | "type" : "float", 34 | "base" : { 35 | "label" : "Power", 36 | "value" : 0.32499998807907104, 37 | "min" : 0, 38 | "controlType" : "slider", 39 | "max" : 1 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /Assets/Presets/Body/Parameters/Video Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 1, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 1, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /Assets/Presets/Grid/Parameters/Colors.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Oxygen", 9 | "w" : 1, 10 | "x" : 0, 11 | "maxY" : 1, 12 | "y" : 0.66270703077316284, 13 | "minY" : 0, 14 | "z" : 0.94407570362091064, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float4", 24 | "base" : { 25 | "maxZ" : 1, 26 | "minZ" : 0, 27 | "label" : "Carbon", 28 | "w" : 1, 29 | "x" : 1, 30 | "maxY" : 1, 31 | "y" : 0, 32 | "minY" : 0, 33 | "z" : 0.77667254209518433, 34 | "maxX" : 1, 35 | "controlType" : "colorpicker", 36 | "minX" : 0, 37 | "maxW" : 1, 38 | "minW" : 0 39 | } 40 | }, 41 | { 42 | "type" : "float4", 43 | "base" : { 44 | "maxZ" : 1, 45 | "minZ" : 0, 46 | "label" : "Hydrogen", 47 | "w" : 1, 48 | "x" : 1, 49 | "maxY" : 1, 50 | "y" : 0.16896530985832214, 51 | "minY" : 0, 52 | "z" : 0, 53 | "maxX" : 1, 54 | "controlType" : "colorpicker", 55 | "minX" : 0, 56 | "maxW" : 1, 57 | "minW" : 0 58 | } 59 | }, 60 | { 61 | "type" : "float4", 62 | "base" : { 63 | "maxZ" : 1, 64 | "minZ" : 0, 65 | "label" : "Nitrogen", 66 | "w" : 1, 67 | "x" : 0.55634254217147827, 68 | "maxY" : 1, 69 | "y" : 0.97934550046920776, 70 | "minY" : 0, 71 | "z" : 0, 72 | "maxX" : 1, 73 | "controlType" : "colorpicker", 74 | "minX" : 0, 75 | "maxW" : 1, 76 | "minW" : 0 77 | } 78 | }, 79 | { 80 | "type" : "float4", 81 | "base" : { 82 | "maxZ" : 1, 83 | "minZ" : 0, 84 | "label" : "Calcium", 85 | "w" : 1, 86 | "x" : 0, 87 | "maxY" : 1, 88 | "y" : 0.97680455446243286, 89 | "minY" : 0, 90 | "z" : 0, 91 | "maxX" : 1, 92 | "controlType" : "colorpicker", 93 | "minX" : 0, 94 | "maxW" : 1, 95 | "minW" : 0 96 | } 97 | }, 98 | { 99 | "type" : "float4", 100 | "base" : { 101 | "maxZ" : 1, 102 | "minZ" : 0, 103 | "label" : "Phosphorus", 104 | "w" : 1, 105 | "x" : 0, 106 | "maxY" : 1, 107 | "y" : 1, 108 | "minY" : 0, 109 | "z" : 0, 110 | "maxX" : 1, 111 | "controlType" : "colorpicker", 112 | "minX" : 0, 113 | "maxW" : 1, 114 | "minW" : 0 115 | } 116 | }, 117 | { 118 | "type" : "float4", 119 | "base" : { 120 | "maxZ" : 1, 121 | "minZ" : 0, 122 | "label" : "Potassium", 123 | "w" : 1, 124 | "x" : 0, 125 | "maxY" : 1, 126 | "y" : 0.58980089426040649, 127 | "minY" : 0, 128 | "z" : 1, 129 | "maxX" : 1, 130 | "controlType" : "colorpicker", 131 | "minX" : 0, 132 | "maxW" : 1, 133 | "minW" : 0 134 | } 135 | }, 136 | { 137 | "type" : "float4", 138 | "base" : { 139 | "maxZ" : 1, 140 | "minZ" : 0, 141 | "label" : "Sulfur", 142 | "w" : 1, 143 | "x" : 0.016804177314043045, 144 | "maxY" : 1, 145 | "y" : 0.19835099577903748, 146 | "minY" : 0, 147 | "z" : 1, 148 | "maxX" : 1, 149 | "controlType" : "colorpicker", 150 | "minX" : 0, 151 | "maxW" : 1, 152 | "minW" : 0 153 | } 154 | }, 155 | { 156 | "type" : "float4", 157 | "base" : { 158 | "maxZ" : 1, 159 | "minZ" : 0, 160 | "label" : "Sodium", 161 | "w" : 1, 162 | "x" : 0.5818830132484436, 163 | "maxY" : 1, 164 | "y" : 0.21569153666496277, 165 | "minY" : 0, 166 | "z" : 1, 167 | "maxX" : 1, 168 | "controlType" : "colorpicker", 169 | "minX" : 0, 170 | "maxW" : 1, 171 | "minW" : 0 172 | } 173 | }, 174 | { 175 | "type" : "float4", 176 | "base" : { 177 | "maxZ" : 1, 178 | "minZ" : 0, 179 | "label" : "Chlorine", 180 | "w" : 1, 181 | "x" : 1, 182 | "maxY" : 1, 183 | "y" : 0.25279238820075989, 184 | "minY" : 0, 185 | "z" : 1, 186 | "maxX" : 1, 187 | "controlType" : "colorpicker", 188 | "minX" : 0, 189 | "maxW" : 1, 190 | "minW" : 0 191 | } 192 | }, 193 | { 194 | "type" : "float4", 195 | "base" : { 196 | "maxZ" : 1, 197 | "minZ" : 0, 198 | "label" : "Magnesium", 199 | "w" : 1, 200 | "x" : 1, 201 | "maxY" : 1, 202 | "y" : 0.18573886156082153, 203 | "minY" : 0, 204 | "z" : 0.5733950138092041, 205 | "maxX" : 1, 206 | "controlType" : "colorpicker", 207 | "minX" : 0, 208 | "maxW" : 1, 209 | "minW" : 0 210 | } 211 | } 212 | ] 213 | } -------------------------------------------------------------------------------- /Assets/Presets/Grid/Parameters/Controls.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Background", 9 | "w" : 1, 10 | "x" : 0.96070021390914917, 11 | "maxY" : 1, 12 | "y" : 0.96083825826644897, 13 | "minY" : 0, 14 | "z" : 0.96067017316818237, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "string", 24 | "base" : { 25 | "label" : "Blending", 26 | "value" : "Alpha", 27 | "options" : [ 28 | "Additive", 29 | "Alpha", 30 | "Subtract" 31 | ], 32 | "controlType" : "dropdown" 33 | } 34 | }, 35 | { 36 | "type" : "bool", 37 | "base" : { 38 | "controlType" : "toggle", 39 | "label" : "Fullscreen", 40 | "value" : false 41 | } 42 | }, 43 | { 44 | "type" : "string", 45 | "base" : { 46 | "label" : "Video Input", 47 | "value" : "Logitech BRIO", 48 | "options" : [ 49 | "FaceTime HD ", 50 | "Logitech BRIO" 51 | ], 52 | "controlType" : "dropdown" 53 | } 54 | }, 55 | { 56 | "type" : "bool", 57 | "base" : { 58 | "controlType" : "toggle", 59 | "label" : "Show Video", 60 | "value" : false 61 | } 62 | }, 63 | { 64 | "type" : "bool", 65 | "base" : { 66 | "controlType" : "toggle", 67 | "label" : "Flip Video", 68 | "value" : true 69 | } 70 | }, 71 | { 72 | "type" : "bool", 73 | "base" : { 74 | "controlType" : "toggle", 75 | "label" : "Update Pose", 76 | "value" : false 77 | } 78 | }, 79 | { 80 | "type" : "bool", 81 | "base" : { 82 | "controlType" : "toggle", 83 | "label" : "Fake Pose", 84 | "value" : true 85 | } 86 | }, 87 | { 88 | "type" : "bool", 89 | "base" : { 90 | "controlType" : "toggle", 91 | "label" : "Show Points", 92 | "value" : false 93 | } 94 | }, 95 | { 96 | "type" : "bool", 97 | "base" : { 98 | "controlType" : "toggle", 99 | "label" : "Show Lines", 100 | "value" : false 101 | } 102 | }, 103 | { 104 | "type" : "int", 105 | "base" : { 106 | "label" : "Particle Count", 107 | "value" : 262144, 108 | "min" : 0, 109 | "controlType" : "inputfield", 110 | "max" : 100 111 | } 112 | }, 113 | { 114 | "type" : "bool", 115 | "base" : { 116 | "controlType" : "button", 117 | "label" : "Reset Particles", 118 | "value" : false 119 | } 120 | }, 121 | { 122 | "type" : "bool", 123 | "base" : { 124 | "controlType" : "toggle", 125 | "label" : "Update Particles", 126 | "value" : true 127 | } 128 | }, 129 | { 130 | "type" : "bool", 131 | "base" : { 132 | "controlType" : "toggle", 133 | "label" : "Show Particles", 134 | "value" : true 135 | } 136 | } 137 | ] 138 | } -------------------------------------------------------------------------------- /Assets/Presets/Grid/Parameters/Line Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 1, 11 | "maxY" : 1, 12 | "y" : 0, 13 | "minY" : 0, 14 | "z" : 0.61564642190933228, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float4", 24 | "base" : { 25 | "maxZ" : 1, 26 | "minZ" : 0, 27 | "label" : "Resolution", 28 | "w" : 2, 29 | "x" : 5428, 30 | "maxY" : 1, 31 | "y" : 1512, 32 | "minY" : 0, 33 | "z" : 3.589946985244751, 34 | "maxX" : 1, 35 | "controlType" : "none", 36 | "minX" : 0, 37 | "maxW" : 1, 38 | "minW" : 0 39 | } 40 | }, 41 | { 42 | "type" : "float3", 43 | "base" : { 44 | "controlType" : "none", 45 | "x" : 0, 46 | "maxX" : 1, 47 | "y" : 0, 48 | "maxY" : 1, 49 | "minX" : 0, 50 | "z" : 1000, 51 | "minZ" : 0, 52 | "label" : "Camera Position", 53 | "minY" : 0, 54 | "maxZ" : 1 55 | } 56 | }, 57 | { 58 | "type" : "float3", 59 | "base" : { 60 | "controlType" : "none", 61 | "x" : 1.4870045185089111, 62 | "maxX" : 1, 63 | "y" : 0, 64 | "maxY" : 1, 65 | "minX" : 0, 66 | "z" : 0, 67 | "minZ" : 0, 68 | "label" : "Camera Right", 69 | "minY" : 0, 70 | "maxZ" : 1 71 | } 72 | }, 73 | { 74 | "type" : "float3", 75 | "base" : { 76 | "controlType" : "none", 77 | "x" : 0, 78 | "maxX" : 1, 79 | "y" : 0.41421350836753845, 80 | "maxY" : 1, 81 | "minX" : 0, 82 | "z" : 0, 83 | "minZ" : 0, 84 | "label" : "Camera Up", 85 | "minY" : 0, 86 | "maxZ" : 1 87 | } 88 | }, 89 | { 90 | "type" : "float3", 91 | "base" : { 92 | "controlType" : "none", 93 | "x" : 0, 94 | "maxX" : 1, 95 | "y" : 0, 96 | "maxY" : 1, 97 | "minX" : 0, 98 | "z" : -0.99999994039535522, 99 | "minZ" : 0, 100 | "label" : "Camera Forward", 101 | "minY" : 0, 102 | "maxZ" : 1 103 | } 104 | }, 105 | { 106 | "type" : "float2", 107 | "base" : { 108 | "maxX" : 1, 109 | "controlType" : "none", 110 | "x" : 0.0099999997764825821, 111 | "y" : 4000, 112 | "maxY" : 1, 113 | "minX" : 0, 114 | "label" : "Near Far", 115 | "minY" : 0 116 | } 117 | }, 118 | { 119 | "type" : "float2", 120 | "base" : { 121 | "maxX" : 1, 122 | "controlType" : "none", 123 | "x" : 1.0000025033950806, 124 | "y" : 0.010000024922192097, 125 | "maxY" : 1, 126 | "minX" : 0, 127 | "label" : "Camera Depth", 128 | "minY" : 0 129 | } 130 | }, 131 | { 132 | "type" : "float", 133 | "base" : { 134 | "label" : "Line Width", 135 | "value" : 8, 136 | "min" : 0, 137 | "controlType" : "slider", 138 | "max" : 20 139 | } 140 | } 141 | ] 142 | } -------------------------------------------------------------------------------- /Assets/Presets/Grid/Parameters/Masses.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float", 5 | "base" : { 6 | "label" : "Oxygen Mass", 7 | "value" : 0.64999997615814209, 8 | "min" : 0, 9 | "controlType" : "inputfield", 10 | "max" : 1 11 | } 12 | }, 13 | { 14 | "type" : "float", 15 | "base" : { 16 | "label" : "Carbon Mass", 17 | "value" : 0.18500000238418579, 18 | "min" : 0, 19 | "controlType" : "inputfield", 20 | "max" : 1 21 | } 22 | }, 23 | { 24 | "type" : "float", 25 | "base" : { 26 | "label" : "Hydrogen Mass", 27 | "value" : 0.094999998807907104, 28 | "min" : 0, 29 | "controlType" : "inputfield", 30 | "max" : 1 31 | } 32 | }, 33 | { 34 | "type" : "float", 35 | "base" : { 36 | "label" : "Nitrogen Mass", 37 | "value" : 0.032000001519918442, 38 | "min" : 0, 39 | "controlType" : "inputfield", 40 | "max" : 1 41 | } 42 | }, 43 | { 44 | "type" : "float", 45 | "base" : { 46 | "label" : "Calcium Mass", 47 | "value" : 0.014999999664723873, 48 | "min" : 0, 49 | "controlType" : "inputfield", 50 | "max" : 1 51 | } 52 | }, 53 | { 54 | "type" : "float", 55 | "base" : { 56 | "label" : "Phosphorus Mass", 57 | "value" : 0.0099999997764825821, 58 | "min" : 0, 59 | "controlType" : "inputfield", 60 | "max" : 1 61 | } 62 | }, 63 | { 64 | "type" : "float", 65 | "base" : { 66 | "label" : "Potassium Mass", 67 | "value" : 0.0040000001899898052, 68 | "min" : 0, 69 | "controlType" : "inputfield", 70 | "max" : 1 71 | } 72 | }, 73 | { 74 | "type" : "float", 75 | "base" : { 76 | "label" : "Sulfur Mass", 77 | "value" : 0.0030000000260770321, 78 | "min" : 0, 79 | "controlType" : "inputfield", 80 | "max" : 1 81 | } 82 | }, 83 | { 84 | "type" : "float", 85 | "base" : { 86 | "label" : "Sodium Mass", 87 | "value" : 0.0020000000949949026, 88 | "min" : 0, 89 | "controlType" : "inputfield", 90 | "max" : 1 91 | } 92 | }, 93 | { 94 | "type" : "float", 95 | "base" : { 96 | "label" : "Chlorine Mass", 97 | "value" : 0.0020000000949949026, 98 | "min" : 0, 99 | "controlType" : "inputfield", 100 | "max" : 1 101 | } 102 | }, 103 | { 104 | "type" : "float", 105 | "base" : { 106 | "label" : "Magnesium Mass", 107 | "value" : 0.0010000000474974513, 108 | "min" : 0, 109 | "controlType" : "inputfield", 110 | "max" : 1 111 | } 112 | } 113 | ] 114 | } -------------------------------------------------------------------------------- /Assets/Presets/Grid/Parameters/Particles.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "int", 5 | "base" : { 6 | "label" : "Count", 7 | "value" : 262144, 8 | "min" : 0, 9 | "controlType" : "none", 10 | "max" : 100 11 | } 12 | }, 13 | { 14 | "type" : "float", 15 | "base" : { 16 | "label" : "Time", 17 | "value" : 723.8729248046875, 18 | "min" : 0, 19 | "controlType" : "none", 20 | "max" : 1 21 | } 22 | }, 23 | { 24 | "type" : "float", 25 | "base" : { 26 | "label" : "Point Size", 27 | "value" : 16, 28 | "min" : 0, 29 | "controlType" : "slider", 30 | "max" : 32 31 | } 32 | }, 33 | { 34 | "type" : "float2", 35 | "base" : { 36 | "maxX" : 1, 37 | "controlType" : "none", 38 | "x" : 2705.596923828125, 39 | "y" : 828.42706298828125, 40 | "maxY" : 1, 41 | "minX" : 0, 42 | "label" : "Grid Size", 43 | "minY" : 0 44 | } 45 | }, 46 | { 47 | "type" : "float", 48 | "base" : { 49 | "label" : "Curl Scale", 50 | "value" : 0.029611539095640182, 51 | "min" : 0, 52 | "controlType" : "slider", 53 | "max" : 0.05000000074505806 54 | } 55 | }, 56 | { 57 | "type" : "float", 58 | "base" : { 59 | "label" : "Curl Speed", 60 | "value" : 0.5, 61 | "min" : 0, 62 | "controlType" : "slider", 63 | "max" : 1 64 | } 65 | }, 66 | { 67 | "type" : "float", 68 | "base" : { 69 | "label" : "Curl", 70 | "value" : 0, 71 | "min" : 0, 72 | "controlType" : "slider", 73 | "max" : 1 74 | } 75 | }, 76 | { 77 | "type" : "float", 78 | "base" : { 79 | "label" : "Homing", 80 | "value" : 1, 81 | "min" : 0, 82 | "controlType" : "slider", 83 | "max" : 1 84 | } 85 | }, 86 | { 87 | "type" : "float", 88 | "base" : { 89 | "label" : "Body", 90 | "value" : 0, 91 | "min" : 0, 92 | "controlType" : "slider", 93 | "max" : 1 94 | } 95 | }, 96 | { 97 | "type" : "float", 98 | "base" : { 99 | "label" : "Stream", 100 | "value" : 0, 101 | "min" : 0, 102 | "controlType" : "slider", 103 | "max" : 1 104 | } 105 | }, 106 | { 107 | "type" : "float", 108 | "base" : { 109 | "label" : "Spherical", 110 | "value" : 0, 111 | "min" : 0, 112 | "controlType" : "slider", 113 | "max" : 1 114 | } 115 | }, 116 | { 117 | "type" : "float", 118 | "base" : { 119 | "label" : "Radius", 120 | "value" : 0, 121 | "min" : 0, 122 | "controlType" : "slider", 123 | "max" : 1000 124 | } 125 | }, 126 | { 127 | "type" : "float", 128 | "base" : { 129 | "label" : "Damping", 130 | "value" : 0.5, 131 | "min" : 0, 132 | "controlType" : "slider", 133 | "max" : 1 134 | } 135 | }, 136 | { 137 | "type" : "float", 138 | "base" : { 139 | "label" : "Delta Time", 140 | "value" : 0.01612699031829834, 141 | "min" : 0, 142 | "controlType" : "none", 143 | "max" : 1 144 | } 145 | }, 146 | { 147 | "type" : "int", 148 | "base" : { 149 | "label" : "Points", 150 | "value" : 19, 151 | "min" : 0, 152 | "controlType" : "none", 153 | "max" : 100 154 | } 155 | }, 156 | { 157 | "type" : "int", 158 | "base" : { 159 | "label" : "Lines", 160 | "value" : 21, 161 | "min" : 0, 162 | "controlType" : "none", 163 | "max" : 100 164 | } 165 | } 166 | ] 167 | } -------------------------------------------------------------------------------- /Assets/Presets/Grid/Parameters/Point Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 0, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 0, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float", 24 | "base" : { 25 | "label" : "Point Size", 26 | "value" : 16, 27 | "min" : 0, 28 | "controlType" : "slider", 29 | "max" : 16 30 | } 31 | }, 32 | { 33 | "type" : "float", 34 | "base" : { 35 | "label" : "Aspect", 36 | "value" : 0, 37 | "min" : 0, 38 | "controlType" : "none", 39 | "max" : 1 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /Assets/Presets/Grid/Parameters/Sprite Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 0.9999045729637146, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 0.99988085031509399, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float", 24 | "base" : { 25 | "label" : "Sigma", 26 | "value" : 0.32499998807907104, 27 | "min" : 0, 28 | "controlType" : "slider", 29 | "max" : 1 30 | } 31 | }, 32 | { 33 | "type" : "float", 34 | "base" : { 35 | "label" : "Power", 36 | "value" : 0.32499998807907104, 37 | "min" : 0, 38 | "controlType" : "slider", 39 | "max" : 1 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /Assets/Presets/Grid/Parameters/Video Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 1, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 1, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /Assets/Presets/Orbit/Parameters/Colors.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Oxygen", 9 | "w" : 1, 10 | "x" : 0, 11 | "maxY" : 1, 12 | "y" : 0.66270703077316284, 13 | "minY" : 0, 14 | "z" : 0.94407570362091064, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float4", 24 | "base" : { 25 | "maxZ" : 1, 26 | "minZ" : 0, 27 | "label" : "Carbon", 28 | "w" : 1, 29 | "x" : 1, 30 | "maxY" : 1, 31 | "y" : 0, 32 | "minY" : 0, 33 | "z" : 0.77667254209518433, 34 | "maxX" : 1, 35 | "controlType" : "colorpicker", 36 | "minX" : 0, 37 | "maxW" : 1, 38 | "minW" : 0 39 | } 40 | }, 41 | { 42 | "type" : "float4", 43 | "base" : { 44 | "maxZ" : 1, 45 | "minZ" : 0, 46 | "label" : "Hydrogen", 47 | "w" : 1, 48 | "x" : 1, 49 | "maxY" : 1, 50 | "y" : 0.16896530985832214, 51 | "minY" : 0, 52 | "z" : 0, 53 | "maxX" : 1, 54 | "controlType" : "colorpicker", 55 | "minX" : 0, 56 | "maxW" : 1, 57 | "minW" : 0 58 | } 59 | }, 60 | { 61 | "type" : "float4", 62 | "base" : { 63 | "maxZ" : 1, 64 | "minZ" : 0, 65 | "label" : "Nitrogen", 66 | "w" : 1, 67 | "x" : 0.55634254217147827, 68 | "maxY" : 1, 69 | "y" : 0.97934550046920776, 70 | "minY" : 0, 71 | "z" : 0, 72 | "maxX" : 1, 73 | "controlType" : "colorpicker", 74 | "minX" : 0, 75 | "maxW" : 1, 76 | "minW" : 0 77 | } 78 | }, 79 | { 80 | "type" : "float4", 81 | "base" : { 82 | "maxZ" : 1, 83 | "minZ" : 0, 84 | "label" : "Calcium", 85 | "w" : 1, 86 | "x" : 0, 87 | "maxY" : 1, 88 | "y" : 0.97680455446243286, 89 | "minY" : 0, 90 | "z" : 0, 91 | "maxX" : 1, 92 | "controlType" : "colorpicker", 93 | "minX" : 0, 94 | "maxW" : 1, 95 | "minW" : 0 96 | } 97 | }, 98 | { 99 | "type" : "float4", 100 | "base" : { 101 | "maxZ" : 1, 102 | "minZ" : 0, 103 | "label" : "Phosphorus", 104 | "w" : 1, 105 | "x" : 0, 106 | "maxY" : 1, 107 | "y" : 1, 108 | "minY" : 0, 109 | "z" : 0, 110 | "maxX" : 1, 111 | "controlType" : "colorpicker", 112 | "minX" : 0, 113 | "maxW" : 1, 114 | "minW" : 0 115 | } 116 | }, 117 | { 118 | "type" : "float4", 119 | "base" : { 120 | "maxZ" : 1, 121 | "minZ" : 0, 122 | "label" : "Potassium", 123 | "w" : 1, 124 | "x" : 0, 125 | "maxY" : 1, 126 | "y" : 0.58980089426040649, 127 | "minY" : 0, 128 | "z" : 1, 129 | "maxX" : 1, 130 | "controlType" : "colorpicker", 131 | "minX" : 0, 132 | "maxW" : 1, 133 | "minW" : 0 134 | } 135 | }, 136 | { 137 | "type" : "float4", 138 | "base" : { 139 | "maxZ" : 1, 140 | "minZ" : 0, 141 | "label" : "Sulfur", 142 | "w" : 1, 143 | "x" : 0.016804177314043045, 144 | "maxY" : 1, 145 | "y" : 0.19835099577903748, 146 | "minY" : 0, 147 | "z" : 1, 148 | "maxX" : 1, 149 | "controlType" : "colorpicker", 150 | "minX" : 0, 151 | "maxW" : 1, 152 | "minW" : 0 153 | } 154 | }, 155 | { 156 | "type" : "float4", 157 | "base" : { 158 | "maxZ" : 1, 159 | "minZ" : 0, 160 | "label" : "Sodium", 161 | "w" : 1, 162 | "x" : 0.5818830132484436, 163 | "maxY" : 1, 164 | "y" : 0.21569153666496277, 165 | "minY" : 0, 166 | "z" : 1, 167 | "maxX" : 1, 168 | "controlType" : "colorpicker", 169 | "minX" : 0, 170 | "maxW" : 1, 171 | "minW" : 0 172 | } 173 | }, 174 | { 175 | "type" : "float4", 176 | "base" : { 177 | "maxZ" : 1, 178 | "minZ" : 0, 179 | "label" : "Chlorine", 180 | "w" : 1, 181 | "x" : 1, 182 | "maxY" : 1, 183 | "y" : 0.25279238820075989, 184 | "minY" : 0, 185 | "z" : 1, 186 | "maxX" : 1, 187 | "controlType" : "colorpicker", 188 | "minX" : 0, 189 | "maxW" : 1, 190 | "minW" : 0 191 | } 192 | }, 193 | { 194 | "type" : "float4", 195 | "base" : { 196 | "maxZ" : 1, 197 | "minZ" : 0, 198 | "label" : "Magnesium", 199 | "w" : 1, 200 | "x" : 1, 201 | "maxY" : 1, 202 | "y" : 0.18573886156082153, 203 | "minY" : 0, 204 | "z" : 0.5733950138092041, 205 | "maxX" : 1, 206 | "controlType" : "colorpicker", 207 | "minX" : 0, 208 | "maxW" : 1, 209 | "minW" : 0 210 | } 211 | } 212 | ] 213 | } -------------------------------------------------------------------------------- /Assets/Presets/Orbit/Parameters/Controls.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Background", 9 | "w" : 1, 10 | "x" : 0.96070021390914917, 11 | "maxY" : 1, 12 | "y" : 0.96083825826644897, 13 | "minY" : 0, 14 | "z" : 0.96067017316818237, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "string", 24 | "base" : { 25 | "label" : "Blending", 26 | "value" : "Alpha", 27 | "options" : [ 28 | "Additive", 29 | "Alpha", 30 | "Subtract" 31 | ], 32 | "controlType" : "dropdown" 33 | } 34 | }, 35 | { 36 | "type" : "bool", 37 | "base" : { 38 | "controlType" : "toggle", 39 | "label" : "Fullscreen", 40 | "value" : false 41 | } 42 | }, 43 | { 44 | "type" : "string", 45 | "base" : { 46 | "label" : "Video Input", 47 | "value" : "Logitech BRIO", 48 | "options" : [ 49 | "FaceTime HD ", 50 | "Logitech BRIO" 51 | ], 52 | "controlType" : "dropdown" 53 | } 54 | }, 55 | { 56 | "type" : "bool", 57 | "base" : { 58 | "controlType" : "toggle", 59 | "label" : "Show Video", 60 | "value" : false 61 | } 62 | }, 63 | { 64 | "type" : "bool", 65 | "base" : { 66 | "controlType" : "toggle", 67 | "label" : "Flip Video", 68 | "value" : true 69 | } 70 | }, 71 | { 72 | "type" : "bool", 73 | "base" : { 74 | "controlType" : "toggle", 75 | "label" : "Update Pose", 76 | "value" : false 77 | } 78 | }, 79 | { 80 | "type" : "bool", 81 | "base" : { 82 | "controlType" : "toggle", 83 | "label" : "Fake Pose", 84 | "value" : true 85 | } 86 | }, 87 | { 88 | "type" : "bool", 89 | "base" : { 90 | "controlType" : "toggle", 91 | "label" : "Show Points", 92 | "value" : false 93 | } 94 | }, 95 | { 96 | "type" : "bool", 97 | "base" : { 98 | "controlType" : "toggle", 99 | "label" : "Show Lines", 100 | "value" : false 101 | } 102 | }, 103 | { 104 | "type" : "int", 105 | "base" : { 106 | "label" : "Particle Count", 107 | "value" : 262144, 108 | "min" : 0, 109 | "controlType" : "inputfield", 110 | "max" : 100 111 | } 112 | }, 113 | { 114 | "type" : "bool", 115 | "base" : { 116 | "controlType" : "button", 117 | "label" : "Reset Particles", 118 | "value" : false 119 | } 120 | }, 121 | { 122 | "type" : "bool", 123 | "base" : { 124 | "controlType" : "toggle", 125 | "label" : "Update Particles", 126 | "value" : true 127 | } 128 | }, 129 | { 130 | "type" : "bool", 131 | "base" : { 132 | "controlType" : "toggle", 133 | "label" : "Show Particles", 134 | "value" : true 135 | } 136 | } 137 | ] 138 | } -------------------------------------------------------------------------------- /Assets/Presets/Orbit/Parameters/Line Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 1, 11 | "maxY" : 1, 12 | "y" : 0, 13 | "minY" : 0, 14 | "z" : 0.61564642190933228, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float4", 24 | "base" : { 25 | "maxZ" : 1, 26 | "minZ" : 0, 27 | "label" : "Resolution", 28 | "w" : 2, 29 | "x" : 5428, 30 | "maxY" : 1, 31 | "y" : 1512, 32 | "minY" : 0, 33 | "z" : 3.589946985244751, 34 | "maxX" : 1, 35 | "controlType" : "none", 36 | "minX" : 0, 37 | "maxW" : 1, 38 | "minW" : 0 39 | } 40 | }, 41 | { 42 | "type" : "float3", 43 | "base" : { 44 | "controlType" : "none", 45 | "x" : 0, 46 | "maxX" : 1, 47 | "y" : 0, 48 | "maxY" : 1, 49 | "minX" : 0, 50 | "z" : 1000, 51 | "minZ" : 0, 52 | "label" : "Camera Position", 53 | "minY" : 0, 54 | "maxZ" : 1 55 | } 56 | }, 57 | { 58 | "type" : "float3", 59 | "base" : { 60 | "controlType" : "none", 61 | "x" : 1.4870045185089111, 62 | "maxX" : 1, 63 | "y" : 0, 64 | "maxY" : 1, 65 | "minX" : 0, 66 | "z" : 0, 67 | "minZ" : 0, 68 | "label" : "Camera Right", 69 | "minY" : 0, 70 | "maxZ" : 1 71 | } 72 | }, 73 | { 74 | "type" : "float3", 75 | "base" : { 76 | "controlType" : "none", 77 | "x" : 0, 78 | "maxX" : 1, 79 | "y" : 0.41421350836753845, 80 | "maxY" : 1, 81 | "minX" : 0, 82 | "z" : 0, 83 | "minZ" : 0, 84 | "label" : "Camera Up", 85 | "minY" : 0, 86 | "maxZ" : 1 87 | } 88 | }, 89 | { 90 | "type" : "float3", 91 | "base" : { 92 | "controlType" : "none", 93 | "x" : 0, 94 | "maxX" : 1, 95 | "y" : 0, 96 | "maxY" : 1, 97 | "minX" : 0, 98 | "z" : -0.99999994039535522, 99 | "minZ" : 0, 100 | "label" : "Camera Forward", 101 | "minY" : 0, 102 | "maxZ" : 1 103 | } 104 | }, 105 | { 106 | "type" : "float2", 107 | "base" : { 108 | "maxX" : 1, 109 | "controlType" : "none", 110 | "x" : 0.0099999997764825821, 111 | "y" : 4000, 112 | "maxY" : 1, 113 | "minX" : 0, 114 | "label" : "Near Far", 115 | "minY" : 0 116 | } 117 | }, 118 | { 119 | "type" : "float2", 120 | "base" : { 121 | "maxX" : 1, 122 | "controlType" : "none", 123 | "x" : 1.0000025033950806, 124 | "y" : 0.010000024922192097, 125 | "maxY" : 1, 126 | "minX" : 0, 127 | "label" : "Camera Depth", 128 | "minY" : 0 129 | } 130 | }, 131 | { 132 | "type" : "float", 133 | "base" : { 134 | "label" : "Line Width", 135 | "value" : 8, 136 | "min" : 0, 137 | "controlType" : "slider", 138 | "max" : 20 139 | } 140 | } 141 | ] 142 | } -------------------------------------------------------------------------------- /Assets/Presets/Orbit/Parameters/Masses.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float", 5 | "base" : { 6 | "label" : "Oxygen Mass", 7 | "value" : 0.64999997615814209, 8 | "min" : 0, 9 | "controlType" : "inputfield", 10 | "max" : 1 11 | } 12 | }, 13 | { 14 | "type" : "float", 15 | "base" : { 16 | "label" : "Carbon Mass", 17 | "value" : 0.18500000238418579, 18 | "min" : 0, 19 | "controlType" : "inputfield", 20 | "max" : 1 21 | } 22 | }, 23 | { 24 | "type" : "float", 25 | "base" : { 26 | "label" : "Hydrogen Mass", 27 | "value" : 0.094999998807907104, 28 | "min" : 0, 29 | "controlType" : "inputfield", 30 | "max" : 1 31 | } 32 | }, 33 | { 34 | "type" : "float", 35 | "base" : { 36 | "label" : "Nitrogen Mass", 37 | "value" : 0.032000001519918442, 38 | "min" : 0, 39 | "controlType" : "inputfield", 40 | "max" : 1 41 | } 42 | }, 43 | { 44 | "type" : "float", 45 | "base" : { 46 | "label" : "Calcium Mass", 47 | "value" : 0.014999999664723873, 48 | "min" : 0, 49 | "controlType" : "inputfield", 50 | "max" : 1 51 | } 52 | }, 53 | { 54 | "type" : "float", 55 | "base" : { 56 | "label" : "Phosphorus Mass", 57 | "value" : 0.0099999997764825821, 58 | "min" : 0, 59 | "controlType" : "inputfield", 60 | "max" : 1 61 | } 62 | }, 63 | { 64 | "type" : "float", 65 | "base" : { 66 | "label" : "Potassium Mass", 67 | "value" : 0.0040000001899898052, 68 | "min" : 0, 69 | "controlType" : "inputfield", 70 | "max" : 1 71 | } 72 | }, 73 | { 74 | "type" : "float", 75 | "base" : { 76 | "label" : "Sulfur Mass", 77 | "value" : 0.0030000000260770321, 78 | "min" : 0, 79 | "controlType" : "inputfield", 80 | "max" : 1 81 | } 82 | }, 83 | { 84 | "type" : "float", 85 | "base" : { 86 | "label" : "Sodium Mass", 87 | "value" : 0.0020000000949949026, 88 | "min" : 0, 89 | "controlType" : "inputfield", 90 | "max" : 1 91 | } 92 | }, 93 | { 94 | "type" : "float", 95 | "base" : { 96 | "label" : "Chlorine Mass", 97 | "value" : 0.0020000000949949026, 98 | "min" : 0, 99 | "controlType" : "inputfield", 100 | "max" : 1 101 | } 102 | }, 103 | { 104 | "type" : "float", 105 | "base" : { 106 | "label" : "Magnesium Mass", 107 | "value" : 0.0010000000474974513, 108 | "min" : 0, 109 | "controlType" : "inputfield", 110 | "max" : 1 111 | } 112 | } 113 | ] 114 | } -------------------------------------------------------------------------------- /Assets/Presets/Orbit/Parameters/Particles.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "int", 5 | "base" : { 6 | "label" : "Count", 7 | "value" : 262144, 8 | "min" : 0, 9 | "controlType" : "none", 10 | "max" : 100 11 | } 12 | }, 13 | { 14 | "type" : "float", 15 | "base" : { 16 | "label" : "Time", 17 | "value" : 560.79241943359375, 18 | "min" : 0, 19 | "controlType" : "none", 20 | "max" : 1 21 | } 22 | }, 23 | { 24 | "type" : "float", 25 | "base" : { 26 | "label" : "Point Size", 27 | "value" : 8, 28 | "min" : 0, 29 | "controlType" : "slider", 30 | "max" : 32 31 | } 32 | }, 33 | { 34 | "type" : "float2", 35 | "base" : { 36 | "maxX" : 1, 37 | "controlType" : "none", 38 | "x" : 2705.596923828125, 39 | "y" : 828.42706298828125, 40 | "maxY" : 1, 41 | "minX" : 0, 42 | "label" : "Grid Size", 43 | "minY" : 0 44 | } 45 | }, 46 | { 47 | "type" : "float", 48 | "base" : { 49 | "label" : "Curl Scale", 50 | "value" : 0.029611539095640182, 51 | "min" : 0, 52 | "controlType" : "slider", 53 | "max" : 0.05000000074505806 54 | } 55 | }, 56 | { 57 | "type" : "float", 58 | "base" : { 59 | "label" : "Curl Speed", 60 | "value" : 0.5, 61 | "min" : 0, 62 | "controlType" : "slider", 63 | "max" : 1 64 | } 65 | }, 66 | { 67 | "type" : "float", 68 | "base" : { 69 | "label" : "Curl", 70 | "value" : 0.15752720832824707, 71 | "min" : 0, 72 | "controlType" : "slider", 73 | "max" : 1 74 | } 75 | }, 76 | { 77 | "type" : "float", 78 | "base" : { 79 | "label" : "Homing", 80 | "value" : 0, 81 | "min" : 0, 82 | "controlType" : "slider", 83 | "max" : 1 84 | } 85 | }, 86 | { 87 | "type" : "float", 88 | "base" : { 89 | "label" : "Body", 90 | "value" : 0, 91 | "min" : 0, 92 | "controlType" : "slider", 93 | "max" : 1 94 | } 95 | }, 96 | { 97 | "type" : "float", 98 | "base" : { 99 | "label" : "Stream", 100 | "value" : 0, 101 | "min" : 0, 102 | "controlType" : "slider", 103 | "max" : 1 104 | } 105 | }, 106 | { 107 | "type" : "float", 108 | "base" : { 109 | "label" : "Spherical", 110 | "value" : 1, 111 | "min" : 0, 112 | "controlType" : "slider", 113 | "max" : 1 114 | } 115 | }, 116 | { 117 | "type" : "float", 118 | "base" : { 119 | "label" : "Radius", 120 | "value" : 500, 121 | "min" : 0, 122 | "controlType" : "slider", 123 | "max" : 1000 124 | } 125 | }, 126 | { 127 | "type" : "float", 128 | "base" : { 129 | "label" : "Damping", 130 | "value" : 0.02500000037252903, 131 | "min" : 0, 132 | "controlType" : "slider", 133 | "max" : 1 134 | } 135 | }, 136 | { 137 | "type" : "float", 138 | "base" : { 139 | "label" : "Delta Time", 140 | "value" : 0.015591979026794434, 141 | "min" : 0, 142 | "controlType" : "none", 143 | "max" : 1 144 | } 145 | }, 146 | { 147 | "type" : "int", 148 | "base" : { 149 | "label" : "Points", 150 | "value" : 19, 151 | "min" : 0, 152 | "controlType" : "none", 153 | "max" : 100 154 | } 155 | }, 156 | { 157 | "type" : "int", 158 | "base" : { 159 | "label" : "Lines", 160 | "value" : 21, 161 | "min" : 0, 162 | "controlType" : "none", 163 | "max" : 100 164 | } 165 | } 166 | ] 167 | } -------------------------------------------------------------------------------- /Assets/Presets/Orbit/Parameters/Point Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 0, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 0, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float", 24 | "base" : { 25 | "label" : "Point Size", 26 | "value" : 16, 27 | "min" : 0, 28 | "controlType" : "slider", 29 | "max" : 16 30 | } 31 | }, 32 | { 33 | "type" : "float", 34 | "base" : { 35 | "label" : "Aspect", 36 | "value" : 0, 37 | "min" : 0, 38 | "controlType" : "none", 39 | "max" : 1 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /Assets/Presets/Orbit/Parameters/Sprite Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 0.75, 10 | "x" : 0.9999045729637146, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 0.99988085031509399, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float", 24 | "base" : { 25 | "label" : "Sigma", 26 | "value" : 0.32499998807907104, 27 | "min" : 0, 28 | "controlType" : "slider", 29 | "max" : 1 30 | } 31 | }, 32 | { 33 | "type" : "float", 34 | "base" : { 35 | "label" : "Power", 36 | "value" : 0.32499998807907104, 37 | "min" : 0, 38 | "controlType" : "slider", 39 | "max" : 1 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /Assets/Presets/Orbit/Parameters/Video Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 1, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 1, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /Assets/Presets/Stream/Parameters/Colors.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Oxygen", 9 | "w" : 1, 10 | "x" : 0, 11 | "maxY" : 1, 12 | "y" : 0.66270703077316284, 13 | "minY" : 0, 14 | "z" : 0.94407570362091064, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float4", 24 | "base" : { 25 | "maxZ" : 1, 26 | "minZ" : 0, 27 | "label" : "Carbon", 28 | "w" : 1, 29 | "x" : 1, 30 | "maxY" : 1, 31 | "y" : 0, 32 | "minY" : 0, 33 | "z" : 0.77667254209518433, 34 | "maxX" : 1, 35 | "controlType" : "colorpicker", 36 | "minX" : 0, 37 | "maxW" : 1, 38 | "minW" : 0 39 | } 40 | }, 41 | { 42 | "type" : "float4", 43 | "base" : { 44 | "maxZ" : 1, 45 | "minZ" : 0, 46 | "label" : "Hydrogen", 47 | "w" : 1, 48 | "x" : 1, 49 | "maxY" : 1, 50 | "y" : 0.16896530985832214, 51 | "minY" : 0, 52 | "z" : 0, 53 | "maxX" : 1, 54 | "controlType" : "colorpicker", 55 | "minX" : 0, 56 | "maxW" : 1, 57 | "minW" : 0 58 | } 59 | }, 60 | { 61 | "type" : "float4", 62 | "base" : { 63 | "maxZ" : 1, 64 | "minZ" : 0, 65 | "label" : "Nitrogen", 66 | "w" : 1, 67 | "x" : 0.55634254217147827, 68 | "maxY" : 1, 69 | "y" : 0.97934550046920776, 70 | "minY" : 0, 71 | "z" : 0, 72 | "maxX" : 1, 73 | "controlType" : "colorpicker", 74 | "minX" : 0, 75 | "maxW" : 1, 76 | "minW" : 0 77 | } 78 | }, 79 | { 80 | "type" : "float4", 81 | "base" : { 82 | "maxZ" : 1, 83 | "minZ" : 0, 84 | "label" : "Calcium", 85 | "w" : 1, 86 | "x" : 0, 87 | "maxY" : 1, 88 | "y" : 0.97680455446243286, 89 | "minY" : 0, 90 | "z" : 0, 91 | "maxX" : 1, 92 | "controlType" : "colorpicker", 93 | "minX" : 0, 94 | "maxW" : 1, 95 | "minW" : 0 96 | } 97 | }, 98 | { 99 | "type" : "float4", 100 | "base" : { 101 | "maxZ" : 1, 102 | "minZ" : 0, 103 | "label" : "Phosphorus", 104 | "w" : 1, 105 | "x" : 0, 106 | "maxY" : 1, 107 | "y" : 1, 108 | "minY" : 0, 109 | "z" : 0, 110 | "maxX" : 1, 111 | "controlType" : "colorpicker", 112 | "minX" : 0, 113 | "maxW" : 1, 114 | "minW" : 0 115 | } 116 | }, 117 | { 118 | "type" : "float4", 119 | "base" : { 120 | "maxZ" : 1, 121 | "minZ" : 0, 122 | "label" : "Potassium", 123 | "w" : 1, 124 | "x" : 0, 125 | "maxY" : 1, 126 | "y" : 0.58980089426040649, 127 | "minY" : 0, 128 | "z" : 1, 129 | "maxX" : 1, 130 | "controlType" : "colorpicker", 131 | "minX" : 0, 132 | "maxW" : 1, 133 | "minW" : 0 134 | } 135 | }, 136 | { 137 | "type" : "float4", 138 | "base" : { 139 | "maxZ" : 1, 140 | "minZ" : 0, 141 | "label" : "Sulfur", 142 | "w" : 1, 143 | "x" : 0.016804177314043045, 144 | "maxY" : 1, 145 | "y" : 0.19835099577903748, 146 | "minY" : 0, 147 | "z" : 1, 148 | "maxX" : 1, 149 | "controlType" : "colorpicker", 150 | "minX" : 0, 151 | "maxW" : 1, 152 | "minW" : 0 153 | } 154 | }, 155 | { 156 | "type" : "float4", 157 | "base" : { 158 | "maxZ" : 1, 159 | "minZ" : 0, 160 | "label" : "Sodium", 161 | "w" : 1, 162 | "x" : 0.5818830132484436, 163 | "maxY" : 1, 164 | "y" : 0.21569153666496277, 165 | "minY" : 0, 166 | "z" : 1, 167 | "maxX" : 1, 168 | "controlType" : "colorpicker", 169 | "minX" : 0, 170 | "maxW" : 1, 171 | "minW" : 0 172 | } 173 | }, 174 | { 175 | "type" : "float4", 176 | "base" : { 177 | "maxZ" : 1, 178 | "minZ" : 0, 179 | "label" : "Chlorine", 180 | "w" : 1, 181 | "x" : 1, 182 | "maxY" : 1, 183 | "y" : 0.25279238820075989, 184 | "minY" : 0, 185 | "z" : 1, 186 | "maxX" : 1, 187 | "controlType" : "colorpicker", 188 | "minX" : 0, 189 | "maxW" : 1, 190 | "minW" : 0 191 | } 192 | }, 193 | { 194 | "type" : "float4", 195 | "base" : { 196 | "maxZ" : 1, 197 | "minZ" : 0, 198 | "label" : "Magnesium", 199 | "w" : 1, 200 | "x" : 1, 201 | "maxY" : 1, 202 | "y" : 0.18573886156082153, 203 | "minY" : 0, 204 | "z" : 0.5733950138092041, 205 | "maxX" : 1, 206 | "controlType" : "colorpicker", 207 | "minX" : 0, 208 | "maxW" : 1, 209 | "minW" : 0 210 | } 211 | } 212 | ] 213 | } -------------------------------------------------------------------------------- /Assets/Presets/Stream/Parameters/Controls.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Background", 9 | "w" : 1, 10 | "x" : 0.96070021390914917, 11 | "maxY" : 1, 12 | "y" : 0.96083825826644897, 13 | "minY" : 0, 14 | "z" : 0.96067017316818237, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "string", 24 | "base" : { 25 | "label" : "Blending", 26 | "value" : "Alpha", 27 | "options" : [ 28 | "Additive", 29 | "Alpha", 30 | "Subtract" 31 | ], 32 | "controlType" : "dropdown" 33 | } 34 | }, 35 | { 36 | "type" : "bool", 37 | "base" : { 38 | "controlType" : "toggle", 39 | "label" : "Fullscreen", 40 | "value" : false 41 | } 42 | }, 43 | { 44 | "type" : "string", 45 | "base" : { 46 | "label" : "Video Input", 47 | "value" : "Logitech BRIO", 48 | "options" : [ 49 | "FaceTime HD ", 50 | "Logitech BRIO" 51 | ], 52 | "controlType" : "dropdown" 53 | } 54 | }, 55 | { 56 | "type" : "bool", 57 | "base" : { 58 | "controlType" : "toggle", 59 | "label" : "Show Video", 60 | "value" : false 61 | } 62 | }, 63 | { 64 | "type" : "bool", 65 | "base" : { 66 | "controlType" : "toggle", 67 | "label" : "Flip Video", 68 | "value" : true 69 | } 70 | }, 71 | { 72 | "type" : "bool", 73 | "base" : { 74 | "controlType" : "toggle", 75 | "label" : "Update Pose", 76 | "value" : false 77 | } 78 | }, 79 | { 80 | "type" : "bool", 81 | "base" : { 82 | "controlType" : "toggle", 83 | "label" : "Fake Pose", 84 | "value" : true 85 | } 86 | }, 87 | { 88 | "type" : "bool", 89 | "base" : { 90 | "controlType" : "toggle", 91 | "label" : "Show Points", 92 | "value" : false 93 | } 94 | }, 95 | { 96 | "type" : "bool", 97 | "base" : { 98 | "controlType" : "toggle", 99 | "label" : "Show Lines", 100 | "value" : false 101 | } 102 | }, 103 | { 104 | "type" : "int", 105 | "base" : { 106 | "label" : "Particle Count", 107 | "value" : 262144, 108 | "min" : 0, 109 | "controlType" : "inputfield", 110 | "max" : 100 111 | } 112 | }, 113 | { 114 | "type" : "bool", 115 | "base" : { 116 | "controlType" : "button", 117 | "label" : "Reset Particles", 118 | "value" : false 119 | } 120 | }, 121 | { 122 | "type" : "bool", 123 | "base" : { 124 | "controlType" : "toggle", 125 | "label" : "Update Particles", 126 | "value" : true 127 | } 128 | }, 129 | { 130 | "type" : "bool", 131 | "base" : { 132 | "controlType" : "toggle", 133 | "label" : "Show Particles", 134 | "value" : true 135 | } 136 | } 137 | ] 138 | } -------------------------------------------------------------------------------- /Assets/Presets/Stream/Parameters/Line Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 1, 11 | "maxY" : 1, 12 | "y" : 0, 13 | "minY" : 0, 14 | "z" : 0.61564642190933228, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float4", 24 | "base" : { 25 | "maxZ" : 1, 26 | "minZ" : 0, 27 | "label" : "Resolution", 28 | "w" : 2, 29 | "x" : 5428, 30 | "maxY" : 1, 31 | "y" : 1512, 32 | "minY" : 0, 33 | "z" : 3.589946985244751, 34 | "maxX" : 1, 35 | "controlType" : "none", 36 | "minX" : 0, 37 | "maxW" : 1, 38 | "minW" : 0 39 | } 40 | }, 41 | { 42 | "type" : "float3", 43 | "base" : { 44 | "controlType" : "none", 45 | "x" : 0, 46 | "maxX" : 1, 47 | "y" : 0, 48 | "maxY" : 1, 49 | "minX" : 0, 50 | "z" : 1000, 51 | "minZ" : 0, 52 | "label" : "Camera Position", 53 | "minY" : 0, 54 | "maxZ" : 1 55 | } 56 | }, 57 | { 58 | "type" : "float3", 59 | "base" : { 60 | "controlType" : "none", 61 | "x" : 1.4870045185089111, 62 | "maxX" : 1, 63 | "y" : 0, 64 | "maxY" : 1, 65 | "minX" : 0, 66 | "z" : 0, 67 | "minZ" : 0, 68 | "label" : "Camera Right", 69 | "minY" : 0, 70 | "maxZ" : 1 71 | } 72 | }, 73 | { 74 | "type" : "float3", 75 | "base" : { 76 | "controlType" : "none", 77 | "x" : 0, 78 | "maxX" : 1, 79 | "y" : 0.41421350836753845, 80 | "maxY" : 1, 81 | "minX" : 0, 82 | "z" : 0, 83 | "minZ" : 0, 84 | "label" : "Camera Up", 85 | "minY" : 0, 86 | "maxZ" : 1 87 | } 88 | }, 89 | { 90 | "type" : "float3", 91 | "base" : { 92 | "controlType" : "none", 93 | "x" : 0, 94 | "maxX" : 1, 95 | "y" : 0, 96 | "maxY" : 1, 97 | "minX" : 0, 98 | "z" : -0.99999994039535522, 99 | "minZ" : 0, 100 | "label" : "Camera Forward", 101 | "minY" : 0, 102 | "maxZ" : 1 103 | } 104 | }, 105 | { 106 | "type" : "float2", 107 | "base" : { 108 | "maxX" : 1, 109 | "controlType" : "none", 110 | "x" : 0.0099999997764825821, 111 | "y" : 4000, 112 | "maxY" : 1, 113 | "minX" : 0, 114 | "label" : "Near Far", 115 | "minY" : 0 116 | } 117 | }, 118 | { 119 | "type" : "float2", 120 | "base" : { 121 | "maxX" : 1, 122 | "controlType" : "none", 123 | "x" : 1.0000025033950806, 124 | "y" : 0.010000024922192097, 125 | "maxY" : 1, 126 | "minX" : 0, 127 | "label" : "Camera Depth", 128 | "minY" : 0 129 | } 130 | }, 131 | { 132 | "type" : "float", 133 | "base" : { 134 | "label" : "Line Width", 135 | "value" : 8, 136 | "min" : 0, 137 | "controlType" : "slider", 138 | "max" : 20 139 | } 140 | } 141 | ] 142 | } -------------------------------------------------------------------------------- /Assets/Presets/Stream/Parameters/Masses.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float", 5 | "base" : { 6 | "label" : "Oxygen Mass", 7 | "value" : 0.64999997615814209, 8 | "min" : 0, 9 | "controlType" : "inputfield", 10 | "max" : 1 11 | } 12 | }, 13 | { 14 | "type" : "float", 15 | "base" : { 16 | "label" : "Carbon Mass", 17 | "value" : 0.18500000238418579, 18 | "min" : 0, 19 | "controlType" : "inputfield", 20 | "max" : 1 21 | } 22 | }, 23 | { 24 | "type" : "float", 25 | "base" : { 26 | "label" : "Hydrogen Mass", 27 | "value" : 0.094999998807907104, 28 | "min" : 0, 29 | "controlType" : "inputfield", 30 | "max" : 1 31 | } 32 | }, 33 | { 34 | "type" : "float", 35 | "base" : { 36 | "label" : "Nitrogen Mass", 37 | "value" : 0.032000001519918442, 38 | "min" : 0, 39 | "controlType" : "inputfield", 40 | "max" : 1 41 | } 42 | }, 43 | { 44 | "type" : "float", 45 | "base" : { 46 | "label" : "Calcium Mass", 47 | "value" : 0.014999999664723873, 48 | "min" : 0, 49 | "controlType" : "inputfield", 50 | "max" : 1 51 | } 52 | }, 53 | { 54 | "type" : "float", 55 | "base" : { 56 | "label" : "Phosphorus Mass", 57 | "value" : 0.0099999997764825821, 58 | "min" : 0, 59 | "controlType" : "inputfield", 60 | "max" : 1 61 | } 62 | }, 63 | { 64 | "type" : "float", 65 | "base" : { 66 | "label" : "Potassium Mass", 67 | "value" : 0.0040000001899898052, 68 | "min" : 0, 69 | "controlType" : "inputfield", 70 | "max" : 1 71 | } 72 | }, 73 | { 74 | "type" : "float", 75 | "base" : { 76 | "label" : "Sulfur Mass", 77 | "value" : 0.0030000000260770321, 78 | "min" : 0, 79 | "controlType" : "inputfield", 80 | "max" : 1 81 | } 82 | }, 83 | { 84 | "type" : "float", 85 | "base" : { 86 | "label" : "Sodium Mass", 87 | "value" : 0.0020000000949949026, 88 | "min" : 0, 89 | "controlType" : "inputfield", 90 | "max" : 1 91 | } 92 | }, 93 | { 94 | "type" : "float", 95 | "base" : { 96 | "label" : "Chlorine Mass", 97 | "value" : 0.0020000000949949026, 98 | "min" : 0, 99 | "controlType" : "inputfield", 100 | "max" : 1 101 | } 102 | }, 103 | { 104 | "type" : "float", 105 | "base" : { 106 | "label" : "Magnesium Mass", 107 | "value" : 0.0010000000474974513, 108 | "min" : 0, 109 | "controlType" : "inputfield", 110 | "max" : 1 111 | } 112 | } 113 | ] 114 | } -------------------------------------------------------------------------------- /Assets/Presets/Stream/Parameters/Particles.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "int", 5 | "base" : { 6 | "label" : "Count", 7 | "value" : 262144, 8 | "min" : 0, 9 | "controlType" : "none", 10 | "max" : 100 11 | } 12 | }, 13 | { 14 | "type" : "float", 15 | "base" : { 16 | "label" : "Time", 17 | "value" : 1295.759033203125, 18 | "min" : 0, 19 | "controlType" : "none", 20 | "max" : 1 21 | } 22 | }, 23 | { 24 | "type" : "float", 25 | "base" : { 26 | "label" : "Point Size", 27 | "value" : 8, 28 | "min" : 0, 29 | "controlType" : "slider", 30 | "max" : 32 31 | } 32 | }, 33 | { 34 | "type" : "float2", 35 | "base" : { 36 | "maxX" : 1, 37 | "controlType" : "none", 38 | "x" : 2705.596923828125, 39 | "y" : 828.42706298828125, 40 | "maxY" : 1, 41 | "minX" : 0, 42 | "label" : "Grid Size", 43 | "minY" : 0 44 | } 45 | }, 46 | { 47 | "type" : "float", 48 | "base" : { 49 | "label" : "Curl Scale", 50 | "value" : 0.004999999888241291, 51 | "min" : 0, 52 | "controlType" : "slider", 53 | "max" : 0.05000000074505806 54 | } 55 | }, 56 | { 57 | "type" : "float", 58 | "base" : { 59 | "label" : "Curl Speed", 60 | "value" : 0.02500000037252903, 61 | "min" : 0, 62 | "controlType" : "slider", 63 | "max" : 1 64 | } 65 | }, 66 | { 67 | "type" : "float", 68 | "base" : { 69 | "label" : "Curl", 70 | "value" : 0.11792523413896561, 71 | "min" : 0, 72 | "controlType" : "slider", 73 | "max" : 1 74 | } 75 | }, 76 | { 77 | "type" : "float", 78 | "base" : { 79 | "label" : "Homing", 80 | "value" : 0, 81 | "min" : 0, 82 | "controlType" : "slider", 83 | "max" : 1 84 | } 85 | }, 86 | { 87 | "type" : "float", 88 | "base" : { 89 | "label" : "Body", 90 | "value" : 1, 91 | "min" : 0, 92 | "controlType" : "slider", 93 | "max" : 1 94 | } 95 | }, 96 | { 97 | "type" : "float", 98 | "base" : { 99 | "label" : "Stream", 100 | "value" : 0.25, 101 | "min" : 0, 102 | "controlType" : "slider", 103 | "max" : 1 104 | } 105 | }, 106 | { 107 | "type" : "float", 108 | "base" : { 109 | "label" : "Spherical", 110 | "value" : 0, 111 | "min" : 0, 112 | "controlType" : "slider", 113 | "max" : 1 114 | } 115 | }, 116 | { 117 | "type" : "float", 118 | "base" : { 119 | "label" : "Radius", 120 | "value" : 0, 121 | "min" : 0, 122 | "controlType" : "slider", 123 | "max" : 1000 124 | } 125 | }, 126 | { 127 | "type" : "float", 128 | "base" : { 129 | "label" : "Damping", 130 | "value" : 0.02500000037252903, 131 | "min" : 0, 132 | "controlType" : "slider", 133 | "max" : 1 134 | } 135 | }, 136 | { 137 | "type" : "float", 138 | "base" : { 139 | "label" : "Delta Time", 140 | "value" : 0.028583049774169922, 141 | "min" : 0, 142 | "controlType" : "none", 143 | "max" : 1 144 | } 145 | }, 146 | { 147 | "type" : "int", 148 | "base" : { 149 | "label" : "Points", 150 | "value" : 19, 151 | "min" : 0, 152 | "controlType" : "none", 153 | "max" : 100 154 | } 155 | }, 156 | { 157 | "type" : "int", 158 | "base" : { 159 | "label" : "Lines", 160 | "value" : 21, 161 | "min" : 0, 162 | "controlType" : "none", 163 | "max" : 100 164 | } 165 | } 166 | ] 167 | } -------------------------------------------------------------------------------- /Assets/Presets/Stream/Parameters/Point Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 0, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 0, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float", 24 | "base" : { 25 | "label" : "Point Size", 26 | "value" : 16, 27 | "min" : 0, 28 | "controlType" : "slider", 29 | "max" : 16 30 | } 31 | }, 32 | { 33 | "type" : "float", 34 | "base" : { 35 | "label" : "Aspect", 36 | "value" : 0, 37 | "min" : 0, 38 | "controlType" : "none", 39 | "max" : 1 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /Assets/Presets/Stream/Parameters/Sprite Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 0.9999045729637146, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 0.99988085031509399, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | }, 22 | { 23 | "type" : "float", 24 | "base" : { 25 | "label" : "Sigma", 26 | "value" : 0.32499998807907104, 27 | "min" : 0, 28 | "controlType" : "slider", 29 | "max" : 1 30 | } 31 | }, 32 | { 33 | "type" : "float", 34 | "base" : { 35 | "label" : "Power", 36 | "value" : 0.32499998807907104, 37 | "min" : 0, 38 | "controlType" : "slider", 39 | "max" : 1 40 | } 41 | } 42 | ] 43 | } -------------------------------------------------------------------------------- /Assets/Presets/Stream/Parameters/Video Material.json: -------------------------------------------------------------------------------- 1 | { 2 | "params" : [ 3 | { 4 | "type" : "float4", 5 | "base" : { 6 | "maxZ" : 1, 7 | "minZ" : 0, 8 | "label" : "Color", 9 | "w" : 1, 10 | "x" : 1, 11 | "maxY" : 1, 12 | "y" : 1, 13 | "minY" : 0, 14 | "z" : 1, 15 | "maxX" : 1, 16 | "controlType" : "colorpicker", 17 | "minX" : 0, 18 | "maxW" : 1, 19 | "minW" : 0 20 | } 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "cocoapods", "1.10.1" 4 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.3) 5 | activesupport (5.2.6) 6 | concurrent-ruby (~> 1.0, >= 1.0.2) 7 | i18n (>= 0.7, < 2) 8 | minitest (~> 5.1) 9 | tzinfo (~> 1.1) 10 | addressable (2.8.0) 11 | public_suffix (>= 2.0.2, < 5.0) 12 | algoliasearch (1.27.5) 13 | httpclient (~> 2.8, >= 2.8.3) 14 | json (>= 1.5.1) 15 | atomos (0.1.3) 16 | claide (1.0.3) 17 | cocoapods (1.10.1) 18 | addressable (~> 2.6) 19 | claide (>= 1.0.2, < 2.0) 20 | cocoapods-core (= 1.10.1) 21 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 22 | cocoapods-downloader (>= 1.4.0, < 2.0) 23 | cocoapods-plugins (>= 1.0.0, < 2.0) 24 | cocoapods-search (>= 1.0.0, < 2.0) 25 | cocoapods-trunk (>= 1.4.0, < 2.0) 26 | cocoapods-try (>= 1.1.0, < 2.0) 27 | colored2 (~> 3.1) 28 | escape (~> 0.0.4) 29 | fourflusher (>= 2.3.0, < 3.0) 30 | gh_inspector (~> 1.0) 31 | molinillo (~> 0.6.6) 32 | nap (~> 1.0) 33 | ruby-macho (~> 1.4) 34 | xcodeproj (>= 1.19.0, < 2.0) 35 | cocoapods-core (1.10.1) 36 | activesupport (> 5.0, < 6) 37 | addressable (~> 2.6) 38 | algoliasearch (~> 1.0) 39 | concurrent-ruby (~> 1.1) 40 | fuzzy_match (~> 2.0.4) 41 | nap (~> 1.0) 42 | netrc (~> 0.11) 43 | public_suffix 44 | typhoeus (~> 1.0) 45 | cocoapods-deintegrate (1.0.5) 46 | cocoapods-downloader (1.5.0) 47 | cocoapods-plugins (1.0.0) 48 | nap 49 | cocoapods-search (1.0.1) 50 | cocoapods-trunk (1.6.0) 51 | nap (>= 0.8, < 2.0) 52 | netrc (~> 0.11) 53 | cocoapods-try (1.2.0) 54 | colored2 (3.1.2) 55 | concurrent-ruby (1.1.9) 56 | escape (0.0.4) 57 | ethon (0.14.0) 58 | ffi (>= 1.15.0) 59 | ffi (1.15.4) 60 | fourflusher (2.3.1) 61 | fuzzy_match (2.0.4) 62 | gh_inspector (1.1.3) 63 | httpclient (2.8.3) 64 | i18n (1.8.10) 65 | concurrent-ruby (~> 1.0) 66 | json (2.5.1) 67 | minitest (5.14.4) 68 | molinillo (0.6.6) 69 | nanaimo (0.3.0) 70 | nap (1.1.0) 71 | netrc (0.11.0) 72 | public_suffix (4.0.6) 73 | rexml (3.2.5) 74 | ruby-macho (1.4.0) 75 | thread_safe (0.3.6) 76 | typhoeus (1.4.0) 77 | ethon (>= 0.9.0) 78 | tzinfo (1.2.9) 79 | thread_safe (~> 0.1) 80 | xcodeproj (1.21.0) 81 | CFPropertyList (>= 2.3.3, < 4.0) 82 | atomos (~> 0.1.3) 83 | claide (>= 1.0.2, < 2.0) 84 | colored2 (~> 3.1) 85 | nanaimo (~> 0.3.0) 86 | rexml (~> 3.2.4) 87 | 88 | PLATFORMS 89 | universal-darwin-20 90 | 91 | DEPENDENCIES 92 | cocoapods (= 1.10.1) 93 | 94 | BUNDLED WITH 95 | 2.2.20 96 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Joel Gethin Lewis & Reza Ali 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 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | source 'https://cdn.cocoapods.org/' 2 | 3 | install! 'cocoapods', 4 | :generate_multiple_pod_projects => true, 5 | :incremental_installation => true, 6 | :preserve_pod_file_structure => true 7 | 8 | install! 'cocoapods', :disable_input_output_paths => true 9 | 10 | use_frameworks! 11 | 12 | target 'SharingElements macOS' do 13 | platform :osx, '11.0' 14 | pod 'Forge', :path => '../Forge' 15 | pod 'Satin', :path => '../Satin' 16 | pod 'Youi', :path => '../Youi' 17 | end 18 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Forge (1.0.9) 3 | - Satin (1.3.4) 4 | - Youi (2.0.4): 5 | - Satin 6 | 7 | DEPENDENCIES: 8 | - Forge (from `../Forge`) 9 | - Satin (from `../Satin`) 10 | - Youi (from `../Youi`) 11 | 12 | EXTERNAL SOURCES: 13 | Forge: 14 | :path: "../Forge" 15 | Satin: 16 | :path: "../Satin" 17 | Youi: 18 | :path: "../Youi" 19 | 20 | SPEC CHECKSUMS: 21 | Forge: abca50ae8838a6d745b9a4e204bc2cb800546cef 22 | Satin: c8b8c80e461918ab3ab8a03f1138a54cb0172fda 23 | Youi: d10bf40e4e73a3d9fe484dc7e82d3193b413f9ef 24 | 25 | PODFILE CHECKSUM: 5c592cf47eb39a259510068f1e62e5a7a9c71a1a 26 | 27 | COCOAPODS: 1.10.1 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SharingElements 2 | 3 | An interactive body tracking installation 4 | 5 | ## Requirements 6 | 7 | Hardware requirements: MacOS computer (preferably (M1 chip)[https://en.wikipedia.org/wiki/Apple_M1] based machine) and either built in FaceTime camera or external Webcam. 8 | 9 | Hardware specification for installation version: 10 | * [M1 Mac Mini with 16Gb memory and 256Gb hard drive](https://www.apple.com/mac-mini/specs/) 11 | * [Logitech Brio Stream Webcam, Ultra HD 4K Streaming Edition](https://www.logitech.com/en-us/products/webcams/brio-4k-hdr-webcam.960-001105.html) 12 | 13 | Software requirements: 14 | * A GitHub account 15 | * [macOS 11.4 "Big Sur"](https://en.wikipedia.org/wiki/MacOS_Big_Sur) 16 | * [Xcode 12.5 or above](https://apps.apple.com/us/app/xcode/id497799835?mt=12) 17 | * Xcode command line tools, which can be installed via the command: ```xcode-select --install``` 18 | * Command line access via SSH to your GitHub account. [See this guide to connecting to GitHub with SSH](https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh). 19 | 20 | ## Software installation instructions: 21 | 22 | Open [Terminal](https://en.wikipedia.org/wiki/Terminal_(macOS)) and create a folder using the [mkdir](https://en.wikipedia.org/wiki/Mkdir) command for the project in a place of your choosing: 23 | 24 | ``` 25 | mkdir SharingElementsInstallation 26 | ``` 27 | 28 | Use the [cd](https://en.wikipedia.org/wiki/Cd_(command)) command to open the folder you just created: 29 | 30 | ``` 31 | cd SharingElementsInstallation 32 | ``` 33 | 34 | If you haven't already done so, install [Homebrew](https://brew.sh/) via the following command: 35 | 36 | ``` 37 | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 38 | ``` 39 | 40 | Now install [rbenv](https://github.com/rbenv/rbenv) and [ruby-build](https://github.com/rbenv/ruby-build) via Homebrew, to allow your computer to have multiple versions of Ruby installed: 41 | 42 | ``` 43 | brew install rbenv ruby-build 44 | ``` 45 | 46 | Add rbenv to ZSH so that it loads every time you open a terminal: (P.S. we love [Oh My Zsh](https://ohmyz.sh)) 47 | 48 | ``` 49 | echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.zshrc 50 | source ~/.zshrc 51 | ``` 52 | 53 | Install Ruby 3.0.1: 54 | 55 | ``` 56 | rbenv install 3.0.1 57 | rbenv global 3.0.1 58 | ruby -v 59 | ``` 60 | 61 | N.B. If ruby -v doesn't report 3.0.1, you may have to restart Terminal.app in order for it to be reported correctly. Clone [this repository](https://github.com/JGL/SharingElements/) using the git clone command: 62 | 63 | ``` 64 | git clone git@github.com:JGL/SharingElements.git 65 | ``` 66 | 67 | Clone the [Satin](https://github.com/Hi-Rez/Satin), [Forge](https://github.com/Hi-Rez/Forge) & [Youi](https://github.com/Hi-Rez/Youi) repositories: 68 | 69 | ``` 70 | git clone git@github.com:Hi-Rez/Satin.git && git clone git@github.com:Hi-Rez/Forge.git && git clone git@github.com:Hi-Rez/Youi.git 71 | ``` 72 | 73 | Install [Bundler](https://bundler.io/) using: 74 | 75 | ``` 76 | sudo gem install bundler 77 | ``` 78 | 79 | Use the [cd](https://en.wikipedia.org/wiki/Cd_(command)) command to open the folder that the first git clone command created: 80 | 81 | ``` 82 | cd SharingElements 83 | ``` 84 | 85 | Install the Bundler dependencies specified in the [Gemfile](https://guides.cocoapods.org/using/a-gemfile.html): 86 | 87 | ``` 88 | bundle config set path vendor/bundle 89 | bundle install 90 | ``` 91 | 92 | Install the [CocoaPod](https://cocoapods.org/) dependencies using Bundler: 93 | 94 | ``` 95 | bundle exec pod install 96 | ``` 97 | 98 | Make sure to open the Xcode workspace, not the Xcode project: 99 | 100 | ``` 101 | open SharingElements.xcworkspace 102 | ``` 103 | 104 | Compile and build. 105 | 106 | ## Running instructions: 107 | 108 | * Press the M key to hide/show the mouse 109 | * Press the F key to switch between fullscreen/windowed mode 110 | * Press command I to hide/show the interface 111 | * Click and drag with the mouse to rotate the canvas in 3D, double click to reset to origin 112 | 113 | Don't forget to disable screen saver and other energy saving options on the installation Mac Mini M1! 114 | -------------------------------------------------------------------------------- /SharingElements.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.device.audio-input 8 | 9 | com.apple.security.device.camera 10 | 11 | com.apple.security.files.downloads.read-write 12 | 13 | com.apple.security.files.user-selected.read-write 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /SharingElements.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SharingElements.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SharingElements.xcodeproj/xcshareddata/xcschemes/SharingElements.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 60 | 62 | 68 | 69 | 70 | 71 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /SharingElements.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Source/Materials/LineMaterial.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineMaterial.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import MetalKit 10 | import Satin 11 | 12 | class LineMaterial: LiveMaterial { 13 | weak var mtkView: MTKView? 14 | weak var camera: PerspectiveCamera? 15 | 16 | init(pipelinesURL: URL, mtkView: MTKView?, instance: String = "") { 17 | self.mtkView = mtkView 18 | super.init(pipelinesURL: pipelinesURL, instance: instance) 19 | self.blending = .alpha 20 | } 21 | 22 | override func update(camera: Camera) { 23 | self.camera = camera as? PerspectiveCamera 24 | } 25 | 26 | func updateCamera() { 27 | guard let camera = self.camera else { return } 28 | let imagePlaneHeight = tanf(degToRad(camera.fov) * 0.5) 29 | let imagePlaneWidth = camera.aspect * imagePlaneHeight 30 | 31 | let cameraRight = normalize(camera.worldRightDirection) * imagePlaneWidth 32 | let cameraUp = normalize(camera.worldUpDirection) * imagePlaneHeight 33 | let cameraForward = normalize(camera.viewDirection) 34 | let cameraDelta = camera.far - camera.near 35 | let cameraA = camera.far / cameraDelta 36 | let cameraB = (camera.far * camera.near) / cameraDelta 37 | 38 | set("Camera Position", camera.worldPosition) 39 | set("Camera Right", cameraRight) 40 | set("Camera Up", cameraUp) 41 | set("Camera Forward", cameraForward) 42 | 43 | if let view = mtkView { 44 | var dpr: Float = 0.0 45 | #if os(iOS) 46 | dpr = Float(view.contentScaleFactor) 47 | #elseif os(macOS) 48 | let pixelSize = view.convertToBacking(NSSize(width: 1, height: 1)) 49 | dpr = Float(pixelSize.width) 50 | #endif 51 | let size = view.drawableSize 52 | set("Resolution", simd_make_float4(Float(size.width), Float(size.height), Float(size.width/size.height), dpr)) 53 | } 54 | set("Near Far", simd_make_float2(camera.near, camera.far)) 55 | set("Camera Depth", simd_make_float2(cameraA, cameraB)) 56 | } 57 | 58 | override func bind(_ renderEncoder: MTLRenderCommandEncoder) { 59 | updateCamera() 60 | uniforms?.update() 61 | super.bind(renderEncoder) 62 | if let camera = self.camera { 63 | var view = camera.viewMatrix 64 | renderEncoder.setFragmentBytes(&view, length: MemoryLayout.size, index: FragmentBufferIndex.Custom0.rawValue) 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /Source/Materials/PointMaterial.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointMaterial.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import MetalKit 10 | import Satin 11 | 12 | class PointMaterial: LiveMaterial {} 13 | -------------------------------------------------------------------------------- /Source/Meshes/DataMesh.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DataMesh.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import Satin 10 | 11 | class DataMesh: Mesh { 12 | var updateData = true 13 | 14 | func _setup() 15 | { 16 | 17 | } 18 | 19 | func _update() 20 | { 21 | 22 | } 23 | 24 | override func update() { 25 | if updateData { 26 | _setup() 27 | updateData = false 28 | } 29 | _update() 30 | super.update() 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /Source/Meshes/LineMesh.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LineMesh.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import Satin 10 | import MetalKit 11 | 12 | class LineMesh: DataMesh { 13 | var pointsBuffer: MTLBuffer? 14 | var points: [simd_float3] { 15 | didSet { 16 | updateData = true 17 | } 18 | } 19 | 20 | required init(from decoder: Decoder) throws { 21 | fatalError("init(from:) has not been implemented") 22 | } 23 | 24 | init(points: [simd_float3], material: Material) { 25 | self.points = points 26 | super.init(geometry: QuadGeometry(), material: material) 27 | self.cullMode = .none 28 | self.preDraw = { [unowned self] renderEncoder in 29 | renderEncoder.setVertexBuffer(self.pointsBuffer, offset: 0, index: VertexBufferIndex.Custom0.rawValue) 30 | } 31 | } 32 | 33 | override func _setup() 34 | { 35 | guard let context = self.context else { return } 36 | instanceCount = points.count / 2 37 | guard instanceCount > 0 else { return } 38 | pointsBuffer = context.device.makeBuffer(bytes: points, length: MemoryLayout.stride * points.count) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/Meshes/PointMesh.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PointMesh.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import MetalKit 10 | import Satin 11 | 12 | class PointMesh: DataMesh { 13 | var pointsBuffer: MTLBuffer? 14 | var points: [simd_float3] { 15 | didSet { 16 | updateData = true 17 | } 18 | } 19 | 20 | required init(from decoder: Decoder) throws { 21 | fatalError("init(from:) has not been implemented") 22 | } 23 | 24 | init(points: [simd_float3], material: Material) { 25 | self.points = points 26 | super.init(geometry: PointGeometry(), material: material) 27 | self.cullMode = .none 28 | self.preDraw = { [unowned self] renderEncoder in 29 | renderEncoder.setVertexBuffer(self.pointsBuffer, offset: 0, index: VertexBufferIndex.Custom0.rawValue) 30 | } 31 | } 32 | 33 | override func _setup() 34 | { 35 | guard let context = self.context else { return } 36 | instanceCount = points.count 37 | guard instanceCount > 0 else { return } 38 | pointsBuffer = context.device.makeBuffer(bytes: &points, length: MemoryLayout.stride * points.count) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Source/Renderer/Renderer+Compute.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Renderer+Compute.swift 3 | // BodyElements macOS 4 | // 5 | // Created by Reza Ali on 7/18/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import Metal 10 | import Satin 11 | 12 | extension Renderer { 13 | func setupMetalCompiler() { 14 | metalFileCompiler.onUpdate = { [unowned self] in 15 | self.setupLibrary() 16 | } 17 | } 18 | 19 | // MARK: Setup Library 20 | 21 | func setupLibrary() { 22 | print("Compiling Library") 23 | do { 24 | var librarySource = "" 25 | if let colorParams = self.colorParams { 26 | librarySource += colorParams.structString 27 | } 28 | if let massesParams = self.massesParams { 29 | librarySource += massesParams.structString 30 | } 31 | 32 | librarySource += try metalFileCompiler.parse(pipelinesURL.appendingPathComponent("Compute/Shaders.metal")) 33 | 34 | injectConstants(source: &librarySource) 35 | let library = try context.device.makeLibrary(source: librarySource, options: .none) 36 | 37 | if let params = parseStruct(source: librarySource, key: "Particle") { 38 | computeSystem.setParams([params]) 39 | } 40 | 41 | if let computeParams = self.computeParams { 42 | computeParams.save(parametersURL.appendingPathComponent("Particles.json")) 43 | } 44 | 45 | if let params = parseParameters(source: librarySource, key: "ComputeUniforms") { 46 | params.label = "Compute" 47 | params.load(parametersURL.appendingPathComponent("Particles.json"), append: false) 48 | computeUniforms = UniformBuffer(context: context, parameters: params) 49 | computeParams = params 50 | } 51 | 52 | _updateInspector = true 53 | 54 | setupBufferCompute(library) 55 | } 56 | catch let MetalFileCompilerError.invalidFile(fileURL) { 57 | print("Invalid File: \(fileURL.absoluteString)") 58 | } 59 | catch { 60 | print("Error: \(error)") 61 | } 62 | } 63 | 64 | func setupBufferCompute(_ library: MTLLibrary) { 65 | do { 66 | computeSystem.resetPipeline = try makeComputePipeline(library: library, kernel: "resetCompute") 67 | computeSystem.updatePipeline = try makeComputePipeline(library: library, kernel: "updateCompute") 68 | computeSystem.reset() 69 | } 70 | catch { 71 | print(error.localizedDescription) 72 | } 73 | } 74 | 75 | func updateBufferComputeUniforms() { 76 | if let uniforms = self.computeUniforms { 77 | let theta = degToRad(camera.fov / 2.0) 78 | let gridHeight = 2.0 * abs(camera.position.z) * tan(theta) 79 | let gridWidth = gridHeight * camera.aspect 80 | uniforms.parameters.set("Grid Size", simd_make_float2(gridWidth, gridHeight)) 81 | uniforms.parameters.set("Count", particleCountValue) 82 | uniforms.parameters.set("Time", Float(currentTime)) 83 | uniforms.parameters.set("Delta Time", Float(deltaTime)) 84 | uniforms.parameters.set("Points", pointsMesh.points.count) 85 | uniforms.parameters.set("Lines", linesMesh.points.count/2) 86 | uniforms.update() 87 | } 88 | 89 | if let uniforms = self.colorUniforms { 90 | uniforms.update() 91 | } 92 | 93 | if let uniforms = self.massUniforms { 94 | uniforms.update() 95 | } 96 | } 97 | 98 | } 99 | -------------------------------------------------------------------------------- /Source/Renderer/Renderer+Inspector.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Renderer+Inspector.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import Satin 10 | #if os(macOS) || os(iOS) 11 | import Youi 12 | #endif 13 | 14 | extension Renderer { 15 | // MARK: - UI 16 | 17 | func setupInspector() { 18 | var panelOpenStates: [String: Bool] = [:] 19 | if let inspectorWindow = self.inspectorWindow, let inspector = inspectorWindow.inspectorViewController { 20 | let panels = inspector.getPanels() 21 | for panel in panels { 22 | if let label = panel.title { 23 | panelOpenStates[label] = panel.open 24 | } 25 | } 26 | } 27 | 28 | if inspectorWindow == nil { 29 | #if os(macOS) 30 | let inspectorWindow = InspectorWindow("Inspector") 31 | inspectorWindow.setIsVisible(false) 32 | #elseif os(iOS) 33 | let inspectorWindow = InspectorWindow("\(label) Controls", edge: .right) 34 | mtkView.addSubview(inspectorWindow.view) 35 | #endif 36 | self.inspectorWindow = inspectorWindow 37 | } 38 | 39 | if let inspectorWindow = self.inspectorWindow, let inspectorViewController = inspectorWindow.inspectorViewController { 40 | if inspectorViewController.getPanels().count > 0 { 41 | inspectorViewController.removeAllPanels() 42 | } 43 | 44 | updateUI(inspectorViewController) 45 | 46 | let panels = inspectorViewController.getPanels() 47 | for panel in panels { 48 | if let label = panel.title { 49 | if let open = panelOpenStates[label] { 50 | panel.open = open 51 | } 52 | } 53 | } 54 | } 55 | } 56 | 57 | func updateUI(_ inspectorViewController: InspectorViewController) { 58 | let paramters = params 59 | for key in paramKeys { 60 | if let param = paramters[key], let p = param { 61 | let panel = PanelViewController(key, parameters: p) 62 | inspectorViewController.addPanel(panel) 63 | } 64 | } 65 | } 66 | 67 | func updateInspector() { 68 | if _updateInspector { 69 | DispatchQueue.main.async { [unowned self] in 70 | self.setupInspector() 71 | } 72 | _updateInspector = false 73 | } 74 | } 75 | 76 | public func toggleInspector() 77 | { 78 | guard let inspectorWindow = self.inspectorWindow else { return } 79 | inspectorWindow.setIsVisible(!inspectorWindow.isVisible) 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Source/Renderer/Renderer+LiveCode.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Renderer+LiveCode.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | #if os(macOS) 10 | import AppKit 11 | 12 | extension Renderer { 13 | func openEditor() { 14 | if let editorURL = UserDefaults.standard.url(forKey: "Editor") { 15 | openEditor(at: editorURL) 16 | } 17 | else { 18 | let openPanel = NSOpenPanel() 19 | openPanel.canChooseFiles = true 20 | openPanel.allowsMultipleSelection = false 21 | openPanel.canCreateDirectories = false 22 | openPanel.begin(completionHandler: { [unowned self] (result: NSApplication.ModalResponse) in 23 | if result == .OK { 24 | if let editorUrl = openPanel.url { 25 | UserDefaults.standard.set(editorUrl, forKey: "Editor") 26 | self.openEditor(at: editorUrl) 27 | } 28 | } 29 | openPanel.close() 30 | }) 31 | } 32 | } 33 | 34 | func openEditor(at editorURL: URL) { 35 | do { 36 | try NSWorkspace.shared.open([self.pipelinesURL], withApplicationAt: editorURL, options: [], configuration: [:]) 37 | } catch { 38 | print(error) 39 | } 40 | } 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /Source/Renderer/Renderer+Observers.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Renderer+Observers.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import AVFoundation 10 | import Satin 11 | 12 | extension Renderer { 13 | func updateBackground() 14 | { 15 | let c = self.bgColor.value 16 | let red = Double(c.x) 17 | let green = Double(c.y) 18 | let blue = Double(c.z) 19 | let alpha = Double(c.w) 20 | let clearColor: MTLClearColor = .init(red: red, green: green, blue: blue, alpha: alpha) 21 | self.renderer.clearColor = clearColor 22 | } 23 | 24 | func setupObservers() { 25 | let bgColorCb: (Float4Parameter, NSKeyValueObservedChange) -> Void = { [unowned self] _, _ in 26 | self.updateBackground() 27 | } 28 | observers.append(bgColor.observe(\.x, changeHandler: bgColorCb)) 29 | observers.append(bgColor.observe(\.y, changeHandler: bgColorCb)) 30 | observers.append(bgColor.observe(\.z, changeHandler: bgColorCb)) 31 | observers.append(bgColor.observe(\.w, changeHandler: bgColorCb)) 32 | 33 | observers.append(videoInput.observe(\StringParameter.value, options: [.new, .old]) { [unowned self] _, change in 34 | if let newValue = change.newValue, let oldValue = change.oldValue, newValue != oldValue { 35 | if let captureInput = self.captureInput { 36 | self.captureSession.removeInput(captureInput) 37 | } 38 | 39 | guard let inputDevice = self.getInputDevice(self.videoInput.value) else { return } 40 | do { 41 | self.captureInput = try AVCaptureDeviceInput(device: inputDevice) 42 | } 43 | catch { 44 | print("AVCaptureDeviceInput Failed") 45 | return 46 | } 47 | 48 | self.captureSession.beginConfiguration() 49 | self.captureSession.sessionPreset = .vga640x480 50 | if self.captureSession.canAddInput(self.captureInput!) { 51 | self.captureSession.addInput(self.captureInput!) 52 | } 53 | self.captureSession.commitConfiguration() 54 | } 55 | }) 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Source/Renderer/Renderer+Save+Load.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Renderer+Save+Load.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Renderer { 12 | // MARK: - Save & Load 13 | 14 | public func save() { 15 | saveParameters(parametersURL) 16 | } 17 | 18 | public func load() { 19 | loadParameters(parametersURL) 20 | } 21 | 22 | public func save(_ url: URL) { 23 | let saveParametersURL = url.appendingPathComponent("Parameters") 24 | removeFile(url) 25 | if createDirectory(url), createDirectory(saveParametersURL) { 26 | saveParameters(saveParametersURL) 27 | } 28 | } 29 | 30 | public func load(_ url: URL) { 31 | loadParameters(url.appendingPathComponent("Parameters")) 32 | } 33 | 34 | func saveParameters(_ url: URL) { 35 | for (key, param) in params { 36 | if let p = param { 37 | p.save(url.appendingPathComponent(key + ".json")) 38 | } 39 | } 40 | } 41 | 42 | func loadParameters(_ url: URL) { 43 | for (key, param) in params { 44 | if let p = param { 45 | p.load(url.appendingPathComponent(key + ".json"), append: false) 46 | } 47 | } 48 | } 49 | 50 | public func savePreset(_ name: String) { 51 | let url = presetsURL.appendingPathComponent(name) 52 | removeFile(url) 53 | save(url) 54 | } 55 | 56 | public func loadPreset(_ name: String) { 57 | load(presetsURL.appendingPathComponent(name)) 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Source/Utilities/Element.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Element.swift 3 | // BodyElements macOS 4 | // 5 | // Created by Reza Ali on 7/26/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct Element: Codable { 12 | var name: String 13 | var symbol: String 14 | var mass: Float 15 | var atoms: Float 16 | } 17 | -------------------------------------------------------------------------------- /Source/Utilities/Elements.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Elements.swift 3 | // BodyElements macOS 4 | // 5 | // Created by Reza Ali on 7/26/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | struct Elements: Codable { 12 | var elements: [Element] = [] 13 | } 14 | -------------------------------------------------------------------------------- /Source/Utilities/Paths.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Paths.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import Satin 11 | 12 | func fileExists(_ url: URL) -> Bool { 13 | let fm = FileManager.default 14 | return fm.fileExists(atPath: url.path) 15 | } 16 | 17 | public func removeFile(_ url: URL) 18 | { 19 | let fm = FileManager.default 20 | if fm.fileExists(atPath: url.path) 21 | { 22 | do 23 | { 24 | try fm.removeItem(at: url) 25 | } 26 | catch 27 | { 28 | print(error) 29 | } 30 | } 31 | } 32 | 33 | func createDirectory(_ url: URL) -> Bool 34 | { 35 | let fm = FileManager.default 36 | do 37 | { 38 | try fm.createDirectory(at: url, withIntermediateDirectories: false, attributes: nil) 39 | return true 40 | } 41 | catch 42 | { 43 | print(error.localizedDescription) 44 | return false 45 | } 46 | } 47 | 48 | func copyDirectory(at: URL, to: URL) -> Bool 49 | { 50 | let fm = FileManager.default 51 | do 52 | { 53 | try fm.copyItem(at: at, to: to) 54 | return true 55 | } 56 | catch 57 | { 58 | print(error.localizedDescription) 59 | return false 60 | } 61 | } 62 | 63 | func copyDirectory(atPath: String, toPath: String, force: Bool = false) 64 | { 65 | let fm = FileManager.default 66 | // upon fresh install copy shaders directory 67 | if !fm.fileExists(atPath: toPath) 68 | { 69 | do 70 | { 71 | try fm.copyItem(atPath: atPath, toPath: toPath) 72 | } 73 | catch 74 | { 75 | print(error) 76 | } 77 | } 78 | // otherwise go through all the files and only overwrite the files that dont exist and the ones that have been updates 79 | else 80 | { 81 | do 82 | { 83 | let results = try fm.subpathsOfDirectory(atPath: atPath) 84 | for file in results 85 | { 86 | let srcPath = atPath + "/" + file 87 | let dstPath = toPath + "/" + file 88 | 89 | var directory: ObjCBool = ObjCBool(false) 90 | if fm.fileExists(atPath: srcPath, isDirectory: &directory) 91 | { 92 | if directory.boolValue 93 | { 94 | if !fm.fileExists(atPath: dstPath) 95 | { 96 | do 97 | { 98 | try fm.copyItem(atPath: srcPath, toPath: dstPath) 99 | } 100 | catch 101 | { 102 | print(error) 103 | } 104 | } 105 | else 106 | { 107 | copyDirectory(atPath: srcPath, toPath: dstPath) 108 | } 109 | } 110 | else 111 | { 112 | do 113 | { 114 | let resPathAttributes = try fm.attributesOfItem(atPath: srcPath) 115 | if fm.fileExists(atPath: dstPath) 116 | { 117 | let dstPathAttributes = try fm.attributesOfItem(atPath: dstPath) 118 | if let resDate = resPathAttributes[.modificationDate] as? Date, let dstDate = dstPathAttributes[.modificationDate] as? Date 119 | { 120 | if force || resDate > dstDate 121 | { 122 | do 123 | { 124 | try fm.removeItem(atPath: dstPath) 125 | try fm.copyItem(atPath: srcPath, toPath: dstPath) 126 | } 127 | catch 128 | { 129 | print(error) 130 | } 131 | } 132 | } 133 | } 134 | else 135 | { 136 | do 137 | { 138 | try fm.copyItem(atPath: srcPath, toPath: dstPath) 139 | } 140 | catch 141 | { 142 | print(error) 143 | } 144 | } 145 | } 146 | catch 147 | { 148 | print(error) 149 | } 150 | } 151 | } 152 | } 153 | } 154 | catch 155 | { 156 | print(error) 157 | } 158 | } 159 | } 160 | 161 | 162 | public func getDocumentsDirectoryURL() -> URL 163 | { 164 | return FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! 165 | } 166 | 167 | public func getDocumentsDirectoryURL(_ path: String) -> URL 168 | { 169 | return getDocumentsDirectoryURL().appendingPathComponent(path) 170 | } 171 | 172 | public func getDocumentsAssetsDirectoryUrl() -> URL 173 | { 174 | return getDocumentsDirectoryURL("Assets") 175 | } 176 | 177 | public func getDocumentsAssetsDirectoryUrl(_ path: String) -> URL 178 | { 179 | return getDocumentsAssetsDirectoryUrl().appendingPathComponent(path) 180 | } 181 | 182 | public func getResourceDirectory() -> String 183 | { 184 | return Bundle.main.resourcePath! 185 | } 186 | 187 | public func getResourceDirectory(_ path: String) -> String 188 | { 189 | return getResourceDirectory() + "/" + path 190 | } 191 | 192 | public func getResourcesDirectoryURL() -> URL 193 | { 194 | return Bundle.main.resourceURL! 195 | } 196 | 197 | public func getResourceDirectoryUrl(_ path: String) -> URL 198 | { 199 | return getResourcesDirectoryURL().appendingPathComponent(path) 200 | } 201 | 202 | public func getResourceAssetsDirectory() -> String 203 | { 204 | return getResourceDirectory("Assets") 205 | } 206 | 207 | public func getResourceAssetsDirectory(_ path: String) -> String 208 | { 209 | return getResourceAssetsDirectory() + "/" + path 210 | } 211 | 212 | public func getResourceAssetsDirectoryUrl() -> URL 213 | { 214 | return URL(fileURLWithPath: getResourceAssetsDirectory()) 215 | } 216 | 217 | public func getResourceAssetsDirectoryUrl(_ path: String) -> URL 218 | { 219 | return getResourceAssetsDirectoryUrl().appendingPathComponent(path) 220 | } 221 | -------------------------------------------------------------------------------- /Source/macOS/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // BodyElements 4 | // 5 | // Created by Reza Ali on 7/16/21. 6 | // Copyright © 2021 Reza Ali. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import MetalKit 11 | 12 | import Forge 13 | 14 | @NSApplicationMain 15 | class AppDelegate: NSObject, NSApplicationDelegate { 16 | @IBOutlet var presetsMenu: NSMenu? 17 | 18 | var window: NSWindow? 19 | var viewController: Forge.ViewController! 20 | weak var renderer: Renderer? 21 | 22 | func applicationDidFinishLaunching(_ aNotification: Notification) { 23 | if fileExists(getDocumentsAssetsDirectoryUrl()) { 24 | copyDirectory(atPath: getResourceAssetsDirectoryUrl().path, toPath: getDocumentsAssetsDirectoryUrl().path) 25 | } 26 | else { 27 | copyDirectory(atPath: getResourceAssetsDirectoryUrl().path, toPath: getDocumentsAssetsDirectoryUrl().path, force: true) 28 | } 29 | 30 | let window = NSWindow( 31 | contentRect: NSRect(origin: CGPoint(x: 100.0, y: 400.0), size: CGSize(width: 512, height: 512)), 32 | styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView], 33 | backing: .buffered, 34 | defer: true 35 | ) 36 | 37 | self.window = window 38 | self.viewController = Forge.ViewController(nibName: .init("ViewController"), bundle: Bundle(for: Forge.ViewController.self)) 39 | guard let view = self.viewController?.view else { return } 40 | let renderer = Renderer() 41 | self.viewController.renderer = renderer 42 | self.renderer = renderer 43 | guard let contentView = window.contentView else { return } 44 | 45 | view.frame = contentView.bounds 46 | view.autoresizingMask = [.width, .height] 47 | contentView.addSubview(view) 48 | 49 | window.setFrameAutosaveName("Sharing Elements") 50 | window.titlebarAppearsTransparent = true 51 | window.title = "" 52 | window.makeKeyAndOrderFront(nil) 53 | 54 | self.setupPresetsMenu() 55 | } 56 | 57 | func applicationWillTerminate(_ aNotification: Notification) { 58 | if let renderer = self.renderer { 59 | renderer.cleanup() 60 | } 61 | self.viewController?.view.removeFromSuperview() 62 | self.viewController.renderer = nil 63 | self.viewController = nil 64 | } 65 | 66 | func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 67 | return true 68 | } 69 | 70 | // MARK: - Toggle Inspector 71 | 72 | @IBAction func toggleInspector(_ sender: NSMenuItem) { 73 | guard let renderer = self.renderer else { return } 74 | renderer.toggleInspector() 75 | } 76 | 77 | // MARK: - Presets 78 | 79 | @IBAction func savePreset(_ sender: NSMenuItem) { 80 | guard let renderer = self.renderer else { return } 81 | let msg = NSAlert() 82 | msg.addButton(withTitle: "OK") 83 | msg.addButton(withTitle: "Cancel") 84 | msg.messageText = "Enter Preset Name" 85 | msg.informativeText = "" 86 | 87 | let input = NSTextField(frame: NSRect(x: 0, y: 0, width: 200, height: 22)) 88 | input.stringValue = "" 89 | input.placeholderString = "" 90 | 91 | msg.accessoryView = input 92 | msg.window.initialFirstResponder = input 93 | let response: NSApplication.ModalResponse = msg.runModal() 94 | 95 | let presetName = input.stringValue 96 | if !presetName.isEmpty, response == NSApplication.ModalResponse.alertFirstButtonReturn { 97 | renderer.savePreset(presetName) 98 | self.setupPresetsMenu() 99 | } 100 | } 101 | 102 | @IBAction func savePresetAs(_ sender: NSMenuItem) { 103 | guard let renderer = self.renderer else { return } 104 | let savePanel = NSSavePanel() 105 | savePanel.canCreateDirectories = true 106 | savePanel.title = "Save Preset" 107 | savePanel.allowedFileTypes = [""] 108 | savePanel.nameFieldStringValue = "" 109 | savePanel.begin(completionHandler: { (result: NSApplication.ModalResponse) in 110 | if result == .OK, let url = savePanel.url { 111 | renderer.save(url) 112 | } 113 | savePanel.close() 114 | }) 115 | } 116 | 117 | @IBAction func openPreset(_ sender: NSMenuItem) { 118 | guard let renderer = self.renderer else { return } 119 | let openPanel = NSOpenPanel() 120 | openPanel.canChooseFiles = false 121 | openPanel.canChooseDirectories = true 122 | openPanel.allowsMultipleSelection = false 123 | openPanel.canCreateDirectories = false 124 | openPanel.begin(completionHandler: { (result: NSApplication.ModalResponse) in 125 | if result == .OK { 126 | if let url = openPanel.url { 127 | renderer.load(url) 128 | } 129 | } 130 | openPanel.close() 131 | }) 132 | } 133 | 134 | func setupPresetsMenu() { 135 | guard let menu = presetsMenu else { return } 136 | var activePresetName = "" 137 | for item in menu.items { 138 | if item.state == .on { 139 | activePresetName = item.title 140 | break 141 | } 142 | } 143 | menu.removeAllItems() 144 | menu.addItem(withTitle: "Default", action: #selector(self.loadPreset), keyEquivalent: "") 145 | menu.addItem(NSMenuItem.separator()) 146 | 147 | let fm = FileManager.default 148 | let presetsUrl = getDocumentsAssetsDirectoryUrl("Presets") 149 | if fm.fileExists(atPath: presetsUrl.path) { 150 | do { 151 | let presets = try fm.contentsOfDirectory(atPath: presetsUrl.path).sorted() 152 | for preset in presets { 153 | let presetUrl = presetsUrl.appendingPathComponent(preset) 154 | var isDirectory: ObjCBool = false 155 | if fm.fileExists(atPath: presetUrl.path, isDirectory: &isDirectory) { 156 | if isDirectory.boolValue { 157 | let item = NSMenuItem(title: preset, action: #selector(self.loadPreset), keyEquivalent: "") 158 | if preset == activePresetName { 159 | item.state = .on 160 | } 161 | menu.addItem(item) 162 | } 163 | } 164 | } 165 | } 166 | catch { 167 | print(error.localizedDescription) 168 | } 169 | } 170 | } 171 | 172 | @objc func loadPreset(_ sender: NSMenuItem) { 173 | guard let renderer = self.renderer else { return } 174 | 175 | renderer.loadPreset(sender.title) 176 | 177 | guard let menu = presetsMenu else { return } 178 | for item in menu.items { 179 | item.state = .off 180 | } 181 | sender.state = .on 182 | } 183 | } 184 | -------------------------------------------------------------------------------- /Source/macOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSCameraUsageDescription 26 | Lets Make Art 27 | NSHumanReadableCopyright 28 | Copyright © 2021 Reza Ali. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /Source/macOS/MainMenu.xib: -------------------------------------------------------------------------------- 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 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /docs/001_firstScenes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Body Elements 001 First Scenes 8 | 9 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/001_firstScenes/sketch.js: -------------------------------------------------------------------------------- 1 | // Based on examples from: http://brm.io/matter-js/ 2 | // Originally from https://github.com/shiffman/p5-matter/blob/master/01_basics/sketch.js 3 | 4 | // var Engine = Matter.Engine; 5 | // var Render = Matter.Render; 6 | // var World = Matter.World; 7 | // var Body = Matter.Body; 8 | // var Bodies = Matter.Bodies; 9 | // var Composite = Matter.Composite; 10 | // var Composites = Matter.Composites; 11 | // var Constraint = Matter.Constraint; 12 | 13 | // //via https://github.com/shiffman/p5-matter/blob/master/03_chain/sketch.js 14 | // var Mouse = Matter.Mouse; 15 | // var MouseConstraint = Matter.MouseConstraint; 16 | // var mouseConstraint; 17 | 18 | // var engine; //matter physics engine 19 | // var world; //matter physics world 20 | // var bodies; //matter physics bodies 21 | 22 | // var ground; //ground object for the physics simluation, so that the rectangles can't go off the canvas 23 | // var leftWall; //left wall as above 24 | // var rightWall; //right wall as above 25 | // var ceiling; //ceilling as above 26 | 27 | // GUI controls: https://github.com/bitcraftlab/p5.gui 28 | var visible; //is the GUI visible or not? 29 | var gui; //the gui object itself 30 | 31 | var manager; 32 | 33 | let bodyImage; 34 | let worldImage; 35 | let gridImage; 36 | let streamImage; 37 | 38 | var centre = new p5.Vector(); 39 | 40 | function preload() { 41 | // preload() runs once 42 | bodyImage = loadImage("../img/scene_01.png"); 43 | worldImage = loadImage("../img/scene_02.png"); 44 | gridImage = loadImage("../img/scene_03.png"); 45 | streamImage = loadImage("../img/scene_04.png"); 46 | } 47 | 48 | function windowResized() { 49 | resizeCanvas(windowWidth, windowHeight); 50 | centre.set(width / 2, height / 2); 51 | } 52 | 53 | function setup() { 54 | //setting up colour mode and fill mode 55 | colorMode(HSB); //https://p5js.org/reference/#/p5/colorMode have to do it right at the start of setup, otherwise other created colours remember the colour mode they were created in 56 | //colorMode(HSB, 360, 100, 100, 1) is default 57 | 58 | //https://stackoverflow.com/questions/37083287/how-to-set-canvas-width-height-using-parent-divs-attributes 59 | //https://github.com/processing/p5.js/wiki/Beyond-the-canvas 60 | //https://github.com/processing/p5.js/wiki/Positioning-your-canvas 61 | 62 | createCanvas(windowWidth, windowHeight); 63 | centre.set(width / 2, height / 2); 64 | //console.log(canvas); 65 | // canvas.parent("BodyElements"); //https://github.com/processing/p5.js/wiki/Beyond-the-canvas 66 | 67 | textSize(42); //42 is the answer to everything 68 | textAlign(CENTER, CENTER); //https://p5js.org/reference/#/p5/textAlign 69 | 70 | // // create an engine 71 | // engine = Engine.create(); 72 | // world = engine.world; 73 | 74 | // // get mouse interaction set up.... 75 | // var mouse = Mouse.create(canvas.elt); 76 | // var mouseParams = { 77 | // mouse: mouse, 78 | // constraint: { 79 | // stiffness: 0.1, 80 | // }, 81 | // }; 82 | // mouseConstraint = MouseConstraint.create(engine, mouseParams); 83 | // mouseConstraint.mouse.pixelRatio = pixelDensity(); 84 | // World.add(world, mouseConstraint); 85 | 86 | // //make walls to constrain everything 87 | // var params = { 88 | // isStatic: true, 89 | // }; 90 | // ground = Bodies.rectangle(width / 2, height + 1, width, 1, params); //+1 so it's just below the bottom of the screen, Matter.Bodies.rectangle(x, y, width, height, [options]) 91 | // leftWall = Bodies.rectangle(0, height / 2, 1, height, params); 92 | // rightWall = Bodies.rectangle(width, height / 2, 1, height, params); 93 | // ceiling = Bodies.rectangle(width / 2, 0, width, 1, params); 94 | // World.add(world, ground); 95 | // World.add(world, leftWall); 96 | // World.add(world, rightWall); 97 | // World.add(world, ceiling); 98 | 99 | // // run the engine 100 | // Engine.run(engine); 101 | 102 | // Create Layout GUI 103 | visible = true; 104 | gui = createGui("Press g to hide/show me"); 105 | 106 | manager = new SceneManager(); 107 | 108 | // Preload scenes. Preloading is normally optional 109 | // ... but needed if showNextScene() is used. 110 | manager.addScene(BodyScene); 111 | manager.addScene(WorldScene); 112 | manager.addScene(GridScene); 113 | manager.addScene(StreamScene); 114 | 115 | manager.showNextScene(); 116 | } 117 | 118 | // Using p5 to render 119 | function draw() { 120 | background("red"); 121 | // clear(); //https://p5js.org/reference/#/p5/clear 122 | manager.draw(); 123 | } 124 | 125 | function mousePressed() { 126 | manager.handleEvent("mousePressed"); 127 | } 128 | 129 | // check for keyboard events 130 | function keyPressed() { 131 | switch (key) { 132 | // type [g] to hide / show the GUI 133 | case "g": 134 | visible = !visible; 135 | if (visible) gui.show(); 136 | else gui.hide(); 137 | break; 138 | case "1": 139 | manager.showScene(BodyScene); 140 | console.log("Switching to BodyScene"); 141 | break; 142 | case "2": 143 | manager.showScene(WorldScene); 144 | console.log("Switching to WorldScene"); 145 | break; 146 | case "3": 147 | manager.showScene(GridScene); 148 | console.log("Switching to GridScene"); 149 | break; 150 | case "4": 151 | manager.showScene(StreamScene); 152 | console.log("Switching to StreamScene"); 153 | break; 154 | } 155 | 156 | // ... then dispatch via the SceneManager. 157 | manager.handleEvent("keyPressed"); 158 | } 159 | 160 | // ============================================================= 161 | // = BEGIN SCENES = 162 | // ============================================================= 163 | 164 | function BodyScene() { 165 | // enter() will be executed each time the SceneManager switches 166 | // to this animation 167 | this.enter = function () {}; 168 | 169 | this.draw = function () { 170 | background("green"); 171 | 172 | image(bodyImage, 0, 0, 300, 300); //TODO: change this to native size, and the others 173 | 174 | fill("black"); 175 | text( 176 | "Press keys 1, 2, 3, 4 to jump to a particular scene\n" + 177 | "... or mouse to advance animation.\n\n" + 178 | "Press any other key to display it.", 179 | width / 2, 180 | height / 2 181 | ); 182 | }; 183 | 184 | this.mousePressed = function () { 185 | this.sceneManager.showNextScene(); 186 | }; 187 | } 188 | 189 | function WorldScene() { 190 | // enter() will be executed each time the SceneManager switches 191 | // to this animation 192 | this.enter = function () {}; 193 | 194 | this.draw = function () { 195 | background("blue"); 196 | image(worldImage, 0, 0, 300, 300); //TODO: change this to native size, and the others 197 | fill("black"); 198 | text( 199 | "Press keys 1, 2, 3, 4 to jump to a particular scene\n" + 200 | "... or mouse to advance to next scene.\n\n" + 201 | width / 2, 202 | height / 2 203 | ); 204 | }; 205 | 206 | this.mousePressed = function () { 207 | this.sceneManager.showNextScene(); 208 | }; 209 | } 210 | 211 | function GridScene() { 212 | // enter() will be executed each time the SceneManager switches 213 | // to this animation 214 | this.enter = function () {}; 215 | 216 | this.draw = function () { 217 | background("orange"); 218 | image(gridImage, 0, 0, 300, 300); //TODO: change this to native size, and the others 219 | fill("black"); 220 | text( 221 | "Press keys 1, 2, 3, 4 to jump to a particular scene\n" + 222 | "... or mouse to advance to next scene.\n\n" + 223 | width / 2, 224 | height / 2 225 | ); 226 | }; 227 | 228 | this.mousePressed = function () { 229 | this.sceneManager.showNextScene(); 230 | }; 231 | } 232 | 233 | function StreamScene() { 234 | // enter() will be executed each time the SceneManager switches 235 | // to this animation 236 | this.enter = function () {}; 237 | 238 | this.draw = function () { 239 | background("pink"); 240 | image(streamImage, 0, 0, 300, 300); //TODO: change this to native size, and the others 241 | fill("black"); 242 | text( 243 | "Press keys 1, 2, 3, 4 to jump to a particular scene\n" + 244 | "... or mouse to advance to next scene.\n\n" + 245 | width / 2, 246 | height / 2 247 | ); 248 | }; 249 | 250 | this.mousePressed = function () { 251 | this.sceneManager.showNextScene(); 252 | }; 253 | } 254 | -------------------------------------------------------------------------------- /docs/002_firstParticles/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Body Elements 002 First Particles 8 | 9 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /docs/003_firstBodyTrack/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Body Elements 003 First Body Tracking 8 | 9 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /docs/004_firstProperElements/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Body Elements 004: First proper ratio of elements by mass and number of atoms 8 | 9 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /docs/005_stressTestForM1/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Body Elements 005: Stress Test for M1 8 | 9 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /docs/img/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JGL/SharingElements/32db5775e4dfd4b066b704f8cfabb83d5459621a/docs/img/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/img/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JGL/SharingElements/32db5775e4dfd4b066b704f8cfabb83d5459621a/docs/img/android-chrome-512x512.png -------------------------------------------------------------------------------- /docs/img/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JGL/SharingElements/32db5775e4dfd4b066b704f8cfabb83d5459621a/docs/img/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/img/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JGL/SharingElements/32db5775e4dfd4b066b704f8cfabb83d5459621a/docs/img/favicon-16x16.png -------------------------------------------------------------------------------- /docs/img/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JGL/SharingElements/32db5775e4dfd4b066b704f8cfabb83d5459621a/docs/img/favicon-32x32.png -------------------------------------------------------------------------------- /docs/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JGL/SharingElements/32db5775e4dfd4b066b704f8cfabb83d5459621a/docs/img/favicon.ico -------------------------------------------------------------------------------- /docs/img/scene_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JGL/SharingElements/32db5775e4dfd4b066b704f8cfabb83d5459621a/docs/img/scene_01.png -------------------------------------------------------------------------------- /docs/img/scene_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JGL/SharingElements/32db5775e4dfd4b066b704f8cfabb83d5459621a/docs/img/scene_02.png -------------------------------------------------------------------------------- /docs/img/scene_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JGL/SharingElements/32db5775e4dfd4b066b704f8cfabb83d5459621a/docs/img/scene_03.png -------------------------------------------------------------------------------- /docs/img/scene_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JGL/SharingElements/32db5775e4dfd4b066b704f8cfabb83d5459621a/docs/img/scene_04.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Body Elements index 9 | 10 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

This is the index of all experiments for the Body Elements installation. The corresponding GitHub, where source code and other things can be found is here: https://github.com/JGL/BodyElements/.

30 |

Experiments: 31 |

    32 |
  1. Experiment 1: first scene manager and 4 scenes.
  2. 33 |
  3. Experiment 2: particles in 4 scenes.
  4. 34 |
  5. Experiment 3: particles in 4 scenes with live body tracking.
  6. 35 |
  7. Experiment 4: proper ratio of elements by mass and number of atoms.
  8. 36 |
  9. Experiment 5: stress test for M1.
  10. 37 |
38 |

39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /docs/js/matter-wrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * matter-wrap 0.2.0 by Liam Brummitt 2017-07-04 3 | * https://github.com/liabru/matter-wrap 4 | * License MIT 5 | */ 6 | !function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("matter-js")):"function"==typeof define&&define.amd?define(["matter-js"],e):"object"==typeof exports?exports.MatterWrap=e(require("matter-js")):n.MatterWrap=e(n.Matter)}(this,function(n){return function(n){function e(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return n[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var t={};return e.m=n,e.c=t,e.i=function(n){return n},e.d=function(n,t,r){e.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:r})},e.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,"a",t),t},e.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},e.p="/libs",e(e.s=1)}([function(e,t){e.exports=n},function(n,e,t){"use strict";var r=t(0),o={name:"matter-wrap",version:"0.1.3",for:"matter-js@^0.12.0",install:function(n){n.after("Engine.update",function(){o.Engine.update(this)})},Engine:{update:function(n){for(var e=n.world,t=r.Composite.allBodies(e),i=r.Composite.allComposites(e),u=0;ue.max.x?t=e.min.x-n.max.x:n.max.xe.max.y?r=e.min.y-n.max.y:n.max.y 1) { 128 | params = Array.prototype.slice.call(arguments) 129 | params = params.slice(1); 130 | } 131 | // if no arguments are provided take all keys of the object 132 | if(params.length === 0) { 133 | // won't work in Internet Explorer < 9 (use a polyfill) 134 | params = Object.keys(object); 135 | } 136 | qs.bindParams(object, params); 137 | }; 138 | 139 | // noLoop() to call draw every time the gui changes when we are not looping 140 | this.noLoop = function() { 141 | qs.setGlobalChangeHandler(sketch._draw); 142 | }; 143 | 144 | this.loop = function() { 145 | qs.setGlobalChangeHandler(null); 146 | }; 147 | 148 | // pass through ... 149 | this.show = function() { qs.show(); }; 150 | this.hide = function() { qs.hide(); }; 151 | this.toggleVisibility = function() { qs.toggleVisibility(); }; 152 | this.setPosition = function(x, y) { 153 | qs.setPosition(x, y); 154 | return this; 155 | }; 156 | 157 | // Extend Quicksettings 158 | // so it can magically create a GUI for parameters passed by name 159 | qs.bindParams = function(object, params) { 160 | 161 | // iterate over all the arguments 162 | for(var i = 0; i < params.length; i++) { 163 | 164 | var arg = params[i]; 165 | var val = object[arg]; 166 | var typ = typeof val; 167 | 168 | //console.log(typ, arg, val); 169 | 170 | // don't need to show the sliders for range min, max and step of a property 171 | var sliderConfigRegEx = /^(.*min|.*max|.*step)$/i; 172 | if( sliderConfigRegEx.test(arg)){ 173 | continue; 174 | } 175 | switch(typ) { 176 | 177 | case 'object': 178 | 179 | // color triple ? 180 | if(val instanceof Array && val.length === 3 && typeof val[0] === 'number') { 181 | // create color according to the current color mode of the current sketch 182 | var c = sketch.color(val[0], val[1], val[2]); 183 | // get decimal RGB values 184 | var c2 = c.levels.slice(0,3); 185 | // create HTML color code 186 | var vcolor = '#' + c2.map(function(value) { 187 | return ('0' + value.toString(16)).slice(-2); 188 | }).join(''); 189 | this.bindColor(arg, vcolor, object); 190 | } else { 191 | // multiple choice drop down list 192 | this.bindDropDown(arg, val, object); 193 | object[arg] = val[0]; 194 | } 195 | break; 196 | 197 | case 'number': 198 | 199 | // values as defined by magic variables or gui.sliderRange() 200 | var vmin = object[arg + 'Min'] || object[arg + 'min'] || sliderMin; 201 | var vmax = object[arg + 'Max'] || object[arg + 'max'] || sliderMax; 202 | var vstep = object[arg + 'Step'] || object[arg + 'step'] || sliderStep; 203 | 204 | // the actual values can still overrule the limits set by magic 205 | var vmin = Math.min(val, vmin); 206 | var vmax = Math.max(val, vmax); 207 | 208 | // set the range 209 | this.bindRange(arg, vmin, vmax, val, vstep, object); 210 | 211 | break; 212 | 213 | case 'string': 214 | 215 | var HEX6 = /^#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i; 216 | if(HEX6.test(val)) { 217 | // HTML color value (such as #ff0000) 218 | this.bindColor(arg, val, object); 219 | } else { 220 | // String value 221 | this.bindText(arg, val, object); 222 | } 223 | break; 224 | 225 | case 'boolean': 226 | 227 | this.bindBoolean(arg, object[arg], object); 228 | break; 229 | 230 | } 231 | } 232 | }; 233 | 234 | // bind params that are defined globally 235 | qs.bindGlobals = function(params) { 236 | this.bindParams(window, params); 237 | }; 238 | 239 | } 240 | 241 | // Just a Dummy object that provides the GUI interface 242 | function DummyGui() { 243 | var f = function() {}; 244 | this.addGlobals = f; 245 | this.noLoop = f; 246 | this.addObject = f; 247 | this.show = f; 248 | } 249 | 250 | 251 | })(); 252 | -------------------------------------------------------------------------------- /docs/js/scenemanager.js: -------------------------------------------------------------------------------- 1 | // 2 | // p5 SceneManager helps you create p5.js sketches with multiple states / scenes 3 | // Each scene is a like a sketch within the main sketch. You focus on creating 4 | // the scene like a regular sketch and SceneManager ensure scene switching 5 | // routing the main setup(), draw(), mousePressed(), etc. events to the 6 | // appropriate current scene. 7 | // 8 | // Author: Marian Veteanu 9 | // http://github.com/mveteanu 10 | // 11 | function SceneManager(p) 12 | { 13 | this.scenes = []; 14 | this.scene = null; 15 | 16 | // Wire relevant p5.js events, except setup() 17 | // If you don't call this method, you need to manually wire events 18 | this.wire = function() 19 | { 20 | const P5Events = [ "mouseClicked", 21 | "mousePressed", 22 | "mouseReleased", 23 | "mouseMoved", 24 | "mouseDragged", 25 | "doubleClicked", 26 | "mouseWheel", 27 | "keyPressed", 28 | "keyReleased", 29 | "keyTyped", 30 | "touchStarted", 31 | "touchMoved", 32 | "touchEnded", 33 | "deviceMoved", 34 | "deviceTurned", 35 | "deviceShaken" ]; 36 | 37 | var me = this; 38 | var o = p != null ? p : window; 39 | 40 | // Wire draw manually for speed reasons... 41 | o.draw = function(){ me.draw(); }; 42 | 43 | // This loop will wire automatically all P5 events to each scene like this: 44 | // o.mouseClicked = function() { me.handleEvent("mouseClicked"); } 45 | for(var i = 0; i < P5Events.length; i++) 46 | { 47 | let sEvent = P5Events[i]; // let is necesary to set the scope at the level of for 48 | o[sEvent] = function() { me.handleEvent(sEvent) }; 49 | } 50 | 51 | return me; 52 | } 53 | 54 | 55 | // Add a scene to the collection 56 | // You need to add all the scenes if intend to call .showNextScene() 57 | this.addScene = function( fnScene ) 58 | { 59 | var oScene = new fnScene(p); 60 | 61 | // inject p as a property of the scene 62 | this.p = p; 63 | 64 | // inject sceneManager as a property of the scene 65 | oScene.sceneManager = this; 66 | 67 | var o = { fnScene: fnScene, 68 | oScene: oScene, 69 | hasSetup : "setup" in oScene, 70 | hasEnter : "enter" in oScene, 71 | hasDraw : "draw" in oScene, 72 | setupExecuted : false, 73 | enterExecuted : false }; 74 | 75 | this.scenes.push(o); 76 | return o; 77 | } 78 | 79 | // Return the index of a scene in the internal collection 80 | this.findSceneIndex = function( fnScene ) 81 | { 82 | for(var i = 0; i < this.scenes.length; i++) 83 | { 84 | var o = this.scenes[i]; 85 | if ( o.fnScene == fnScene ) 86 | return i; 87 | } 88 | 89 | return -1; 90 | } 91 | 92 | // Return a scene object wrapper 93 | this.findScene = function( fnScene ) 94 | { 95 | var i = this.findSceneIndex( fnScene ); 96 | return i >= 0 ? this.scenes[i] : null; 97 | } 98 | 99 | // Returns true if the current displayed scene is fnScene 100 | this.isCurrent = function ( fnScene ) 101 | { 102 | if ( this.scene == null ) 103 | return false; 104 | 105 | return this.scene.fnScene == fnScene; 106 | } 107 | 108 | // Show a scene based on the function name 109 | // Optionally you can send arguments to the scene 110 | // Arguments will be retrieved in the scene via .sceneArgs property 111 | this.showScene = function( fnScene, sceneArgs ) 112 | { 113 | var o = this.findScene( fnScene ); 114 | 115 | if ( o == null ) 116 | o = this.addScene( fnScene ); 117 | 118 | // Re-arm the enter function at each show of the scene 119 | o.enterExecuted = false; 120 | 121 | this.scene = o; 122 | 123 | // inject sceneArgs as a property of the scene 124 | o.oScene.sceneArgs = sceneArgs; 125 | } 126 | 127 | // Show the next scene in the collection 128 | // Useful if implementing demo applications 129 | // where you want to advance scenes automatically 130 | this.showNextScene = function( sceneArgs ) 131 | { 132 | if ( this.scenes.length == 0 ) 133 | return; 134 | 135 | var nextSceneIndex = 0; 136 | 137 | if ( this.scene != null ) 138 | { 139 | // search current scene... 140 | // can be optimized to avoid searching current scene... 141 | var i = this.findSceneIndex( this.scene.fnScene ); 142 | nextSceneIndex = i < this.scenes.length - 1 ? i + 1 : 0; 143 | } 144 | 145 | var nextScene = this.scenes[nextSceneIndex]; 146 | this.showScene( nextScene.fnScene, sceneArgs ); 147 | } 148 | 149 | // This is the SceneManager .draw() method 150 | // This will dispatch the main draw() to the 151 | // current scene draw() method 152 | this.draw = function() 153 | { 154 | // take the current scene in a variable to protect it in case 155 | // it gets changed by the user code in the events such as setup()... 156 | var currScene = this.scene; 157 | 158 | if ( currScene == null ) 159 | return; 160 | 161 | if ( currScene.hasSetup && !currScene.setupExecuted ) 162 | { 163 | currScene.oScene.setup(); 164 | currScene.setupExecuted = true; 165 | } 166 | 167 | if ( currScene.hasEnter && !currScene.enterExecuted ) 168 | { 169 | currScene.oScene.enter(); 170 | currScene.enterExecuted = true; 171 | } 172 | 173 | if ( currScene.hasDraw ) 174 | { 175 | currScene.oScene.draw(); 176 | } 177 | } 178 | 179 | 180 | // Handle a certain even for a scene... 181 | // It is used by the anonymous functions from the wire() function 182 | this.handleEvent = function(sEvent) 183 | { 184 | if ( this.scene == null || this.scene.oScene == null ) 185 | return; 186 | 187 | var fnSceneEvent = this.scene.oScene[sEvent]; 188 | if (fnSceneEvent) 189 | fnSceneEvent.call(this.scene.oScene); 190 | } 191 | 192 | // Legacy method... preserved for maintaining compatibility 193 | this.mousePressed = function() 194 | { 195 | this.handleEvent("mousePressed"); 196 | } 197 | 198 | // Legacy method... preserved for maintaining compatibility 199 | this.keyPressed = function() 200 | { 201 | this.handleEvent("keyPressed"); 202 | } 203 | 204 | } 205 | -------------------------------------------------------------------------------- /docs/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} --------------------------------------------------------------------------------