├── .gitattributes ├── .gitignore ├── Assets ├── ColorSuite.meta ├── ColorSuite │ ├── ColorSuite.cs │ ├── ColorSuite.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── ColorSuiteEditor.cs │ │ └── ColorSuiteEditor.cs.meta │ ├── Shader.meta │ └── Shader │ │ ├── ColorSuite.shader │ │ └── ColorSuite.shader.meta ├── Editor.meta ├── Editor │ ├── PackageTool.cs │ └── PackageTool.cs.meta ├── Gasta.meta ├── Gasta │ ├── Acknowledgement.txt │ ├── Acknowledgement.txt.meta │ ├── hdriReflectionLow.hdr │ └── hdriReflectionLow.hdr.meta ├── Kino.meta ├── Kino │ ├── Fringe.meta │ ├── Fringe │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── FringeEditor.cs │ │ │ └── FringeEditor.cs.meta │ │ ├── Fringe.cs │ │ ├── Fringe.cs.meta │ │ ├── Shader.meta │ │ └── Shader │ │ │ ├── Fringe.shader │ │ │ └── Fringe.shader.meta │ ├── Obscurance.meta │ ├── Obscurance │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── ObscuranceEditor.cs │ │ │ └── ObscuranceEditor.cs.meta │ │ ├── Obscurance.cs │ │ ├── Obscurance.cs.meta │ │ ├── Script.meta │ │ ├── Script │ │ │ ├── PropertyObserver.cs │ │ │ └── PropertyObserver.cs.meta │ │ ├── Shader.meta │ │ └── Shader │ │ │ ├── Obscurance.cginc │ │ │ ├── Obscurance.cginc.meta │ │ │ ├── Obscurance.shader │ │ │ └── Obscurance.shader.meta │ ├── Vignette.meta │ └── Vignette │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── VignetteEditor.cs │ │ └── VignetteEditor.cs.meta │ │ ├── Shader.meta │ │ ├── Shader │ │ ├── Vignette.shader │ │ └── Vignette.shader.meta │ │ ├── Vignette.cs │ │ └── Vignette.cs.meta ├── Neuron.meta ├── Neuron │ ├── LICENSE.pdf │ ├── LICENSE.pdf.meta │ ├── Plugins.meta │ ├── Plugins │ │ ├── x86_64.meta │ │ └── x86_64 │ │ │ ├── NeuronDataReader.dll │ │ │ └── NeuronDataReader.dll.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── NeuronAnimatorEditor.cs │ │ └── NeuronAnimatorEditor.cs.meta │ │ ├── NeuronActor.cs │ │ ├── NeuronActor.cs.meta │ │ ├── NeuronAnimator.cs │ │ ├── NeuronAnimator.cs.meta │ │ ├── NeuronBones.cs │ │ ├── NeuronBones.cs.meta │ │ ├── NeuronConnection.cs │ │ ├── NeuronConnection.cs.meta │ │ ├── NeuronDataReader.cs │ │ ├── NeuronDataReader.cs.meta │ │ ├── NeuronSource.cs │ │ └── NeuronSource.cs.meta ├── Test.meta └── Test │ ├── Floor.mat │ ├── Floor.mat.meta │ ├── Model.meta │ ├── Model │ ├── Ethan.fbx │ ├── Ethan.fbx.meta │ ├── Materials.meta │ ├── Materials │ │ ├── EthanWhite.mat │ │ ├── EthanWhite.mat.meta │ │ ├── MazeLowMan Scaled.mat │ │ ├── MazeLowMan Scaled.mat.meta │ │ ├── MazeLowMan.mat │ │ └── MazeLowMan.mat.meta │ ├── MazeLowMan scaled.fbx │ ├── MazeLowMan scaled.fbx.meta │ ├── MazeLowMan.fbx │ └── MazeLowMan.fbx.meta │ ├── Skybox.mat │ ├── Skybox.mat.meta │ ├── Test.unity │ ├── Test.unity.meta │ ├── Texture.meta │ ├── Texture │ ├── EthanNormals.png │ ├── EthanNormals.png.meta │ ├── EthanOcclusion.png │ ├── EthanOcclusion.png.meta │ ├── LowManOcclusion.tif │ └── LowManOcclusion.tif.meta │ ├── UV Test.png │ └── UV Test.png.meta ├── NeuronAnimator.unitypackage ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityConnectSettings.asset └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | 6 | # Autogenerated VS/MD solution and project files 7 | *.csproj 8 | *.unityproj 9 | *.sln 10 | *.suo 11 | *.tmp 12 | *.user 13 | *.userprefs 14 | *.pidb 15 | *.booproj 16 | 17 | # Unity3D generated meta files 18 | *.pidb.meta 19 | 20 | # Unity3D Generated File On Crash Reports 21 | sysinfo.txt 22 | 23 | # ========================= 24 | # Operating System Files 25 | # ========================= 26 | 27 | # OSX 28 | # ========================= 29 | 30 | .DS_Store 31 | .AppleDouble 32 | .LSOverride 33 | 34 | # Thumbnails 35 | ._* 36 | 37 | # Files that might appear in the root of a volume 38 | .DocumentRevisions-V100 39 | .fseventsd 40 | .Spotlight-V100 41 | .TemporaryItems 42 | .Trashes 43 | .VolumeIcon.icns 44 | 45 | # Directories potentially created on remote AFP share 46 | .AppleDB 47 | .AppleDesktop 48 | Network Trash Folder 49 | Temporary Items 50 | .apdisk 51 | 52 | # Windows 53 | # ========================= 54 | 55 | # Windows image file caches 56 | Thumbs.db 57 | ehthumbs.db 58 | 59 | # Folder config file 60 | Desktop.ini 61 | 62 | # Recycle Bin used on file shares 63 | $RECYCLE.BIN/ 64 | 65 | # Windows Installer files 66 | *.cab 67 | *.msi 68 | *.msm 69 | *.msp 70 | 71 | # Windows shortcuts 72 | *.lnk 73 | -------------------------------------------------------------------------------- /Assets/ColorSuite.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13c0ed86d47f3ee478384d2d14452998 3 | folderAsset: yes 4 | timeCreated: 1466160676 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ColorSuite/ColorSuite.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2014, 2015 Keijiro Takahashi 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | // this software and associated documentation files (the "Software"), to deal in 6 | // the Software without restriction, including without limitation the rights to 7 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | // the Software, and to permit persons to whom the Software is furnished to do so, 9 | // subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | // 21 | using UnityEngine; 22 | using System.Collections; 23 | 24 | [ExecuteInEditMode] 25 | [ImageEffectTransformsToLDR] 26 | [RequireComponent(typeof(Camera))] 27 | [AddComponentMenu("Image Effects/Color Adjustments/Color Suite")] 28 | public class ColorSuite : MonoBehaviour 29 | { 30 | #region Public Properties 31 | 32 | // White balance. 33 | [SerializeField] float _colorTemp = 0.0f; 34 | [SerializeField] float _colorTint = 0.0f; 35 | 36 | public float colorTemp { 37 | get { return _colorTemp; } 38 | set { _colorTemp = value; } 39 | } 40 | public float colorTint { 41 | get { return _colorTint; } 42 | set { _colorTint = value; } 43 | } 44 | 45 | // Tone mapping. 46 | [SerializeField] bool _toneMapping = false; 47 | [SerializeField] float _exposure = 1.0f; 48 | 49 | public bool toneMapping { 50 | get { return _toneMapping; } 51 | set { _toneMapping = value; } 52 | } 53 | public float exposure { 54 | get { return _exposure; } 55 | set { _exposure = value; } 56 | } 57 | 58 | // Color saturation. 59 | [SerializeField] float _saturation = 1.0f; 60 | 61 | public float saturation { 62 | get { return _saturation; } 63 | set { _saturation = value; } 64 | } 65 | 66 | // Curves. 67 | [SerializeField] AnimationCurve _rCurve = AnimationCurve.Linear(0, 0, 1, 1); 68 | [SerializeField] AnimationCurve _gCurve = AnimationCurve.Linear(0, 0, 1, 1); 69 | [SerializeField] AnimationCurve _bCurve = AnimationCurve.Linear(0, 0, 1, 1); 70 | [SerializeField] AnimationCurve _cCurve = AnimationCurve.Linear(0, 0, 1, 1); 71 | 72 | public AnimationCurve redCurve { 73 | get { return _rCurve; } 74 | set { _rCurve = value; UpdateLUT(); } 75 | } 76 | public AnimationCurve greenCurve { 77 | get { return _gCurve; } 78 | set { _gCurve = value; UpdateLUT(); } 79 | } 80 | public AnimationCurve blueCurve { 81 | get { return _bCurve; } 82 | set { _bCurve = value; UpdateLUT(); } 83 | } 84 | public AnimationCurve rgbCurve { 85 | get { return _cCurve; } 86 | set { _cCurve = value; UpdateLUT(); } 87 | } 88 | 89 | // Dithering. 90 | public enum DitherMode { Off, Ordered, Triangular } 91 | [SerializeField] DitherMode _ditherMode = DitherMode.Off; 92 | 93 | public DitherMode ditherMode { 94 | get { return _ditherMode; } 95 | set { _ditherMode = value; } 96 | } 97 | 98 | #endregion 99 | 100 | #region Internal Properties 101 | 102 | // Reference to the shader. 103 | [SerializeField] Shader shader; 104 | 105 | // Temporary objects. 106 | Material _material; 107 | Texture2D _lutTexture; 108 | 109 | #endregion 110 | 111 | #region Local Functions 112 | 113 | // RGBM encoding. 114 | static Color EncodeRGBM(float r, float g, float b) 115 | { 116 | var a = Mathf.Max(Mathf.Max(r, g), Mathf.Max(b, 1e-6f)); 117 | a = Mathf.Ceil(a * 255) / 255; 118 | return new Color(r / a, g / a, b / a, a); 119 | } 120 | 121 | // An analytical model of chromaticity of the standard illuminant, by Judd et al. 122 | // http://en.wikipedia.org/wiki/Standard_illuminant#Illuminant_series_D 123 | // Slightly modifed to adjust it with the D65 white point (x=0.31271, y=0.32902). 124 | static float StandardIlluminantY(float x) 125 | { 126 | return 2.87f * x - 3.0f * x * x - 0.27509507f; 127 | } 128 | 129 | // CIE xy chromaticity to CAT02 LMS. 130 | // http://en.wikipedia.org/wiki/LMS_color_space#CAT02 131 | static Vector3 CIExyToLMS(float x, float y) 132 | { 133 | var Y = 1.0f; 134 | var X = Y * x / y; 135 | var Z = Y * (1.0f - x - y) / y; 136 | 137 | var L = 0.7328f * X + 0.4296f * Y - 0.1624f * Z; 138 | var M = -0.7036f * X + 1.6975f * Y + 0.0061f * Z; 139 | var S = 0.0030f * X + 0.0136f * Y + 0.9834f * Z; 140 | 141 | return new Vector3(L, M, S); 142 | } 143 | 144 | #endregion 145 | 146 | #region Private Methods 147 | 148 | // Set up the temporary assets. 149 | void Setup() 150 | { 151 | if (_material == null) 152 | { 153 | _material = new Material(shader); 154 | _material.hideFlags = HideFlags.DontSave; 155 | } 156 | 157 | if (_lutTexture == null) 158 | { 159 | _lutTexture = new Texture2D(512, 1, TextureFormat.ARGB32, false, true); 160 | _lutTexture.hideFlags = HideFlags.DontSave; 161 | _lutTexture.wrapMode = TextureWrapMode.Clamp; 162 | UpdateLUT(); 163 | } 164 | } 165 | 166 | // Update the LUT texture. 167 | void UpdateLUT() 168 | { 169 | for (var x = 0; x < _lutTexture.width; x++) 170 | { 171 | var u = 1.0f / (_lutTexture.width - 1) * x; 172 | var r = _cCurve.Evaluate(_rCurve.Evaluate(u)); 173 | var g = _cCurve.Evaluate(_gCurve.Evaluate(u)); 174 | var b = _cCurve.Evaluate(_bCurve.Evaluate(u)); 175 | _lutTexture.SetPixel(x, 0, EncodeRGBM(r, g, b)); 176 | } 177 | _lutTexture.Apply(); 178 | } 179 | 180 | // Calculate the color balance coefficients. 181 | Vector3 CalculateColorBalance() 182 | { 183 | // Get the CIE xy chromaticity of the reference white point. 184 | // Note: 0.31271 = x value on the D65 white point 185 | var x = 0.31271f - _colorTemp * (_colorTemp < 0.0f ? 0.1f : 0.05f); 186 | var y = StandardIlluminantY(x) + _colorTint * 0.05f; 187 | 188 | // Calculate the coefficients in the LMS space. 189 | var w1 = new Vector3(0.949237f, 1.03542f, 1.08728f); // D65 white point 190 | var w2 = CIExyToLMS(x, y); 191 | return new Vector3(w1.x / w2.x, w1.y / w2.y, w1.z / w2.z); 192 | } 193 | 194 | #endregion 195 | 196 | #region Monobehaviour Functions 197 | 198 | void Start() 199 | { 200 | Setup(); 201 | } 202 | 203 | void OnValidate() 204 | { 205 | Setup(); 206 | UpdateLUT(); 207 | } 208 | 209 | void Reset() 210 | { 211 | Setup(); 212 | UpdateLUT(); 213 | } 214 | 215 | void OnRenderImage(RenderTexture source, RenderTexture destination) 216 | { 217 | var linear = QualitySettings.activeColorSpace == ColorSpace.Linear; 218 | 219 | Setup(); 220 | 221 | if (linear) 222 | _material.EnableKeyword("COLORSPACE_LINEAR"); 223 | else 224 | _material.DisableKeyword("COLORSPACE_LINEAR"); 225 | 226 | if (_colorTemp != 0.0f || _colorTint != 0.0f) 227 | { 228 | _material.EnableKeyword("BALANCING_ON"); 229 | _material.SetVector("_Balance", CalculateColorBalance()); 230 | } 231 | else 232 | _material.DisableKeyword("BALANCING_ON"); 233 | 234 | if (_toneMapping && linear) 235 | { 236 | _material.EnableKeyword("TONEMAPPING_ON"); 237 | _material.SetFloat("_Exposure", _exposure); 238 | } 239 | else 240 | _material.DisableKeyword("TONEMAPPING_ON"); 241 | 242 | _material.SetTexture("_Curves", _lutTexture); 243 | _material.SetFloat("_Saturation", _saturation); 244 | 245 | if (_ditherMode == DitherMode.Ordered) 246 | { 247 | _material.EnableKeyword("DITHER_ORDERED"); 248 | _material.DisableKeyword("DITHER_TRIANGULAR"); 249 | } 250 | else if (_ditherMode == DitherMode.Triangular) 251 | { 252 | _material.DisableKeyword("DITHER_ORDERED"); 253 | _material.EnableKeyword("DITHER_TRIANGULAR"); 254 | } 255 | else 256 | { 257 | _material.DisableKeyword("DITHER_ORDERED"); 258 | _material.DisableKeyword("DITHER_TRIANGULAR"); 259 | } 260 | 261 | Graphics.Blit(source, destination, _material); 262 | } 263 | 264 | #endregion 265 | } 266 | -------------------------------------------------------------------------------- /Assets/ColorSuite/ColorSuite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10593b7d510b64560a297a8af1356dcb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: 6 | - shader: {fileID: 4800000, guid: dc9775b65c52747e69fc4c854c00d696, type: 3} 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ColorSuite/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 092e473a72cbd3c4c9e1c58ee539d353 3 | folderAsset: yes 4 | timeCreated: 1466160676 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ColorSuite/Editor/ColorSuiteEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2014, 2015 Keijiro Takahashi 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | // this software and associated documentation files (the "Software"), to deal in 6 | // the Software without restriction, including without limitation the rights to 7 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | // the Software, and to permit persons to whom the Software is furnished to do so, 9 | // subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | // 21 | using UnityEngine; 22 | using UnityEditor; 23 | using System.Collections; 24 | 25 | [CustomEditor(typeof(ColorSuite)), CanEditMultipleObjects] 26 | public class ColorSuiteEditor : Editor 27 | { 28 | SerializedProperty propColorTemp; 29 | SerializedProperty propColorTint; 30 | 31 | SerializedProperty propToneMapping; 32 | SerializedProperty propExposure; 33 | 34 | SerializedProperty propSaturation; 35 | 36 | SerializedProperty propRCurve; 37 | SerializedProperty propGCurve; 38 | SerializedProperty propBCurve; 39 | SerializedProperty propCCurve; 40 | 41 | SerializedProperty propDitherMode; 42 | 43 | GUIContent labelColorTemp; 44 | GUIContent labelColorTint; 45 | 46 | void OnEnable() 47 | { 48 | propColorTemp = serializedObject.FindProperty("_colorTemp"); 49 | propColorTint = serializedObject.FindProperty("_colorTint"); 50 | 51 | propToneMapping = serializedObject.FindProperty("_toneMapping"); 52 | propExposure = serializedObject.FindProperty("_exposure"); 53 | 54 | propSaturation = serializedObject.FindProperty("_saturation"); 55 | 56 | propRCurve = serializedObject.FindProperty("_rCurve"); 57 | propGCurve = serializedObject.FindProperty("_gCurve"); 58 | propBCurve = serializedObject.FindProperty("_bCurve"); 59 | propCCurve = serializedObject.FindProperty("_cCurve"); 60 | 61 | propDitherMode = serializedObject.FindProperty("_ditherMode"); 62 | 63 | labelColorTemp = new GUIContent("Color Temperature"); 64 | labelColorTint = new GUIContent("Tint (green-purple)"); 65 | } 66 | 67 | public override void OnInspectorGUI() 68 | { 69 | serializedObject.Update(); 70 | 71 | EditorGUILayout.PropertyField(propToneMapping); 72 | if (propToneMapping.hasMultipleDifferentValues || propToneMapping.boolValue) 73 | { 74 | EditorGUILayout.Slider(propExposure, 0, 5); 75 | if (QualitySettings.activeColorSpace != ColorSpace.Linear) 76 | EditorGUILayout.HelpBox("Linear space lighting should be enabled for tone mapping.", MessageType.Warning); 77 | } 78 | 79 | EditorGUILayout.Space(); 80 | 81 | EditorGUILayout.Slider(propColorTemp, -1.0f, 1.0f, labelColorTemp); 82 | EditorGUILayout.Slider(propColorTint, -1.0f, 1.0f, labelColorTint); 83 | 84 | EditorGUILayout.Space(); 85 | 86 | EditorGUILayout.Slider(propSaturation, 0, 2); 87 | 88 | EditorGUILayout.LabelField("Curves (R, G, B, Combined)"); 89 | EditorGUILayout.BeginHorizontal(); 90 | var doubleHeight = GUILayout.Height(EditorGUIUtility.singleLineHeight * 2); 91 | EditorGUILayout.PropertyField(propRCurve, GUIContent.none, doubleHeight); 92 | EditorGUILayout.PropertyField(propGCurve, GUIContent.none, doubleHeight); 93 | EditorGUILayout.PropertyField(propBCurve, GUIContent.none, doubleHeight); 94 | EditorGUILayout.PropertyField(propCCurve, GUIContent.none, doubleHeight); 95 | EditorGUILayout.EndHorizontal(); 96 | 97 | EditorGUILayout.Space(); 98 | 99 | EditorGUILayout.PropertyField(propDitherMode); 100 | 101 | serializedObject.ApplyModifiedProperties(); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /Assets/ColorSuite/Editor/ColorSuiteEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f328b8677255d426a999185016ef88f2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/ColorSuite/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0eae95d6241c18d45b2154cd33ba996b 3 | folderAsset: yes 4 | timeCreated: 1466160677 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ColorSuite/Shader/ColorSuite.shader: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2014, 2015 Keijiro Takahashi 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | // this software and associated documentation files (the "Software"), to deal in 6 | // the Software without restriction, including without limitation the rights to 7 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | // the Software, and to permit persons to whom the Software is furnished to do so, 9 | // subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | // 21 | 22 | Shader "Hidden/ColorSuite" 23 | { 24 | Properties 25 | { 26 | _MainTex ("-", 2D) = ""{} 27 | _Curves ("-", 2D) = ""{} 28 | _Exposure ("-", Float) = 1.0 29 | _Saturation ("-", Float) = 1.0 30 | _Balance ("-", Vector) = (1, 1, 1, 0) 31 | } 32 | 33 | CGINCLUDE 34 | 35 | // Multi-compilation options. 36 | #pragma multi_compile COLORSPACE_SRGB COLORSPACE_LINEAR 37 | #pragma multi_compile BALANCING_OFF BALANCING_ON 38 | #pragma multi_compile TONEMAPPING_OFF TONEMAPPING_ON 39 | #pragma multi_compile DITHER_OFF DITHER_ORDERED DITHER_TRIANGULAR 40 | 41 | #include "UnityCG.cginc" 42 | 43 | sampler2D _MainTex; 44 | float2 _MainTex_TexelSize; 45 | sampler2D _Curves; 46 | float _Exposure; 47 | float _Saturation; 48 | float4 _Balance; 49 | 50 | #if COLORSPACE_LINEAR 51 | 52 | // Color space conversion between sRGB and linear space. 53 | // http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html 54 | 55 | float3 srgb_to_linear(float3 c) 56 | { 57 | return c * (c * (c * 0.305306011 + 0.682171111) + 0.012522878); 58 | } 59 | 60 | float3 linear_to_srgb(float3 c) 61 | { 62 | return max(1.055 * pow(c, 0.416666667) - 0.055, 0.0); 63 | } 64 | 65 | #endif 66 | 67 | #if BALANCING_ON 68 | 69 | // Color space conversion between linear RGB and LMS 70 | // based on the CIECAM02 model (CAT02). 71 | // http://en.wikipedia.org/wiki/LMS_color_space#CAT02 72 | 73 | float3 lrgb_to_lms(float3 c) 74 | { 75 | float3x3 m = { 76 | 3.90405e-1f, 5.49941e-1f, 8.92632e-3f, 77 | 7.08416e-2f, 9.63172e-1f, 1.35775e-3f, 78 | 2.31082e-2f, 1.28021e-1f, 9.36245e-1f 79 | }; 80 | return mul(m, c); 81 | } 82 | 83 | float3 lms_to_lrgb(float3 c) 84 | { 85 | float3x3 m = { 86 | 2.85847e+0f, -1.62879e+0f, -2.48910e-2f, 87 | -2.10182e-1f, 1.15820e+0f, 3.24281e-4f, 88 | -4.18120e-2f, -1.18169e-1f, 1.06867e+0f 89 | }; 90 | return mul(m, c); 91 | } 92 | 93 | // Color balance function. 94 | // - The gamma compression/expansion equation used in this function 95 | // differs from the standard sRGB-Linear conversion. 96 | 97 | float3 apply_balance(float3 c) 98 | { 99 | #if !COLORSPACE_LINEAR 100 | // Do the gamma expansion before applying the color balance. 101 | c = pow(c, 2.2); 102 | #endif 103 | 104 | // Apply the color balance in the LMS color space. 105 | c = lms_to_lrgb(lrgb_to_lms(c) * _Balance); 106 | 107 | // It may return a minus value, which should be cropped out. 108 | c = max(c, 0.0); 109 | 110 | #if !COLORSPACE_LINEAR 111 | // Gamma compression. 112 | c = pow(c, 1.0 / 2.2); 113 | #endif 114 | 115 | return c; 116 | } 117 | 118 | #endif 119 | 120 | #if TONEMAPPING_ON 121 | 122 | // John Hable's filmic tone mapping operator. 123 | // http://filmicgames.com/archives/6 124 | 125 | float3 hable_op(float3 c) 126 | { 127 | float A = 0.15; 128 | float B = 0.50; 129 | float C = 0.10; 130 | float D = 0.20; 131 | float E = 0.02; 132 | float F = 0.30; 133 | return ((c * (c * A + B * C) + D * E) / (c * (c * A + B) + D * F)) - E / F; 134 | } 135 | 136 | float3 tone_mapping(float3 c) 137 | { 138 | c *= _Exposure * 4; 139 | c = hable_op(c) / hable_op(11.2); 140 | return pow(c, 1 / 2.2); 141 | } 142 | 143 | #endif 144 | 145 | // Color saturation. 146 | 147 | float luma(float3 c) 148 | { 149 | return 0.212 * c.r + 0.701 * c.g + 0.087 * c.b; 150 | } 151 | 152 | float3 apply_saturation(float3 c) 153 | { 154 | return lerp((float3)luma(c), c, _Saturation); 155 | } 156 | 157 | // RGB curves. 158 | 159 | float3 apply_curves(float3 c) 160 | { 161 | float4 r = tex2D(_Curves, float2(c.r, 0)); 162 | float4 g = tex2D(_Curves, float2(c.g, 0)); 163 | float4 b = tex2D(_Curves, float2(c.b, 0)); 164 | return float3(r.r * r.a, g.g * g.a, b.b * b.a); 165 | } 166 | 167 | #if DITHER_ORDERED 168 | 169 | // Interleaved gradient function from CoD AW. 170 | // http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare 171 | 172 | float interleaved_gradient(float2 uv) 173 | { 174 | float3 magic = float3(0.06711056, 0.00583715, 52.9829189); 175 | return frac(magic.z * frac(dot(uv, magic.xy))); 176 | } 177 | 178 | float3 dither(float2 uv) 179 | { 180 | return (float3)(interleaved_gradient(uv / _MainTex_TexelSize) / 255); 181 | } 182 | 183 | #endif 184 | 185 | #if DITHER_TRIANGULAR 186 | 187 | // Triangular PDF. 188 | 189 | float nrand(float2 uv) 190 | { 191 | return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453); 192 | } 193 | 194 | float3 dither(float2 uv) 195 | { 196 | float r = nrand(uv) + nrand(uv + (float2)1.1) - 0.5; 197 | return (float3)(r / 255); 198 | } 199 | 200 | #endif 201 | 202 | float4 frag(v2f_img i) : SV_Target 203 | { 204 | float4 source = tex2D(_MainTex, i.uv); 205 | float3 rgb = source.rgb; 206 | 207 | #if BALANCING_ON 208 | rgb = apply_balance(rgb); 209 | #endif 210 | 211 | #if COLORSPACE_LINEAR 212 | #if TONEMAPPING_ON 213 | // Apply the tone mapping. 214 | rgb = tone_mapping(rgb); 215 | #else 216 | // Convert the color into the sRGB color space. 217 | rgb = linear_to_srgb(rgb); 218 | #endif 219 | #endif 220 | 221 | // Color saturation. 222 | rgb = apply_saturation(rgb); 223 | 224 | // RGB curves. 225 | rgb = apply_curves(rgb); 226 | 227 | #if !DITHER_OFF 228 | rgb += dither(i.uv); 229 | #endif 230 | 231 | #if COLORSPACE_LINEAR 232 | // Take the color back into the linear color space. 233 | rgb = srgb_to_linear(rgb); 234 | #endif 235 | 236 | return float4(rgb, source.a); 237 | } 238 | 239 | ENDCG 240 | 241 | Subshader 242 | { 243 | Pass 244 | { 245 | ZTest Always Cull Off ZWrite Off 246 | Fog { Mode off } 247 | CGPROGRAM 248 | #pragma target 3.0 249 | #pragma glsl 250 | #pragma vertex vert_img 251 | #pragma fragment frag 252 | ENDCG 253 | } 254 | } 255 | } 256 | -------------------------------------------------------------------------------- /Assets/ColorSuite/Shader/ColorSuite.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc9775b65c52747e69fc4c854c00d696 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49f71e2858a4a0f46a83b2f4a542c100 3 | folderAsset: yes 4 | timeCreated: 1466608765 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor/PackageTool.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | 4 | public class PackageTool 5 | { 6 | [MenuItem("Package/Update Package")] 7 | static void UpdatePackage() 8 | { 9 | AssetDatabase.ExportPackage("Assets/Neuron", "NeuronAnimator.unitypackage", ExportPackageOptions.Recurse); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Editor/PackageTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 909a48377c445234f9454fe274c0dd71 3 | timeCreated: 1466608784 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Gasta.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0ad7bd6bb5ae40f58484f714b0b08b7 3 | folderAsset: yes 4 | timeCreated: 1453621206 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Gasta/Acknowledgement.txt: -------------------------------------------------------------------------------- 1 | The HDRI file in this directory is made by Nicola Gastaldi. 2 | http://www.gasta.org/wordpress/free-hdri-studio/ 3 | -------------------------------------------------------------------------------- /Assets/Gasta/Acknowledgement.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65e059e561dc04ff483544a88d05adc6 3 | timeCreated: 1453621215 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Gasta/hdriReflectionLow.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/Assets/Gasta/hdriReflectionLow.hdr -------------------------------------------------------------------------------- /Assets/Gasta/hdriReflectionLow.hdr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e33424c966d1b44e5952e3e1317041e5 3 | timeCreated: 1453621212 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 8900000: generatedCubemap 8 | serializedVersion: 2 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 1 12 | linearTexture: 0 13 | correctGamma: 0 14 | fadeOut: 0 15 | borderMipMap: 0 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: .25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | cubemapConvolutionSteps: 8 28 | cubemapConvolutionExponent: 1.5 29 | seamlessCubemap: 1 30 | textureFormat: -3 31 | maxTextureSize: 2048 32 | textureSettings: 33 | filterMode: 1 34 | aniso: -1 35 | mipBias: -1 36 | wrapMode: 1 37 | nPOTScale: 1 38 | lightmap: 0 39 | rGBM: 0 40 | compressionQuality: 50 41 | allowsAlphaSplitting: 0 42 | spriteMode: 0 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: .5, y: .5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaIsTransparency: 0 50 | textureType: 3 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | sprites: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Kino.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96d6f0c23b5b349a39907f19574573ef 3 | folderAsset: yes 4 | timeCreated: 1435811145 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Fringe.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 473406a9bb49846d4a86baa6b3bc6e45 3 | folderAsset: yes 4 | timeCreated: 1438092929 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Fringe/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75aca1c5048c4f84fb8f74f680dba321 3 | folderAsset: yes 4 | timeCreated: 1438528237 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Fringe/Editor/FringeEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // KinoFringe - Chromatic aberration effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | using UnityEngine; 24 | using UnityEditor; 25 | 26 | namespace Kino 27 | { 28 | [CanEditMultipleObjects, CustomEditor(typeof(Fringe))] 29 | public class FringeEditor : Editor 30 | { 31 | SerializedProperty _lateralShift; 32 | SerializedProperty _axialStrength; 33 | SerializedProperty _axialShift; 34 | SerializedProperty _axialQuality; 35 | 36 | static GUIContent _textShift = new GUIContent("Shift"); 37 | static GUIContent _textStrength = new GUIContent("Strength"); 38 | static GUIContent _textQuality = new GUIContent("Quality"); 39 | 40 | void OnEnable() 41 | { 42 | _lateralShift = serializedObject.FindProperty("_lateralShift"); 43 | _axialStrength = serializedObject.FindProperty("_axialStrength"); 44 | _axialShift = serializedObject.FindProperty("_axialShift"); 45 | _axialQuality = serializedObject.FindProperty("_axialQuality"); 46 | } 47 | 48 | public override void OnInspectorGUI() 49 | { 50 | serializedObject.Update(); 51 | 52 | EditorGUILayout.LabelField("Lateral CA", EditorStyles.boldLabel); 53 | EditorGUILayout.PropertyField(_lateralShift, _textShift); 54 | 55 | EditorGUILayout.LabelField("Axial CA (purple fringing)", EditorStyles.boldLabel); 56 | EditorGUILayout.PropertyField(_axialStrength, _textStrength); 57 | EditorGUILayout.PropertyField(_axialShift, _textShift); 58 | EditorGUILayout.PropertyField(_axialQuality, _textQuality); 59 | 60 | serializedObject.ApplyModifiedProperties(); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Assets/Kino/Fringe/Editor/FringeEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 671e39ebb83d76d4c947046211765e36 3 | timeCreated: 1438528250 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Kino/Fringe/Fringe.cs: -------------------------------------------------------------------------------- 1 | // 2 | // KinoFringe - Chromatic aberration effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | using UnityEngine; 24 | 25 | namespace Kino 26 | { 27 | [ExecuteInEditMode] 28 | [RequireComponent(typeof(Camera))] 29 | [AddComponentMenu("Kino Image Effects/Fringe")] 30 | public class Fringe : MonoBehaviour 31 | { 32 | #region Public Properties 33 | 34 | // Shift amount for lateral CA 35 | [SerializeField, Range(0, 1)] 36 | float _lateralShift = 0.3f; 37 | 38 | public float lateralShift { 39 | get { return _lateralShift; } 40 | set { _lateralShift = value; } 41 | } 42 | 43 | // Axial CA strength 44 | [SerializeField, Range(0, 1)] 45 | float _axialStrength = 0.8f; 46 | 47 | public float axialStrength { 48 | get { return _axialStrength; } 49 | set { _axialStrength = value; } 50 | } 51 | 52 | // Shift amount for axial CA 53 | [SerializeField, Range(0, 1)] 54 | float _axialShift = 0.3f; 55 | 56 | public float axialShift { 57 | get { return _axialShift; } 58 | set { _axialShift = value; } 59 | } 60 | 61 | // Quality level for axial CA 62 | public enum QualityLevel { Low, High } 63 | 64 | [SerializeField] 65 | QualityLevel _axialQuality = QualityLevel.Low; 66 | 67 | public QualityLevel axialQuality { 68 | get { return _axialQuality; } 69 | set { _axialQuality = value; } 70 | } 71 | 72 | #endregion 73 | 74 | #region Private Properties 75 | 76 | [SerializeField] Shader _shader; 77 | 78 | Material _material; 79 | 80 | #endregion 81 | 82 | #region MonoBehaviour Functions 83 | 84 | void OnRenderImage(RenderTexture source, RenderTexture destination) 85 | { 86 | if (_material == null) 87 | { 88 | _material = new Material(_shader); 89 | _material.hideFlags = HideFlags.DontSave; 90 | } 91 | 92 | var cam = GetComponent(); 93 | var aspect = new Vector4(cam.aspect, 1.0f / cam.aspect, 1, 0); 94 | 95 | _material.SetVector("_CameraAspect", aspect); 96 | _material.SetFloat("_LateralShift", _lateralShift); 97 | _material.SetFloat("_AxialStrength", _axialStrength); 98 | _material.SetFloat("_AxialShift", _axialShift); 99 | 100 | if (_axialStrength == 0) 101 | { 102 | _material.DisableKeyword("AXIAL_SAMPLE_LOW"); 103 | _material.DisableKeyword("AXIAL_SAMPLE_HIGH"); 104 | } 105 | else if (_axialQuality == QualityLevel.Low) 106 | { 107 | _material.EnableKeyword("AXIAL_SAMPLE_LOW"); 108 | _material.DisableKeyword("AXIAL_SAMPLE_HIGH"); 109 | } 110 | else 111 | { 112 | _material.DisableKeyword("AXIAL_SAMPLE_LOW"); 113 | _material.EnableKeyword("AXIAL_SAMPLE_HIGH"); 114 | } 115 | 116 | Graphics.Blit(source, destination, _material, 0); 117 | } 118 | 119 | #endregion 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /Assets/Kino/Fringe/Fringe.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e11ef96a8174459fa3d231009ff28f8 3 | timeCreated: 1438093366 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _shader: {fileID: 4800000, guid: 4e3f6504698a346cb971f9ab5286fca9, type: 3} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Kino/Fringe/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e6a57babb8fa4b998eda0cab28b28b3 3 | folderAsset: yes 4 | timeCreated: 1438611720 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Fringe/Shader/Fringe.shader: -------------------------------------------------------------------------------- 1 | // 2 | // KinoFringe - Chromatic aberration effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | Shader "Hidden/Kino/Fringe" 24 | { 25 | Properties 26 | { 27 | _MainTex ("-", 2D) = "" {} 28 | } 29 | 30 | CGINCLUDE 31 | 32 | #pragma multi_compile _ AXIAL_SAMPLE_LOW AXIAL_SAMPLE_HIGH 33 | 34 | #include "UnityCG.cginc" 35 | 36 | sampler2D _MainTex; 37 | float4 _MainTex_TexelSize; 38 | 39 | float4 _CameraAspect; // (h/w, w/h, 1, 0) 40 | float _LateralShift; 41 | float _AxialStrength; 42 | float _AxialShift; 43 | 44 | // Poisson disk sample points 45 | #if AXIAL_SAMPLE_LOW 46 | static const uint SAMPLE_NUM = 8; 47 | static const float2 POISSON_SAMPLES[SAMPLE_NUM] = 48 | { 49 | float2( 0.373838022357f, 0.662882019975f ), 50 | float2( -0.335774814282f, -0.940070127794f ), 51 | float2( -0.9115721822f, 0.324130702404f ), 52 | float2( 0.837294074715f, -0.504677167232f ), 53 | float2( -0.0500874221246f, -0.0917990757772f ), 54 | float2( -0.358644570242f, 0.906381100284f ), 55 | float2( 0.961200130218f, 0.219135111748f ), 56 | float2( -0.896666615007f, -0.440304757692f ) 57 | }; 58 | #else 59 | static const uint SAMPLE_NUM = 16; 60 | static const float2 POISSON_SAMPLES[SAMPLE_NUM] = 61 | { 62 | float2( 0.0984258332809f, 0.918808284462f ), 63 | float2( 0.00259138629413f, -0.999838959623f ), 64 | float2( -0.987959729023f, -0.00429660140761f ), 65 | float2( 0.981234239267f, -0.140666219895f ), 66 | float2( -0.0212157973013f, -0.0443286928994f ), 67 | float2( -0.652058534734f, 0.695078086985f ), 68 | float2( -0.68090417832f, -0.681862769398f ), 69 | float2( 0.779643686501f, 0.603399060386f ), 70 | float2( 0.67941165083f, -0.731372789969f ), 71 | float2( 0.468821477499f, -0.251621416756f ), 72 | float2( 0.278991228738f, 0.39302189329f ), 73 | float2( -0.191188273806f, -0.527976638433f ), 74 | float2( -0.464789669525f, 0.216311272754f ), 75 | float2( -0.559833960421f, -0.256176089172f ), 76 | float2( 0.65988403582f, 0.170056284903f ), 77 | float2( -0.170289189543f, 0.551561042407f ) 78 | }; 79 | #endif 80 | 81 | // Poisson filter 82 | half3 poisson_filter(float2 uv) 83 | { 84 | half3 acc = 0; 85 | for (uint i = 0; i < SAMPLE_NUM; i++) 86 | { 87 | float2 disp = POISSON_SAMPLES[i]; 88 | disp *= _CameraAspect.yz * _AxialShift * 0.02; 89 | acc += tex2D(_MainTex, uv + disp).rgb; 90 | } 91 | return acc / SAMPLE_NUM; 92 | } 93 | 94 | // Rec.709 Luminance 95 | half luminance(half3 rgb) 96 | { 97 | return dot(rgb, half3(0.2126, 0.7152, 0.0722)); 98 | } 99 | 100 | // CA filter 101 | half4 frag(v2f_img i) : SV_Target 102 | { 103 | float2 spc = (i.uv - 0.5) * _CameraAspect.xz; 104 | float r2 = dot(spc, spc); 105 | 106 | float f_r = 1.0 + r2 * _LateralShift * -0.02; 107 | float f_b = 1.0 + r2 * _LateralShift * +0.02; 108 | 109 | half4 src = tex2D(_MainTex, i.uv); 110 | src.r = tex2D(_MainTex, (i.uv - 0.5) * f_r + 0.5).r; 111 | src.b = tex2D(_MainTex, (i.uv - 0.5) * f_b + 0.5).b; 112 | 113 | #if AXIAL_SAMPLE_LOW || AXIAL_SAMPLE_HIGH 114 | half3 blur = poisson_filter(i.uv); 115 | half ldiff = luminance(blur) - luminance(src.rgb); 116 | src.rb = max(src.rb, blur.rb * ldiff * _AxialStrength); 117 | #endif 118 | 119 | return src; 120 | } 121 | 122 | ENDCG 123 | 124 | SubShader 125 | { 126 | Pass 127 | { 128 | ZTest Always Cull Off ZWrite Off 129 | CGPROGRAM 130 | #pragma vertex vert_img 131 | #pragma fragment frag 132 | ENDCG 133 | } 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /Assets/Kino/Fringe/Shader/Fringe.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e3f6504698a346cb971f9ab5286fca9 3 | timeCreated: 1438093351 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7dae4842a870747de9617b3c18ba916e 3 | folderAsset: yes 4 | timeCreated: 1455515606 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5dce06de9574c40f782c3cdb4218f34e 3 | folderAsset: yes 4 | timeCreated: 1455515624 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Editor/ObscuranceEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Obscurance - SSAO (screen-space ambient obscurance) effect for Unity 3 | // 4 | // Copyright (C) 2016 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | using UnityEngine; 25 | using UnityEditor; 26 | 27 | namespace Kino 28 | { 29 | [CanEditMultipleObjects] 30 | [CustomEditor(typeof(Obscurance))] 31 | public class ObscuranceEditor : Editor 32 | { 33 | SerializedProperty _intensity; 34 | SerializedProperty _radius; 35 | SerializedProperty _sampleCount; 36 | SerializedProperty _sampleCountValue; 37 | SerializedProperty _downsampling; 38 | SerializedProperty _occlusionSource; 39 | SerializedProperty _ambientOnly; 40 | 41 | static GUIContent _textValue = new GUIContent("Value"); 42 | 43 | static string _textNoGBuffer = 44 | "G-buffer is currently unavailable. " + 45 | "Change Renderring Path in camera settings to Deferred."; 46 | 47 | static string _textNoAmbientOnly = 48 | "The ambient-only mode is currently disabled; " + 49 | "it requires G-buffer source and HDR rendering."; 50 | 51 | void OnEnable() 52 | { 53 | _intensity = serializedObject.FindProperty("_intensity"); 54 | _radius = serializedObject.FindProperty("_radius"); 55 | _sampleCount = serializedObject.FindProperty("_sampleCount"); 56 | _sampleCountValue = serializedObject.FindProperty("_sampleCountValue"); 57 | _downsampling = serializedObject.FindProperty("_downsampling"); 58 | _occlusionSource = serializedObject.FindProperty("_occlusionSource"); 59 | _ambientOnly = serializedObject.FindProperty("_ambientOnly"); 60 | } 61 | 62 | public override void OnInspectorGUI() 63 | { 64 | var obscurance = (Obscurance)target; 65 | 66 | serializedObject.Update(); 67 | 68 | EditorGUILayout.PropertyField(_intensity); 69 | EditorGUILayout.PropertyField(_radius); 70 | EditorGUILayout.PropertyField(_sampleCount); 71 | 72 | if (_sampleCount.hasMultipleDifferentValues || 73 | _sampleCount.enumValueIndex == (int)Obscurance.SampleCount.Variable) 74 | { 75 | EditorGUI.indentLevel++; 76 | EditorGUILayout.PropertyField(_sampleCountValue, _textValue); 77 | EditorGUI.indentLevel--; 78 | } 79 | 80 | EditorGUILayout.PropertyField(_downsampling); 81 | EditorGUILayout.PropertyField(_occlusionSource); 82 | 83 | if (!_occlusionSource.hasMultipleDifferentValues) 84 | if (_occlusionSource.enumValueIndex != (int)obscurance.occlusionSource) 85 | EditorGUILayout.HelpBox(_textNoGBuffer, MessageType.Warning); 86 | 87 | EditorGUILayout.PropertyField(_ambientOnly); 88 | 89 | if (!_ambientOnly.hasMultipleDifferentValues) 90 | if (_ambientOnly.boolValue != obscurance.ambientOnly) 91 | EditorGUILayout.HelpBox(_textNoAmbientOnly, MessageType.Warning); 92 | 93 | serializedObject.ApplyModifiedProperties(); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Editor/ObscuranceEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4c34df7fb8f94f15bbe24c63dbe9df0 3 | timeCreated: 1455515930 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Obscurance.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Obscurance - SSAO (screen-space ambient obscurance) effect for Unity 3 | // 4 | // Copyright (C) 2016 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | using UnityEngine; 25 | using UnityEngine.Rendering; 26 | 27 | namespace Kino 28 | { 29 | [ExecuteInEditMode] 30 | [RequireComponent(typeof(Camera))] 31 | [AddComponentMenu("Kino Image Effects/Obscurance")] 32 | public partial class Obscurance : MonoBehaviour 33 | { 34 | #region Public Properties 35 | 36 | /// Degree of darkness produced by the effect. 37 | public float intensity { 38 | get { return _intensity; } 39 | set { _intensity = value; } 40 | } 41 | 42 | [SerializeField, Range(0, 4), Tooltip( 43 | "Degree of darkness produced by the effect.")] 44 | float _intensity = 1; 45 | 46 | /// Radius of sample points, which affects extent of darkened areas. 47 | public float radius { 48 | get { return Mathf.Max(_radius, 1e-4f); } 49 | set { _radius = value; } 50 | } 51 | 52 | [SerializeField, Tooltip( 53 | "Radius of sample points, which affects extent of darkened areas.")] 54 | float _radius = 0.3f; 55 | 56 | /// Number of sample points, which affects quality and performance. 57 | public SampleCount sampleCount { 58 | get { return _sampleCount; } 59 | set { _sampleCount = value; } 60 | } 61 | 62 | public enum SampleCount { Lowest, Low, Medium, High, Variable } 63 | 64 | [SerializeField, Tooltip( 65 | "Number of sample points, which affects quality and performance.")] 66 | SampleCount _sampleCount = SampleCount.Medium; 67 | 68 | /// Determines the sample count when SampleCount.Variable is used. 69 | /// In other cases, it returns the preset value of the current setting. 70 | public int sampleCountValue { 71 | get { 72 | switch (_sampleCount) { 73 | case SampleCount.Lowest: return 3; 74 | case SampleCount.Low: return 6; 75 | case SampleCount.Medium: return 12; 76 | case SampleCount.High: return 20; 77 | } 78 | return Mathf.Clamp(_sampleCountValue, 1, 256); 79 | } 80 | set { _sampleCountValue = value; } 81 | } 82 | 83 | [SerializeField] 84 | int _sampleCountValue = 24; 85 | 86 | /// Halves the resolution of the effect to increase performance. 87 | public bool downsampling { 88 | get { return _downsampling; } 89 | set { _downsampling = value; } 90 | } 91 | 92 | [SerializeField, Tooltip( 93 | "Halves the resolution of the effect to increase performance.")] 94 | bool _downsampling = false; 95 | 96 | /// Source buffer used for obscurance estimation. 97 | public OcclusionSource occlusionSource { 98 | get { 99 | var isGBuffer = _occlusionSource == OcclusionSource.GBuffer; 100 | if (isGBuffer && !IsGBufferAvailable) 101 | // An unavailable source was chosen: 102 | // fallback to DepthNormalsTexture. 103 | return OcclusionSource.DepthNormalsTexture; 104 | else 105 | return _occlusionSource; 106 | } 107 | set { _occlusionSource = value; } 108 | } 109 | 110 | public enum OcclusionSource { 111 | DepthTexture, DepthNormalsTexture, GBuffer 112 | } 113 | 114 | [SerializeField, Tooltip( 115 | "Source buffer used for obscurance estimation")] 116 | OcclusionSource _occlusionSource = OcclusionSource.GBuffer; 117 | 118 | /// Enables the ambient-only mode in that the effect only affects 119 | /// ambient lighting. This mode is only available with G-buffer source 120 | /// and HDR rendering. 121 | public bool ambientOnly { 122 | get { 123 | return _ambientOnly && targetCamera.hdr && 124 | occlusionSource == OcclusionSource.GBuffer; 125 | } 126 | set { _ambientOnly = value; } 127 | } 128 | 129 | [SerializeField, Tooltip( 130 | "If checked, the effect only affects ambient lighting.")] 131 | bool _ambientOnly = false; 132 | 133 | #endregion 134 | 135 | #region Private Properties 136 | 137 | // Texture format used for storing AO 138 | RenderTextureFormat aoTextureFormat { 139 | get { 140 | if (SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.R8)) 141 | return RenderTextureFormat.R8; 142 | else 143 | return RenderTextureFormat.Default; 144 | } 145 | } 146 | 147 | // AO shader material 148 | Material aoMaterial { 149 | get { 150 | if (_aoMaterial == null) { 151 | var shader = Shader.Find("Hidden/Kino/Obscurance"); 152 | _aoMaterial = new Material(shader); 153 | _aoMaterial.hideFlags = HideFlags.DontSave; 154 | } 155 | return _aoMaterial; 156 | } 157 | } 158 | 159 | [SerializeField] Shader _aoShader; 160 | Material _aoMaterial; 161 | 162 | // Command buffer for the AO pass 163 | CommandBuffer aoCommands { 164 | get { 165 | if (_aoCommands == null) { 166 | _aoCommands = new CommandBuffer(); 167 | _aoCommands.name = "Kino.Obscurance"; 168 | } 169 | return _aoCommands; 170 | } 171 | } 172 | 173 | CommandBuffer _aoCommands; 174 | 175 | // Target camera 176 | Camera targetCamera { 177 | get { return GetComponent(); } 178 | } 179 | 180 | // Property observer 181 | PropertyObserver propertyObserver { get; set; } 182 | 183 | // Check if the G-buffer is available 184 | bool IsGBufferAvailable { 185 | get { 186 | var path = targetCamera.actualRenderingPath; 187 | return path == RenderingPath.DeferredShading; 188 | } 189 | } 190 | 191 | // Reference to the quad mesh in the built-in assets 192 | // (used in MRT blitting) 193 | [SerializeField] Mesh _quadMesh; 194 | 195 | #endregion 196 | 197 | #region Effect Passes 198 | 199 | // Build commands for the AO pass (used in the ambient-only mode). 200 | void BuildAOCommands() 201 | { 202 | var cb = aoCommands; 203 | 204 | var tw = targetCamera.pixelWidth; 205 | var th = targetCamera.pixelHeight; 206 | var ts = downsampling ? 2 : 1; 207 | var format = aoTextureFormat; 208 | var rwMode = RenderTextureReadWrite.Linear; 209 | var filter = FilterMode.Bilinear; 210 | 211 | // AO buffer 212 | var m = aoMaterial; 213 | var rtMask = Shader.PropertyToID("_ObscuranceTexture"); 214 | cb.GetTemporaryRT( 215 | rtMask, tw / ts, th / ts, 0, filter, format, rwMode 216 | ); 217 | 218 | // AO estimation 219 | cb.Blit(null, rtMask, m, 2); 220 | 221 | // Blur buffer 222 | var rtBlur = Shader.PropertyToID("_ObscuranceBlurTexture"); 223 | 224 | // 1st blur iteration (large kernel) 225 | cb.GetTemporaryRT(rtBlur, tw, th, 0, filter, format, rwMode); 226 | cb.SetGlobalVector("_BlurVector", Vector2.right * 2); 227 | cb.Blit(rtMask, rtBlur, m, 4); 228 | cb.ReleaseTemporaryRT(rtMask); 229 | 230 | cb.GetTemporaryRT(rtMask, tw, th, 0, filter, format, rwMode); 231 | cb.SetGlobalVector("_BlurVector", Vector2.up * 2 * ts); 232 | cb.Blit(rtBlur, rtMask, m, 4); 233 | cb.ReleaseTemporaryRT(rtBlur); 234 | 235 | // 2nd blur iteration (small kernel) 236 | cb.GetTemporaryRT(rtBlur, tw, th, 0, filter, format, rwMode); 237 | cb.SetGlobalVector("_BlurVector", Vector2.right * ts); 238 | cb.Blit(rtMask, rtBlur, m, 6); 239 | cb.ReleaseTemporaryRT(rtMask); 240 | 241 | cb.GetTemporaryRT(rtMask, tw, th, 0, filter, format, rwMode); 242 | cb.SetGlobalVector("_BlurVector", Vector2.up * ts); 243 | cb.Blit(rtBlur, rtMask, m, 6); 244 | cb.ReleaseTemporaryRT(rtBlur); 245 | 246 | // Combine AO to the G-buffer. 247 | var mrt = new RenderTargetIdentifier[] { 248 | BuiltinRenderTextureType.GBuffer0, // Albedo, Occ 249 | BuiltinRenderTextureType.CameraTarget // Ambient 250 | }; 251 | cb.SetRenderTarget(mrt, BuiltinRenderTextureType.CameraTarget); 252 | cb.DrawMesh(_quadMesh, Matrix4x4.identity, m, 0, 8); 253 | 254 | cb.ReleaseTemporaryRT(rtMask); 255 | } 256 | 257 | // Execute the AO pass immediately (used in the forward mode). 258 | void ExecuteAOPass(RenderTexture source, RenderTexture destination) 259 | { 260 | var tw = source.width; 261 | var th = source.height; 262 | var ts = downsampling ? 2 : 1; 263 | var format = aoTextureFormat; 264 | var rwMode = RenderTextureReadWrite.Linear; 265 | var useGBuffer = occlusionSource == OcclusionSource.GBuffer; 266 | 267 | // AO buffer 268 | var m = aoMaterial; 269 | var rtMask = RenderTexture.GetTemporary( 270 | tw / ts, th / ts, 0, format, rwMode 271 | ); 272 | 273 | // AO estimation 274 | Graphics.Blit(null, rtMask, m, (int)occlusionSource); 275 | 276 | // 1st blur iteration (large kernel) 277 | var rtBlur = RenderTexture.GetTemporary(tw, th, 0, format, rwMode); 278 | m.SetVector("_BlurVector", Vector2.right * 2); 279 | Graphics.Blit(rtMask, rtBlur, m, useGBuffer ? 4 : 3); 280 | RenderTexture.ReleaseTemporary(rtMask); 281 | 282 | rtMask = RenderTexture.GetTemporary(tw, th, 0, format, rwMode); 283 | m.SetVector("_BlurVector", Vector2.up * 2 * ts); 284 | Graphics.Blit(rtBlur, rtMask, m, useGBuffer ? 4 : 3); 285 | RenderTexture.ReleaseTemporary(rtBlur); 286 | 287 | // 2nd blur iteration (small kernel) 288 | rtBlur = RenderTexture.GetTemporary(tw, th, 0, format, rwMode); 289 | m.SetVector("_BlurVector", Vector2.right * ts); 290 | Graphics.Blit(rtMask, rtBlur, m, useGBuffer ? 6 : 5); 291 | RenderTexture.ReleaseTemporary(rtMask); 292 | 293 | rtMask = RenderTexture.GetTemporary(tw, th, 0, format, rwMode); 294 | m.SetVector("_BlurVector", Vector2.up * ts); 295 | Graphics.Blit(rtBlur, rtMask, m, useGBuffer ? 6 : 5); 296 | RenderTexture.ReleaseTemporary(rtBlur); 297 | 298 | // Combine AO with the source. 299 | m.SetTexture("_ObscuranceTexture", rtMask); 300 | Graphics.Blit(source, destination, m, 7); 301 | 302 | RenderTexture.ReleaseTemporary(rtMask); 303 | } 304 | 305 | // Update the common material properties. 306 | void UpdateMaterialProperties() 307 | { 308 | var m = aoMaterial; 309 | m.SetFloat("_Intensity", intensity); 310 | m.SetFloat("_Radius", radius); 311 | m.SetFloat("_TargetScale", downsampling ? 0.5f : 1); 312 | m.SetInt("_SampleCount", sampleCountValue); 313 | } 314 | 315 | #endregion 316 | 317 | #region MonoBehaviour Functions 318 | 319 | void OnEnable() 320 | { 321 | // Register the command buffer if in the ambient-only mode. 322 | if (ambientOnly) targetCamera.AddCommandBuffer( 323 | CameraEvent.BeforeReflections, aoCommands 324 | ); 325 | 326 | // Enable depth textures which the occlusion source requires. 327 | if (occlusionSource == OcclusionSource.DepthTexture) 328 | targetCamera.depthTextureMode |= DepthTextureMode.Depth; 329 | 330 | if (occlusionSource != OcclusionSource.GBuffer) 331 | targetCamera.depthTextureMode |= DepthTextureMode.DepthNormals; 332 | } 333 | 334 | void OnDisable() 335 | { 336 | // Destroy all the temporary resources. 337 | if (_aoMaterial != null) DestroyImmediate(_aoMaterial); 338 | _aoMaterial = null; 339 | 340 | if (_aoCommands != null) targetCamera.RemoveCommandBuffer( 341 | CameraEvent.BeforeReflections, _aoCommands 342 | ); 343 | _aoCommands = null; 344 | } 345 | 346 | void Update() 347 | { 348 | if (propertyObserver.CheckNeedsReset(this, targetCamera)) 349 | { 350 | // Reinitialize all the resources by disabling/enabling itself. 351 | // This is not very efficient way but just works... 352 | OnDisable(); 353 | OnEnable(); 354 | 355 | // Build the command buffer if in the ambient-only mode. 356 | if (ambientOnly) 357 | { 358 | aoCommands.Clear(); 359 | BuildAOCommands(); 360 | } 361 | 362 | propertyObserver.Update(this, targetCamera); 363 | } 364 | 365 | // Update the material properties (later used in the AO commands). 366 | if (ambientOnly) UpdateMaterialProperties(); 367 | } 368 | 369 | [ImageEffectOpaque] 370 | void OnRenderImage(RenderTexture source, RenderTexture destination) 371 | { 372 | if (ambientOnly) 373 | { 374 | // Do nothing in the ambient-only mode. 375 | Graphics.Blit(source, destination); 376 | } 377 | else 378 | { 379 | // Execute the AO pass. 380 | UpdateMaterialProperties(); 381 | ExecuteAOPass(source, destination); 382 | } 383 | } 384 | 385 | #endregion 386 | } 387 | } 388 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Obscurance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d901ddf32d7c84ed4b0f84623ef3a7a0 3 | timeCreated: 1456469754 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _aoShader: {fileID: 4800000, guid: 7541b5f18b1224a81927d8b1184b122b, type: 3} 9 | - _quadMesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 10 | executionOrder: 0 11 | icon: {instanceID: 0} 12 | userData: 13 | assetBundleName: 14 | assetBundleVariant: 15 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Script.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7dde330d3542e44209291a0fb4cf460e 3 | folderAsset: yes 4 | timeCreated: 1456726545 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Script/PropertyObserver.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Obscurance - SSAO (screen-space ambient obscurance) effect for Unity 3 | // 4 | // Copyright (C) 2016 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | using UnityEngine; 25 | 26 | namespace Kino 27 | { 28 | public partial class Obscurance : MonoBehaviour 29 | { 30 | // Observer class that detects changes on properties 31 | struct PropertyObserver 32 | { 33 | // Obscurance properties 34 | bool _downsampling; 35 | OcclusionSource _occlusionSource; 36 | bool _ambientOnly; 37 | 38 | // Camera properties 39 | int _pixelWidth; 40 | int _pixelHeight; 41 | 42 | // Check if it has to reset itself for property changes. 43 | public bool CheckNeedsReset(Obscurance target, Camera camera) 44 | { 45 | return 46 | _downsampling != target.downsampling || 47 | _occlusionSource != target.occlusionSource || 48 | _ambientOnly != target.ambientOnly || 49 | _pixelWidth != camera.pixelWidth || 50 | _pixelHeight != camera.pixelHeight; 51 | } 52 | 53 | // Update the internal state. 54 | public void Update(Obscurance target, Camera camera) 55 | { 56 | _downsampling = target.downsampling; 57 | _occlusionSource = target.occlusionSource; 58 | _ambientOnly = target.ambientOnly; 59 | _pixelWidth = camera.pixelWidth; 60 | _pixelHeight = camera.pixelHeight; 61 | } 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Script/PropertyObserver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 150e73556e4cb49d7b7b6a41ada61e06 3 | timeCreated: 1456723172 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f6dbe2cc8ffe4604a9b907745b92da2 3 | folderAsset: yes 4 | timeCreated: 1455515619 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Shader/Obscurance.cginc: -------------------------------------------------------------------------------- 1 | // -------- 2 | // Additional options for further customization 3 | // -------- 4 | 5 | // By default, a fixed sampling pattern is used in the AO estimator. 6 | // Although this gives preferable results in most cases, a completely 7 | // random sampling pattern could give aesthetically good results in some 8 | // cases. Comment out the line below to use the random pattern instead of 9 | // the fixed one. 10 | #define FIX_SAMPLING_PATTERN 1 11 | 12 | // The constant below determines the contrast of occlusion. Altough this 13 | // allows intentional over/under occlusion, currently is not exposed to the 14 | // editor, because it’s thought to be rarely useful. 15 | static const float kContrast = 0.6; 16 | 17 | // The constant below controls the geometry-awareness of the blur filter. 18 | // The higher value, the more sensitive it is. 19 | static const float kGeometry = 50; 20 | 21 | // The constants below are used in the AO estimator. Beta is mainly used 22 | // for suppressing self-shadowing noise, and Epsilon is used to prevent 23 | // calculation underflow. See the paper (Morgan 2011 http://goo.gl/2iz3P) 24 | // for further details of these constants. 25 | static const float kBeta = 0.002; 26 | static const float kEpsilon = 1e-4; 27 | 28 | // -------- 29 | 30 | #include "UnityCG.cginc" 31 | 32 | // Global shader properties 33 | sampler2D _CameraGBufferTexture2; 34 | sampler2D_float _CameraDepthTexture; 35 | sampler2D _CameraDepthNormalsTexture; 36 | float4x4 _WorldToCamera; 37 | 38 | // Sample count 39 | // Use a constant on GLES2 (basically it doesn't support dynamic looping). 40 | #if SHADER_API_GLES 41 | static const int _SampleCount = 5; 42 | #else 43 | int _SampleCount; 44 | #endif 45 | 46 | // Source texture properties 47 | sampler2D _MainTex; 48 | float4 _MainTex_TexelSize; 49 | sampler2D _ObscuranceTexture; 50 | 51 | // Material shader properties 52 | half _Intensity; 53 | float _Radius; 54 | float _TargetScale; 55 | float2 _BlurVector; 56 | 57 | // Utility for sin/cos 58 | float2 CosSin(float theta) 59 | { 60 | float sn, cs; 61 | sincos(theta, sn, cs); 62 | return float2(cs, sn); 63 | } 64 | 65 | // Gamma encoding function for AO value 66 | // (do nothing if in the linear mode) 67 | half EncodeAO(half x) 68 | { 69 | // Gamma encoding 70 | half x_g = 1 - pow(1 - x, 1 / 2.2); 71 | // ColorSpaceLuminance.w is 0 (gamma) or 1 (linear). 72 | return lerp(x_g, x, unity_ColorSpaceLuminance.w); 73 | } 74 | 75 | // Pseudo random number generator with 2D argument 76 | float UVRandom(float u, float v) 77 | { 78 | float f = dot(float2(12.9898, 78.233), float2(u, v)); 79 | return frac(43758.5453 * sin(f)); 80 | } 81 | 82 | // Interleaved gradient function from Jimenez 2014 http://goo.gl/eomGso 83 | float GradientNoise(float2 uv) 84 | { 85 | uv = floor(uv * _ScreenParams.xy); 86 | float f = dot(float2(0.06711056f, 0.00583715f), uv); 87 | return frac(52.9829189f * frac(f)); 88 | } 89 | 90 | // Boundary check for depth sampler 91 | // (returns a very large value if it lies out of bounds) 92 | float CheckBounds(float2 uv, float d) 93 | { 94 | float ob = any(uv < 0) + any(uv > 1); 95 | #if defined(UNITY_REVERSED_Z) 96 | ob += (d <= 0.00001); 97 | #else 98 | ob += (d >= 0.99999); 99 | #endif 100 | return ob * 1e8; 101 | } 102 | 103 | // Depth/normal sampling functions 104 | float SampleDepth(float2 uv) 105 | { 106 | #if SOURCE_GBUFFER || SOURCE_DEPTH 107 | float d = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv); 108 | return LinearEyeDepth(d) + CheckBounds(uv, d); 109 | #else 110 | float4 cdn = tex2D(_CameraDepthNormalsTexture, uv); 111 | float d = DecodeFloatRG(cdn.zw); 112 | return d * _ProjectionParams.z + CheckBounds(uv, d); 113 | #endif 114 | } 115 | 116 | float3 SampleNormal(float2 uv) 117 | { 118 | #if SOURCE_GBUFFER 119 | float3 norm = tex2D(_CameraGBufferTexture2, uv).xyz * 2 - 1; 120 | return mul((float3x3)_WorldToCamera, norm); 121 | #else 122 | float4 cdn = tex2D(_CameraDepthNormalsTexture, uv); 123 | return DecodeViewNormalStereo(cdn) * float3(1, 1, -1); 124 | #endif 125 | } 126 | 127 | float SampleDepthNormal(float2 uv, out float3 normal) 128 | { 129 | #if SOURCE_GBUFFER || SOURCE_DEPTH 130 | normal = SampleNormal(uv); 131 | return SampleDepth(uv); 132 | #else 133 | float4 cdn = tex2D(_CameraDepthNormalsTexture, uv); 134 | normal = DecodeViewNormalStereo(cdn) * float3(1, 1, -1); 135 | float d = DecodeFloatRG(cdn.zw); 136 | return d * _ProjectionParams.z + CheckBounds(uv, d); 137 | #endif 138 | } 139 | 140 | // Reconstruct view-space position from UV and depth. 141 | // p11_22 = (unity_CameraProjection._11, unity_CameraProjection._22) 142 | // p13_31 = (unity_CameraProjection._13, unity_CameraProjection._23) 143 | float3 ReconstructViewPos(float2 uv, float depth, float2 p11_22, float2 p13_31) 144 | { 145 | return float3((uv * 2 - 1 - p13_31) / p11_22, 1) * depth; 146 | } 147 | 148 | // Normal vector comparer (for geometry-aware weighting) 149 | half CompareNormal(half3 d1, half3 d2) 150 | { 151 | return pow((dot(d1, d2) + 1) * 0.5, kGeometry); 152 | } 153 | 154 | // Final combiner function 155 | half3 CombineObscurance(half3 src, half3 ao) 156 | { 157 | return lerp(src, 0, EncodeAO(ao)); 158 | } 159 | 160 | // Sample point picker 161 | float3 PickSamplePoint(float2 uv, float index) 162 | { 163 | // Uniformaly distributed points on a unit sphere http://goo.gl/X2F1Ho 164 | #if FIX_SAMPLING_PATTERN 165 | float gn = GradientNoise(uv * _TargetScale); 166 | float u = frac(UVRandom(0, index) + gn) * 2 - 1; 167 | float theta = (UVRandom(1, index) + gn) * UNITY_PI * 2; 168 | #else 169 | float u = UVRandom(uv.x + _Time.x, uv.y + index) * 2 - 1; 170 | float theta = UVRandom(-uv.x - _Time.x, uv.y + index) * UNITY_PI * 2; 171 | #endif 172 | float3 v = float3(CosSin(theta) * sqrt(1 - u * u), u); 173 | // Make them distributed between [0, _Radius] 174 | float l = sqrt((index + 1) / _SampleCount) * _Radius; 175 | return v * l; 176 | } 177 | 178 | // Obscurance estimator function 179 | float EstimateObscurance(float2 uv) 180 | { 181 | // Parameters used in coordinate conversion 182 | float3x3 proj = (float3x3)unity_CameraProjection; 183 | float2 p11_22 = float2(unity_CameraProjection._11, unity_CameraProjection._22); 184 | float2 p13_31 = float2(unity_CameraProjection._13, unity_CameraProjection._23); 185 | 186 | // View space normal and depth 187 | float3 norm_o; 188 | float depth_o = SampleDepthNormal(uv, norm_o); 189 | 190 | #if SOURCE_DEPTHNORMALS 191 | // Offset the depth value to avoid precision error. 192 | // (depth in the DepthNormals mode has only 16-bit precision) 193 | depth_o -= _ProjectionParams.z / 65536; 194 | #endif 195 | 196 | // Reconstruct the view-space position. 197 | float3 vpos_o = ReconstructViewPos(uv, depth_o, p11_22, p13_31); 198 | 199 | // Distance-based AO estimator based on Morgan 2011 http://goo.gl/2iz3P 200 | float ao = 0.0; 201 | 202 | for (int s = 0; s < _SampleCount; s++) 203 | { 204 | // Sample point 205 | #if SHADER_API_D3D11 206 | // This 'floor(1.0001 * s)' operation is needed to avoid a NVidia 207 | // shader issue. This issue is only observed on DX11. 208 | float3 v_s1 = PickSamplePoint(uv, floor(1.0001 * s)); 209 | #else 210 | float3 v_s1 = PickSamplePoint(uv, s); 211 | #endif 212 | v_s1 = faceforward(v_s1, -norm_o, v_s1); 213 | float3 vpos_s1 = vpos_o + v_s1; 214 | 215 | // Reproject the sample point 216 | float3 spos_s1 = mul(proj, vpos_s1); 217 | float2 uv_s1 = (spos_s1.xy / vpos_s1.z + 1) * 0.5; 218 | 219 | // Depth at the sample point 220 | float depth_s1 = SampleDepth(uv_s1); 221 | 222 | // Relative position of the sample point 223 | float3 vpos_s2 = ReconstructViewPos(uv_s1, depth_s1, p11_22, p13_31); 224 | float3 v_s2 = vpos_s2 - vpos_o; 225 | 226 | // Estimate the obscurance value 227 | float a1 = max(dot(v_s2, norm_o) - kBeta * depth_o, 0); 228 | float a2 = dot(v_s2, v_s2) + kEpsilon; 229 | ao += a1 / a2; 230 | } 231 | 232 | ao *= _Radius; // intensity normalization 233 | 234 | // Apply other parameters. 235 | return pow(ao * _Intensity / _SampleCount, kContrast); 236 | } 237 | 238 | // Geometry-aware separable blur filter (large kernel) 239 | half SeparableBlurLarge(sampler2D tex, float2 uv, float2 delta) 240 | { 241 | #if !SHADER_API_MOBILE 242 | // 9-tap Gaussian blur with adaptive sampling 243 | float2 uv1a = uv - delta; 244 | float2 uv1b = uv + delta; 245 | float2 uv2a = uv - delta * 2; 246 | float2 uv2b = uv + delta * 2; 247 | float2 uv3a = uv - delta * 3.2307692308; 248 | float2 uv3b = uv + delta * 3.2307692308; 249 | 250 | half3 n0 = SampleNormal(uv); 251 | 252 | half w0 = 0.37004405286; 253 | half w1a = CompareNormal(n0, SampleNormal(uv1a)) * 0.31718061674; 254 | half w1b = CompareNormal(n0, SampleNormal(uv1b)) * 0.31718061674; 255 | half w2a = CompareNormal(n0, SampleNormal(uv2a)) * 0.19823788546; 256 | half w2b = CompareNormal(n0, SampleNormal(uv2b)) * 0.19823788546; 257 | half w3a = CompareNormal(n0, SampleNormal(uv3a)) * 0.11453744493; 258 | half w3b = CompareNormal(n0, SampleNormal(uv3b)) * 0.11453744493; 259 | 260 | half s = tex2D(_MainTex, uv).r * w0; 261 | s += tex2D(_MainTex, uv1a).r * w1a; 262 | s += tex2D(_MainTex, uv1b).r * w1b; 263 | s += tex2D(_MainTex, uv2a).r * w2a; 264 | s += tex2D(_MainTex, uv2b).r * w2b; 265 | s += tex2D(_MainTex, uv3a).r * w3a; 266 | s += tex2D(_MainTex, uv3b).r * w3b; 267 | 268 | return s / (w0 + w1a + w1b + w2a + w2b + w3a + w3b); 269 | #else 270 | // 9-tap Gaussian blur with linear sampling 271 | // (less quality but slightly fast) 272 | float2 uv1a = uv - delta * 1.3846153846; 273 | float2 uv1b = uv + delta * 1.3846153846; 274 | float2 uv2a = uv - delta * 3.2307692308; 275 | float2 uv2b = uv + delta * 3.2307692308; 276 | 277 | half3 n0 = SampleNormal(uv); 278 | 279 | half w0 = 0.2270270270; 280 | half w1a = CompareNormal(n0, SampleNormal(uv1a)) * 0.3162162162; 281 | half w1b = CompareNormal(n0, SampleNormal(uv1b)) * 0.3162162162; 282 | half w2a = CompareNormal(n0, SampleNormal(uv2a)) * 0.0702702703; 283 | half w2b = CompareNormal(n0, SampleNormal(uv2b)) * 0.0702702703; 284 | 285 | half s = tex2D(_MainTex, uv).r * w0; 286 | s += tex2D(_MainTex, uv1a).r * w1a; 287 | s += tex2D(_MainTex, uv1b).r * w1b; 288 | s += tex2D(_MainTex, uv2a).r * w2a; 289 | s += tex2D(_MainTex, uv2b).r * w2b; 290 | 291 | return s / (w0 + w1a + w1b + w2a + w2b); 292 | #endif 293 | } 294 | 295 | // Geometry-aware separable blur filter (small kernel) 296 | half SeparableBlurSmall(sampler2D tex, float2 uv, float2 delta) 297 | { 298 | float2 uv1 = uv - delta; 299 | float2 uv2 = uv + delta; 300 | 301 | half3 n0 = SampleNormal(uv); 302 | 303 | half w0 = 2; 304 | half w1 = CompareNormal(n0, SampleNormal(uv1)); 305 | half w2 = CompareNormal(n0, SampleNormal(uv2)); 306 | 307 | half s = tex2D(_MainTex, uv).r * w0; 308 | s += tex2D(_MainTex, uv1).r * w1; 309 | s += tex2D(_MainTex, uv2).r * w2; 310 | 311 | return s / (w0 + w1 + w2); 312 | } 313 | 314 | // Pass 0: Obscurance estimation 315 | half4 frag_ao(v2f_img i) : SV_Target 316 | { 317 | return EstimateObscurance(i.uv); 318 | } 319 | 320 | // Pass 1: Geometry-aware separable blur (1st iteration) 321 | half4 frag_blur1(v2f_img i) : SV_Target 322 | { 323 | float2 delta = _MainTex_TexelSize.xy * _BlurVector; 324 | return SeparableBlurLarge(_MainTex, i.uv, delta); 325 | } 326 | 327 | // Pass 2: Geometry-aware separable blur (2nd iteration) 328 | half4 frag_blur2(v2f_img i) : SV_Target 329 | { 330 | float2 delta = _MainTex_TexelSize.xy * _BlurVector; 331 | return SeparableBlurSmall(_MainTex, i.uv, delta); 332 | } 333 | 334 | // Pass 3: Combiner for the forward mode 335 | struct v2f_multitex 336 | { 337 | float4 pos : SV_POSITION; 338 | float2 uv0 : TEXCOORD0; 339 | float2 uv1 : TEXCOORD1; 340 | }; 341 | 342 | v2f_multitex vert_multitex(appdata_img v) 343 | { 344 | // Handles vertically-flipped case. 345 | float vflip = sign(_MainTex_TexelSize.y); 346 | 347 | v2f_multitex o; 348 | o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 349 | o.uv0 = v.texcoord.xy; 350 | o.uv1 = (v.texcoord.xy - 0.5) * float2(1, vflip) + 0.5; 351 | return o; 352 | } 353 | 354 | half4 frag_combine(v2f_multitex i) : SV_Target 355 | { 356 | half4 src = tex2D(_MainTex, i.uv0); 357 | half ao = tex2D(_ObscuranceTexture, i.uv1).r; 358 | return half4(CombineObscurance(src.rgb, ao), src.a); 359 | } 360 | 361 | // Pass 4: Combiner for the ambient-only mode 362 | v2f_img vert_gbuffer(appdata_img v) 363 | { 364 | v2f_img o; 365 | o.pos = v.vertex * float4(2, 2, 0, 0) + float4(0, 0, 0, 1); 366 | #if UNITY_UV_STARTS_AT_TOP 367 | o.uv = v.texcoord * float2(1, -1) + float2(0, 1); 368 | #else 369 | o.uv = v.texcoord; 370 | #endif 371 | return o; 372 | } 373 | 374 | #if !SHADER_API_GLES // excluding the MRT pass under GLES2 375 | 376 | struct CombinerOutput 377 | { 378 | half4 gbuffer0 : SV_Target0; 379 | half4 gbuffer3 : SV_Target1; 380 | }; 381 | 382 | CombinerOutput frag_gbuffer_combine(v2f_img i) 383 | { 384 | half ao = tex2D(_ObscuranceTexture, i.uv).r; 385 | CombinerOutput o; 386 | o.gbuffer0 = half4(0, 0, 0, ao); 387 | o.gbuffer3 = half4((half3)EncodeAO(ao), 0); 388 | return o; 389 | } 390 | 391 | #else 392 | 393 | fixed4 frag_gbuffer_combine(v2f_img i) : SV_Target0 394 | { 395 | return 0; 396 | } 397 | 398 | #endif 399 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Shader/Obscurance.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53ad5775ae0684d458bfbf2674b495e0 3 | timeCreated: 1463548334 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Shader/Obscurance.shader: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Obscurance - SSAO (screen-space ambient obscurance) effect for Unity 3 | // 4 | // Copyright (C) 2016 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | Shader "Hidden/Kino/Obscurance" 25 | { 26 | Properties 27 | { 28 | _MainTex("", 2D) = ""{} 29 | _ObscuranceTexture("", 2D) = ""{} 30 | } 31 | SubShader 32 | { 33 | // 0: Occlusion estimation with CameraDepthTexture 34 | Pass 35 | { 36 | ZTest Always Cull Off ZWrite Off 37 | CGPROGRAM 38 | #define SOURCE_DEPTH 1 39 | #include "Obscurance.cginc" 40 | #pragma vertex vert_img 41 | #pragma fragment frag_ao 42 | #pragma target 3.0 43 | ENDCG 44 | } 45 | // 1: Occlusion estimation with CameraDepthNormalsTexture 46 | Pass 47 | { 48 | ZTest Always Cull Off ZWrite Off 49 | CGPROGRAM 50 | #define SOURCE_DEPTHNORMALS 1 51 | #include "Obscurance.cginc" 52 | #pragma vertex vert_img 53 | #pragma fragment frag_ao 54 | #pragma target 3.0 55 | ENDCG 56 | } 57 | // 2: Occlusion estimation with G-Buffer 58 | Pass 59 | { 60 | ZTest Always Cull Off ZWrite Off 61 | CGPROGRAM 62 | #define SOURCE_GBUFFER 1 63 | #include "Obscurance.cginc" 64 | #pragma vertex vert_img 65 | #pragma fragment frag_ao 66 | #pragma target 3.0 67 | ENDCG 68 | } 69 | // 3: Noise reduction (first pass) with CameraDepthNormalsTexture 70 | Pass 71 | { 72 | ZTest Always Cull Off ZWrite Off 73 | CGPROGRAM 74 | #define SOURCE_DEPTHNORMALS 1 75 | #include "Obscurance.cginc" 76 | #pragma vertex vert_img 77 | #pragma fragment frag_blur1 78 | #pragma target 3.0 79 | ENDCG 80 | } 81 | // 4: Noise reduction (first pass) with G Buffer 82 | Pass 83 | { 84 | ZTest Always Cull Off ZWrite Off 85 | CGPROGRAM 86 | #define SOURCE_GBUFFER 1 87 | #include "Obscurance.cginc" 88 | #pragma vertex vert_img 89 | #pragma fragment frag_blur1 90 | #pragma target 3.0 91 | ENDCG 92 | } 93 | // 5: Noise reduction (second pass) with CameraDepthNormalsTexture 94 | Pass 95 | { 96 | ZTest Always Cull Off ZWrite Off 97 | CGPROGRAM 98 | #define SOURCE_DEPTHNORMALS 1 99 | #include "Obscurance.cginc" 100 | #pragma vertex vert_img 101 | #pragma fragment frag_blur2 102 | #pragma target 3.0 103 | ENDCG 104 | } 105 | // 6: Noise reduction (second pass) with G Buffer 106 | Pass 107 | { 108 | ZTest Always Cull Off ZWrite Off 109 | CGPROGRAM 110 | #define SOURCE_GBUFFER 1 111 | #include "Obscurance.cginc" 112 | #pragma vertex vert_img 113 | #pragma fragment frag_blur2 114 | #pragma target 3.0 115 | ENDCG 116 | } 117 | // 7: Occlusion combiner 118 | Pass 119 | { 120 | ZTest Always Cull Off ZWrite Off 121 | CGPROGRAM 122 | #include "Obscurance.cginc" 123 | #pragma vertex vert_multitex 124 | #pragma fragment frag_combine 125 | #pragma target 3.0 126 | ENDCG 127 | } 128 | // 8: Occlusion combiner for the ambient-only mode 129 | Pass 130 | { 131 | Blend Zero OneMinusSrcColor, Zero OneMinusSrcAlpha 132 | ZTest Always Cull Off ZWrite Off 133 | CGPROGRAM 134 | #include "Obscurance.cginc" 135 | #pragma vertex vert_gbuffer 136 | #pragma fragment frag_gbuffer_combine 137 | #pragma target 3.0 138 | ENDCG 139 | } 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /Assets/Kino/Obscurance/Shader/Obscurance.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7541b5f18b1224a81927d8b1184b122b 3 | timeCreated: 1455515931 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d43a8ab8eb36c346bdf5c760580b019 3 | folderAsset: yes 4 | timeCreated: 1439534051 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ad044d970086bc48b37420227aaa504 3 | folderAsset: yes 4 | timeCreated: 1439538202 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Editor/VignetteEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // KinoVignette - Natural vignetting effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | using UnityEngine; 24 | using UnityEditor; 25 | 26 | namespace Kino 27 | { 28 | [CanEditMultipleObjects] 29 | [CustomEditor(typeof(Vignette))] 30 | public class VignetteEditor : Editor 31 | { 32 | SerializedProperty _falloff; 33 | 34 | void OnEnable() 35 | { 36 | _falloff = serializedObject.FindProperty("_falloff"); 37 | } 38 | 39 | public override void OnInspectorGUI() 40 | { 41 | serializedObject.Update(); 42 | 43 | EditorGUILayout.PropertyField(_falloff); 44 | 45 | serializedObject.ApplyModifiedProperties(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Editor/VignetteEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01095d10408c28d429dcdb7841e375a5 3 | timeCreated: 1439538208 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8e0d748f5d5fd8479f21c06cddbc912 3 | folderAsset: yes 4 | timeCreated: 1439534088 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Shader/Vignette.shader: -------------------------------------------------------------------------------- 1 | // 2 | // KinoVignette - Natural vignetting effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | Shader "Hidden/Kino/Vignette" 24 | { 25 | Properties 26 | { 27 | _MainTex ("-", 2D) = "" {} 28 | } 29 | 30 | CGINCLUDE 31 | 32 | #include "UnityCG.cginc" 33 | 34 | sampler2D _MainTex; 35 | float2 _Aspect; 36 | float _Falloff; 37 | 38 | half4 frag(v2f_img i) : SV_Target 39 | { 40 | float2 coord = (i.uv - 0.5) * _Aspect * 2; 41 | float rf = sqrt(dot(coord, coord)) * _Falloff; 42 | float rf2_1 = rf * rf + 1.0; 43 | float e = 1.0 / (rf2_1 * rf2_1); 44 | 45 | half4 src = tex2D(_MainTex, i.uv); 46 | return half4(src.rgb * e, src.a); 47 | } 48 | 49 | ENDCG 50 | 51 | SubShader 52 | { 53 | Pass 54 | { 55 | ZTest Always Cull Off ZWrite Off 56 | CGPROGRAM 57 | #pragma vertex vert_img 58 | #pragma fragment frag 59 | ENDCG 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Shader/Vignette.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89a223cbeee1935419811f8736c0a9b3 3 | timeCreated: 1439534076 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Vignette.cs: -------------------------------------------------------------------------------- 1 | // 2 | // KinoVignette - Natural vignetting effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | using UnityEngine; 24 | 25 | namespace Kino 26 | { 27 | [ExecuteInEditMode] 28 | [RequireComponent(typeof(Camera))] 29 | [AddComponentMenu("Kino Image Effects/Vignette")] 30 | public class Vignette : MonoBehaviour 31 | { 32 | #region Public Properties 33 | 34 | // Natural vignetting falloff 35 | [SerializeField, Range(0.0f, 1.0f)] 36 | float _falloff = 0.5f; 37 | 38 | public float intensity { 39 | get { return _falloff; } 40 | set { _falloff = value; } 41 | } 42 | 43 | #endregion 44 | 45 | #region Private Properties 46 | 47 | [SerializeField] Shader _shader; 48 | Material _material; 49 | 50 | #endregion 51 | 52 | #region MonoBehaviour Functions 53 | 54 | void OnRenderImage(RenderTexture source, RenderTexture destination) 55 | { 56 | if (_material == null) 57 | { 58 | _material = new Material(_shader); 59 | _material.hideFlags = HideFlags.DontSave; 60 | } 61 | 62 | var cam = GetComponent(); 63 | _material.SetVector("_Aspect", new Vector2(cam.aspect, 1)); 64 | _material.SetFloat("_Falloff", _falloff); 65 | 66 | Graphics.Blit(source, destination, _material, 0); 67 | } 68 | 69 | #endregion 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Vignette.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fc18a55c333d51489e5ee49b3cbff50 3 | timeCreated: 1439534795 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _shader: {fileID: 4800000, guid: 89a223cbeee1935419811f8736c0a9b3, type: 3} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Neuron.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eea582008cf71274bb354636d25eece4 3 | folderAsset: yes 4 | timeCreated: 1466415991 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Neuron/LICENSE.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/Assets/Neuron/LICENSE.pdf -------------------------------------------------------------------------------- /Assets/Neuron/LICENSE.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 712be4bce70e3c747bfa878f9d5df3d8 3 | timeCreated: 1466478783 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Neuron/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71e29b31b3b5bad4a8cd699a2d88dd13 3 | folderAsset: yes 4 | timeCreated: 1466415991 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Neuron/Plugins/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a84c847938e16f4693350196bfe242d 3 | folderAsset: yes 4 | timeCreated: 1466415991 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Neuron/Plugins/x86_64/NeuronDataReader.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/Assets/Neuron/Plugins/x86_64/NeuronDataReader.dll -------------------------------------------------------------------------------- /Assets/Neuron/Plugins/x86_64/NeuronDataReader.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cbd444969ccc2cb4e828e40f4761ba68 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | assetBundleVariant: 7 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7519f1ea5551ea4e9a1a707c4422902 3 | folderAsset: yes 4 | timeCreated: 1466415991 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a5a7cce706b92d4e8e43726edfeef11 3 | folderAsset: yes 4 | timeCreated: 1466606696 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/Editor/NeuronAnimatorEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Custom editor for Neuron animator class 3 | // 4 | // Refactored by Keijiro Takahashi 5 | // https://github.com/keijiro/NeuronRetargeting 6 | // 7 | // This is a derivative work of the Perception Neuron SDK. You can use this 8 | // freely as one of "Perception Neuron SDK Derivatives". See LICENSE.pdf and 9 | // their website for further details. 10 | // 11 | 12 | using UnityEngine; 13 | using UnityEditor; 14 | 15 | namespace Neuron 16 | { 17 | [CanEditMultipleObjects, CustomEditor(typeof(NeuronAnimator))] 18 | public class NeuronAnimatorEditor : Editor 19 | { 20 | SerializedProperty _address; 21 | SerializedProperty _port; 22 | SerializedProperty _socketType; 23 | SerializedProperty _actorID; 24 | 25 | void OnEnable() 26 | { 27 | _address = serializedObject.FindProperty("_address"); 28 | _port = serializedObject.FindProperty("_port"); 29 | _socketType = serializedObject.FindProperty("_socketType"); 30 | _actorID = serializedObject.FindProperty("_actorID"); 31 | } 32 | 33 | public override void OnInspectorGUI() 34 | { 35 | if (EditorApplication.isPlaying) 36 | { 37 | EditorGUILayout.HelpBox( 38 | "The settings in this component is not editable while " + 39 | "playing. Exit the play mode to change the settings.", 40 | MessageType.None, true 41 | ); 42 | return; 43 | } 44 | 45 | serializedObject.Update(); 46 | 47 | EditorGUILayout.PropertyField(_address); 48 | EditorGUILayout.PropertyField(_port); 49 | EditorGUILayout.PropertyField(_socketType); 50 | EditorGUILayout.PropertyField(_actorID); 51 | 52 | serializedObject.ApplyModifiedProperties(); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/Editor/NeuronAnimatorEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9aadf19b466c916498724aa2b77a885a 3 | timeCreated: 1466606944 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronActor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Neuron actor class 3 | // 4 | // Refactored by Keijiro Takahashi 5 | // https://github.com/keijiro/NeuronRetargeting 6 | // 7 | // This is a derivative work of the Perception Neuron SDK. You can use this 8 | // freely as one of "Perception Neuron SDK Derivatives". See LICENSE.pdf and 9 | // their website for further details. 10 | // 11 | // The following description is from the original source code. 12 | // 13 | 14 | /************************************************************************************ 15 | Copyright: Copyright 2014 Beijing Noitom Technology Ltd. All Rights reserved. 16 | Pending Patents: PCT/CN2014/085659 PCT/CN2014/071006 17 | 18 | Licensed under the Perception Neuron SDK License Beta Version (the “License"); 19 | You may only use the Perception Neuron SDK when in compliance with the License, 20 | which is provided at the time of installation or download, or which 21 | otherwise accompanies this software in the form of either an electronic or a hard copy. 22 | 23 | A copy of the License is included with this package or can be obtained at: 24 | http://www.neuronmocap.com 25 | 26 | Unless required by applicable law or agreed to in writing, the Perception Neuron SDK 27 | distributed under the License is provided on an "AS IS" BASIS, 28 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 | See the License for the specific language governing conditions and 30 | limitations under the License. 31 | ************************************************************************************/ 32 | 33 | using UnityEngine; 34 | using NeuronDataReaderWraper; 35 | using System; 36 | using System.Runtime.InteropServices; 37 | 38 | namespace Neuron 39 | { 40 | public class NeuronActor 41 | { 42 | #region Public properties 43 | 44 | public int ActorID { get; private set; } 45 | 46 | #endregion 47 | 48 | #region Public methods 49 | 50 | public NeuronActor(int actorID) 51 | { 52 | ActorID = actorID; 53 | } 54 | 55 | public Vector3 GetReceivedPosition(NeuronBones bone) 56 | { 57 | // Return zero if no position data is available. 58 | // (only "Hips" is available when displacement data is disabled) 59 | if (_header.bWithDisp == 0 && bone != NeuronBones.Hips) 60 | return Vector3.zero; 61 | 62 | // Calculate the data offset. 63 | var offset = 64 | (_header.bWithReference == 0 ? 0 : 6 ) + (int)bone * 6; 65 | 66 | // Retrieve the position data. 67 | var x = -_data[offset++]; 68 | var y = _data[offset++]; 69 | var z = _data[offset++]; 70 | 71 | return new Vector3(x, y, z) * 0.01f; 72 | } 73 | 74 | public Vector3 GetReceivedRotation(NeuronBones bone) 75 | { 76 | // Calculate the data offset. 77 | var offset = 78 | (_header.bWithReference == 0 ? 3 : 9 ) + 79 | (int)bone * (_header.bWithDisp != 0 ? 6 : 3); 80 | 81 | // Retrieve the rotation data. 82 | var y = -_data[offset++]; 83 | var x = _data[offset++]; 84 | var z = -_data[offset++]; 85 | 86 | return new Vector3(x, y, z); 87 | } 88 | 89 | #endregion 90 | 91 | #region Private members 92 | 93 | const int kMaxFrameDataLength = ((int)NeuronBones.NumOfBones + 1) * 6; 94 | 95 | BvhDataHeader _header; 96 | 97 | float[] _data = new float[kMaxFrameDataLength]; 98 | 99 | #endregion 100 | 101 | #region Data callback function 102 | 103 | public void OnReceivedMotionData(BvhDataHeader header, IntPtr data) 104 | { 105 | _header = header; 106 | try 107 | { 108 | Marshal.Copy(data, _data, 0, (int)header.DataCount); 109 | } 110 | catch (Exception e) 111 | { 112 | Debug.LogException(e); 113 | } 114 | } 115 | 116 | #endregion 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronActor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0c36a0f7ada89944b815c4b21be5336 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronAnimator.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Neuron animator class 3 | // 4 | // Refactored by Keijiro Takahashi 5 | // https://github.com/keijiro/NeuronRetargeting 6 | // 7 | // This is a derivative work of the Perception Neuron SDK. You can use this 8 | // freely as one of "Perception Neuron SDK Derivatives". See LICENSE.pdf and 9 | // their website for further details. 10 | // 11 | 12 | using UnityEngine; 13 | using Neuron; 14 | 15 | [RequireComponent(typeof(Animator))] 16 | [AddComponentMenu("Perception Neuron/Neuron Animator")] 17 | public class NeuronAnimator : MonoBehaviour 18 | { 19 | #region Editable variables 20 | 21 | [SerializeField] 22 | string _address = "127.0.0.1"; 23 | 24 | [SerializeField] 25 | int _port = 7001; 26 | 27 | [SerializeField] 28 | NeuronConnection.SocketType _socketType = NeuronConnection.SocketType.TCP; 29 | 30 | [SerializeField] 31 | int _actorID = 0; 32 | 33 | #endregion 34 | 35 | #region MonoBehavior functions 36 | 37 | void Awake() 38 | { 39 | _animator = GetComponent(); 40 | ScanBones(); 41 | } 42 | 43 | void OnEnable() 44 | { 45 | _source = NeuronConnection.Connect(_address, _port, _socketType); 46 | if (_source != null) _actor = _source.AcquireActor(_actorID); 47 | } 48 | 49 | void OnDisable() 50 | { 51 | if (_source != null) NeuronConnection.Disconnect(_source); 52 | _source = null; 53 | _actor = null; 54 | } 55 | 56 | void Update() 57 | { 58 | if (_actor == null) return; 59 | 60 | UpdateRoot(); 61 | 62 | // Legs 63 | UpdateBoneRotation(HumanBodyBones.RightUpperLeg, NeuronBones.RightUpLeg); 64 | UpdateBoneRotation(HumanBodyBones.RightLowerLeg, NeuronBones.RightLeg); 65 | UpdateBoneRotation(HumanBodyBones.RightFoot, NeuronBones.RightFoot); 66 | UpdateBoneRotation(HumanBodyBones.LeftUpperLeg, NeuronBones.LeftUpLeg); 67 | UpdateBoneRotation(HumanBodyBones.LeftLowerLeg, NeuronBones.LeftLeg); 68 | UpdateBoneRotation(HumanBodyBones.LeftFoot, NeuronBones.LeftFoot); 69 | 70 | // Spine 71 | UpdateBoneRotation(HumanBodyBones.Spine, NeuronBones.Spine); 72 | UpdateBoneRotation(HumanBodyBones.Chest, NeuronBones.Spine1, 73 | NeuronBones.Spine2, 74 | NeuronBones.Spine3); 75 | UpdateBoneRotation(HumanBodyBones.Neck, NeuronBones.Neck); 76 | UpdateBoneRotation(HumanBodyBones.Head, NeuronBones.Head); 77 | 78 | // Right arm 79 | UpdateBoneRotation(HumanBodyBones.RightShoulder, NeuronBones.RightShoulder); 80 | UpdateBoneRotation(HumanBodyBones.RightUpperArm, NeuronBones.RightArm); 81 | UpdateBoneRotation(HumanBodyBones.RightLowerArm, NeuronBones.RightForeArm); 82 | UpdateBoneRotation(HumanBodyBones.RightHand, NeuronBones.RightHand); 83 | 84 | // Left arm 85 | UpdateBoneRotation(HumanBodyBones.LeftShoulder, NeuronBones.LeftShoulder); 86 | UpdateBoneRotation(HumanBodyBones.LeftUpperArm, NeuronBones.LeftArm); 87 | UpdateBoneRotation(HumanBodyBones.LeftLowerArm, NeuronBones.LeftForeArm); 88 | UpdateBoneRotation(HumanBodyBones.LeftHand, NeuronBones.LeftHand); 89 | 90 | // Right fingers 91 | UpdateBoneRotation(HumanBodyBones.RightIndexDistal, NeuronBones.RightHandIndex3); 92 | UpdateBoneRotation(HumanBodyBones.RightIndexIntermediate, NeuronBones.RightHandIndex2); 93 | UpdateBoneRotation(HumanBodyBones.RightIndexProximal, NeuronBones.RightHandIndex1); 94 | UpdateBoneRotation(HumanBodyBones.RightThumbDistal, NeuronBones.RightHandThumb3); 95 | UpdateBoneRotation(HumanBodyBones.RightThumbIntermediate, NeuronBones.RightHandThumb2); 96 | UpdateBoneRotation(HumanBodyBones.RightThumbProximal, NeuronBones.RightHandThumb1); 97 | UpdateBoneRotation(HumanBodyBones.RightMiddleDistal, NeuronBones.RightHandMiddle3); 98 | UpdateBoneRotation(HumanBodyBones.RightMiddleIntermediate, NeuronBones.RightHandMiddle2); 99 | UpdateBoneRotation(HumanBodyBones.RightMiddleProximal, NeuronBones.RightHandMiddle1); 100 | UpdateBoneRotation(HumanBodyBones.RightRingDistal, NeuronBones.RightHandRing3); 101 | UpdateBoneRotation(HumanBodyBones.RightRingIntermediate, NeuronBones.RightHandRing2); 102 | UpdateBoneRotation(HumanBodyBones.RightRingProximal, NeuronBones.RightHandRing1); 103 | UpdateBoneRotation(HumanBodyBones.RightLittleDistal, NeuronBones.RightHandPinky3); 104 | UpdateBoneRotation(HumanBodyBones.RightLittleIntermediate, NeuronBones.RightHandPinky2); 105 | UpdateBoneRotation(HumanBodyBones.RightLittleProximal, NeuronBones.RightHandPinky1); 106 | 107 | // Left fingers 108 | UpdateBoneRotation(HumanBodyBones.LeftIndexDistal, NeuronBones.LeftHandIndex3); 109 | UpdateBoneRotation(HumanBodyBones.LeftIndexIntermediate, NeuronBones.LeftHandIndex2); 110 | UpdateBoneRotation(HumanBodyBones.LeftIndexProximal, NeuronBones.LeftHandIndex1); 111 | UpdateBoneRotation(HumanBodyBones.LeftThumbDistal, NeuronBones.LeftHandThumb3); 112 | UpdateBoneRotation(HumanBodyBones.LeftThumbIntermediate, NeuronBones.LeftHandThumb2); 113 | UpdateBoneRotation(HumanBodyBones.LeftThumbProximal, NeuronBones.LeftHandThumb1); 114 | UpdateBoneRotation(HumanBodyBones.LeftMiddleDistal, NeuronBones.LeftHandMiddle3); 115 | UpdateBoneRotation(HumanBodyBones.LeftMiddleIntermediate, NeuronBones.LeftHandMiddle2); 116 | UpdateBoneRotation(HumanBodyBones.LeftMiddleProximal, NeuronBones.LeftHandMiddle1); 117 | UpdateBoneRotation(HumanBodyBones.LeftRingDistal, NeuronBones.LeftHandRing3); 118 | UpdateBoneRotation(HumanBodyBones.LeftRingIntermediate, NeuronBones.LeftHandRing2); 119 | UpdateBoneRotation(HumanBodyBones.LeftRingProximal, NeuronBones.LeftHandRing1); 120 | UpdateBoneRotation(HumanBodyBones.LeftLittleDistal, NeuronBones.LeftHandPinky3); 121 | UpdateBoneRotation(HumanBodyBones.LeftLittleIntermediate, NeuronBones.LeftHandPinky2); 122 | UpdateBoneRotation(HumanBodyBones.LeftLittleProximal, NeuronBones.LeftHandPinky1); 123 | 124 | FixUpWithFeetPosition(); 125 | } 126 | 127 | void UpdateRoot() 128 | { 129 | var hips = _animator.GetBoneTransform(HumanBodyBones.Hips); 130 | 131 | var pos = _actor.GetReceivedPosition(NeuronBones.Hips); 132 | var rot = _actor.GetReceivedRotation(NeuronBones.Hips); 133 | 134 | var d_rot = _defaultRotations[(int)HumanBodyBones.Hips]; 135 | var r_rot = _resetRotations[(int)HumanBodyBones.Hips]; 136 | var r_rot_inv = Quaternion.Inverse(r_rot); 137 | 138 | hips.localPosition = r_rot * pos * _scaleFactorForHips; 139 | hips.localRotation = r_rot * Quaternion.Euler(rot) * r_rot_inv * d_rot; 140 | } 141 | 142 | void UpdateBoneRotation( 143 | HumanBodyBones humanBone, 144 | NeuronBones neuronBone0, 145 | NeuronBones neuronBone1 = NeuronBones.NumOfBones, 146 | NeuronBones neuronBone2 = NeuronBones.NumOfBones 147 | ) 148 | { 149 | var bone = _animator.GetBoneTransform(humanBone); 150 | if (bone == null) return; 151 | 152 | var rot = _actor.GetReceivedRotation(neuronBone0); 153 | 154 | if (neuronBone1 != NeuronBones.NumOfBones) 155 | rot += _actor.GetReceivedRotation(neuronBone1); 156 | 157 | if (neuronBone2 != NeuronBones.NumOfBones) 158 | rot += _actor.GetReceivedRotation(neuronBone2); 159 | 160 | var d_rot = _defaultRotations[(int)humanBone]; 161 | var r_rot = _resetRotations[(int)humanBone]; 162 | var r_rot_inv = Quaternion.Inverse(r_rot); 163 | 164 | bone.localRotation = r_rot * Quaternion.Euler(rot) * r_rot_inv * d_rot; 165 | } 166 | 167 | void FixUpWithFeetPosition() 168 | { 169 | var lfeet = _animator.GetBoneTransform(HumanBodyBones.LeftFoot); 170 | var rfeet = _animator.GetBoneTransform(HumanBodyBones.RightFoot); 171 | 172 | var offs = 0.0f; 173 | 174 | if (lfeet.position.y < rfeet.position.y) 175 | offs = lfeet.position.y - _animator.leftFeetBottomHeight; 176 | else 177 | offs = rfeet.position.y - _animator.rightFeetBottomHeight; 178 | 179 | var hips = _animator.GetBoneTransform(HumanBodyBones.Hips); 180 | hips.position -= Vector3.up * offs; 181 | } 182 | 183 | #endregion 184 | 185 | #region Private variables 186 | 187 | const int kBoneCount = (int)HumanBodyBones.LastBone; 188 | 189 | Animator _animator; 190 | NeuronSource _source; 191 | NeuronActor _actor; 192 | 193 | float _scaleFactorForHips; 194 | Quaternion[] _resetRotations = new Quaternion[kBoneCount]; 195 | Quaternion[] _defaultRotations = new Quaternion[kBoneCount]; 196 | 197 | #endregion 198 | 199 | #region Private functions 200 | 201 | void ScanBones() 202 | { 203 | // The height of the hips in the base model. 204 | const float kBaseHipsHeight = 1.113886f; 205 | 206 | // Get the feet position. 207 | var lfoot = _animator.GetBoneTransform(HumanBodyBones.LeftFoot); 208 | var rfoot = _animator.GetBoneTransform(HumanBodyBones.RightFoot); 209 | var y_feet = (lfoot.position.y + rfoot.position.y) * 0.5f; 210 | y_feet -= (_animator.leftFeetBottomHeight + _animator.leftFeetBottomHeight) * 0.5f; 211 | 212 | // Calculate the scale factor. 213 | var hips = _animator.GetBoneTransform(HumanBodyBones.Hips); 214 | _scaleFactorForHips = (hips.position.y - y_feet) / kBaseHipsHeight; 215 | 216 | // Retrieve bone rotations. 217 | for (var i = 0; i < kBoneCount; ++i) 218 | { 219 | var bone = _animator.GetBoneTransform((HumanBodyBones)i); 220 | if (bone == null) continue; 221 | 222 | // Default rotation 223 | _defaultRotations[i] = bone.localRotation; 224 | 225 | // "Reset to standard" rotation 226 | _resetRotations[i] = 227 | Quaternion.Inverse(bone.parent.rotation) * 228 | _animator.transform.rotation; 229 | } 230 | } 231 | 232 | #endregion 233 | } 234 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronAnimator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41173daca41f9a64b8552925c6a3c363 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronBones.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Neuron bone definitions 3 | // 4 | // Refactored by Keijiro Takahashi 5 | // https://github.com/keijiro/NeuronRetargeting 6 | // 7 | // This is a derivative work of the Perception Neuron SDK. You can use this 8 | // freely as one of "Perception Neuron SDK Derivatives". See LICENSE.pdf and 9 | // their website for further details. 10 | // 11 | // The following description is from the original source code. 12 | // 13 | 14 | /************************************************************************************ 15 | Copyright: Copyright 2014 Beijing Noitom Technology Ltd. All Rights reserved. 16 | Pending Patents: PCT/CN2014/085659 PCT/CN2014/071006 17 | 18 | Licensed under the Perception Neuron SDK License Beta Version (the “License"); 19 | You may only use the Perception Neuron SDK when in compliance with the License, 20 | which is provided at the time of installation or download, or which 21 | otherwise accompanies this software in the form of either an electronic or a hard copy. 22 | 23 | A copy of the License is included with this package or can be obtained at: 24 | http://www.neuronmocap.com 25 | 26 | Unless required by applicable law or agreed to in writing, the Perception Neuron SDK 27 | distributed under the License is provided on an "AS IS" BASIS, 28 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 | See the License for the specific language governing conditions and 30 | limitations under the License. 31 | ************************************************************************************/ 32 | 33 | namespace Neuron 34 | { 35 | public enum NeuronBones 36 | { 37 | Hips = 0, 38 | RightUpLeg = 1, 39 | RightLeg = 2, 40 | RightFoot = 3, 41 | LeftUpLeg = 4, 42 | LeftLeg = 5, 43 | LeftFoot = 6, 44 | Spine = 7, 45 | Spine1 = 8, 46 | Spine2 = 9, 47 | Spine3 = 10, 48 | Neck = 11, 49 | Head = 12, 50 | RightShoulder = 13, 51 | RightArm = 14, 52 | RightForeArm = 15, 53 | RightHand = 16, 54 | RightHandThumb1 = 17, 55 | RightHandThumb2 = 18, 56 | RightHandThumb3 = 19, 57 | RightInHandIndex = 20, 58 | RightHandIndex1 = 21, 59 | RightHandIndex2 = 22, 60 | RightHandIndex3 = 23, 61 | RightInHandMiddle = 24, 62 | RightHandMiddle1 = 25, 63 | RightHandMiddle2 = 26, 64 | RightHandMiddle3 = 27, 65 | RightInHandRing = 28, 66 | RightHandRing1 = 29, 67 | RightHandRing2 = 30, 68 | RightHandRing3 = 31, 69 | RightInHandPinky = 32, 70 | RightHandPinky1 = 33, 71 | RightHandPinky2 = 34, 72 | RightHandPinky3 = 35, 73 | LeftShoulder = 36, 74 | LeftArm = 37, 75 | LeftForeArm = 38, 76 | LeftHand = 39, 77 | LeftHandThumb1 = 40, 78 | LeftHandThumb2 = 41, 79 | LeftHandThumb3 = 42, 80 | LeftInHandIndex = 43, 81 | LeftHandIndex1 = 44, 82 | LeftHandIndex2 = 45, 83 | LeftHandIndex3 = 46, 84 | LeftInHandMiddle = 47, 85 | LeftHandMiddle1 = 48, 86 | LeftHandMiddle2 = 49, 87 | LeftHandMiddle3 = 50, 88 | LeftInHandRing = 51, 89 | LeftHandRing1 = 52, 90 | LeftHandRing2 = 53, 91 | LeftHandRing3 = 54, 92 | LeftInHandPinky = 55, 93 | LeftHandPinky1 = 56, 94 | LeftHandPinky2 = 57, 95 | LeftHandPinky3 = 58, 96 | NumOfBones 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronBones.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 68fcdc18387fcf44fa3743be26843196 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronConnection.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Neuron connection class 3 | // 4 | // Refactored by Keijiro Takahashi 5 | // https://github.com/keijiro/NeuronRetargeting 6 | // 7 | // This is a derivative work of the Perception Neuron SDK. You can use this 8 | // freely as one of "Perception Neuron SDK Derivatives". See LICENSE.pdf and 9 | // their website for further details. 10 | // 11 | // The following description is from the original source code. 12 | // 13 | 14 | /************************************************************************************ 15 | Copyright: Copyright 2014 Beijing Noitom Technology Ltd. All Rights reserved. 16 | Pending Patents: PCT/CN2014/085659 PCT/CN2014/071006 17 | 18 | Licensed under the Perception Neuron SDK License Beta Version (the “License"); 19 | You may only use the Perception Neuron SDK when in compliance with the License, 20 | which is provided at the time of installation or download, or which 21 | otherwise accompanies this software in the form of either an electronic or a hard copy. 22 | 23 | A copy of the License is included with this package or can be obtained at: 24 | http://www.neuronmocap.com 25 | 26 | Unless required by applicable law or agreed to in writing, the Perception Neuron SDK 27 | distributed under the License is provided on an "AS IS" BASIS, 28 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 | See the License for the specific language governing conditions and 30 | limitations under the License. 31 | ************************************************************************************/ 32 | 33 | using UnityEngine; 34 | using NeuronDataReaderWraper; 35 | using System; 36 | using System.Collections.Generic; 37 | 38 | namespace Neuron 39 | { 40 | public static class NeuronConnection 41 | { 42 | #region Public functions 43 | 44 | public enum SocketType { TCP, UDP } 45 | 46 | public static NeuronSource Connect(string address, int port, SocketType socketType) 47 | { 48 | var source = FindConnection(address, port, socketType); 49 | 50 | if (source == null) 51 | source = CreateConnection(address, port, socketType); 52 | 53 | if (source != null) source.IncrementReferenceCount(); 54 | 55 | return source; 56 | } 57 | 58 | public static void Disconnect(NeuronSource source) 59 | { 60 | if (source == null) return; 61 | 62 | if (source.DecrementReferenceCount() <= 0) 63 | DestroyConnection(source); 64 | } 65 | 66 | #endregion 67 | 68 | #region Internal members 69 | 70 | static List _sources = new List(); 71 | 72 | // The network thread will access to one of sources when receiving 73 | // data from a device. This lock object is used to protect the object 74 | // from deletion by the main thread. 75 | static System.Object _sourcesLock = new System.Object(); 76 | 77 | static NeuronSource FindConnection(string address, int port, SocketType socketType) 78 | { 79 | if (socketType == SocketType.TCP) 80 | { 81 | foreach (var source in _sources) 82 | if (source.SocketType == SocketType.TCP && source.Address == address && source.Port == port) 83 | return source; 84 | } 85 | else // SocketType.UDP 86 | { 87 | foreach (var source in _sources) 88 | if (source.SocketType == SocketType.UDP && source.Port == port) 89 | return source; 90 | } 91 | return null; 92 | } 93 | 94 | static NeuronSource CreateConnection(string address, int port, SocketType socketType) 95 | { 96 | // Try to make connection with using the native plugin. 97 | var socket = IntPtr.Zero; 98 | 99 | if (socketType == SocketType.TCP) 100 | { 101 | socket = NeuronDataReader.BRConnectTo(address, port); 102 | 103 | if (socket == IntPtr.Zero) { 104 | Debug.LogError("[Neuron] Connection failed " + address + ":" + port); 105 | return null; 106 | } 107 | 108 | Debug.Log("[Neuron] Connected " + address + ":" + port); 109 | } 110 | else 111 | { 112 | socket = NeuronDataReader.BRStartUDPServiceAt(port); 113 | 114 | if (socket == IntPtr.Zero) { 115 | Debug.LogError("[Neuron] Failed listening " + port); 116 | return null; 117 | } 118 | 119 | Debug.Log("[Neuron] Started listening " + port); 120 | } 121 | 122 | // If this is the first connection, register the reader callack. 123 | if (_sources.Count == 0) 124 | NeuronDataReader.BRRegisterFrameDataCallback(IntPtr.Zero, OnFrameDataReceived); 125 | 126 | // Create a new source. 127 | var source = new NeuronSource(address, port, socketType, socket); 128 | lock (_sourcesLock) _sources.Add(source); 129 | 130 | return source; 131 | } 132 | 133 | static void DestroyConnection(NeuronSource source) 134 | { 135 | if (source == null) return; 136 | 137 | // We have to make a lock before removing the source from the maps. 138 | lock (_sourcesLock) _sources.Remove(source); 139 | // Now we can delete the source safely! 140 | 141 | if (source.SocketType == SocketType.TCP) 142 | { 143 | NeuronDataReader.BRCloseSocket(source.Socket); 144 | Debug.Log("[Neuron] Disconnected " + source.Address + ":" + source.Port); 145 | } 146 | else 147 | { 148 | NeuronDataReader.BRCloseSocket(source.Socket); 149 | Debug.Log("[Neuron] Stopped listening " + source.Port); 150 | } 151 | 152 | // Unregister the reader callback if this was the last connection. 153 | if (_sources.Count == 0) 154 | NeuronDataReader.BRRegisterFrameDataCallback(IntPtr.Zero, null); 155 | } 156 | 157 | static void OnFrameDataReceived( 158 | IntPtr customObject, IntPtr socket, 159 | IntPtr header, IntPtr data 160 | ) 161 | { 162 | lock (_sourcesLock) 163 | { 164 | // It's dumb to use a for-loop with a generic list, 165 | // but it's the fastest way to scan a list. 166 | for (var i = 0; i < _sources.Count; i++) 167 | { 168 | var source = _sources[i]; 169 | if (source.Socket == socket) 170 | { 171 | source.OnFrameDataReceived(header, data); 172 | break; 173 | } 174 | } 175 | } 176 | } 177 | 178 | #endregion 179 | } 180 | } 181 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronConnection.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c7513a2177c3492479454b6a390dd8a4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronDataReader.cs: -------------------------------------------------------------------------------- 1 | /* Copyright: Copyright 2014 Beijing Noitom Technology Ltd. All Rights reserved. 2 | * Pending Patents: PCT/CN2014/085659 PCT/CN2014/071006 3 | * 4 | * Licensed under the Neuron SDK License Beta Version (the “License"); 5 | * You may only use the Neuron SDK when in compliance with the License, 6 | * which is provided at the time of installation or download, or which 7 | * otherwise accompanies this software in the form of either an electronic or a hard copy. 8 | * 9 | * Unless required by applicable law or agreed to in writing, the Neuron SDK 10 | * distributed under the License is provided on an "AS IS" BASIS, 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | * See the License for the specific language governing conditions and 13 | * limitations under the License. 14 | */ 15 | 16 | 17 | using System; 18 | using System.Text; 19 | using System.Runtime.InteropServices; // For DllImport() 20 | 21 | 22 | namespace NeuronDataReaderWraper 23 | { 24 | #region Basic data types 25 | /// 26 | /// Socket connection status 27 | /// 28 | public enum SocketStatus 29 | { 30 | CS_Running, // Socket is working correctly 31 | CS_Starting, // Is trying to start service 32 | CS_OffWork, // Not working 33 | }; 34 | 35 | /// 36 | /// Data version 37 | /// 38 | public struct DataVersion 39 | { 40 | public byte BuildNumb; // Build number 41 | public byte Revision; // Revision number 42 | public byte Minor; // Subversion number 43 | public byte Major; // Major version number 44 | }; 45 | 46 | /// 47 | /// Header format of BVH data 48 | /// 49 | [StructLayout(LayoutKind.Sequential, Pack=1)] 50 | public struct BvhDataHeader 51 | { 52 | public ushort Token1; // Package start token: 0xDDFF 53 | public DataVersion DataVersion; // Version of community data format: 1.1.0.0 54 | public ushort DataCount; // Values count 55 | public byte bWithDisp; // With/out displacement 56 | public byte bWithReference; // With/out reference bone data at first 57 | public uint AvatarIndex; // Avatar index 58 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] 59 | public string AvatarName; // Avatar name 60 | public uint FrameIndex; // Frame data index 61 | public uint Reserved; // Reserved, only enable this package has 64bytes length 62 | public uint Reserved1; // Reserved, only enable this package has 64bytes length 63 | public uint Reserved2; // Reserved, only enable this package has 64bytes length 64 | public ushort Token2; // Package end token: 0xEEFF 65 | }; 66 | 67 | [StructLayout(LayoutKind.Sequential, Pack = 1)] 68 | public struct CalcDataHeader 69 | { 70 | public ushort Token1; // Package start token: 0x88FF 71 | public DataVersion DataVersion; // Version of community data format. e.g.: 1.0.0.3 72 | public UInt32 DataCount; // Values count 73 | public UInt32 AvatarIndex; // Avatar index 74 | [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] 75 | public string AvatarName; // Avatar name 76 | public UInt32 FrameIndex; // Frame data index 77 | public UInt32 Reserved1; // Reserved, only enable this package has 64bytes length 78 | public UInt32 Reserved2; // Reserved, only enable this package has 64bytes length 79 | public UInt32 Reserved3; // Reserved, only enable this package has 64bytes length 80 | public ushort Token2; // Package end token: 0x99FF 81 | }; 82 | 83 | #endregion 84 | 85 | #region Callbacks for data output 86 | /// 87 | /// FrameDataReceived CALLBACK 88 | /// Remarks 89 | /// The related information of the data stream can be obtained from BvhDataHeader. 90 | /// 91 | /// User defined object. 92 | /// Connector reference of TCP/IP client as identity. 93 | /// A DataHeader type pointer, to output the BVH/Calculation data format information. 94 | /// Float type array pointer, to output binary data. 95 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 96 | public delegate void FrameDataReceived(IntPtr customObject, IntPtr sockRef, IntPtr DataHeader, IntPtr data); 97 | 98 | /// 99 | /// SocketStatusChanged CALLBACK 100 | /// Remarks 101 | /// As convenient, use BRGetSocketStatus() to get status manually other than register this callback 102 | /// 103 | /// User defined object. 104 | /// Socket reference of TCP or UDP service identity. 105 | /// Socket connection status 106 | /// Socket status description. 107 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 108 | public delegate void SocketStatusChanged(IntPtr customObject, IntPtr sockRef, SocketStatus status, [MarshalAs(UnmanagedType.LPStr)]string msg); 109 | #endregion 110 | 111 | // API exporter 112 | public class NeuronDataReader 113 | { 114 | #region Importor definition 115 | #if UNITY_IPHONE && !UNITY_EDITOR 116 | private const string ReaderImportor = "__Internal"; 117 | #elif _WINDOWS 118 | private const string ReaderImportor = "NeuronDataReader.dll"; 119 | #else 120 | private const string ReaderImportor = "NeuronDataReader"; 121 | #endif 122 | #endregion 123 | 124 | #region Functions API 125 | /// 126 | /// Register receiving and parsed frame bvh data callback 127 | /// 128 | /// Client defined object. Can be null 129 | /// Client defined function. 130 | [DllImport(ReaderImportor, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] 131 | public static extern void BRRegisterFrameDataCallback(IntPtr customedObj, FrameDataReceived handle); 132 | /// 133 | /// Register receiving and parsed frame calculation data callback 134 | /// 135 | /// Client defined object. Can be null 136 | /// Client defined function. 137 | [DllImport(ReaderImportor, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] 138 | public static extern void BRRegisterCalculationDataCallback(IntPtr customedObj, FrameDataReceived handle); 139 | 140 | /// 141 | /// 142 | /// 143 | /// 144 | [DllImport(ReaderImportor, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] 145 | //[return: MarshalAs(UnmanagedType.LPStr)] 146 | private static extern IntPtr BRGetLastErrorMessage(); 147 | /// 148 | /// Call this function to get what error occurred in library. 149 | /// 150 | /// 151 | public static string strBRGetLastErrorMessage() 152 | { 153 | // Get message pointer 154 | IntPtr ptr = BRGetLastErrorMessage(); 155 | // Construct a string from the pointer. 156 | return Marshal.PtrToStringAnsi(ptr); 157 | } 158 | 159 | // Register TCP socket status callback 160 | [DllImport(ReaderImportor, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] 161 | public static extern void BRRegisterSocketStatusCallback(IntPtr customedObj, SocketStatusChanged handle); 162 | 163 | // Connect to server by TCP/IP 164 | [DllImport(ReaderImportor, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] 165 | public static extern IntPtr BRConnectTo(string serverIP, int nPort); 166 | 167 | // Start a UDP service to receive data at 'nPort' 168 | [DllImport(ReaderImportor, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] 169 | public static extern IntPtr BRStartUDPServiceAt(int nPort); 170 | 171 | // Check TCP/UDP service status 172 | [DllImport(ReaderImportor, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] 173 | public static extern SocketStatus BRGetSocketStatus(IntPtr sockRef); 174 | 175 | // Close a TCP/UDP service 176 | [DllImport(ReaderImportor, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)] 177 | public static extern void BRCloseSocket(IntPtr sockRef); 178 | 179 | #endregion 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronDataReader.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8aba32ecd05a684b9780c2a95089a8c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronSource.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Neuron data source handler class 3 | // 4 | // Refactored by Keijiro Takahashi 5 | // https://github.com/keijiro/NeuronRetargeting 6 | // 7 | // This is a derivative work of the Perception Neuron SDK. You can use this 8 | // freely as one of "Perception Neuron SDK Derivatives". See LICENSE.pdf and 9 | // their website for further details. 10 | // 11 | // The following description is from the original source code. 12 | // 13 | 14 | /************************************************************************************ 15 | Copyright: Copyright 2014 Beijing Noitom Technology Ltd. All Rights reserved. 16 | Pending Patents: PCT/CN2014/085659 PCT/CN2014/071006 17 | 18 | Licensed under the Perception Neuron SDK License Beta Version (the “License"); 19 | You may only use the Perception Neuron SDK when in compliance with the License, 20 | which is provided at the time of installation or download, or which 21 | otherwise accompanies this software in the form of either an electronic or a hard copy. 22 | 23 | A copy of the License is included with this package or can be obtained at: 24 | http://www.neuronmocap.com 25 | 26 | Unless required by applicable law or agreed to in writing, the Perception Neuron SDK 27 | distributed under the License is provided on an "AS IS" BASIS, 28 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 29 | See the License for the specific language governing conditions and 30 | limitations under the License. 31 | ************************************************************************************/ 32 | 33 | using UnityEngine; 34 | using NeuronDataReaderWraper; 35 | using System; 36 | using System.Collections.Generic; 37 | using System.Runtime.InteropServices; 38 | 39 | namespace Neuron 40 | { 41 | public class NeuronSource 42 | { 43 | #region Public properties; 44 | 45 | public string Address { get; private set; } 46 | 47 | public int Port { get; private set; } 48 | 49 | public NeuronConnection.SocketType SocketType { get; private set; } 50 | 51 | public IntPtr Socket { get; private set; } 52 | 53 | public int ReferenceCounter { get; private set; } 54 | 55 | #endregion 56 | 57 | #region Public methods 58 | 59 | public NeuronSource( 60 | string address, int port, 61 | NeuronConnection.SocketType socketType, IntPtr socket 62 | ) 63 | { 64 | Address = address; 65 | Port = port; 66 | SocketType = socketType; 67 | Socket = socket; 68 | ReferenceCounter = 0; 69 | } 70 | 71 | public int IncrementReferenceCount() 72 | { 73 | return ++ReferenceCounter; 74 | } 75 | 76 | public int DecrementReferenceCount() 77 | { 78 | return --ReferenceCounter; 79 | } 80 | 81 | public NeuronActor AcquireActor(int actorID) 82 | { 83 | return FindOrCreateActor(actorID); 84 | } 85 | 86 | #endregion 87 | 88 | #region Private variables 89 | 90 | List _actors = new List(); 91 | 92 | // The main thread and the network thread will possibly access to the 93 | // actor list and duplicatively make actor objects from a same actor. 94 | // This lock object is used to avoid such a conflict. 95 | System.Object _actorsLock = new System.Object(); 96 | 97 | #endregion 98 | 99 | #region Callback function 100 | 101 | public virtual void OnFrameDataReceived(IntPtr DataHeader, IntPtr data) 102 | { 103 | var header = new BvhDataHeader(); 104 | 105 | try 106 | { 107 | header = (BvhDataHeader)Marshal.PtrToStructure( 108 | DataHeader, typeof(BvhDataHeader) 109 | ); 110 | } 111 | catch(Exception e) 112 | { 113 | Debug.LogException(e); 114 | return; 115 | } 116 | 117 | var actor = FindOrCreateActor((int)header.AvatarIndex); 118 | actor.OnReceivedMotionData(header, data); 119 | } 120 | 121 | #endregion 122 | 123 | #region Private functions 124 | 125 | NeuronActor FindOrCreateActor(int actorID) 126 | { 127 | lock (_actorsLock) 128 | { 129 | foreach (var actor in _actors) 130 | if (actor.ActorID == actorID) return actor; 131 | 132 | var newActor = new NeuronActor(actorID); 133 | _actors.Add(newActor); 134 | 135 | return newActor; 136 | } 137 | } 138 | 139 | #endregion 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /Assets/Neuron/Scripts/NeuronSource.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a563b871bb9a3da409b65f1f3be2c77a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f28daeeb9de90646904618bffe8d331 3 | folderAsset: yes 4 | timeCreated: 1466162028 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Floor.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Floor 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 2800000, guid: 2cccd6cb618e75d4abf331cef3def7e3, type: 3} 23 | m_Scale: {x: 2, y: 2} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _DetailNormalMap 35 | second: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | data: 40 | first: 41 | name: _ParallaxMap 42 | second: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | data: 47 | first: 48 | name: _OcclusionMap 49 | second: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | data: 54 | first: 55 | name: _EmissionMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 2, y: 2} 59 | m_Offset: {x: 0, y: 0} 60 | data: 61 | first: 62 | name: _DetailMask 63 | second: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | data: 68 | first: 69 | name: _DetailAlbedoMap 70 | second: 71 | m_Texture: {fileID: 0} 72 | m_Scale: {x: 1, y: 1} 73 | m_Offset: {x: 0, y: 0} 74 | data: 75 | first: 76 | name: _MetallicGlossMap 77 | second: 78 | m_Texture: {fileID: 0} 79 | m_Scale: {x: 1, y: 1} 80 | m_Offset: {x: 0, y: 0} 81 | m_Floats: 82 | data: 83 | first: 84 | name: _SrcBlend 85 | second: 1 86 | data: 87 | first: 88 | name: _DstBlend 89 | second: 0 90 | data: 91 | first: 92 | name: _Cutoff 93 | second: 0.5 94 | data: 95 | first: 96 | name: _Parallax 97 | second: 0.02 98 | data: 99 | first: 100 | name: _ZWrite 101 | second: 1 102 | data: 103 | first: 104 | name: _Glossiness 105 | second: 0 106 | data: 107 | first: 108 | name: _BumpScale 109 | second: 1 110 | data: 111 | first: 112 | name: _OcclusionStrength 113 | second: 1 114 | data: 115 | first: 116 | name: _DetailNormalMapScale 117 | second: 1 118 | data: 119 | first: 120 | name: _UVSec 121 | second: 0 122 | data: 123 | first: 124 | name: _Mode 125 | second: 0 126 | data: 127 | first: 128 | name: _Metallic 129 | second: 0 130 | m_Colors: 131 | data: 132 | first: 133 | name: _EmissionColor 134 | second: {r: 0, g: 0, b: 0, a: 1} 135 | data: 136 | first: 137 | name: _Color 138 | second: {r: 1, g: 1, b: 1, a: 1} 139 | -------------------------------------------------------------------------------- /Assets/Test/Floor.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 850a9bd1195e45f45962fb4ffc22b213 3 | timeCreated: 1466160464 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Model.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0119c6ecb19c50d4abd67d7fcca5f495 3 | folderAsset: yes 4 | timeCreated: 1463728387 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Model/Ethan.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/Assets/Test/Model/Ethan.fbx -------------------------------------------------------------------------------- /Assets/Test/Model/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42519b2745d2b71469d9d12e85b76520 3 | folderAsset: yes 4 | timeCreated: 1463728551 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Model/Materials/EthanWhite.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 4 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: EthanWhite 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _LIGHTMAPPING_STATIC_LIGHTMAPS _NORMALMAP _UVPRIM_UV1 _UVSEC_UV1 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 2800000, guid: 0ca09a4614a0daa44ba043de90181896, type: 3} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | data: 24 | first: 25 | name: _BumpMap 26 | second: 27 | m_Texture: {fileID: 2800000, guid: 3b5b7be0f2332c24f89a2af018daa62d, type: 3} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | data: 31 | first: 32 | name: _DetailNormalMap 33 | second: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | data: 38 | first: 39 | name: _EmissionMap 40 | second: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | data: 45 | first: 46 | name: _ParallaxMap 47 | second: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | data: 52 | first: 53 | name: _Occlusion 54 | second: 55 | m_Texture: {fileID: 2800000, guid: 4e2f32e9a1fefc24092337ae061f3dbc, type: 3} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | data: 59 | first: 60 | name: _SpecGlossMap 61 | second: 62 | m_Texture: {fileID: 2800000, guid: c6093d6055cd6a44ebf0637f17fca0e8, type: 3} 63 | m_Scale: {x: 1, y: 1} 64 | m_Offset: {x: 0, y: 0} 65 | data: 66 | first: 67 | name: _DetailMask 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | data: 73 | first: 74 | name: _DetailAlbedoMap 75 | second: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | data: 80 | first: 81 | name: _Cube 82 | second: 83 | m_Texture: {fileID: 8900000, guid: 6c5668bb9f9669342bfdd3eaddebb56b, type: 2} 84 | m_Scale: {x: 1, y: 1} 85 | m_Offset: {x: 0, y: 0} 86 | data: 87 | first: 88 | name: _OcclusionMap 89 | second: 90 | m_Texture: {fileID: 2800000, guid: 4e2f32e9a1fefc24092337ae061f3dbc, type: 3} 91 | m_Scale: {x: 1, y: 1} 92 | m_Offset: {x: 0, y: 0} 93 | m_Floats: 94 | data: 95 | first: 96 | name: _Shininess 97 | second: .413138449 98 | data: 99 | first: 100 | name: _AlphaTestRef 101 | second: .5 102 | data: 103 | first: 104 | name: _Lightmapping 105 | second: 0 106 | data: 107 | first: 108 | name: _SrcBlend 109 | second: 1 110 | data: 111 | first: 112 | name: _DstBlend 113 | second: 0 114 | data: 115 | first: 116 | name: _Parallax 117 | second: .0199999996 118 | data: 119 | first: 120 | name: _ZWrite 121 | second: 1 122 | data: 123 | first: 124 | name: _Glossiness 125 | second: .150000006 126 | data: 127 | first: 128 | name: _BumpScale 129 | second: 1 130 | data: 131 | first: 132 | name: _OcclusionStrength 133 | second: 1 134 | data: 135 | first: 136 | name: _DetailNormalMapScale 137 | second: 1 138 | data: 139 | first: 140 | name: _UVSec 141 | second: 0 142 | data: 143 | first: 144 | name: _Mode 145 | second: 0 146 | data: 147 | first: 148 | name: _EmissionScaleUI 149 | second: 1 150 | data: 151 | first: 152 | name: _EmissionScale 153 | second: 1 154 | data: 155 | first: 156 | name: _DetailAlbedoMultiplier 157 | second: 2 158 | data: 159 | first: 160 | name: _UVPrim 161 | second: 0 162 | data: 163 | first: 164 | name: _DetailMode 165 | second: 0 166 | m_Colors: 167 | data: 168 | first: 169 | name: _EmissionColor 170 | second: {r: 0, g: 0, b: 0, a: .99999994} 171 | data: 172 | first: 173 | name: _Color 174 | second: {r: 1, g: 1, b: 1, a: 1} 175 | data: 176 | first: 177 | name: _SpecularColor 178 | second: {r: .242647052, g: .242647052, b: .242647052, a: 1} 179 | data: 180 | first: 181 | name: _EmissionColorUI 182 | second: {r: 0, g: 0, b: 0, a: 1} 183 | data: 184 | first: 185 | name: _EmissionColorWithMapUI 186 | second: {r: 1, g: 1, b: 1, a: 1} 187 | data: 188 | first: 189 | name: _SpecColor 190 | second: {r: .0980392173, g: .0980392173, b: .0980392173, a: 1} 191 | data: 192 | first: 193 | name: _ReflectColor 194 | second: {r: 1, g: 1, b: 1, a: .5} 195 | -------------------------------------------------------------------------------- /Assets/Test/Model/Materials/EthanWhite.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f62b52b2d4b721742a0bc5c6b4db468d 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Test/Model/Materials/MazeLowMan Scaled.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: MazeLowMan Scaled 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _DetailNormalMap 35 | second: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | data: 40 | first: 41 | name: _ParallaxMap 42 | second: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | data: 47 | first: 48 | name: _OcclusionMap 49 | second: 50 | m_Texture: {fileID: 2800000, guid: 2db9b49529685fe43bd5a18a16c1511d, type: 3} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | data: 54 | first: 55 | name: _EmissionMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | data: 61 | first: 62 | name: _DetailMask 63 | second: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | data: 68 | first: 69 | name: _DetailAlbedoMap 70 | second: 71 | m_Texture: {fileID: 0} 72 | m_Scale: {x: 1, y: 1} 73 | m_Offset: {x: 0, y: 0} 74 | data: 75 | first: 76 | name: _MetallicGlossMap 77 | second: 78 | m_Texture: {fileID: 0} 79 | m_Scale: {x: 1, y: 1} 80 | m_Offset: {x: 0, y: 0} 81 | data: 82 | first: 83 | name: _SpecGlossMap 84 | second: 85 | m_Texture: {fileID: 0} 86 | m_Scale: {x: 1, y: 1} 87 | m_Offset: {x: 0, y: 0} 88 | m_Floats: 89 | data: 90 | first: 91 | name: _SrcBlend 92 | second: 1 93 | data: 94 | first: 95 | name: _DstBlend 96 | second: 0 97 | data: 98 | first: 99 | name: _Cutoff 100 | second: 0.5 101 | data: 102 | first: 103 | name: _Parallax 104 | second: 0.02 105 | data: 106 | first: 107 | name: _ZWrite 108 | second: 1 109 | data: 110 | first: 111 | name: _Glossiness 112 | second: 0.332 113 | data: 114 | first: 115 | name: _BumpScale 116 | second: 1 117 | data: 118 | first: 119 | name: _OcclusionStrength 120 | second: 0.626 121 | data: 122 | first: 123 | name: _DetailNormalMapScale 124 | second: 1 125 | data: 126 | first: 127 | name: _UVSec 128 | second: 0 129 | data: 130 | first: 131 | name: _Mode 132 | second: 0 133 | data: 134 | first: 135 | name: _Metallic 136 | second: 0.636 137 | m_Colors: 138 | data: 139 | first: 140 | name: _EmissionColor 141 | second: {r: 0, g: 0, b: 0, a: 1} 142 | data: 143 | first: 144 | name: _Color 145 | second: {r: 0.077205904, g: 0.875, b: 0.51186603, a: 1} 146 | data: 147 | first: 148 | name: _SpecColor 149 | second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 150 | -------------------------------------------------------------------------------- /Assets/Test/Model/Materials/MazeLowMan Scaled.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3540733a34ec6be4ca24bf9913e56203 3 | timeCreated: 1466608249 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Model/Materials/MazeLowMan.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: MazeLowMan 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _DetailNormalMap 35 | second: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | data: 40 | first: 41 | name: _ParallaxMap 42 | second: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | data: 47 | first: 48 | name: _OcclusionMap 49 | second: 50 | m_Texture: {fileID: 2800000, guid: 2db9b49529685fe43bd5a18a16c1511d, type: 3} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | data: 54 | first: 55 | name: _EmissionMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | data: 61 | first: 62 | name: _DetailMask 63 | second: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | data: 68 | first: 69 | name: _DetailAlbedoMap 70 | second: 71 | m_Texture: {fileID: 0} 72 | m_Scale: {x: 1, y: 1} 73 | m_Offset: {x: 0, y: 0} 74 | data: 75 | first: 76 | name: _MetallicGlossMap 77 | second: 78 | m_Texture: {fileID: 0} 79 | m_Scale: {x: 1, y: 1} 80 | m_Offset: {x: 0, y: 0} 81 | data: 82 | first: 83 | name: _SpecGlossMap 84 | second: 85 | m_Texture: {fileID: 0} 86 | m_Scale: {x: 1, y: 1} 87 | m_Offset: {x: 0, y: 0} 88 | m_Floats: 89 | data: 90 | first: 91 | name: _SrcBlend 92 | second: 1 93 | data: 94 | first: 95 | name: _DstBlend 96 | second: 0 97 | data: 98 | first: 99 | name: _Cutoff 100 | second: 0.5 101 | data: 102 | first: 103 | name: _Parallax 104 | second: 0.02 105 | data: 106 | first: 107 | name: _ZWrite 108 | second: 1 109 | data: 110 | first: 111 | name: _Glossiness 112 | second: 0.332 113 | data: 114 | first: 115 | name: _BumpScale 116 | second: 1 117 | data: 118 | first: 119 | name: _OcclusionStrength 120 | second: 0.626 121 | data: 122 | first: 123 | name: _DetailNormalMapScale 124 | second: 1 125 | data: 126 | first: 127 | name: _UVSec 128 | second: 0 129 | data: 130 | first: 131 | name: _Mode 132 | second: 0 133 | data: 134 | first: 135 | name: _Metallic 136 | second: 0.636 137 | m_Colors: 138 | data: 139 | first: 140 | name: _EmissionColor 141 | second: {r: 0, g: 0, b: 0, a: 1} 142 | data: 143 | first: 144 | name: _Color 145 | second: {r: 0.875, g: 0.077205904, b: 0.25877288, a: 1} 146 | data: 147 | first: 148 | name: _SpecColor 149 | second: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 150 | -------------------------------------------------------------------------------- /Assets/Test/Model/Materials/MazeLowMan.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2e9cf99df2f91544a4c0d62fb55273c 3 | timeCreated: 1440254876 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Model/MazeLowMan scaled.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/Assets/Test/Model/MazeLowMan scaled.fbx -------------------------------------------------------------------------------- /Assets/Test/Model/MazeLowMan.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/Assets/Test/Model/MazeLowMan.fbx -------------------------------------------------------------------------------- /Assets/Test/Skybox.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Skybox 10 | m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: 1000 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _DetailNormalMap 35 | second: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | data: 40 | first: 41 | name: _Tex 42 | second: 43 | m_Texture: {fileID: 8900000, guid: e33424c966d1b44e5952e3e1317041e5, type: 3} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | data: 47 | first: 48 | name: _ParallaxMap 49 | second: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | data: 54 | first: 55 | name: _OcclusionMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | data: 61 | first: 62 | name: _EmissionMap 63 | second: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | data: 68 | first: 69 | name: _DetailMask 70 | second: 71 | m_Texture: {fileID: 0} 72 | m_Scale: {x: 1, y: 1} 73 | m_Offset: {x: 0, y: 0} 74 | data: 75 | first: 76 | name: _DetailAlbedoMap 77 | second: 78 | m_Texture: {fileID: 0} 79 | m_Scale: {x: 1, y: 1} 80 | m_Offset: {x: 0, y: 0} 81 | data: 82 | first: 83 | name: _MetallicGlossMap 84 | second: 85 | m_Texture: {fileID: 0} 86 | m_Scale: {x: 1, y: 1} 87 | m_Offset: {x: 0, y: 0} 88 | m_Floats: 89 | data: 90 | first: 91 | name: _SrcBlend 92 | second: 1 93 | data: 94 | first: 95 | name: _DstBlend 96 | second: 0 97 | data: 98 | first: 99 | name: _Cutoff 100 | second: 0.5 101 | data: 102 | first: 103 | name: _Exposure 104 | second: 3 105 | data: 106 | first: 107 | name: _Parallax 108 | second: 0.02 109 | data: 110 | first: 111 | name: _ZWrite 112 | second: 1 113 | data: 114 | first: 115 | name: _Glossiness 116 | second: 0.5 117 | data: 118 | first: 119 | name: _BumpScale 120 | second: 1 121 | data: 122 | first: 123 | name: _OcclusionStrength 124 | second: 1 125 | data: 126 | first: 127 | name: _DetailNormalMapScale 128 | second: 1 129 | data: 130 | first: 131 | name: _UVSec 132 | second: 0 133 | data: 134 | first: 135 | name: _Mode 136 | second: 0 137 | data: 138 | first: 139 | name: _Metallic 140 | second: 0 141 | data: 142 | first: 143 | name: _Rotation 144 | second: 0 145 | m_Colors: 146 | data: 147 | first: 148 | name: _EmissionColor 149 | second: {r: 0, g: 0, b: 0, a: 1} 150 | data: 151 | first: 152 | name: _Color 153 | second: {r: 1, g: 1, b: 1, a: 1} 154 | data: 155 | first: 156 | name: _Tint 157 | second: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} 158 | -------------------------------------------------------------------------------- /Assets/Test/Skybox.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a160287cc0a5e9341877775b70ca8d84 3 | timeCreated: 1466160183 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2b9df0b57039f643a961a18c740271c 3 | timeCreated: 1466424840 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Texture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77d4656b61d1c014fb52ab1484dfbbd6 3 | folderAsset: yes 4 | timeCreated: 1466436992 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Texture/EthanNormals.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/Assets/Test/Texture/EthanNormals.png -------------------------------------------------------------------------------- /Assets/Test/Texture/EthanNormals.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b5b7be0f2332c24f89a2af018daa62d 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 1 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 1 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 4096 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Test/Texture/EthanOcclusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/Assets/Test/Texture/EthanOcclusion.png -------------------------------------------------------------------------------- /Assets/Test/Texture/EthanOcclusion.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e2f32e9a1fefc24092337ae061f3dbc 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 4096 29 | textureSettings: 30 | filterMode: 2 31 | aniso: 1 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 0 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Test/Texture/LowManOcclusion.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/Assets/Test/Texture/LowManOcclusion.tif -------------------------------------------------------------------------------- /Assets/Test/Texture/LowManOcclusion.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2db9b49529685fe43bd5a18a16c1511d 3 | timeCreated: 1443706821 4 | licenseType: Store 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: -1 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/Test/UV Test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/Assets/Test/UV Test.png -------------------------------------------------------------------------------- /Assets/Test/UV Test.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2cccd6cb618e75d4abf331cef3def7e3 3 | timeCreated: 1466160434 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 2 33 | aniso: 4 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | textureType: -1 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /NeuronAnimator.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/NeuronAnimator/8c943d5d64c6bf43927b8e1c7d1ae909fe1d9350/NeuronAnimator.unitypackage -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_DisableAudio: 0 16 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_SolverIterationCount: 6 13 | m_QueriesHitTriggers: 1 14 | m_EnableAdaptiveForce: 0 15 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 16 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Test/Test.unity 10 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_WebSecurityEmulationEnabled: 0 10 | m_WebSecurityEmulationHostUrl: http://www.mydomain.com/mygame.unity3d 11 | m_DefaultBehaviorMode: 0 12 | m_SpritePackerMode: 2 13 | m_SpritePackerPaddingPower: 1 14 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 15 | m_ProjectGenerationRootNamespace: 16 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_LegacyDeferred: 14 | m_Mode: 1 15 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 16 | m_AlwaysIncludedShaders: 17 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 18 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 19 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 20 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 21 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 22 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 23 | m_PreloadedShaders: [] 24 | m_ShaderSettings: 25 | useScreenSpaceShadows: 1 26 | m_BuildTargetShaderSettings: [] 27 | m_LightmapStripping: 0 28 | m_FogStripping: 0 29 | m_LightmapKeepPlain: 1 30 | m_LightmapKeepDirCombined: 1 31 | m_LightmapKeepDirSeparate: 1 32 | m_LightmapKeepDynamicPlain: 1 33 | m_LightmapKeepDynamicDirCombined: 1 34 | m_LightmapKeepDynamicDirSeparate: 1 35 | m_FogKeepLinear: 1 36 | m_FogKeepExp: 1 37 | m_FogKeepExp2: 1 38 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshAreas: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_MinPenetrationForPenalty: 0.01 17 | m_BaumgarteScale: 0.2 18 | m_BaumgarteTimeOfImpactScale: 0.75 19 | m_TimeToSleep: 0.5 20 | m_LinearSleepTolerance: 0.01 21 | m_AngularSleepTolerance: 2 22 | m_QueriesHitTriggers: 1 23 | m_QueriesStartInColliders: 1 24 | m_ChangeStopsCallbacks: 0 25 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 26 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 8 7 | AndroidProfiler: 0 8 | defaultScreenOrientation: 4 9 | targetDevice: 2 10 | useOnDemandResources: 0 11 | accelerometerFrequency: 60 12 | companyName: DefaultCompany 13 | productName: Neuron 14 | defaultCursor: {fileID: 0} 15 | cursorHotspot: {x: 0, y: 0} 16 | m_ShowUnitySplashScreen: 1 17 | m_VirtualRealitySplashScreen: {fileID: 0} 18 | defaultScreenWidth: 1024 19 | defaultScreenHeight: 768 20 | defaultScreenWidthWeb: 960 21 | defaultScreenHeightWeb: 600 22 | m_RenderingPath: 1 23 | m_MobileRenderingPath: 1 24 | m_ActiveColorSpace: 1 25 | m_MTRendering: 1 26 | m_MobileMTRendering: 0 27 | m_Stereoscopic3D: 0 28 | iosShowActivityIndicatorOnLoading: -1 29 | androidShowActivityIndicatorOnLoading: -1 30 | iosAppInBackgroundBehavior: 0 31 | displayResolutionDialog: 1 32 | iosAllowHTTPDownload: 1 33 | allowedAutorotateToPortrait: 1 34 | allowedAutorotateToPortraitUpsideDown: 1 35 | allowedAutorotateToLandscapeRight: 1 36 | allowedAutorotateToLandscapeLeft: 1 37 | useOSAutorotation: 1 38 | use32BitDisplayBuffer: 1 39 | disableDepthAndStencilBuffers: 0 40 | defaultIsFullScreen: 1 41 | defaultIsNativeResolution: 1 42 | runInBackground: 1 43 | captureSingleScreen: 0 44 | Override IPod Music: 0 45 | Prepare IOS For Recording: 0 46 | submitAnalytics: 1 47 | usePlayerLog: 1 48 | bakeCollisionMeshes: 0 49 | forceSingleInstance: 0 50 | resizableWindow: 0 51 | useMacAppStoreValidation: 0 52 | gpuSkinning: 0 53 | xboxPIXTextureCapture: 0 54 | xboxEnableAvatar: 0 55 | xboxEnableKinect: 0 56 | xboxEnableKinectAutoTracking: 0 57 | xboxEnableFitness: 0 58 | visibleInBackground: 0 59 | allowFullscreenSwitch: 1 60 | macFullscreenMode: 2 61 | d3d9FullscreenMode: 1 62 | d3d11FullscreenMode: 1 63 | xboxSpeechDB: 0 64 | xboxEnableHeadOrientation: 0 65 | xboxEnableGuest: 0 66 | xboxEnablePIXSampling: 0 67 | n3dsDisableStereoscopicView: 0 68 | n3dsEnableSharedListOpt: 1 69 | n3dsEnableVSync: 0 70 | uiUse16BitDepthBuffer: 0 71 | ignoreAlphaClear: 0 72 | xboxOneResolution: 0 73 | ps3SplashScreen: {fileID: 0} 74 | videoMemoryForVertexBuffers: 0 75 | psp2PowerMode: 0 76 | psp2AcquireBGM: 1 77 | wiiUTVResolution: 0 78 | wiiUGamePadMSAA: 1 79 | wiiUSupportsNunchuk: 0 80 | wiiUSupportsClassicController: 0 81 | wiiUSupportsBalanceBoard: 0 82 | wiiUSupportsMotionPlus: 0 83 | wiiUSupportsProController: 0 84 | wiiUAllowScreenCapture: 1 85 | wiiUControllerCount: 0 86 | m_SupportedAspectRatios: 87 | 4:3: 1 88 | 5:4: 1 89 | 16:10: 1 90 | 16:9: 1 91 | Others: 1 92 | bundleIdentifier: com.Company.ProductName 93 | bundleVersion: 1.0 94 | preloadedAssets: [] 95 | metroEnableIndependentInputSource: 0 96 | metroEnableLowLatencyPresentationAPI: 0 97 | xboxOneDisableKinectGpuReservation: 0 98 | virtualRealitySupported: 0 99 | productGUID: a18d33f42c6582a479bd33e537c02815 100 | AndroidBundleVersionCode: 1 101 | AndroidMinSdkVersion: 9 102 | AndroidPreferredInstallLocation: 1 103 | aotOptions: 104 | apiCompatibilityLevel: 2 105 | stripEngineCode: 1 106 | iPhoneStrippingLevel: 0 107 | iPhoneScriptCallOptimization: 0 108 | iPhoneBuildNumber: 0 109 | ForceInternetPermission: 0 110 | ForceSDCardPermission: 0 111 | CreateWallpaper: 0 112 | APKExpansionFiles: 0 113 | preloadShaders: 0 114 | StripUnusedMeshComponents: 0 115 | VertexChannelCompressionMask: 116 | serializedVersion: 2 117 | m_Bits: 238 118 | iPhoneSdkVersion: 988 119 | iPhoneTargetOSVersion: 22 120 | tvOSSdkVersion: 0 121 | tvOSTargetOSVersion: 900 122 | uIPrerenderedIcon: 0 123 | uIRequiresPersistentWiFi: 0 124 | uIRequiresFullScreen: 1 125 | uIStatusBarHidden: 1 126 | uIExitOnSuspend: 0 127 | uIStatusBarStyle: 0 128 | iPhoneSplashScreen: {fileID: 0} 129 | iPhoneHighResSplashScreen: {fileID: 0} 130 | iPhoneTallHighResSplashScreen: {fileID: 0} 131 | iPhone47inSplashScreen: {fileID: 0} 132 | iPhone55inPortraitSplashScreen: {fileID: 0} 133 | iPhone55inLandscapeSplashScreen: {fileID: 0} 134 | iPadPortraitSplashScreen: {fileID: 0} 135 | iPadHighResPortraitSplashScreen: {fileID: 0} 136 | iPadLandscapeSplashScreen: {fileID: 0} 137 | iPadHighResLandscapeSplashScreen: {fileID: 0} 138 | appleTVSplashScreen: {fileID: 0} 139 | tvOSSmallIconLayers: [] 140 | tvOSLargeIconLayers: [] 141 | tvOSTopShelfImageLayers: [] 142 | iOSLaunchScreenType: 0 143 | iOSLaunchScreenPortrait: {fileID: 0} 144 | iOSLaunchScreenLandscape: {fileID: 0} 145 | iOSLaunchScreenBackgroundColor: 146 | serializedVersion: 2 147 | rgba: 0 148 | iOSLaunchScreenFillPct: 100 149 | iOSLaunchScreenSize: 100 150 | iOSLaunchScreenCustomXibPath: 151 | iOSLaunchScreeniPadType: 0 152 | iOSLaunchScreeniPadImage: {fileID: 0} 153 | iOSLaunchScreeniPadBackgroundColor: 154 | serializedVersion: 2 155 | rgba: 0 156 | iOSLaunchScreeniPadFillPct: 100 157 | iOSLaunchScreeniPadSize: 100 158 | iOSLaunchScreeniPadCustomXibPath: 159 | iOSDeviceRequirements: [] 160 | AndroidTargetDevice: 0 161 | AndroidSplashScreenScale: 0 162 | androidSplashScreen: {fileID: 0} 163 | AndroidKeystoreName: 164 | AndroidKeyaliasName: 165 | AndroidTVCompatibility: 1 166 | AndroidIsGame: 1 167 | androidEnableBanner: 1 168 | m_AndroidBanners: 169 | - width: 320 170 | height: 180 171 | banner: {fileID: 0} 172 | androidGamepadSupportLevel: 0 173 | resolutionDialogBanner: {fileID: 0} 174 | m_BuildTargetIcons: 175 | - m_BuildTarget: 176 | m_Icons: 177 | - serializedVersion: 2 178 | m_Icon: {fileID: 0} 179 | m_Width: 128 180 | m_Height: 128 181 | m_BuildTargetBatching: [] 182 | m_BuildTargetGraphicsAPIs: [] 183 | webPlayerTemplate: APPLICATION:Default 184 | m_TemplateCustomTags: {} 185 | wiiUTitleID: 0005000011000000 186 | wiiUGroupID: 00010000 187 | wiiUCommonSaveSize: 4096 188 | wiiUAccountSaveSize: 2048 189 | wiiUOlvAccessKey: 0 190 | wiiUTinCode: 0 191 | wiiUJoinGameId: 0 192 | wiiUJoinGameModeMask: 0000000000000000 193 | wiiUCommonBossSize: 0 194 | wiiUAccountBossSize: 0 195 | wiiUAddOnUniqueIDs: [] 196 | wiiUMainThreadStackSize: 3072 197 | wiiULoaderThreadStackSize: 1024 198 | wiiUSystemHeapSize: 128 199 | wiiUTVStartupScreen: {fileID: 0} 200 | wiiUGamePadStartupScreen: {fileID: 0} 201 | wiiUDrcBufferDisabled: 0 202 | wiiUProfilerLibPath: 203 | actionOnDotNetUnhandledException: 1 204 | enableInternalProfiler: 0 205 | logObjCUncaughtExceptions: 1 206 | enableCrashReportAPI: 0 207 | locationUsageDescription: 208 | XboxTitleId: 209 | XboxImageXexPath: 210 | XboxSpaPath: 211 | XboxGenerateSpa: 0 212 | XboxDeployKinectResources: 0 213 | XboxSplashScreen: {fileID: 0} 214 | xboxEnableSpeech: 0 215 | xboxAdditionalTitleMemorySize: 0 216 | xboxDeployKinectHeadOrientation: 0 217 | xboxDeployKinectHeadPosition: 0 218 | ps3TitleConfigPath: 219 | ps3DLCConfigPath: 220 | ps3ThumbnailPath: 221 | ps3BackgroundPath: 222 | ps3SoundPath: 223 | ps3NPAgeRating: 12 224 | ps3TrophyCommId: 225 | ps3NpCommunicationPassphrase: 226 | ps3TrophyPackagePath: 227 | ps3BootCheckMaxSaveGameSizeKB: 128 228 | ps3TrophyCommSig: 229 | ps3SaveGameSlots: 1 230 | ps3TrialMode: 0 231 | ps3VideoMemoryForAudio: 0 232 | ps3EnableVerboseMemoryStats: 0 233 | ps3UseSPUForUmbra: 0 234 | ps3EnableMoveSupport: 1 235 | ps3DisableDolbyEncoding: 0 236 | ps4NPAgeRating: 12 237 | ps4NPTitleSecret: 238 | ps4NPTrophyPackPath: 239 | ps4ParentalLevel: 1 240 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 241 | ps4Category: 0 242 | ps4MasterVersion: 01.00 243 | ps4AppVersion: 01.00 244 | ps4AppType: 0 245 | ps4ParamSfxPath: 246 | ps4VideoOutPixelFormat: 0 247 | ps4VideoOutResolution: 4 248 | ps4PronunciationXMLPath: 249 | ps4PronunciationSIGPath: 250 | ps4BackgroundImagePath: 251 | ps4StartupImagePath: 252 | ps4SaveDataImagePath: 253 | ps4SdkOverride: 254 | ps4BGMPath: 255 | ps4ShareFilePath: 256 | ps4ShareOverlayImagePath: 257 | ps4PrivacyGuardImagePath: 258 | ps4NPtitleDatPath: 259 | ps4RemotePlayKeyAssignment: -1 260 | ps4RemotePlayKeyMappingDir: 261 | ps4EnterButtonAssignment: 1 262 | ps4ApplicationParam1: 0 263 | ps4ApplicationParam2: 0 264 | ps4ApplicationParam3: 0 265 | ps4ApplicationParam4: 0 266 | ps4DownloadDataSize: 0 267 | ps4GarlicHeapSize: 2048 268 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 269 | ps4UseDebugIl2cppLibs: 0 270 | ps4pnSessions: 1 271 | ps4pnPresence: 1 272 | ps4pnFriends: 1 273 | ps4pnGameCustomData: 1 274 | playerPrefsSupport: 0 275 | ps4ReprojectionSupport: 0 276 | ps4UseAudio3dBackend: 0 277 | ps4SocialScreenEnabled: 0 278 | ps4Audio3dVirtualSpeakerCount: 14 279 | ps4attribCpuUsage: 0 280 | ps4PatchPkgPath: 281 | ps4PatchLatestPkgPath: 282 | ps4PatchChangeinfoPath: 283 | ps4attribUserManagement: 0 284 | ps4attribMoveSupport: 0 285 | ps4attrib3DSupport: 0 286 | ps4attribShareSupport: 0 287 | ps4IncludedModules: [] 288 | monoEnv: 289 | psp2Splashimage: {fileID: 0} 290 | psp2NPTrophyPackPath: 291 | psp2NPSupportGBMorGJP: 0 292 | psp2NPAgeRating: 12 293 | psp2NPTitleDatPath: 294 | psp2NPCommsID: 295 | psp2NPCommunicationsID: 296 | psp2NPCommsPassphrase: 297 | psp2NPCommsSig: 298 | psp2ParamSfxPath: 299 | psp2ManualPath: 300 | psp2LiveAreaGatePath: 301 | psp2LiveAreaBackroundPath: 302 | psp2LiveAreaPath: 303 | psp2LiveAreaTrialPath: 304 | psp2PatchChangeInfoPath: 305 | psp2PatchOriginalPackage: 306 | psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui 307 | psp2KeystoneFile: 308 | psp2MemoryExpansionMode: 0 309 | psp2DRMType: 0 310 | psp2StorageType: 0 311 | psp2MediaCapacity: 0 312 | psp2DLCConfigPath: 313 | psp2ThumbnailPath: 314 | psp2BackgroundPath: 315 | psp2SoundPath: 316 | psp2TrophyCommId: 317 | psp2TrophyPackagePath: 318 | psp2PackagedResourcesPath: 319 | psp2SaveDataQuota: 10240 320 | psp2ParentalLevel: 1 321 | psp2ShortTitle: Not Set 322 | psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF 323 | psp2Category: 0 324 | psp2MasterVersion: 01.00 325 | psp2AppVersion: 01.00 326 | psp2TVBootMode: 0 327 | psp2EnterButtonAssignment: 2 328 | psp2TVDisableEmu: 0 329 | psp2AllowTwitterDialog: 1 330 | psp2Upgradable: 0 331 | psp2HealthWarning: 0 332 | psp2UseLibLocation: 0 333 | psp2InfoBarOnStartup: 0 334 | psp2InfoBarColor: 0 335 | psp2UseDebugIl2cppLibs: 0 336 | psmSplashimage: {fileID: 0} 337 | spritePackerPolicy: 338 | scriptingDefineSymbols: {} 339 | metroPackageName: NeuronSDK 340 | metroPackageVersion: 341 | metroCertificatePath: 342 | metroCertificatePassword: 343 | metroCertificateSubject: 344 | metroCertificateIssuer: 345 | metroCertificateNotAfter: 0000000000000000 346 | metroApplicationDescription: NeuronSDK 347 | wsaImages: {} 348 | metroTileShortName: 349 | metroCommandLineArgsFile: 350 | metroTileShowName: 0 351 | metroMediumTileShowName: 0 352 | metroLargeTileShowName: 0 353 | metroWideTileShowName: 0 354 | metroDefaultTileSize: 1 355 | metroTileForegroundText: 1 356 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 357 | metroSplashScreenBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, 358 | a: 1} 359 | metroSplashScreenUseBackgroundColor: 1 360 | platformCapabilities: {} 361 | metroFTAName: 362 | metroFTAFileTypes: [] 363 | metroProtocolName: 364 | metroCompilationOverrides: 1 365 | blackberryDeviceAddress: 366 | blackberryDevicePassword: 367 | blackberryTokenPath: 368 | blackberryTokenExires: 369 | blackberryTokenAuthor: 370 | blackberryTokenAuthorId: 371 | blackberryCskPassword: 372 | blackberrySaveLogPath: 373 | blackberrySharedPermissions: 0 374 | blackberryCameraPermissions: 0 375 | blackberryGPSPermissions: 0 376 | blackberryDeviceIDPermissions: 0 377 | blackberryMicrophonePermissions: 0 378 | blackberryGamepadSupport: 0 379 | blackberryBuildId: 0 380 | blackberryLandscapeSplashScreen: {fileID: 0} 381 | blackberryPortraitSplashScreen: {fileID: 0} 382 | blackberrySquareSplashScreen: {fileID: 0} 383 | tizenProductDescription: 384 | tizenProductURL: 385 | tizenSigningProfileName: 386 | tizenGPSPermissions: 0 387 | tizenMicrophonePermissions: 0 388 | n3dsUseExtSaveData: 0 389 | n3dsCompressStaticMem: 1 390 | n3dsExtSaveDataNumber: 0x12345 391 | n3dsStackSize: 131072 392 | n3dsTargetPlatform: 2 393 | n3dsRegion: 7 394 | n3dsMediaSize: 0 395 | n3dsLogoStyle: 3 396 | n3dsTitle: GameName 397 | n3dsProductCode: 398 | n3dsApplicationId: 0xFF3FF 399 | stvDeviceAddress: 400 | stvProductDescription: 401 | stvProductAuthor: 402 | stvProductAuthorEmail: 403 | stvProductLink: 404 | stvProductCategory: 0 405 | XboxOneProductId: 406 | XboxOneUpdateKey: 407 | XboxOneSandboxId: 408 | XboxOneContentId: 409 | XboxOneTitleId: 410 | XboxOneSCId: 411 | XboxOneGameOsOverridePath: 412 | XboxOnePackagingOverridePath: 413 | XboxOneAppManifestOverridePath: 414 | XboxOnePackageEncryption: 0 415 | XboxOnePackageUpdateGranularity: 2 416 | XboxOneDescription: 417 | XboxOneIsContentPackage: 0 418 | XboxOneEnableGPUVariability: 0 419 | XboxOneSockets: {} 420 | XboxOneSplashScreen: {fileID: 0} 421 | XboxOneAllowedProductIds: [] 422 | XboxOnePersistentLocalStorageSize: 0 423 | intPropertyNames: 424 | - Standalone::ScriptingBackend 425 | - WebPlayer::ScriptingBackend 426 | Standalone::ScriptingBackend: 0 427 | WebPlayer::ScriptingBackend: 0 428 | boolPropertyNames: 429 | - XboxOne::enus 430 | XboxOne::enus: 1 431 | stringPropertyNames: [] 432 | cloudProjectId: 433 | projectName: 434 | organizationId: 435 | cloudEnabled: 0 436 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.3.5f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 0 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Good 11 | pixelLightCount: 2 12 | shadows: 2 13 | shadowResolution: 1 14 | shadowProjection: 1 15 | shadowCascades: 2 16 | shadowDistance: 20 17 | shadowNearPlaneOffset: 2 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | blendWeights: 2 21 | textureQuality: 0 22 | anisotropicTextures: 1 23 | antiAliasing: 0 24 | softParticles: 0 25 | softVegetation: 1 26 | realtimeReflectionProbes: 1 27 | billboardsFaceCameraPosition: 1 28 | vSyncCount: 1 29 | lodBias: 1 30 | maximumLODLevel: 0 31 | particleRaycastBudget: 256 32 | asyncUploadTimeSlice: 2 33 | asyncUploadBufferSize: 4 34 | excludedTargetPlatforms: [] 35 | m_PerPlatformDefaultQuality: 36 | Android: 0 37 | BlackBerry: 0 38 | GLES Emulation: 0 39 | Nintendo 3DS: 0 40 | PS3: 0 41 | PS4: 0 42 | PSM: 0 43 | PSP2: 0 44 | Samsung TV: 0 45 | Standalone: 0 46 | Tizen: 0 47 | WP8: 0 48 | Web: 0 49 | WebGL: 0 50 | WiiU: 0 51 | Windows Store Apps: 0 52 | XBOX360: 0 53 | XboxOne: 0 54 | iPhone: 0 55 | tvOS: 0 56 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 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 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!292 &1 4 | UnityAdsSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_InitializeOnStartup: 1 8 | m_TestMode: 0 9 | m_EnabledPlatforms: 4294967295 10 | m_IosGameId: 11 | m_AndroidGameId: 12 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | UnityPurchasingSettings: 7 | m_Enabled: 0 8 | m_TestMode: 0 9 | UnityAnalyticsSettings: 10 | m_Enabled: 0 11 | m_InitializeOnStartup: 1 12 | m_TestMode: 0 13 | m_TestEventUrl: 14 | m_TestConfigUrl: 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | NeuronAnimator 2 | ============== 3 | 4 | ![gif](https://66.media.tumblr.com/16206b3e0076ad99a6f9850e739ec6fe/tumblr_o96knf6n2S1qio469o1_400.gif) 5 | ![gif](https://67.media.tumblr.com/b679c0780f3bf9bd3fe5f7734e04c5ee/tumblr_o986k6HdVU1qio469o1_400.gif) 6 | 7 | *NeuronAnimator* is a minimum-required subset of the [Perception Neuron][Neuron] 8 | SDK for Unity. This plugin is aiming to provide the following points: 9 | 10 | **Retargetable** 11 | 12 | The original SDK doesn't support retargeting, and therefore models have to be 13 | rigged in a very specific way. Within this plugin, you can animate any humanoid 14 | model with Neuron. 15 | 16 | **Simpleness** 17 | 18 | All you have to do is just adding the NeuronAnimator component to a game 19 | object. Then it starts controlling the model based on input from Neuron mocap 20 | system. That’s that! Simple! 21 | 22 | **Robustness** 23 | 24 | The original SDK lacks thread-safety and hence crashes periodically in some 25 | environments. To avoid issues like this, the entire code has been overhauled 26 | for this plugin. Should work robustly! 27 | 28 | Limitations 29 | ----------- 30 | 31 | - To retrieve retargeting information properly, the target model has to be 32 | in a **perfect** T-stance pose. If the default pose of the model looks 33 | loose (hands are lower than shoulder, feet are widely opened, etc.), it’s 34 | recommended to straighten up manually. 35 | 36 | License 37 | ------- 38 | 39 | Copyright © 2015 Beijing Noitom Technologies Ltd. All rights reserved 40 | 41 | This plugin is considered as one of "derivative works" of the Perception Neuron 42 | SDK. It means you can use the plugin in the same way as the original SDK. For 43 | further details, please read [the original license document][License]. 44 | 45 | [Neuron]: https://neuronmocap.com/software/unity-sdk 46 | [License]: https://github.com/keijiro/NeuronAnimator/blob/master/Assets/Neuron/LICENSE.pdf 47 | --------------------------------------------------------------------------------