├── .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 ├── Kino Imported.meta ├── Kino Imported │ ├── 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 │ │ │ ├── Common.cginc │ │ │ ├── Common.cginc.meta │ │ │ ├── Composition.cginc │ │ │ ├── Composition.cginc.meta │ │ │ ├── Obscurance.cginc │ │ │ ├── Obscurance.cginc.meta │ │ │ ├── Obscurance.shader │ │ │ ├── Obscurance.shader.meta │ │ │ ├── SeparableBlur.cginc │ │ │ └── SeparableBlur.cginc.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 ├── Kino.meta ├── Kino │ ├── Motion.meta │ └── Motion │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── FrameBlendingIcon.png │ │ ├── FrameBlendingIcon.png.meta │ │ ├── MotionEditor.cs │ │ ├── MotionEditor.cs.meta │ │ ├── MotionGraphDrawer.cs │ │ └── MotionGraphDrawer.cs.meta │ │ ├── Motion.cs │ │ ├── Motion.cs.meta │ │ ├── Script.meta │ │ ├── Script │ │ ├── FrameBlendingFilter.cs │ │ ├── FrameBlendingFilter.cs.meta │ │ ├── ReconstructionFilter.cs │ │ └── ReconstructionFilter.cs.meta │ │ ├── Shader.meta │ │ └── Shader │ │ ├── Common.cginc │ │ ├── Common.cginc.meta │ │ ├── FrameBlending.shader │ │ ├── FrameBlending.shader.meta │ │ ├── Prefilter.cginc │ │ ├── Prefilter.cginc.meta │ │ ├── Reconstruction.cginc │ │ ├── Reconstruction.cginc.meta │ │ ├── Reconstruction.shader │ │ └── Reconstruction.shader.meta ├── Klak.meta ├── Klak │ ├── Editor.meta │ ├── Editor │ │ ├── GUIHelper.cs │ │ ├── GUIHelper.cs.meta │ │ ├── ImageSequenceWindow.cs │ │ └── ImageSequenceWindow.cs.meta │ ├── Math.meta │ ├── Math │ │ ├── NoiseGenerator.cs │ │ ├── NoiseGenerator.cs.meta │ │ ├── Perlin.cs │ │ ├── Perlin.cs.meta │ │ ├── XXHash.cs │ │ └── XXHash.cs.meta │ ├── Motion.meta │ └── Motion │ │ ├── BrownianMotion.cs │ │ ├── BrownianMotion.cs.meta │ │ ├── ConstantMotion.cs │ │ ├── ConstantMotion.cs.meta │ │ ├── Editor.meta │ │ └── Editor │ │ ├── BrownianMotionEditor.cs │ │ ├── BrownianMotionEditor.cs.meta │ │ ├── ConstantMotionEditor.cs │ │ └── ConstantMotionEditor.cs.meta ├── Test.meta ├── Test │ ├── Animation.meta │ ├── Animation │ │ ├── HumanoidRun.fbx │ │ ├── HumanoidRun.fbx.meta │ │ ├── Run.controller │ │ └── Run.controller.meta │ ├── Benchmark.unity │ ├── Benchmark.unity.meta │ ├── Benchmark2.unity │ ├── Benchmark2.unity.meta │ ├── Depth.unity │ ├── Depth.unity.meta │ ├── Material.meta │ ├── Material │ │ ├── Background.mat │ │ ├── Background.mat.meta │ │ ├── Background.shader │ │ ├── Background.shader.meta │ │ ├── Blue.mat │ │ ├── Blue.mat.meta │ │ ├── Cube.mat │ │ ├── Cube.mat.meta │ │ ├── Floor.mat │ │ ├── Floor.mat.meta │ │ ├── Red.mat │ │ ├── Red.mat.meta │ │ ├── Skybox.mat │ │ ├── Skybox.mat.meta │ │ ├── Sphere.mat │ │ ├── Sphere.mat.meta │ │ ├── UV Test.mat │ │ └── UV Test.mat.meta │ ├── Model.meta │ ├── Model │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── MazeLowMan.mat │ │ │ ├── MazeLowMan.mat.meta │ │ │ ├── mat_plank_01.mat │ │ │ └── mat_plank_01.mat.meta │ │ ├── MazeLowMan.fbx │ │ ├── MazeLowMan.fbx.meta │ │ ├── prop_fence_01.fbx │ │ └── prop_fence_01.fbx.meta │ ├── Rotation.unity │ ├── Rotation.unity.meta │ ├── Runner.unity │ ├── Runner.unity.meta │ ├── Scroller.cs │ ├── Scroller.cs.meta │ ├── Segment.prefab │ ├── Segment.prefab.meta │ ├── Static.unity │ ├── Static.unity.meta │ ├── Texture.meta │ └── Texture │ │ ├── LowManOcclusion.tif │ │ ├── LowManOcclusion.tif.meta │ │ ├── UV Test.png │ │ ├── UV Test.png.meta │ │ ├── wood_tiled_02_a.tif │ │ ├── wood_tiled_02_a.tif.meta │ │ ├── wood_tiled_02_n.tif │ │ ├── wood_tiled_02_n.tif.meta │ │ ├── wood_tiled_02_o.tif │ │ ├── wood_tiled_02_o.tif.meta │ │ ├── wood_tiled_03_o.tif │ │ └── wood_tiled_03_o.tif.meta ├── sIBL Archive.meta └── sIBL Archive │ ├── Acknowledgement.txt │ ├── Acknowledgement.txt.meta │ ├── MonValley_G_DirtRoad_3k.hdr │ └── MonValley_G_DirtRoad_3k.hdr.meta ├── LICENSE.txt ├── 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 └── UnityConnectSettings.asset └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.cs diff=csharp 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows 2 | Thumbs.db 3 | Desktop.ini 4 | 5 | # macOS 6 | .DS_Store 7 | 8 | # Vim 9 | *.swp 10 | 11 | # Unity 12 | /Library 13 | /Temp 14 | 15 | KinoMotion.unitypackage 16 | -------------------------------------------------------------------------------- /Assets/ColorSuite.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d68d0d387bdc3647bbfbde848b4a3e7 3 | folderAsset: yes 4 | timeCreated: 1463727926 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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: 3d58d1e162661ce45aad90c718879ece 3 | folderAsset: yes 4 | timeCreated: 1463727926 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: b12eef35d3bfdd14f9e5300e1cc1db33 3 | folderAsset: yes 4 | timeCreated: 1463727926 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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: ba17d9665533542d5b41c619aca3cc7c 3 | folderAsset: yes 4 | timeCreated: 1463738362 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/Kino", "KinoMotion.unitypackage", ExportPackageOptions.Recurse); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Editor/PackageTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4775ec806d3304f0a9a16ff0ea09e2a2 3 | timeCreated: 1463738415 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 Imported.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 885b57c46ac1b41bd914befec266050d 3 | folderAsset: yes 4 | timeCreated: 1463714353 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino Imported/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 Imported/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 Imported/Obscurance/Editor/ObscuranceEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Obscurance - Screen space ambient obscurance image effect 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 | "Ambient-only mode is currently disabled; " + 49 | "it requires G-buffer source and HDR rendering."; 50 | 51 | #if UNITY_5_4_OR_NEWER 52 | static string _textSinglePassStereo = 53 | "Ambient-only mode isn't supported in single-pass stereo rendering."; 54 | #endif 55 | 56 | void OnEnable() 57 | { 58 | _intensity = serializedObject.FindProperty("_intensity"); 59 | _radius = serializedObject.FindProperty("_radius"); 60 | _sampleCount = serializedObject.FindProperty("_sampleCount"); 61 | _sampleCountValue = serializedObject.FindProperty("_sampleCountValue"); 62 | _downsampling = serializedObject.FindProperty("_downsampling"); 63 | _occlusionSource = serializedObject.FindProperty("_occlusionSource"); 64 | _ambientOnly = serializedObject.FindProperty("_ambientOnly"); 65 | } 66 | 67 | public override void OnInspectorGUI() 68 | { 69 | var obscurance = (Obscurance)target; 70 | 71 | serializedObject.Update(); 72 | 73 | EditorGUILayout.PropertyField(_intensity); 74 | EditorGUILayout.PropertyField(_radius); 75 | EditorGUILayout.PropertyField(_sampleCount); 76 | 77 | if (_sampleCount.hasMultipleDifferentValues || 78 | _sampleCount.enumValueIndex == (int)Obscurance.SampleCount.Custom) 79 | { 80 | EditorGUI.indentLevel++; 81 | EditorGUILayout.PropertyField(_sampleCountValue, _textValue); 82 | EditorGUI.indentLevel--; 83 | } 84 | 85 | EditorGUILayout.PropertyField(_downsampling); 86 | EditorGUILayout.PropertyField(_occlusionSource); 87 | 88 | if (!_occlusionSource.hasMultipleDifferentValues) 89 | if (_occlusionSource.enumValueIndex != (int)obscurance.occlusionSource) 90 | EditorGUILayout.HelpBox(_textNoGBuffer, MessageType.Warning); 91 | 92 | EditorGUILayout.PropertyField(_ambientOnly); 93 | 94 | if (!_ambientOnly.hasMultipleDifferentValues) 95 | if (_ambientOnly.boolValue != obscurance.ambientOnly) 96 | EditorGUILayout.HelpBox(_textNoAmbientOnly, MessageType.Warning); 97 | 98 | #if UNITY_5_5_OR_NEWER 99 | if (_ambientOnly.boolValue && PlayerSettings.stereoRenderingPath == StereoRenderingPath.SinglePass) 100 | EditorGUILayout.HelpBox(_textSinglePassStereo, MessageType.Warning); 101 | #elif UNITY_5_4_OR_NEWER 102 | if (_ambientOnly.boolValue && PlayerSettings.singlePassStereoRendering) 103 | EditorGUILayout.HelpBox(_textSinglePassStereo, MessageType.Warning); 104 | #endif 105 | 106 | serializedObject.ApplyModifiedProperties(); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Assets/Kino Imported/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 Imported/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 Imported/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 Imported/Obscurance/Script/PropertyObserver.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Obscurance - Screen space ambient obscurance image effect 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 | class 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 Imported/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 Imported/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 Imported/Obscurance/Shader/Common.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3eb19962be1644549b0105a619242cfa 3 | timeCreated: 1472800373 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino Imported/Obscurance/Shader/Composition.cginc: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Obscurance - Screen space ambient obscurance image effect 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 | 25 | #include "Common.cginc" 26 | 27 | // Gamma encoding (only needed in gamma lighting mode) 28 | half EncodeAO(half x) 29 | { 30 | half x_g = 1 - max(1.055 * pow(1 - x, 0.416666667) - 0.055, 0); 31 | // ColorSpaceLuminance.w == 0 (gamma) or 1 (linear) 32 | return lerp(x_g, x, unity_ColorSpaceLuminance.w); 33 | } 34 | 35 | // Geometry-aware bilateral filter (single pass/small kernel) 36 | half BlurSmall(sampler2D tex, float2 uv, float2 delta) 37 | { 38 | fixed4 p0 = tex2D(tex, uv); 39 | fixed4 p1 = tex2D(tex, uv + float2(-delta.x, -delta.y)); 40 | fixed4 p2 = tex2D(tex, uv + float2(+delta.x, -delta.y)); 41 | fixed4 p3 = tex2D(tex, uv + float2(-delta.x, +delta.y)); 42 | fixed4 p4 = tex2D(tex, uv + float2(+delta.x, +delta.y)); 43 | 44 | fixed3 n0 = GetPackedNormal(p0); 45 | 46 | half w0 = 1; 47 | half w1 = CompareNormal(n0, GetPackedNormal(p1)); 48 | half w2 = CompareNormal(n0, GetPackedNormal(p2)); 49 | half w3 = CompareNormal(n0, GetPackedNormal(p3)); 50 | half w4 = CompareNormal(n0, GetPackedNormal(p4)); 51 | 52 | half s; 53 | s = GetPackedAO(p0) * w0; 54 | s += GetPackedAO(p1) * w1; 55 | s += GetPackedAO(p2) * w2; 56 | s += GetPackedAO(p3) * w3; 57 | s += GetPackedAO(p4) * w4; 58 | 59 | return s / (w0 + w1 + w2 + w3 + w4); 60 | } 61 | 62 | // Final composition shader 63 | half4 frag_composition(v2f i) : SV_Target 64 | { 65 | float2 delta = _MainTex_TexelSize.xy / _Downsample; 66 | half ao = BlurSmall(_OcclusionTexture, i.uvAlt, delta); 67 | 68 | half4 color = tex2D(_MainTex, i.uv); 69 | color.rgb *= 1 - EncodeAO(ao); 70 | 71 | return color; 72 | } 73 | 74 | // Final composition shader (ambient-only mode) 75 | v2f_img vert_composition_gbuffer(appdata_img v) 76 | { 77 | v2f_img o; 78 | o.pos = v.vertex * float4(2, 2, 0, 0) + float4(0, 0, 0, 1); 79 | #if UNITY_UV_STARTS_AT_TOP 80 | o.uv = v.texcoord * float2(1, -1) + float2(0, 1); 81 | #else 82 | o.uv = v.texcoord; 83 | #endif 84 | return o; 85 | } 86 | 87 | #if !defined(SHADER_API_GLES) // excluding the MRT pass under GLES2 88 | 89 | struct CompositionOutput 90 | { 91 | half4 gbuffer0 : SV_Target0; 92 | half4 gbuffer3 : SV_Target1; 93 | }; 94 | 95 | CompositionOutput frag_composition_gbuffer(v2f_img i) 96 | { 97 | // Workaround: _OcclusionTexture_Texelsize hasn't been set properly 98 | // for some reasons. Use _ScreenParams instead. 99 | float2 delta = (_ScreenParams.zw - 1) / _Downsample; 100 | half ao = BlurSmall(_OcclusionTexture, i.uv, delta); 101 | 102 | CompositionOutput o; 103 | o.gbuffer0 = half4(0, 0, 0, ao); 104 | o.gbuffer3 = half4((half3)EncodeAO(ao), 0); 105 | return o; 106 | } 107 | 108 | #else 109 | 110 | fixed4 frag_composition_gbuffer(v2f_img i) : SV_Target0 111 | { 112 | return 0; 113 | } 114 | 115 | #endif 116 | -------------------------------------------------------------------------------- /Assets/Kino Imported/Obscurance/Shader/Composition.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 884dc0aeb5091e0429005dd13519f4e3 3 | timeCreated: 1472800373 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino Imported/Obscurance/Shader/Obscurance.cginc: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Obscurance - Screen space ambient obscurance image effect 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 | 25 | #include "Common.cginc" 26 | 27 | // Trigonometric function utility 28 | float2 CosSin(float theta) 29 | { 30 | float sn, cs; 31 | sincos(theta, sn, cs); 32 | return float2(cs, sn); 33 | } 34 | 35 | // Pseudo random number generator with 2D coordinates 36 | float UVRandom(float u, float v) 37 | { 38 | float f = dot(float2(12.9898, 78.233), float2(u, v)); 39 | return frac(43758.5453 * sin(f)); 40 | } 41 | 42 | // Interleaved gradient function from Jimenez 2014 http://goo.gl/eomGso 43 | float GradientNoise(float2 uv) 44 | { 45 | uv = floor(uv * _ScreenParams.xy); 46 | float f = dot(float2(0.06711056f, 0.00583715f), uv); 47 | return frac(52.9829189f * frac(f)); 48 | } 49 | 50 | // Check if the camera is perspective. 51 | // (returns 1.0 when orthographic) 52 | float CheckPerspective(float x) 53 | { 54 | return lerp(x, 1, unity_OrthoParams.w); 55 | } 56 | 57 | // Reconstruct view-space position from UV and depth. 58 | // p11_22 = (unity_CameraProjection._11, unity_CameraProjection._22) 59 | // p13_31 = (unity_CameraProjection._13, unity_CameraProjection._23) 60 | float3 ReconstructViewPos(float2 uv, float depth, float2 p11_22, float2 p13_31) 61 | { 62 | return float3((uv * 2 - 1 - p13_31) / p11_22 * CheckPerspective(depth), depth); 63 | } 64 | 65 | // Sample point picker 66 | float3 PickSamplePoint(float2 uv, float index) 67 | { 68 | // Uniformaly distributed points on a unit sphere http://goo.gl/X2F1Ho 69 | #if defined(FIX_SAMPLING_PATTERN) 70 | float gn = GradientNoise(uv * _Downsample); 71 | float u = frac(UVRandom(0, index) + gn) * 2 - 1; 72 | float theta = (UVRandom(1, index) + gn) * UNITY_PI * 2; 73 | #else 74 | float u = UVRandom(uv.x + _Time.x, uv.y + index) * 2 - 1; 75 | float theta = UVRandom(-uv.x - _Time.x, uv.y + index) * UNITY_PI * 2; 76 | #endif 77 | float3 v = float3(CosSin(theta) * sqrt(1 - u * u), u); 78 | // Make them distributed between [0, _Radius] 79 | float l = sqrt((index + 1) / _SampleCount) * _Radius; 80 | return v * l; 81 | } 82 | 83 | // 84 | // Distance-based AO estimator based on Morgan 2011 http://goo.gl/2iz3P 85 | // 86 | half4 frag_ao(v2f i) : SV_Target 87 | { 88 | float2 uv = i.uvAlt; 89 | float2 uv01 = i.uv01; 90 | 91 | // Parameters used in coordinate conversion 92 | float3x3 proj = (float3x3)unity_CameraProjection; 93 | float2 p11_22 = float2(unity_CameraProjection._11, unity_CameraProjection._22); 94 | float2 p13_31 = float2(unity_CameraProjection._13, unity_CameraProjection._23); 95 | 96 | // View space normal and depth 97 | float3 norm_o; 98 | float depth_o = SampleDepthNormal(uv, norm_o); 99 | 100 | #if defined(SOURCE_DEPTHNORMALS) 101 | // Offset the depth value to avoid precision error. 102 | // (depth in the DepthNormals mode has only 16-bit precision) 103 | depth_o -= _ProjectionParams.z / 65536; 104 | #endif 105 | 106 | // Reconstruct the view-space position. 107 | float3 vpos_o = ReconstructViewPos(uv01, depth_o, p11_22, p13_31); 108 | 109 | float ao = 0.0; 110 | 111 | for (int s = 0; s < _SampleCount; s++) 112 | { 113 | // Sample point 114 | #if defined(SHADER_API_D3D11) 115 | // This 'floor(1.0001 * s)' operation is needed to avoid a NVidia 116 | // shader issue. This issue is only observed on DX11. 117 | float3 v_s1 = PickSamplePoint(uv, floor(1.0001 * s)); 118 | #else 119 | float3 v_s1 = PickSamplePoint(uv, s); 120 | #endif 121 | v_s1 = faceforward(v_s1, -norm_o, v_s1); 122 | float3 vpos_s1 = vpos_o + v_s1; 123 | 124 | // Reproject the sample point 125 | float3 spos_s1 = mul(proj, vpos_s1); 126 | float2 uv_s1_01 = (spos_s1.xy / CheckPerspective(vpos_s1.z) + 1) * 0.5; 127 | #if defined(UNITY_SINGLE_PASS_STEREO) 128 | float2 uv_s1 = UnityStereoScreenSpaceUVAdjust(uv_s1_01, _MainTex_ST); 129 | #else 130 | float2 uv_s1 = uv_s1_01; 131 | #endif 132 | 133 | // Depth at the sample point 134 | float depth_s1 = SampleDepth(uv_s1); 135 | 136 | // Relative position of the sample point 137 | float3 vpos_s2 = ReconstructViewPos(uv_s1_01, depth_s1, p11_22, p13_31); 138 | float3 v_s2 = vpos_s2 - vpos_o; 139 | 140 | // Estimate the obscurance value 141 | float a1 = max(dot(v_s2, norm_o) - kBeta * depth_o, 0); 142 | float a2 = dot(v_s2, v_s2) + kEpsilon; 143 | ao += a1 / a2; 144 | } 145 | 146 | ao *= _Radius; // intensity normalization 147 | 148 | // Apply other parameters. 149 | ao = pow(ao * _Intensity / _SampleCount, kContrast); 150 | 151 | return PackAONormal(ao, norm_o); 152 | } 153 | -------------------------------------------------------------------------------- /Assets/Kino Imported/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 Imported/Obscurance/Shader/Obscurance.shader: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Obscurance - Screen space ambient obscurance image effect 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 | _OcclusionTexture("", 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 39 | #include "Obscurance.cginc" 40 | #pragma vertex vert 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 51 | #include "Obscurance.cginc" 52 | #pragma vertex vert 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 63 | #include "Obscurance.cginc" 64 | #pragma vertex vert 65 | #pragma fragment frag_ao 66 | #pragma target 3.0 67 | ENDCG 68 | } 69 | // 3: Separable blur (horizontal pass) with CameraDepthNormalsTexture 70 | Pass 71 | { 72 | ZTest Always Cull Off ZWrite Off 73 | CGPROGRAM 74 | #define SOURCE_DEPTHNORMALS 75 | #define BLUR_HORIZONTAL 76 | #define BLUR_SAMPLE_CENTER_NORMAL 77 | #include "SeparableBlur.cginc" 78 | #pragma vertex vert 79 | #pragma fragment frag_blur 80 | #pragma target 3.0 81 | ENDCG 82 | } 83 | // 4: Separable blur (horizontal pass) with G-Buffer 84 | Pass 85 | { 86 | ZTest Always Cull Off ZWrite Off 87 | CGPROGRAM 88 | #define SOURCE_GBUFFER 89 | #define BLUR_HORIZONTAL 90 | #define BLUR_SAMPLE_CENTER_NORMAL 91 | #include "SeparableBlur.cginc" 92 | #pragma vertex vert 93 | #pragma fragment frag_blur 94 | #pragma target 3.0 95 | ENDCG 96 | } 97 | // 5: Separable blur (vertical pass) 98 | Pass 99 | { 100 | ZTest Always Cull Off ZWrite Off 101 | CGPROGRAM 102 | #define BLUR_VERTICAL 103 | #include "SeparableBlur.cginc" 104 | #pragma vertex vert 105 | #pragma fragment frag_blur 106 | #pragma target 3.0 107 | ENDCG 108 | } 109 | // 6: Final composition 110 | Pass 111 | { 112 | ZTest Always Cull Off ZWrite Off 113 | CGPROGRAM 114 | #include "Composition.cginc" 115 | #pragma vertex vert 116 | #pragma fragment frag_composition 117 | #pragma target 3.0 118 | ENDCG 119 | } 120 | // 7: Final composition (ambient only mode) 121 | Pass 122 | { 123 | Blend Zero OneMinusSrcColor, Zero OneMinusSrcAlpha 124 | ZTest Always Cull Off ZWrite Off 125 | CGPROGRAM 126 | #include "Composition.cginc" 127 | #pragma vertex vert_composition_gbuffer 128 | #pragma fragment frag_composition_gbuffer 129 | #pragma target 3.0 130 | ENDCG 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /Assets/Kino Imported/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 Imported/Obscurance/Shader/SeparableBlur.cginc: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Obscurance - Screen space ambient obscurance image effect 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 | 25 | #include "Common.cginc" 26 | 27 | // Geometry-aware separable bilateral filter 28 | half4 frag_blur(v2f i) : SV_Target 29 | { 30 | #if defined(BLUR_HORIZONTAL) 31 | // Horizontal pass: Always use 2 texels interval to match to 32 | // the dither pattern. 33 | float2 delta = float2(_MainTex_TexelSize.x * 2, 0); 34 | #else 35 | // Vertical pass: Apply _Downsample to match to the dither 36 | // pattern in the original occlusion buffer. 37 | float2 delta = float2(0, _MainTex_TexelSize.y / _Downsample * 2); 38 | #endif 39 | 40 | #if defined(BLUR_HIGH_QUALITY) 41 | 42 | // High quality 7-tap Gaussian with adaptive sampling 43 | 44 | fixed4 p0 = tex2D(_MainTex, i.uv); 45 | fixed4 p1a = tex2D(_MainTex, i.uv - delta); 46 | fixed4 p1b = tex2D(_MainTex, i.uv + delta); 47 | fixed4 p2a = tex2D(_MainTex, i.uv - delta * 2); 48 | fixed4 p2b = tex2D(_MainTex, i.uv + delta * 2); 49 | fixed4 p3a = tex2D(_MainTex, i.uv - delta * 3.2307692308); 50 | fixed4 p3b = tex2D(_MainTex, i.uv + delta * 3.2307692308); 51 | 52 | #if defined(BLUR_SAMPLE_CENTER_NORMAL) 53 | fixed3 n0 = SampleNormal(i.uv); 54 | #else 55 | fixed3 n0 = GetPackedNormal(p0); 56 | #endif 57 | 58 | half w0 = 0.37004405286; 59 | half w1a = CompareNormal(n0, GetPackedNormal(p1a)) * 0.31718061674; 60 | half w1b = CompareNormal(n0, GetPackedNormal(p1b)) * 0.31718061674; 61 | half w2a = CompareNormal(n0, GetPackedNormal(p2a)) * 0.19823788546; 62 | half w2b = CompareNormal(n0, GetPackedNormal(p2b)) * 0.19823788546; 63 | half w3a = CompareNormal(n0, GetPackedNormal(p3a)) * 0.11453744493; 64 | half w3b = CompareNormal(n0, GetPackedNormal(p3b)) * 0.11453744493; 65 | 66 | half s; 67 | s = GetPackedAO(p0) * w0; 68 | s += GetPackedAO(p1a) * w1a; 69 | s += GetPackedAO(p1b) * w1b; 70 | s += GetPackedAO(p2a) * w2a; 71 | s += GetPackedAO(p2b) * w2b; 72 | s += GetPackedAO(p3a) * w3a; 73 | s += GetPackedAO(p3b) * w3b; 74 | 75 | s /= w0 + w1a + w1b + w2a + w2b + w3a + w3b; 76 | 77 | #else 78 | 79 | // Fater 5-tap Gaussian with linear sampling 80 | 81 | fixed4 p0 = tex2D(_MainTex, i.uv); 82 | fixed4 p1a = tex2D(_MainTex, i.uv - delta * 1.3846153846); 83 | fixed4 p1b = tex2D(_MainTex, i.uv + delta * 1.3846153846); 84 | fixed4 p2a = tex2D(_MainTex, i.uv - delta * 3.2307692308); 85 | fixed4 p2b = tex2D(_MainTex, i.uv + delta * 3.2307692308); 86 | 87 | #if defined(BLUR_SAMPLE_CENTER_NORMAL) 88 | fixed3 n0 = SampleNormal(i.uv); 89 | #else 90 | fixed3 n0 = GetPackedNormal(p0); 91 | #endif 92 | 93 | half w0 = 0.2270270270; 94 | half w1a = CompareNormal(n0, GetPackedNormal(p1a)) * 0.3162162162; 95 | half w1b = CompareNormal(n0, GetPackedNormal(p1b)) * 0.3162162162; 96 | half w2a = CompareNormal(n0, GetPackedNormal(p2a)) * 0.0702702703; 97 | half w2b = CompareNormal(n0, GetPackedNormal(p2b)) * 0.0702702703; 98 | 99 | half s; 100 | s = GetPackedAO(p0) * w0; 101 | s += GetPackedAO(p1a) * w1a; 102 | s += GetPackedAO(p1b) * w1b; 103 | s += GetPackedAO(p2a) * w2a; 104 | s += GetPackedAO(p2b) * w2b; 105 | 106 | s /= w0 + w1a + w1b + w2a + w2b; 107 | 108 | #endif 109 | 110 | return PackAONormal(s, n0); 111 | } 112 | -------------------------------------------------------------------------------- /Assets/Kino Imported/Obscurance/Shader/SeparableBlur.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5df54c45e5d5d604ba05cf0dcb06af53 3 | timeCreated: 1472800373 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino Imported/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 Imported/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 Imported/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 Imported/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 Imported/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 Imported/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 Imported/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 Imported/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 Imported/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/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/Motion.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1bbaa5091b7e45fc83bab811c6c892f 3 | folderAsset: yes 4 | timeCreated: 1463714361 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a54c5223adf946208a4f52d6565dc4e 3 | folderAsset: yes 4 | timeCreated: 1463714378 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Editor/FrameBlendingIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/Assets/Kino/Motion/Editor/FrameBlendingIcon.png -------------------------------------------------------------------------------- /Assets/Kino/Motion/Editor/FrameBlendingIcon.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ee0944ebff744551aad746d9251acb8 3 | timeCreated: 1467349728 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | linearTexture: 1 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: -1 33 | aniso: 1 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 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: 1 49 | spriteTessellationDetail: -1 50 | textureType: 2 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | serializedVersion: 2 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Editor/MotionEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Motion - Motion blur effect 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 | 25 | // Suppress "assigned but never used" warning 26 | #pragma warning disable 414 27 | 28 | // Show fancy graphs 29 | #define SHOW_GRAPHS 30 | 31 | using UnityEngine; 32 | using UnityEditor; 33 | 34 | namespace Kino 35 | { 36 | [CanEditMultipleObjects] 37 | [CustomEditor(typeof(Motion))] 38 | public class MotionEditor : Editor 39 | { 40 | MotionGraphDrawer _graph; 41 | 42 | SerializedProperty _shutterAngle; 43 | SerializedProperty _sampleCount; 44 | SerializedProperty _frameBlending; 45 | 46 | [SerializeField] Texture2D _blendingIcon; 47 | 48 | static GUIContent _textStrength = new GUIContent("Strength"); 49 | 50 | void OnEnable() 51 | { 52 | _shutterAngle = serializedObject.FindProperty("_shutterAngle"); 53 | _sampleCount = serializedObject.FindProperty("_sampleCount"); 54 | _frameBlending = serializedObject.FindProperty("_frameBlending"); 55 | } 56 | 57 | public override void OnInspectorGUI() 58 | { 59 | if (_graph == null) _graph = new MotionGraphDrawer(_blendingIcon); 60 | 61 | serializedObject.Update(); 62 | 63 | EditorGUILayout.LabelField("Shutter Speed Simulation", EditorStyles.boldLabel); 64 | 65 | #if SHOW_GRAPHS 66 | _graph.DrawShutterGraph(_shutterAngle.floatValue); 67 | #endif 68 | 69 | EditorGUILayout.PropertyField(_shutterAngle); 70 | EditorGUILayout.PropertyField(_sampleCount); 71 | 72 | EditorGUILayout.Space(); 73 | 74 | EditorGUILayout.LabelField("Multiple Frame Blending", EditorStyles.boldLabel); 75 | 76 | #if SHOW_GRAPHS 77 | _graph.DrawBlendingGraph(_frameBlending.floatValue); 78 | #endif 79 | 80 | EditorGUILayout.PropertyField(_frameBlending, _textStrength); 81 | 82 | serializedObject.ApplyModifiedProperties(); 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Editor/MotionEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27b58f59bad4f465898256e11c0532f3 3 | timeCreated: 1467355992 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _blendingIcon: {fileID: 2800000, guid: 9ee0944ebff744551aad746d9251acb8, type: 3} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Editor/MotionGraphDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f39b8366342014ece8018cb16bd07295 3 | timeCreated: 1467344387 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/Motion/Motion.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Motion - Motion blur effect 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 | [RequireComponent(typeof(Camera))] 29 | [AddComponentMenu("Kino Image Effects/Motion")] 30 | public partial class Motion : MonoBehaviour 31 | { 32 | #region Public properties 33 | 34 | /// The angle of rotary shutter. The larger the angle is, the longer 35 | /// the exposure time is. 36 | public float shutterAngle { 37 | get { return _shutterAngle; } 38 | set { _shutterAngle = value; } 39 | } 40 | 41 | [SerializeField, Range(0, 360)] 42 | [Tooltip("The angle of rotary shutter. Larger values give longer exposure.")] 43 | float _shutterAngle = 270; 44 | 45 | /// The amount of sample points, which affects quality and performance. 46 | public int sampleCount { 47 | get { return _sampleCount; } 48 | set { _sampleCount = value; } 49 | } 50 | 51 | [SerializeField] 52 | [Tooltip("The amount of sample points, which affects quality and performance.")] 53 | int _sampleCount = 8; 54 | 55 | /// The strength of multiple frame blending. The opacity of preceding 56 | /// frames are determined from this coefficient and time differences. 57 | public float frameBlending { 58 | get { return _frameBlending; } 59 | set { _frameBlending = value; } 60 | } 61 | 62 | [SerializeField, Range(0, 1)] 63 | [Tooltip("The strength of multiple frame blending")] 64 | float _frameBlending = 0; 65 | 66 | #endregion 67 | 68 | #region Private fields 69 | 70 | [SerializeField] Shader _reconstructionShader; 71 | [SerializeField] Shader _frameBlendingShader; 72 | 73 | ReconstructionFilter _reconstructionFilter; 74 | FrameBlendingFilter _frameBlendingFilter; 75 | 76 | #endregion 77 | 78 | #region MonoBehaviour functions 79 | 80 | void OnEnable() 81 | { 82 | _reconstructionFilter = new ReconstructionFilter(); 83 | _frameBlendingFilter = new FrameBlendingFilter(); 84 | } 85 | 86 | void OnDisable() 87 | { 88 | _reconstructionFilter.Release(); 89 | _frameBlendingFilter.Release(); 90 | 91 | _reconstructionFilter = null; 92 | _frameBlendingFilter = null; 93 | } 94 | 95 | void Update() 96 | { 97 | // Enable motion vector rendering if reuqired. 98 | if (_shutterAngle > 0) 99 | GetComponent().depthTextureMode |= 100 | DepthTextureMode.Depth | DepthTextureMode.MotionVectors; 101 | } 102 | 103 | void OnRenderImage(RenderTexture source, RenderTexture destination) 104 | { 105 | if (_shutterAngle > 0 && _frameBlending > 0) 106 | { 107 | // Reconstruction and frame blending 108 | var temp = RenderTexture.GetTemporary( 109 | source.width, source.height, 0, source.format 110 | ); 111 | 112 | _reconstructionFilter.ProcessImage( 113 | _shutterAngle, _sampleCount, source, temp 114 | ); 115 | 116 | _frameBlendingFilter.BlendFrames( 117 | _frameBlending, temp, destination 118 | ); 119 | _frameBlendingFilter.PushFrame(temp); 120 | 121 | RenderTexture.ReleaseTemporary(temp); 122 | } 123 | else if (_shutterAngle > 0) 124 | { 125 | // Reconstruction only 126 | _reconstructionFilter.ProcessImage( 127 | _shutterAngle, _sampleCount, source, destination 128 | ); 129 | } 130 | else if (_frameBlending > 0) 131 | { 132 | // Frame blending only 133 | _frameBlendingFilter.BlendFrames( 134 | _frameBlending, source, destination 135 | ); 136 | _frameBlendingFilter.PushFrame(source); 137 | } 138 | else 139 | { 140 | // Nothing to do! 141 | Graphics.Blit(source, destination); 142 | } 143 | } 144 | 145 | #endregion 146 | } 147 | } 148 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Motion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 860e82cd7a6bb4a29a4b7add4ec78d10 3 | timeCreated: 1468558550 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _reconstructionShader: {fileID: 4800000, guid: 60701d53f4c638048b5e49c197d08b77, 9 | type: 3} 10 | - _frameBlendingShader: {fileID: 4800000, guid: 95caa7c3844725840aec8dad64ac258e, 11 | type: 3} 12 | executionOrder: 0 13 | icon: {instanceID: 0} 14 | userData: 15 | assetBundleName: 16 | assetBundleVariant: 17 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Script.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0a4cd51e9c3a437d94f4c625fcc278a 3 | folderAsset: yes 4 | timeCreated: 1467341153 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Script/FrameBlendingFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1dba8dae74bbb49b681fe192baf05194 3 | timeCreated: 1467340681 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/Motion/Script/ReconstructionFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0925dd1b093054d4fa15cb935691b9e4 3 | timeCreated: 1468556386 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/Motion/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c56fc9d7ab7eb4fa2af627be0674c069 3 | folderAsset: yes 4 | timeCreated: 1463714384 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Shader/Common.cginc: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Motion - Motion blur effect 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 | 25 | #include "UnityCG.cginc" 26 | 27 | // Workaround for #827031 (PS4/PS Vita) 28 | #if defined(SHADER_API_PSSL) 29 | #define sampler2D_half sampler2D_float 30 | #endif 31 | 32 | // Main source texture 33 | sampler2D _MainTex; 34 | float4 _MainTex_TexelSize; 35 | 36 | // Camera depth texture 37 | sampler2D_float _CameraDepthTexture; 38 | float4 _CameraDepthTexture_TexelSize; 39 | 40 | // Camera motion vectors texture 41 | sampler2D_half _CameraMotionVectorsTexture; 42 | float4 _CameraMotionVectorsTexture_TexelSize; 43 | 44 | // Pakced velocity texture (2/10/10/10) 45 | sampler2D_half _VelocityTex; 46 | float4 _VelocityTex_TexelSize; 47 | 48 | // NeighborMax texture 49 | sampler2D_half _NeighborMaxTex; 50 | float4 _NeighborMaxTex_TexelSize; 51 | 52 | // Velocity scale factor 53 | float _VelocityScale; 54 | 55 | // TileMax filter parameters 56 | int _TileMaxLoop; 57 | float2 _TileMaxOffs; 58 | 59 | // Maximum blur radius (in pixels) 60 | half _MaxBlurRadius; 61 | float _RcpMaxBlurRadius; 62 | 63 | // Filter parameters/coefficients 64 | half _LoopCount; 65 | 66 | // History buffer for frame blending 67 | sampler2D _History1LumaTex; 68 | sampler2D _History2LumaTex; 69 | sampler2D _History3LumaTex; 70 | sampler2D _History4LumaTex; 71 | 72 | sampler2D _History1ChromaTex; 73 | sampler2D _History2ChromaTex; 74 | sampler2D _History3ChromaTex; 75 | sampler2D _History4ChromaTex; 76 | 77 | half _History1Weight; 78 | half _History2Weight; 79 | half _History3Weight; 80 | half _History4Weight; 81 | 82 | // Linearize depth value sampled from the camera depth texture. 83 | float LinearizeDepth(float z) 84 | { 85 | float isOrtho = unity_OrthoParams.w; 86 | float isPers = 1 - unity_OrthoParams.w; 87 | z *= _ZBufferParams.x; 88 | return (1 - isOrtho * z) / (isPers * z + _ZBufferParams.y); 89 | } 90 | 91 | // Vertex shader for multiple texture blitting 92 | struct v2f_multitex 93 | { 94 | float4 pos : SV_POSITION; 95 | float2 uv0 : TEXCOORD0; 96 | float2 uv1 : TEXCOORD1; 97 | }; 98 | 99 | v2f_multitex vert_Multitex(appdata_full v) 100 | { 101 | v2f_multitex o; 102 | o.pos = UnityObjectToClipPos(v.vertex); 103 | o.uv0 = v.texcoord.xy; 104 | o.uv1 = v.texcoord.xy; 105 | #if UNITY_UV_STARTS_AT_TOP 106 | if (_MainTex_TexelSize.y < 0.0) 107 | o.uv1.y = 1.0 - v.texcoord.y; 108 | #endif 109 | return o; 110 | } 111 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Shader/Common.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6cc5914b4a028a4a898a9deb44ef841 3 | timeCreated: 1467097118 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Shader/FrameBlending.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 95caa7c3844725840aec8dad64ac258e 3 | timeCreated: 1467096761 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Shader/Prefilter.cginc: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Motion - Motion blur effect 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 | 25 | #include "Common.cginc" 26 | 27 | // Returns the largest vector of v1 and v2. 28 | half2 VMax(half2 v1, half2 v2) 29 | { 30 | return dot(v1, v1) < dot(v2, v2) ? v2 : v1; 31 | } 32 | 33 | // Fragment shader: Velocity texture setup 34 | half4 frag_VelocitySetup(v2f_img i) : SV_Target 35 | { 36 | // Sample the motion vector. 37 | float2 v = tex2D(_CameraMotionVectorsTexture, i.uv).rg; 38 | 39 | // Apply the exposure time and convert to the pixel space. 40 | v *= (_VelocityScale * 0.5) * _CameraMotionVectorsTexture_TexelSize.zw; 41 | 42 | // Clamp the vector with the maximum blur radius. 43 | v /= max(1, length(v) * _RcpMaxBlurRadius); 44 | 45 | // Sample the depth of the pixel. 46 | half d = LinearizeDepth(SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv)); 47 | 48 | // Pack into 10/10/10/2 format. 49 | return half4((v * _RcpMaxBlurRadius + 1) / 2, d, 0); 50 | } 51 | 52 | // Fragment shader: TileMax filter (2 pixel width with normalization) 53 | half4 frag_TileMax1(v2f_img i) : SV_Target 54 | { 55 | float4 d = _MainTex_TexelSize.xyxy * float4(-0.5, -0.5, 0.5, 0.5); 56 | 57 | half2 v1 = tex2D(_MainTex, i.uv + d.xy).rg; 58 | half2 v2 = tex2D(_MainTex, i.uv + d.zy).rg; 59 | half2 v3 = tex2D(_MainTex, i.uv + d.xw).rg; 60 | half2 v4 = tex2D(_MainTex, i.uv + d.zw).rg; 61 | 62 | v1 = (v1 * 2 - 1) * _MaxBlurRadius; 63 | v2 = (v2 * 2 - 1) * _MaxBlurRadius; 64 | v3 = (v3 * 2 - 1) * _MaxBlurRadius; 65 | v4 = (v4 * 2 - 1) * _MaxBlurRadius; 66 | 67 | return half4(VMax(VMax(VMax(v1, v2), v3), v4), 0, 0); 68 | } 69 | 70 | // Fragment shader: TileMax filter (2 pixel width) 71 | half4 frag_TileMax2(v2f_img i) : SV_Target 72 | { 73 | float4 d = _MainTex_TexelSize.xyxy * float4(-0.5, -0.5, 0.5, 0.5); 74 | 75 | half2 v1 = tex2D(_MainTex, i.uv + d.xy).rg; 76 | half2 v2 = tex2D(_MainTex, i.uv + d.zy).rg; 77 | half2 v3 = tex2D(_MainTex, i.uv + d.xw).rg; 78 | half2 v4 = tex2D(_MainTex, i.uv + d.zw).rg; 79 | 80 | return half4(VMax(VMax(VMax(v1, v2), v3), v4), 0, 0); 81 | } 82 | 83 | // Fragment shader: TileMax filter (variable width) 84 | half4 frag_TileMaxV(v2f_img i) : SV_Target 85 | { 86 | float2 uv0 = i.uv + _MainTex_TexelSize.xy * _TileMaxOffs.xy; 87 | 88 | float2 du = float2(_MainTex_TexelSize.x, 0); 89 | float2 dv = float2(0, _MainTex_TexelSize.y); 90 | 91 | half2 vo = 0; 92 | 93 | UNITY_LOOP for (int ix = 0; ix < _TileMaxLoop; ix++) 94 | { 95 | UNITY_LOOP for (int iy = 0; iy < _TileMaxLoop; iy++) 96 | { 97 | float2 uv = uv0 + du * ix + dv * iy; 98 | vo = VMax(vo, tex2D(_MainTex, uv).rg); 99 | } 100 | } 101 | 102 | return half4(vo, 0, 0); 103 | } 104 | 105 | // Fragment shader: NeighborMax filter 106 | half4 frag_NeighborMax(v2f_img i) : SV_Target 107 | { 108 | const half cw = 1.01f; // center weight tweak 109 | 110 | float4 d = _MainTex_TexelSize.xyxy * float4(1, 1, -1, 0); 111 | 112 | half2 v1 = tex2D(_MainTex, i.uv - d.xy).rg; 113 | half2 v2 = tex2D(_MainTex, i.uv - d.wy).rg; 114 | half2 v3 = tex2D(_MainTex, i.uv - d.zy).rg; 115 | 116 | half2 v4 = tex2D(_MainTex, i.uv - d.xw).rg; 117 | half2 v5 = tex2D(_MainTex, i.uv ).rg * cw; 118 | half2 v6 = tex2D(_MainTex, i.uv + d.xw).rg; 119 | 120 | half2 v7 = tex2D(_MainTex, i.uv + d.zy).rg; 121 | half2 v8 = tex2D(_MainTex, i.uv + d.wy).rg; 122 | half2 v9 = tex2D(_MainTex, i.uv + d.xy).rg; 123 | 124 | half2 va = VMax(v1, VMax(v2, v3)); 125 | half2 vb = VMax(v4, VMax(v5, v6)); 126 | half2 vc = VMax(v7, VMax(v8, v9)); 127 | 128 | return half4(VMax(va, VMax(vb, vc)) / cw, 0, 0); 129 | } 130 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Shader/Prefilter.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 390e8b33333a5b94d987b380821b341e 3 | timeCreated: 1467096761 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Shader/Reconstruction.cginc: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Motion - Motion blur effect 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 | 25 | #include "Common.cginc" 26 | 27 | // Returns true or false with a given interval. 28 | bool Interval(half phase, half interval) 29 | { 30 | return frac(phase / interval) > 0.499; 31 | } 32 | 33 | // Interleaved gradient function from Jimenez 2014 http://goo.gl/eomGso 34 | float GradientNoise(float2 uv) 35 | { 36 | uv = floor((uv + _Time.y) * _ScreenParams.xy); 37 | float f = dot(float2(0.06711056f, 0.00583715f), uv); 38 | return frac(52.9829189f * frac(f)); 39 | } 40 | 41 | // Jitter function for tile lookup 42 | float2 JitterTile(float2 uv) 43 | { 44 | float rx, ry; 45 | sincos(GradientNoise(uv + float2(2, 0)) * UNITY_PI * 2, ry, rx); 46 | return float2(rx, ry) * _NeighborMaxTex_TexelSize.xy / 4; 47 | } 48 | 49 | // Velocity sampling function 50 | half3 SampleVelocity(float2 uv) 51 | { 52 | half3 v = tex2Dlod(_VelocityTex, float4(uv, 0, 0)).xyz; 53 | return half3((v.xy * 2 - 1) * _MaxBlurRadius, v.z); 54 | } 55 | 56 | // Reconstruction fragment shader 57 | half4 frag_Reconstruction(v2f_multitex i) : SV_Target 58 | { 59 | // Color sample at the center point 60 | const half4 c_p = tex2D(_MainTex, i.uv0); 61 | 62 | // Velocity/Depth sample at the center point 63 | const half3 vd_p = SampleVelocity(i.uv1); 64 | const half l_v_p = max(length(vd_p.xy), 0.5); 65 | const half rcp_d_p = 1 / vd_p.z; 66 | 67 | // NeighborMax vector sample at the center point 68 | const half2 v_max = tex2D(_NeighborMaxTex, i.uv1 + JitterTile(i.uv1)).xy; 69 | const half l_v_max = length(v_max); 70 | const half rcp_l_v_max = 1 / l_v_max; 71 | 72 | // Escape early if the NeighborMax vector is small enough. 73 | if (l_v_max < 2) return c_p; 74 | 75 | // Use V_p as a secondary sampling direction except when it's too small 76 | // compared to V_max. This vector is rescaled to be the length of V_max. 77 | const half2 v_alt = (l_v_p * 2 > l_v_max) ? vd_p.xy * (l_v_max / l_v_p) : v_max; 78 | 79 | // Determine the sample count. 80 | const half sc = floor(min(_LoopCount, l_v_max / 2)); 81 | 82 | // Loop variables (starts from the outermost sample) 83 | const half dt = 1 / sc; 84 | const half t_offs = (GradientNoise(i.uv0) - 0.5) * dt; 85 | half t = 1 - dt / 2; 86 | half count = 0; 87 | 88 | // Background velocity 89 | // This is used for tracking the maximum velocity in the background layer. 90 | half l_v_bg = max(l_v_p, 1); 91 | 92 | // Color accumlation 93 | half4 acc = 0; 94 | 95 | UNITY_LOOP while (t > dt / 4) 96 | { 97 | // Sampling direction (switched per every two samples) 98 | const half2 v_s = Interval(count, 4) ? v_alt : v_max; 99 | 100 | // Sample position (inverted per every sample) 101 | const half t_s = (Interval(count, 2) ? -t : t) + t_offs; 102 | 103 | // Distance to the sample position 104 | const half l_t = l_v_max * abs(t_s); 105 | 106 | // UVs for the sample position 107 | const float2 uv0 = i.uv0 + v_s * t_s * _MainTex_TexelSize.xy; 108 | const float2 uv1 = i.uv1 + v_s * t_s * _VelocityTex_TexelSize.xy; 109 | 110 | // Color sample 111 | const half3 c = tex2Dlod(_MainTex, float4(uv0, 0, 0)).rgb; 112 | 113 | // Velocity/Depth sample 114 | const half3 vd = SampleVelocity(uv1); 115 | 116 | // Background/Foreground separation 117 | const half fg = saturate((vd_p.z - vd.z) * 20 * rcp_d_p); 118 | 119 | // Length of the velocity vector 120 | const half l_v = lerp(l_v_bg, length(vd.xy), fg); 121 | 122 | // Sample weight 123 | // (Distance test) * (Spreading out by motion) * (Triangular window) 124 | const half w = saturate(l_v - l_t) / l_v * (1.2 - t); 125 | 126 | // Color accumulation 127 | acc += half4(c, 1) * w; 128 | 129 | // Update the background velocity. 130 | l_v_bg = max(l_v_bg, l_v); 131 | 132 | // Advance to the next sample. 133 | t = Interval(count, 2) ? t - dt : t; 134 | count += 1; 135 | } 136 | 137 | // Add the center sample. 138 | acc += half4(c_p.rgb, 1) * (1.2 / (l_v_bg * sc * 2)); 139 | 140 | return half4(acc.rgb / acc.a, c_p.a); 141 | } 142 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Shader/Reconstruction.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1ca76c39dd469e498fafe6942e45f59 3 | timeCreated: 1467096761 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Shader/Reconstruction.shader: -------------------------------------------------------------------------------- 1 | // 2 | // Kino/Motion - Motion blur effect 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/Motion/Reconstruction" 25 | { 26 | Properties 27 | { 28 | _MainTex ("", 2D) = ""{} 29 | _VelocityTex ("", 2D) = ""{} 30 | _NeighborMaxTex ("", 2D) = ""{} 31 | } 32 | Subshader 33 | { 34 | // Pass 0: Velocity texture setup 35 | Pass 36 | { 37 | ZTest Always Cull Off ZWrite Off 38 | CGPROGRAM 39 | #include "Prefilter.cginc" 40 | #pragma vertex vert_img 41 | #pragma fragment frag_VelocitySetup 42 | #pragma target 3.0 43 | ENDCG 44 | } 45 | // Pass 1: TileMax filter (2 pixels width with normalization) 46 | Pass 47 | { 48 | ZTest Always Cull Off ZWrite Off 49 | CGPROGRAM 50 | #include "Prefilter.cginc" 51 | #pragma vertex vert_img 52 | #pragma fragment frag_TileMax1 53 | #pragma target 3.0 54 | ENDCG 55 | } 56 | // Pass 2: TileMax filter (2 pixels width) 57 | Pass 58 | { 59 | ZTest Always Cull Off ZWrite Off 60 | CGPROGRAM 61 | #include "Prefilter.cginc" 62 | #pragma vertex vert_img 63 | #pragma fragment frag_TileMax2 64 | #pragma target 3.0 65 | ENDCG 66 | } 67 | // Pass 3: TileMax filter (variable width) 68 | Pass 69 | { 70 | ZTest Always Cull Off ZWrite Off 71 | CGPROGRAM 72 | #include "Prefilter.cginc" 73 | #pragma vertex vert_img 74 | #pragma fragment frag_TileMaxV 75 | #pragma target 3.0 76 | ENDCG 77 | } 78 | // Pass 4: NeighborMax filter 79 | Pass 80 | { 81 | ZTest Always Cull Off ZWrite Off 82 | CGPROGRAM 83 | #include "Prefilter.cginc" 84 | #pragma vertex vert_img 85 | #pragma fragment frag_NeighborMax 86 | #pragma target 3.0 87 | ENDCG 88 | } 89 | // Pass 5: Reconstruction filter 90 | Pass 91 | { 92 | ZTest Always Cull Off ZWrite Off 93 | CGPROGRAM 94 | #include "Reconstruction.cginc" 95 | #pragma vertex vert_Multitex 96 | #pragma fragment frag_Reconstruction 97 | #pragma target 3.0 98 | ENDCG 99 | } 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Assets/Kino/Motion/Shader/Reconstruction.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60701d53f4c638048b5e49c197d08b77 3 | timeCreated: 1467096761 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Klak.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d80c83752a75c40649d0a3c49a424bd4 3 | folderAsset: yes 4 | timeCreated: 1452473625 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Klak/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0965c0a5f97c14e31a16959dd1103305 3 | folderAsset: yes 4 | timeCreated: 1452484574 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Klak/Editor/GUIHelper.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Klak - Utilities for creative coding with 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 Klak 28 | { 29 | public static class GUIHelper 30 | { 31 | public static void ShowInputValueNote() 32 | { 33 | EditorGUILayout.HelpBox( 34 | "Receives float values from the inputValue property.", 35 | MessageType.None); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Klak/Editor/GUIHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 419a4d015120b054b8e817a78d3e4712 3 | timeCreated: 1452781280 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/Klak/Editor/ImageSequenceWindow.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Klak - Utilities for creative coding with 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 | using System.IO; 27 | 28 | namespace Klak 29 | { 30 | public class ImageSequenceWindow : EditorWindow 31 | { 32 | #region Private Variables 33 | 34 | // recorder settings 35 | int _frameRate = 30; 36 | int _superSampling = 1; 37 | bool _autoRecord; 38 | 39 | // recorder state 40 | bool _isRecording; 41 | int _frameCount; 42 | int _previousFrame; 43 | 44 | #endregion 45 | 46 | #region Recorder Functions 47 | 48 | void InitializeRecorder() 49 | { 50 | _isRecording = false; 51 | if (_autoRecord) StartRecord(); 52 | } 53 | 54 | void StartRecord() 55 | { 56 | _frameCount = -1; 57 | _isRecording = true; 58 | } 59 | 60 | void EndRecord() 61 | { 62 | Time.captureFramerate = 0; 63 | _isRecording = false; 64 | } 65 | 66 | void StepRecorder() 67 | { 68 | if (_frameCount == 0) 69 | { 70 | Directory.CreateDirectory("Capture"); 71 | Time.captureFramerate = _frameRate; 72 | } 73 | else if (_frameCount > 0) 74 | { 75 | var name = "Capture/frame" + _frameCount.ToString("0000") + ".png"; 76 | ScreenCapture.CaptureScreenshot(name, _superSampling); 77 | } 78 | _frameCount++; 79 | } 80 | 81 | #endregion 82 | 83 | #region EditorWindow Functions 84 | 85 | [MenuItem ("Window/Image Sequence")] 86 | static void Init() 87 | { 88 | var instance = CreateInstance(); 89 | instance.minSize = instance.maxSize = 90 | new Vector2(20, 6) * EditorGUIUtility.singleLineHeight; 91 | instance.titleContent = new GUIContent("Image Sequence"); 92 | instance.ShowUtility(); 93 | } 94 | 95 | void OnEnable() 96 | { 97 | EditorApplication.playmodeStateChanged += OnPlaymodeChanged; 98 | } 99 | 100 | void OnDisable() 101 | { 102 | EditorApplication.playmodeStateChanged -= OnPlaymodeChanged; 103 | } 104 | 105 | void OnPlaymodeChanged() 106 | { 107 | // detecting a start of the play mode 108 | if (!Application.isPlaying && EditorApplication.isPlayingOrWillChangePlaymode) 109 | InitializeRecorder(); 110 | Repaint(); 111 | } 112 | 113 | void OnGUI() 114 | { 115 | _frameRate = EditorGUILayout.IntSlider("Frame Rate", _frameRate, 1, 120); 116 | _superSampling = EditorGUILayout.IntSlider("Supersampling", _superSampling, 1, 4); 117 | _autoRecord = EditorGUILayout.Toggle("Auto Recording", _autoRecord); 118 | 119 | if (EditorApplication.isPlaying) 120 | { 121 | var fatButton = GUILayout.Height(30); 122 | 123 | if (!_isRecording) 124 | { 125 | if (GUILayout.Button("REC", fatButton)) StartRecord(); 126 | } 127 | else 128 | { 129 | var time = (float)_frameCount / _frameRate; 130 | var label = "STOP (" + time.ToString("0.0") + "s)"; 131 | if (GUILayout.Button(label, fatButton)) EndRecord(); 132 | } 133 | } 134 | } 135 | 136 | void Update() 137 | { 138 | var frame = Time.frameCount; 139 | if (_previousFrame != frame) 140 | { 141 | if (Application.isPlaying && _isRecording) 142 | { 143 | StepRecorder(); 144 | Repaint(); 145 | } 146 | _previousFrame = frame; 147 | } 148 | } 149 | 150 | #endregion 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /Assets/Klak/Editor/ImageSequenceWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb3fa56e3b2454553aef859ff356d123 3 | timeCreated: 1452500661 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/Klak/Math.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb9dc05a19a2fad4caf8b1a87a2c484c 3 | folderAsset: yes 4 | timeCreated: 1452843589 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Klak/Math/NoiseGenerator.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Klak - Utilities for creative coding with 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 Klak.Math 27 | { 28 | /// Noise generator that provides Vector3/Quaternion values 29 | struct NoiseGenerator 30 | { 31 | #region Private variables 32 | 33 | const float _fbmNorm = 1 / 0.75f; 34 | 35 | XXHash _hash1; 36 | XXHash _hash2; 37 | XXHash _hash3; 38 | 39 | int _fractal; 40 | float _frequency; 41 | float _time; 42 | 43 | #endregion 44 | 45 | #region Constructors 46 | 47 | public NoiseGenerator(float frequency) 48 | { 49 | _hash1 = XXHash.RandomHash; 50 | _hash2 = XXHash.RandomHash; 51 | _hash3 = XXHash.RandomHash; 52 | _fractal = 2; 53 | _frequency = frequency; 54 | _time = 0; 55 | } 56 | 57 | public NoiseGenerator(int seed, float frequency) 58 | { 59 | _hash1 = new XXHash(seed); 60 | _hash2 = new XXHash(seed ^ 0x1327495a); 61 | _hash3 = new XXHash(seed ^ 0x3cbe84f2); 62 | _fractal = 2; 63 | _frequency = frequency; 64 | _time = 0; 65 | } 66 | 67 | #endregion 68 | 69 | #region Public Properties And Methods 70 | 71 | public int FractalLevel { 72 | get { return _fractal; } 73 | set { _fractal = value; } 74 | } 75 | 76 | public float Frequency { 77 | get { return _frequency; } 78 | set { _frequency = value; } 79 | } 80 | 81 | public void Step() 82 | { 83 | _time += _frequency * Time.deltaTime; 84 | } 85 | 86 | #endregion 87 | 88 | #region Noise Functions 89 | 90 | public float Value01(int seed2) 91 | { 92 | var i1 = _hash1.Range(-100.0f, 100.0f, seed2); 93 | return Perlin.Fbm(_time + i1, _fractal) * _fbmNorm * 0.5f + 0.5f; 94 | } 95 | 96 | public float Value(int seed2) 97 | { 98 | var i1 = _hash1.Range(-100.0f, 100.0f, seed2); 99 | return Perlin.Fbm(_time + i1, _fractal) * _fbmNorm; 100 | } 101 | 102 | public Vector3 Vector(int seed2) 103 | { 104 | var i1 = _hash1.Range(-100.0f, 100.0f, seed2); 105 | var i2 = _hash2.Range(-100.0f, 100.0f, seed2); 106 | var i3 = _hash3.Range(-100.0f, 100.0f, seed2); 107 | return new Vector3( 108 | Perlin.Fbm(_time + i1, _fractal) * _fbmNorm, 109 | Perlin.Fbm(_time + i2, _fractal) * _fbmNorm, 110 | Perlin.Fbm(_time + i3, _fractal) * _fbmNorm); 111 | } 112 | 113 | public Quaternion Rotation(int seed2, float angle) 114 | { 115 | var i1 = _hash1.Range(-100.0f, 100.0f, seed2); 116 | var i2 = _hash2.Range(-100.0f, 100.0f, seed2); 117 | var i3 = _hash3.Range(-100.0f, 100.0f, seed2); 118 | return Quaternion.Euler( 119 | Perlin.Fbm(_time + i1, _fractal) * _fbmNorm * angle, 120 | Perlin.Fbm(_time + i2, _fractal) * _fbmNorm * angle, 121 | Perlin.Fbm(_time + i3, _fractal) * _fbmNorm * angle); 122 | } 123 | 124 | public Quaternion Rotation(int seed2, float rx, float ry, float rz) 125 | { 126 | var i1 = _hash1.Range(-100.0f, 100.0f, seed2); 127 | var i2 = _hash2.Range(-100.0f, 100.0f, seed2); 128 | var i3 = _hash3.Range(-100.0f, 100.0f, seed2); 129 | return Quaternion.Euler( 130 | Perlin.Fbm(_time + i1, _fractal) * _fbmNorm * rx, 131 | Perlin.Fbm(_time + i2, _fractal) * _fbmNorm * ry, 132 | Perlin.Fbm(_time + i3, _fractal) * _fbmNorm * rz); 133 | } 134 | 135 | #endregion 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /Assets/Klak/Math/NoiseGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02dfbe70c75094fe1973194746bdef09 3 | timeCreated: 1452489764 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/Klak/Math/Perlin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b05ef48e04bc4e4385bbbecb990f874 3 | timeCreated: 1452487793 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/Klak/Math/XXHash.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Klak - Utilities for creative coding with 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 | 25 | namespace Klak.Math 26 | { 27 | /// xxHash algorithm 28 | public struct XXHash 29 | { 30 | #region Private Members 31 | 32 | const uint PRIME32_1 = 2654435761U; 33 | const uint PRIME32_2 = 2246822519U; 34 | const uint PRIME32_3 = 3266489917U; 35 | const uint PRIME32_4 = 668265263U; 36 | const uint PRIME32_5 = 374761393U; 37 | 38 | static uint rotl32(uint x, int r) 39 | { 40 | return (x << r) | (x >> 32 - r); 41 | } 42 | 43 | #endregion 44 | 45 | #region Static Functions 46 | 47 | public static uint GetHash(int data, int seed) 48 | { 49 | uint h32 = (uint)seed + PRIME32_5; 50 | h32 += 4U; 51 | h32 += (uint)data * PRIME32_3; 52 | h32 = rotl32(h32, 17) * PRIME32_4; 53 | h32 ^= h32 >> 15; 54 | h32 *= PRIME32_2; 55 | h32 ^= h32 >> 13; 56 | h32 *= PRIME32_3; 57 | h32 ^= h32 >> 16; 58 | return h32; 59 | } 60 | 61 | #endregion 62 | 63 | #region Struct Implementation 64 | 65 | static int _counter; 66 | 67 | public int seed; 68 | 69 | public static XXHash RandomHash { 70 | get { 71 | return new XXHash((int)XXHash.GetHash(0xcafe, _counter++)); 72 | } 73 | } 74 | 75 | public XXHash(int seed) 76 | { 77 | this.seed = seed; 78 | } 79 | 80 | public uint GetHash(int data) 81 | { 82 | return GetHash(data, seed); 83 | } 84 | 85 | public int Range(int max, int data) 86 | { 87 | return (int)GetHash(data) % max; 88 | } 89 | 90 | public int Range(int min, int max, int data) 91 | { 92 | return (int)GetHash(data) % (max - min) + min; 93 | } 94 | 95 | public float Value01(int data) 96 | { 97 | return GetHash(data) / (float)uint.MaxValue; 98 | } 99 | 100 | public float Range(float min, float max, int data) 101 | { 102 | return Value01(data) * (max - min) + min; 103 | } 104 | 105 | #endregion 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Assets/Klak/Math/XXHash.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6508314c510884ced8a4be226dea5495 3 | timeCreated: 1452488971 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/Klak/Motion.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b04e253fd90e09646b7032c3100d8444 3 | folderAsset: yes 4 | timeCreated: 1452843621 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Klak/Motion/BrownianMotion.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Klak - Utilities for creative coding with 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 Klak.Math; 26 | 27 | namespace Klak.Motion 28 | { 29 | [AddComponentMenu("Klak/Motion/Brownian Motion")] 30 | public class BrownianMotion : MonoBehaviour 31 | { 32 | #region Editable Properties 33 | 34 | [SerializeField] bool _enablePositionNoise = true; 35 | [SerializeField] bool _enableRotationNoise = true; 36 | 37 | [SerializeField] float _positionFrequency = 0.2f; 38 | [SerializeField] float _rotationFrequency = 0.2f; 39 | 40 | [SerializeField] float _positionAmplitude = 0.5f; 41 | [SerializeField] float _rotationAmplitude = 10.0f; 42 | 43 | [SerializeField] Vector3 _positionScale = Vector3.one; 44 | [SerializeField] Vector3 _rotationScale = new Vector3(1, 1, 0); 45 | 46 | [SerializeField, Range(0, 8)] int _positionFractalLevel = 3; 47 | [SerializeField, Range(0, 8)] int _rotationFractalLevel = 3; 48 | 49 | #endregion 50 | 51 | #region Public Properties 52 | 53 | public bool enablePositionNoise { 54 | get { return _enablePositionNoise; } 55 | set { _enablePositionNoise = value; } 56 | } 57 | 58 | public bool enableRotationNoise { 59 | get { return _enableRotationNoise; } 60 | set { _enableRotationNoise = value; } 61 | } 62 | 63 | public float positionFrequency { 64 | get { return _positionFrequency; } 65 | set { _positionFrequency = value; } 66 | } 67 | 68 | public float rotationFrequency { 69 | get { return _rotationFrequency; } 70 | set { _rotationFrequency = value; } 71 | } 72 | 73 | public float positionAmplitude { 74 | get { return _positionAmplitude; } 75 | set { _positionAmplitude = value; } 76 | } 77 | 78 | public float rotationAmplitude { 79 | get { return _rotationAmplitude; } 80 | set { _rotationAmplitude = value; } 81 | } 82 | 83 | public Vector3 positionScale { 84 | get { return _positionScale; } 85 | set { _positionScale = value; } 86 | } 87 | 88 | public Vector3 rotationScale { 89 | get { return _rotationScale; } 90 | set { _rotationScale = value; } 91 | } 92 | 93 | public int positionFractalLevel { 94 | get { return _positionFractalLevel; } 95 | set { _positionFractalLevel = value; } 96 | } 97 | 98 | public int rotationFractalLevel { 99 | get { return _rotationFractalLevel; } 100 | set { _rotationFractalLevel = value; } 101 | } 102 | 103 | #endregion 104 | 105 | #region Private Members 106 | 107 | static int _seed = 0; 108 | 109 | const float _fbmNorm = 1 / 0.75f; 110 | 111 | Vector3 _initialPosition; 112 | Quaternion _initialRotation; 113 | float[] _time; 114 | 115 | #endregion 116 | 117 | #region MonoBehaviour Functions 118 | 119 | void Start() 120 | { 121 | var hash = new XXHash(_seed++); 122 | _time = new float[6]; 123 | for (var i = 0; i < 6; i++) 124 | _time[i] = hash.Range(-10000.0f, 0.0f, i); 125 | } 126 | 127 | void OnEnable() 128 | { 129 | _initialPosition = transform.localPosition; 130 | _initialRotation = transform.localRotation; 131 | } 132 | 133 | void Update() 134 | { 135 | var dt = Time.deltaTime; 136 | 137 | if (_enablePositionNoise) 138 | { 139 | for (var i = 0; i < 3; i++) 140 | _time[i] += _positionFrequency * dt; 141 | 142 | var n = new Vector3( 143 | Perlin.Fbm(_time[0], _positionFractalLevel), 144 | Perlin.Fbm(_time[1], _positionFractalLevel), 145 | Perlin.Fbm(_time[2], _positionFractalLevel)); 146 | 147 | n = Vector3.Scale(n, _positionScale); 148 | n *= _positionAmplitude * _fbmNorm; 149 | 150 | transform.localPosition = _initialPosition + n; 151 | } 152 | 153 | if (_enableRotationNoise) 154 | { 155 | for (var i = 0; i < 3; i++) 156 | _time[i + 3] += _rotationFrequency * dt; 157 | 158 | var n = new Vector3( 159 | Perlin.Fbm(_time[3], _rotationFractalLevel), 160 | Perlin.Fbm(_time[4], _rotationFractalLevel), 161 | Perlin.Fbm(_time[5], _rotationFractalLevel)); 162 | 163 | n = Vector3.Scale(n, _rotationScale); 164 | n *= _rotationAmplitude * _fbmNorm; 165 | 166 | transform.localRotation = 167 | Quaternion.Euler(n) * _initialRotation; 168 | } 169 | } 170 | 171 | #endregion 172 | } 173 | } 174 | -------------------------------------------------------------------------------- /Assets/Klak/Motion/BrownianMotion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 543ddbe12367a4899b011d43ef41f357 3 | timeCreated: 1452493080 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/Klak/Motion/ConstantMotion.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Klak - Utilities for creative coding with 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 Klak.Motion 27 | { 28 | [AddComponentMenu("Klak/Motion/Constant Motion")] 29 | public class ConstantMotion : MonoBehaviour 30 | { 31 | #region Nested Classes 32 | 33 | public enum TranslationMode { 34 | Off, XAxis, YAxis, ZAxis, Vector, Random 35 | }; 36 | 37 | public enum RotationMode { 38 | Off, XAxis, YAxis, ZAxis, Vector, Random 39 | } 40 | 41 | #endregion 42 | 43 | #region Editable Properties 44 | 45 | [SerializeField] 46 | TranslationMode _translationMode = TranslationMode.Off; 47 | 48 | [SerializeField] 49 | Vector3 _translationVector = Vector3.forward; 50 | 51 | [SerializeField] 52 | float _translationSpeed = 1.0f; 53 | 54 | [SerializeField] 55 | RotationMode _rotationMode = RotationMode.Off; 56 | 57 | [SerializeField] 58 | Vector3 _rotationAxis = Vector3.up; 59 | 60 | [SerializeField] 61 | float _rotationSpeed = 30.0f; 62 | 63 | [SerializeField] 64 | bool _useLocalCoordinate = true; 65 | 66 | #endregion 67 | 68 | #region Public Properties 69 | 70 | public TranslationMode translationMode { 71 | get { return _translationMode; } 72 | set { _translationMode = value; } 73 | } 74 | 75 | public Vector3 translationVector { 76 | get { return _translationVector; } 77 | set { _translationVector = value; } 78 | } 79 | 80 | public float translationSpeed { 81 | get { return _translationSpeed; } 82 | set { _translationSpeed = value; } 83 | } 84 | 85 | public RotationMode rotationMode { 86 | get { return _rotationMode; } 87 | set { _rotationMode = value; } 88 | } 89 | 90 | public Vector3 rotationAxis { 91 | get { return _rotationAxis; } 92 | set { _rotationAxis = value; } 93 | } 94 | 95 | public float rotationSpeed { 96 | get { return _rotationSpeed; } 97 | set { _rotationSpeed = value; } 98 | } 99 | 100 | public bool useLocalCoordinate { 101 | get { return _useLocalCoordinate; } 102 | set { _useLocalCoordinate = value; } 103 | } 104 | 105 | #endregion 106 | 107 | #region Private Variables 108 | 109 | Vector3 _randomVectorT; 110 | Vector3 _randomVectorR; 111 | 112 | Vector3 TranslationVector { 113 | get { 114 | switch (_translationMode) 115 | { 116 | case TranslationMode.XAxis: return Vector3.right; 117 | case TranslationMode.YAxis: return Vector3.up; 118 | case TranslationMode.ZAxis: return Vector3.forward; 119 | case TranslationMode.Vector: return _translationVector; 120 | } 121 | // TranslationMode.Random 122 | return _randomVectorT; 123 | } 124 | } 125 | 126 | Vector3 RotationVector { 127 | get { 128 | switch (_rotationMode) 129 | { 130 | case RotationMode.XAxis: return Vector3.right; 131 | case RotationMode.YAxis: return Vector3.up; 132 | case RotationMode.ZAxis: return Vector3.forward; 133 | case RotationMode.Vector: return _rotationAxis; 134 | } 135 | // RotationMode.Random 136 | return _randomVectorR; 137 | } 138 | } 139 | 140 | #endregion 141 | 142 | #region MonoBehaviour Functions 143 | 144 | void Start() 145 | { 146 | _randomVectorT = Random.onUnitSphere; 147 | _randomVectorR = Random.onUnitSphere; 148 | } 149 | 150 | void Update() 151 | { 152 | var dt = Time.deltaTime; 153 | 154 | if (_translationMode != TranslationMode.Off) 155 | { 156 | var dp = TranslationVector * _translationSpeed * dt; 157 | 158 | if (_useLocalCoordinate) 159 | transform.localPosition += dp; 160 | else 161 | transform.position += dp; 162 | } 163 | 164 | if (_rotationMode != RotationMode.Off) 165 | { 166 | var dr = Quaternion.AngleAxis( 167 | _rotationSpeed * dt, RotationVector); 168 | 169 | if (_useLocalCoordinate) 170 | transform.localRotation = dr * transform.localRotation; 171 | else 172 | transform.rotation = dr * transform.rotation; 173 | } 174 | } 175 | 176 | #endregion 177 | } 178 | } 179 | -------------------------------------------------------------------------------- /Assets/Klak/Motion/ConstantMotion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3db4c4a72731246b2b1ad1e73178c04e 3 | timeCreated: 1452494131 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/Klak/Motion/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f2b8436fbb9bd045ab8bdccf8490ae1 3 | folderAsset: yes 4 | timeCreated: 1452853741 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Klak/Motion/Editor/BrownianMotionEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Klak - Utilities for creative coding with 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 Klak.Motion 28 | { 29 | [CanEditMultipleObjects] 30 | [CustomEditor(typeof(BrownianMotion))] 31 | public class BrownianMotionEditor : Editor 32 | { 33 | SerializedProperty _enablePositionNoise; 34 | SerializedProperty _enableRotationNoise; 35 | SerializedProperty _positionFrequency; 36 | SerializedProperty _rotationFrequency; 37 | SerializedProperty _positionAmplitude; 38 | SerializedProperty _rotationAmplitude; 39 | SerializedProperty _positionScale; 40 | SerializedProperty _rotationScale; 41 | SerializedProperty _positionFractalLevel; 42 | SerializedProperty _rotationFractalLevel; 43 | 44 | static GUIContent _textPositionNoise = new GUIContent("Position Noise"); 45 | static GUIContent _textRotationNoise = new GUIContent("Rotation Noise"); 46 | static GUIContent _textFrequency = new GUIContent("Frequency"); 47 | static GUIContent _textAmplitude = new GUIContent("Amplitude"); 48 | static GUIContent _textScale = new GUIContent("Scale"); 49 | static GUIContent _textFractal = new GUIContent("Fractal"); 50 | 51 | void OnEnable() 52 | { 53 | _enablePositionNoise = serializedObject.FindProperty("_enablePositionNoise"); 54 | _enableRotationNoise = serializedObject.FindProperty("_enableRotationNoise"); 55 | _positionFrequency = serializedObject.FindProperty("_positionFrequency"); 56 | _rotationFrequency = serializedObject.FindProperty("_rotationFrequency"); 57 | _positionAmplitude = serializedObject.FindProperty("_positionAmplitude"); 58 | _rotationAmplitude = serializedObject.FindProperty("_rotationAmplitude"); 59 | _positionScale = serializedObject.FindProperty("_positionScale"); 60 | _rotationScale = serializedObject.FindProperty("_rotationScale"); 61 | _positionFractalLevel = serializedObject.FindProperty("_positionFractalLevel"); 62 | _rotationFractalLevel = serializedObject.FindProperty("_rotationFractalLevel"); 63 | } 64 | 65 | public override void OnInspectorGUI() 66 | { 67 | serializedObject.Update(); 68 | 69 | EditorGUILayout.PropertyField(_enablePositionNoise, _textPositionNoise); 70 | 71 | if (_enablePositionNoise.hasMultipleDifferentValues || _enablePositionNoise.boolValue) 72 | { 73 | EditorGUI.indentLevel++; 74 | EditorGUILayout.PropertyField(_positionFrequency, _textFrequency); 75 | EditorGUILayout.PropertyField(_positionAmplitude, _textAmplitude); 76 | EditorGUILayout.PropertyField(_positionScale, _textScale); 77 | EditorGUILayout.PropertyField(_positionFractalLevel, _textFractal); 78 | EditorGUI.indentLevel--; 79 | } 80 | 81 | EditorGUILayout.PropertyField(_enableRotationNoise, _textRotationNoise); 82 | 83 | if (_enableRotationNoise.hasMultipleDifferentValues || _enableRotationNoise.boolValue) 84 | { 85 | EditorGUI.indentLevel++; 86 | EditorGUILayout.PropertyField(_rotationFrequency, _textFrequency); 87 | EditorGUILayout.PropertyField(_rotationAmplitude, _textAmplitude); 88 | EditorGUILayout.PropertyField(_rotationScale, _textScale); 89 | EditorGUILayout.PropertyField(_rotationFractalLevel, _textFractal); 90 | EditorGUI.indentLevel--; 91 | } 92 | 93 | serializedObject.ApplyModifiedProperties(); 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/Klak/Motion/Editor/BrownianMotionEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff30deb1b277747ecb72302943759563 3 | timeCreated: 1452493920 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/Klak/Motion/Editor/ConstantMotionEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Klak - Utilities for creative coding with 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 Klak.Motion 28 | { 29 | [CanEditMultipleObjects] 30 | [CustomEditor(typeof(ConstantMotion))] 31 | public class ConstantMotionEditor : Editor 32 | { 33 | SerializedProperty _translationMode; 34 | SerializedProperty _translationVector; 35 | SerializedProperty _translationSpeed; 36 | 37 | SerializedProperty _rotationMode; 38 | SerializedProperty _rotationAxis; 39 | SerializedProperty _rotationSpeed; 40 | 41 | SerializedProperty _useLocalCoordinate; 42 | 43 | static GUIContent _textLocalCoordinate = new GUIContent("Local Coordinate"); 44 | static GUIContent _textRotation = new GUIContent("Rotation"); 45 | static GUIContent _textSpeed = new GUIContent("Speed"); 46 | static GUIContent _textTranslation = new GUIContent("Translation"); 47 | static GUIContent _textVector = new GUIContent("Vector"); 48 | 49 | void OnEnable() 50 | { 51 | _translationMode = serializedObject.FindProperty("_translationMode"); 52 | _translationVector = serializedObject.FindProperty("_translationVector"); 53 | _translationSpeed = serializedObject.FindProperty("_translationSpeed"); 54 | 55 | _rotationMode = serializedObject.FindProperty("_rotationMode"); 56 | _rotationAxis = serializedObject.FindProperty("_rotationAxis"); 57 | _rotationSpeed = serializedObject.FindProperty("_rotationSpeed"); 58 | 59 | _useLocalCoordinate = serializedObject.FindProperty("_useLocalCoordinate"); 60 | } 61 | 62 | public override void OnInspectorGUI() 63 | { 64 | serializedObject.Update(); 65 | 66 | EditorGUILayout.PropertyField(_translationMode, _textTranslation); 67 | 68 | EditorGUI.indentLevel++; 69 | 70 | if (_translationMode.hasMultipleDifferentValues || 71 | _translationMode.enumValueIndex == (int)ConstantMotion.TranslationMode.Vector) 72 | EditorGUILayout.PropertyField(_translationVector, _textVector); 73 | 74 | if (_translationMode.hasMultipleDifferentValues || 75 | _translationMode.enumValueIndex != 0) 76 | EditorGUILayout.PropertyField(_translationSpeed, _textSpeed); 77 | 78 | EditorGUI.indentLevel--; 79 | 80 | EditorGUILayout.PropertyField(_rotationMode, _textRotation); 81 | 82 | EditorGUI.indentLevel++; 83 | 84 | if (_rotationMode.hasMultipleDifferentValues || 85 | _rotationMode.enumValueIndex == (int)ConstantMotion.RotationMode.Vector) 86 | EditorGUILayout.PropertyField(_rotationAxis, _textVector); 87 | 88 | if (_rotationMode.hasMultipleDifferentValues || 89 | _rotationMode.enumValueIndex != 0) 90 | EditorGUILayout.PropertyField(_rotationSpeed, _textSpeed); 91 | 92 | EditorGUI.indentLevel--; 93 | 94 | EditorGUILayout.PropertyField(_useLocalCoordinate, _textLocalCoordinate); 95 | 96 | serializedObject.ApplyModifiedProperties(); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Assets/Klak/Motion/Editor/ConstantMotionEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fc5aa7ff4bc94e60a8415d6b0755c76 3 | timeCreated: 1452496761 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/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db3d2236a40093649a5ece79621b9963 3 | folderAsset: yes 4 | timeCreated: 1463725521 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Animation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad9b02fff8d94464a8504746d4c9b006 3 | folderAsset: yes 4 | timeCreated: 1463728382 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Animation/HumanoidRun.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/Assets/Test/Animation/HumanoidRun.fbx -------------------------------------------------------------------------------- /Assets/Test/Animation/Run.controller: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!91 &9100000 4 | AnimatorController: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: Run 9 | serializedVersion: 5 10 | m_AnimatorParameters: [] 11 | m_AnimatorLayers: 12 | - serializedVersion: 5 13 | m_Name: Base Layer 14 | m_StateMachine: {fileID: 1107000012681023252} 15 | m_Mask: {fileID: 0} 16 | m_Motions: [] 17 | m_Behaviours: [] 18 | m_BlendingMode: 0 19 | m_SyncedLayerIndex: -1 20 | m_DefaultWeight: 0 21 | m_IKPass: 0 22 | m_SyncedLayerAffectsTiming: 0 23 | m_Controller: {fileID: 9100000} 24 | --- !u!1102 &1102000011307189964 25 | AnimatorState: 26 | serializedVersion: 5 27 | m_ObjectHideFlags: 1 28 | m_PrefabParentObject: {fileID: 0} 29 | m_PrefabInternal: {fileID: 0} 30 | m_Name: HumanoidRun 31 | m_Speed: 1.333 32 | m_CycleOffset: 0 33 | m_Transitions: [] 34 | m_StateMachineBehaviours: [] 35 | m_Position: {x: 50, y: 50, z: 0} 36 | m_IKOnFeet: 0 37 | m_WriteDefaultValues: 1 38 | m_Mirror: 0 39 | m_SpeedParameterActive: 0 40 | m_MirrorParameterActive: 0 41 | m_CycleOffsetParameterActive: 0 42 | m_Motion: {fileID: 7400000, guid: 1cb8ed3cbba15f0479fbae54e0a963df, type: 3} 43 | m_Tag: 44 | m_SpeedParameter: 45 | m_MirrorParameter: 46 | m_CycleOffsetParameter: 47 | --- !u!1107 &1107000012681023252 48 | AnimatorStateMachine: 49 | serializedVersion: 5 50 | m_ObjectHideFlags: 1 51 | m_PrefabParentObject: {fileID: 0} 52 | m_PrefabInternal: {fileID: 0} 53 | m_Name: Base Layer 54 | m_ChildStates: 55 | - serializedVersion: 1 56 | m_State: {fileID: 1102000011307189964} 57 | m_Position: {x: 385, y: 63, z: 0} 58 | m_ChildStateMachines: [] 59 | m_AnyStateTransitions: [] 60 | m_EntryTransitions: [] 61 | m_StateMachineTransitions: {} 62 | m_StateMachineBehaviours: [] 63 | m_AnyStatePosition: {x: 50, y: 20, z: 0} 64 | m_EntryPosition: {x: 50, y: 120, z: 0} 65 | m_ExitPosition: {x: 800, y: 120, z: 0} 66 | m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} 67 | m_DefaultState: {fileID: 1102000011307189964} 68 | -------------------------------------------------------------------------------- /Assets/Test/Animation/Run.controller.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 178754b9775604340b44ea127c907d04 3 | timeCreated: 1463725851 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Benchmark.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 76da2d11ff109504cb888f3c8dd577f7 3 | timeCreated: 1465965494 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Benchmark2.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6bae465f2fcc9340a210a14ea419bc9 3 | timeCreated: 1465965494 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Depth.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6996bea175522fd4098c27e68f883e1c 3 | timeCreated: 1464847216 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Material.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9de3a98b354eaad4ca34c0e3524b99f5 3 | folderAsset: yes 4 | timeCreated: 1463728403 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Material/Background.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: Background 10 | m_Shader: {fileID: 4800000, guid: f138bceceaeb3914e95353b4de35a65e, type: 3} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 2800000, guid: 8560d420cafabc24a96f9719e811b213, type: 3} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _Scroll 108 | second: 1 109 | - first: 110 | name: _Smoothness 111 | second: 0 112 | - first: 113 | name: _SmoothnessTextureChannel 114 | second: 0 115 | - first: 116 | name: _SpecularHighlights 117 | second: 1 118 | - first: 119 | name: _SrcBlend 120 | second: 1 121 | - first: 122 | name: _UVSec 123 | second: 0 124 | - first: 125 | name: _ZWrite 126 | second: 1 127 | m_Colors: 128 | - first: 129 | name: _Color 130 | second: {r: 1, g: 1, b: 1, a: 1} 131 | - first: 132 | name: _EmissionColor 133 | second: {r: 0, g: 0, b: 0, a: 1} 134 | -------------------------------------------------------------------------------- /Assets/Test/Material/Background.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57be7e72590c6054b886fba57ff94b80 3 | timeCreated: 1480408615 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Material/Background.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/Background" 2 | { 3 | Properties 4 | { 5 | _Color("Color", Color) = (1,1,1,1) 6 | _MainTex("Albedo", 2D) = "white" {} 7 | _Smoothness("Smoothness", Range(0,1)) = 0.0 8 | _Metallic("Metallic", Range(0,1)) = 0.0 9 | _Scroll("Scroll (60 fps fixed)", Float) = 1 10 | } 11 | SubShader 12 | { 13 | Tags { "RenderType"="Opaque" } 14 | 15 | Pass 16 | { 17 | Tags { "LightMode" = "MotionVectors" } 18 | ZWrite Off 19 | CGPROGRAM 20 | 21 | #pragma vertex vert 22 | #pragma fragment frag 23 | #pragma target 3.0 24 | 25 | #include "UnityCG.cginc" 26 | 27 | struct appdata 28 | { 29 | float4 vertex : POSITION; 30 | }; 31 | 32 | struct v2f 33 | { 34 | float4 vertex : SV_POSITION; 35 | }; 36 | 37 | half _Scroll; 38 | 39 | v2f vert(appdata v) 40 | { 41 | v2f o; 42 | o.vertex = UnityObjectToClipPos(v.vertex); 43 | return o; 44 | } 45 | 46 | half4 frag(v2f i) : SV_Target 47 | { 48 | return half4(_Scroll / 60, 0, 0, 1); 49 | } 50 | 51 | ENDCG 52 | } 53 | 54 | CGPROGRAM 55 | 56 | #pragma surface surf Standard fullforwardshadows 57 | #pragma target 3.0 58 | 59 | sampler2D _MainTex; 60 | 61 | struct Input 62 | { 63 | float2 uv_MainTex; 64 | }; 65 | 66 | half _Smoothness; 67 | half _Metallic; 68 | fixed4 _Color; 69 | half _Scroll; 70 | 71 | void surf(Input IN, inout SurfaceOutputStandard o) 72 | { 73 | float2 uv = IN.uv_MainTex; 74 | uv.x += _Scroll * _Time.y; 75 | o.Albedo = tex2D(_MainTex, uv).rgb * _Color.rgb; 76 | o.Metallic = _Metallic; 77 | o.Smoothness = _Smoothness; 78 | } 79 | 80 | ENDCG 81 | } 82 | FallBack "Diffuse" 83 | } 84 | -------------------------------------------------------------------------------- /Assets/Test/Material/Background.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f138bceceaeb3914e95353b4de35a65e 3 | timeCreated: 1480408605 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Material/Blue.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: Blue 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 2, y: 2} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 2800000, guid: 8560d420cafabc24a96f9719e811b213, type: 3} 52 | m_Scale: {x: 2, y: 2} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _SmoothnessTextureChannel 108 | second: 0 109 | - first: 110 | name: _SpecularHighlights 111 | second: 1 112 | - first: 113 | name: _SrcBlend 114 | second: 1 115 | - first: 116 | name: _UVSec 117 | second: 0 118 | - first: 119 | name: _ZWrite 120 | second: 1 121 | m_Colors: 122 | - first: 123 | name: _Color 124 | second: {r: 0.10056226, g: 0.418339, b: 0.6838235, a: 1} 125 | - first: 126 | name: _EmissionColor 127 | second: {r: 0, g: 0, b: 0, a: 1} 128 | -------------------------------------------------------------------------------- /Assets/Test/Material/Blue.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 53e1f095ff0bd2349bf12e1b4884de2c 3 | timeCreated: 1464252923 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Material/Cube.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: Cube 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 0.5, y: 0.5} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 2800000, guid: 8560d420cafabc24a96f9719e811b213, type: 3} 52 | m_Scale: {x: 0.5, y: 0.5} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _SmoothnessTextureChannel 108 | second: 0 109 | - first: 110 | name: _SpecularHighlights 111 | second: 1 112 | - first: 113 | name: _SrcBlend 114 | second: 1 115 | - first: 116 | name: _UVSec 117 | second: 0 118 | - first: 119 | name: _ZWrite 120 | second: 1 121 | m_Colors: 122 | - first: 123 | name: _Color 124 | second: {r: 1, g: 1, b: 1, a: 1} 125 | - first: 126 | name: _EmissionColor 127 | second: {r: 0, g: 0, b: 0, a: 1} 128 | -------------------------------------------------------------------------------- /Assets/Test/Material/Cube.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4257b87a07be7364f8a115c3b2b5a25c 3 | timeCreated: 1464243382 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Material/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: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 4, y: 4} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 2800000, guid: 8560d420cafabc24a96f9719e811b213, type: 3} 52 | m_Scale: {x: 4, y: 4} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _SmoothnessTextureChannel 108 | second: 0 109 | - first: 110 | name: _SpecularHighlights 111 | second: 1 112 | - first: 113 | name: _SrcBlend 114 | second: 1 115 | - first: 116 | name: _UVSec 117 | second: 0 118 | - first: 119 | name: _ZWrite 120 | second: 1 121 | m_Colors: 122 | - first: 123 | name: _Color 124 | second: {r: 0.5147059, g: 0.5147059, b: 0.5147059, a: 1} 125 | - first: 126 | name: _EmissionColor 127 | second: {r: 0, g: 0, b: 0, a: 1} 128 | -------------------------------------------------------------------------------- /Assets/Test/Material/Floor.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa89df0e4a92dbe488082c724b8c754e 3 | timeCreated: 1464847287 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Material/Red.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: Red 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _SmoothnessTextureChannel 108 | second: 0 109 | - first: 110 | name: _SpecularHighlights 111 | second: 1 112 | - first: 113 | name: _SrcBlend 114 | second: 1 115 | - first: 116 | name: _UVSec 117 | second: 0 118 | - first: 119 | name: _ZWrite 120 | second: 1 121 | m_Colors: 122 | - first: 123 | name: _Color 124 | second: {r: 0.6544118, g: 0.09142519, b: 0.09142519, a: 1} 125 | - first: 126 | name: _EmissionColor 127 | second: {r: 0, g: 0, b: 0, a: 1} 128 | -------------------------------------------------------------------------------- /Assets/Test/Material/Red.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8b7b0dcf2036de41b0db7b85f3f6643 3 | timeCreated: 1464252885 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Material/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: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: 1000 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | - first: 73 | name: _Tex 74 | second: 75 | m_Texture: {fileID: 8900000, guid: 29182f375c0b2674fa35000e546dfa4c, type: 3} 76 | m_Scale: {x: 1, y: 1} 77 | m_Offset: {x: 0, y: 0} 78 | m_Floats: 79 | - first: 80 | name: _BumpScale 81 | second: 1 82 | - first: 83 | name: _Cutoff 84 | second: 0.5 85 | - first: 86 | name: _DetailNormalMapScale 87 | second: 1 88 | - first: 89 | name: _DstBlend 90 | second: 0 91 | - first: 92 | name: _Exposure 93 | second: 1 94 | - first: 95 | name: _GlossMapScale 96 | second: 1 97 | - first: 98 | name: _Glossiness 99 | second: 0.5 100 | - first: 101 | name: _GlossyReflections 102 | second: 1 103 | - first: 104 | name: _Metallic 105 | second: 0 106 | - first: 107 | name: _Mode 108 | second: 0 109 | - first: 110 | name: _OcclusionStrength 111 | second: 1 112 | - first: 113 | name: _Parallax 114 | second: 0.02 115 | - first: 116 | name: _Rotation 117 | second: 0 118 | - first: 119 | name: _SmoothnessTextureChannel 120 | second: 0 121 | - first: 122 | name: _SpecularHighlights 123 | second: 1 124 | - first: 125 | name: _SrcBlend 126 | second: 1 127 | - first: 128 | name: _UVSec 129 | second: 0 130 | - first: 131 | name: _ZWrite 132 | second: 1 133 | m_Colors: 134 | - first: 135 | name: _Color 136 | second: {r: 1, g: 1, b: 1, a: 1} 137 | - first: 138 | name: _EmissionColor 139 | second: {r: 0, g: 0, b: 0, a: 1} 140 | - first: 141 | name: _Tint 142 | second: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} 143 | -------------------------------------------------------------------------------- /Assets/Test/Material/Skybox.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31de36dd7a8fc804e9103ee64eb3a25c 3 | timeCreated: 1463725466 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Material/Sphere.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: Sphere 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 0.5} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 2800000, guid: 8560d420cafabc24a96f9719e811b213, type: 3} 52 | m_Scale: {x: 1, y: 0.5} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0.5 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _SmoothnessTextureChannel 108 | second: 0 109 | - first: 110 | name: _SpecularHighlights 111 | second: 1 112 | - first: 113 | name: _SrcBlend 114 | second: 1 115 | - first: 116 | name: _UVSec 117 | second: 0 118 | - first: 119 | name: _ZWrite 120 | second: 1 121 | m_Colors: 122 | - first: 123 | name: _Color 124 | second: {r: 1, g: 1, b: 1, a: 1} 125 | - first: 126 | name: _EmissionColor 127 | second: {r: 0, g: 0, b: 0, a: 1} 128 | -------------------------------------------------------------------------------- /Assets/Test/Material/Sphere.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 93ba84eca77d87e47be40c386de4f8b6 3 | timeCreated: 1464243112 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Material/UV Test.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: UV Test 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 2} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 2800000, guid: 8560d420cafabc24a96f9719e811b213, type: 3} 52 | m_Scale: {x: 1, y: 2} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 0} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - first: 74 | name: _BumpScale 75 | second: 1 76 | - first: 77 | name: _Cutoff 78 | second: 0.5 79 | - first: 80 | name: _DetailNormalMapScale 81 | second: 1 82 | - first: 83 | name: _DstBlend 84 | second: 0 85 | - first: 86 | name: _GlossMapScale 87 | second: 1 88 | - first: 89 | name: _Glossiness 90 | second: 0.5 91 | - first: 92 | name: _GlossyReflections 93 | second: 1 94 | - first: 95 | name: _Metallic 96 | second: 0 97 | - first: 98 | name: _Mode 99 | second: 0 100 | - first: 101 | name: _OcclusionStrength 102 | second: 1 103 | - first: 104 | name: _Parallax 105 | second: 0.02 106 | - first: 107 | name: _SmoothnessTextureChannel 108 | second: 0 109 | - first: 110 | name: _SpecularHighlights 111 | second: 1 112 | - first: 113 | name: _SrcBlend 114 | second: 1 115 | - first: 116 | name: _UVSec 117 | second: 0 118 | - first: 119 | name: _ZWrite 120 | second: 1 121 | m_Colors: 122 | - first: 123 | name: _Color 124 | second: {r: 1, g: 1, b: 1, a: 1} 125 | - first: 126 | name: _EmissionColor 127 | second: {r: 0, g: 0, b: 0, a: 1} 128 | -------------------------------------------------------------------------------- /Assets/Test/Material/UV Test.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7c1a187c7d9dff42912cda56aecb26b 3 | timeCreated: 1463725529 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/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/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: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION 12 | m_LightmapFlags: 1 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | - first: 19 | name: _BumpMap 20 | second: 21 | m_Texture: {fileID: 0} 22 | m_Scale: {x: 1, y: 1} 23 | m_Offset: {x: 0, y: 0} 24 | - first: 25 | name: _DetailAlbedoMap 26 | second: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - first: 31 | name: _DetailMask 32 | second: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - first: 37 | name: _DetailNormalMap 38 | second: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - first: 43 | name: _EmissionMap 44 | second: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - first: 49 | name: _MainTex 50 | second: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - first: 55 | name: _MetallicGlossMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - first: 61 | name: _OcclusionMap 62 | second: 63 | m_Texture: {fileID: 2800000, guid: 2db9b49529685fe43bd5a18a16c1511d, type: 3} 64 | m_Scale: {x: 1, y: 1} 65 | m_Offset: {x: 0, y: 0} 66 | - first: 67 | name: _ParallaxMap 68 | second: 69 | m_Texture: {fileID: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | - first: 73 | name: _SpecGlossMap 74 | second: 75 | m_Texture: {fileID: 0} 76 | m_Scale: {x: 1, y: 1} 77 | m_Offset: {x: 0, y: 0} 78 | m_Floats: 79 | - first: 80 | name: _BumpScale 81 | second: 1 82 | - first: 83 | name: _Cutoff 84 | second: 0.5 85 | - first: 86 | name: _DetailNormalMapScale 87 | second: 1 88 | - first: 89 | name: _DstBlend 90 | second: 0 91 | - first: 92 | name: _GlossMapScale 93 | second: 1 94 | - first: 95 | name: _Glossiness 96 | second: 0.32 97 | - first: 98 | name: _GlossyReflections 99 | second: 1 100 | - first: 101 | name: _Metallic 102 | second: 0 103 | - first: 104 | name: _Mode 105 | second: 0 106 | - first: 107 | name: _OcclusionStrength 108 | second: 1 109 | - first: 110 | name: _Parallax 111 | second: 0.02 112 | - first: 113 | name: _SmoothnessTextureChannel 114 | second: 0 115 | - first: 116 | name: _SpecularHighlights 117 | second: 1 118 | - first: 119 | name: _SrcBlend 120 | second: 1 121 | - first: 122 | name: _UVSec 123 | second: 0 124 | - first: 125 | name: _ZWrite 126 | second: 1 127 | m_Colors: 128 | - first: 129 | name: _Color 130 | second: {r: 0.6691177, g: 0.1771194, b: 0.1771194, a: 1} 131 | - first: 132 | name: _EmissionColor 133 | second: {r: 0, g: 0, b: 0, a: 1} 134 | - first: 135 | name: _SpecColor 136 | second: {r: 0.11764706, g: 0.11764706, b: 0.11764706, a: 1} 137 | -------------------------------------------------------------------------------- /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/Materials/mat_plank_01.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: mat_plank_01 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _EMISSION _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _NORMALMAP _UVSEC_UV1 13 | m_LightmapFlags: 1 14 | m_CustomRenderQueue: -1 15 | stringTagMap: {} 16 | m_SavedProperties: 17 | serializedVersion: 2 18 | m_TexEnvs: 19 | - first: 20 | name: _BumpMap 21 | second: 22 | m_Texture: {fileID: 2800000, guid: 017469a3ea9ca3e4ea89e14f79a6e221, type: 3} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - first: 26 | name: _DetailAlbedoMap 27 | second: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 3, y: 3} 30 | m_Offset: {x: 0, y: 0} 31 | - first: 32 | name: _DetailMask 33 | second: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - first: 38 | name: _DetailNormalMap 39 | second: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - first: 44 | name: _EmissionMap 45 | second: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - first: 50 | name: _MainTex 51 | second: 52 | m_Texture: {fileID: 2800000, guid: 69c23a9535a4c2143bdfda7b563b993a, type: 3} 53 | m_Scale: {x: 3, y: 3} 54 | m_Offset: {x: 0, y: 0} 55 | - first: 56 | name: _Occlusion 57 | second: 58 | m_Texture: {fileID: 2800000, guid: dbecf1615df1f4b4db1c8e05461a8386, type: 3} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | - first: 62 | name: _OcclusionMap 63 | second: 64 | m_Texture: {fileID: 2800000, guid: cda04cf139859604badb70af62700f4b, type: 3} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - first: 68 | name: _ParallaxMap 69 | second: 70 | m_Texture: {fileID: 0} 71 | m_Scale: {x: 1, y: 1} 72 | m_Offset: {x: 0, y: 0} 73 | - first: 74 | name: _SpecGlossMap 75 | second: 76 | m_Texture: {fileID: 2800000, guid: d452ac33fae6fb244852db7d01ed6251, type: 3} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | m_Floats: 80 | - first: 81 | name: _AlphaTestRef 82 | second: 0.5 83 | - first: 84 | name: _BumpScale 85 | second: 0.93 86 | - first: 87 | name: _Cutoff 88 | second: 0.5 89 | - first: 90 | name: _DetailNormalMapScale 91 | second: 1 92 | - first: 93 | name: _DstBlend 94 | second: 0 95 | - first: 96 | name: _EmissionScaleUI 97 | second: 1 98 | - first: 99 | name: _GlossMapScale 100 | second: 1 101 | - first: 102 | name: _Glossiness 103 | second: 0.054 104 | - first: 105 | name: _GlossyReflections 106 | second: 1 107 | - first: 108 | name: _Lightmapping 109 | second: 1 110 | - first: 111 | name: _Mode 112 | second: 0 113 | - first: 114 | name: _OcclusionStrength 115 | second: 1 116 | - first: 117 | name: _Parallax 118 | second: 0.02 119 | - first: 120 | name: _SmoothnessTextureChannel 121 | second: 0 122 | - first: 123 | name: _SpecularHighlights 124 | second: 1 125 | - first: 126 | name: _SrcBlend 127 | second: 1 128 | - first: 129 | name: _UVSec 130 | second: 0 131 | - first: 132 | name: _ZWrite 133 | second: 1 134 | m_Colors: 135 | - first: 136 | name: _Color 137 | second: {r: 0.6539837, g: 0.6693755, b: 0.70588624, a: 1} 138 | - first: 139 | name: _EmissionColor 140 | second: {r: 0, g: 0, b: 0, a: 0.99999994} 141 | - first: 142 | name: _EmissionColorUI 143 | second: {r: 0, g: 0, b: 0, a: 1} 144 | - first: 145 | name: _EmissionColorWithMapUI 146 | second: {r: 1, g: 1, b: 1, a: 1} 147 | - first: 148 | name: _SpecColor 149 | second: {r: 0.2, g: 0.2, b: 0.2, a: 1} 150 | - first: 151 | name: _SpecularColor 152 | second: {r: 0.18431373, g: 0.18431373, b: 0.18431373, a: 1} 153 | -------------------------------------------------------------------------------- /Assets/Test/Model/Materials/mat_plank_01.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ede9d35d37e165649ad928d519b4a91c 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/Test/Model/MazeLowMan.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/Assets/Test/Model/MazeLowMan.fbx -------------------------------------------------------------------------------- /Assets/Test/Model/prop_fence_01.fbx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/Assets/Test/Model/prop_fence_01.fbx -------------------------------------------------------------------------------- /Assets/Test/Model/prop_fence_01.fbx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61e0fad85ffca3d48af70c4ed4412dd4 3 | ModelImporter: 4 | serializedVersion: 18 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2300000: //RootNode 9 | 3300000: //RootNode 10 | 4300000: polySurface1 11 | 4300002: prop_fence_01 12 | 9500000: //RootNode 13 | materials: 14 | importMaterials: 0 15 | materialName: 0 16 | materialSearch: 1 17 | animations: 18 | legacyGenerateAnimations: 4 19 | bakeSimulation: 0 20 | optimizeGameObjects: 0 21 | motionNodeName: 22 | pivotNodeName: 23 | animationCompression: 1 24 | animationRotationError: .5 25 | animationPositionError: .5 26 | animationScaleError: .5 27 | animationWrapMode: 0 28 | extraExposedTransformPaths: [] 29 | clipAnimations: [] 30 | isReadable: 1 31 | meshes: 32 | lODScreenPercentages: [] 33 | globalScale: 1 34 | meshCompression: 0 35 | addColliders: 0 36 | importBlendShapes: 1 37 | swapUVChannels: 0 38 | generateSecondaryUV: 0 39 | useFileUnits: 1 40 | optimizeMeshForGPU: 1 41 | keepQuads: 0 42 | weldVertices: 1 43 | secondaryUVAngleDistortion: 8 44 | secondaryUVAreaDistortion: 15.000001 45 | secondaryUVHardAngle: 88 46 | secondaryUVPackMargin: 4 47 | useFileScale: 1 48 | tangentSpace: 49 | normalSmoothAngle: 60 50 | splitTangentsAcrossUV: 1 51 | normalImportMode: 0 52 | tangentImportMode: 1 53 | importAnimation: 1 54 | copyAvatar: 0 55 | humanDescription: 56 | human: [] 57 | skeleton: [] 58 | armTwist: .5 59 | foreArmTwist: .5 60 | upperLegTwist: .5 61 | legTwist: .5 62 | armStretch: .0500000007 63 | legStretch: .0500000007 64 | feetSpacing: 0 65 | rootMotionBoneName: 66 | lastHumanDescriptionAvatarSource: {instanceID: 0} 67 | animationType: 0 68 | additionalBone: 0 69 | userData: 70 | assetBundleName: 71 | -------------------------------------------------------------------------------- /Assets/Test/Rotation.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36f8afc7610865948813dbb62292bf95 3 | timeCreated: 1464242859 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Runner.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d33e9fc8d7e0b42c0a76e4fb47997577 3 | timeCreated: 1463717448 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Scroller.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | public class Scroller : MonoBehaviour 4 | { 5 | [SerializeField] float _speed = 1; 6 | [SerializeField] float _wrapPoint = 10; 7 | 8 | float _position; 9 | 10 | void Start() 11 | { 12 | _position = Vector3.Dot(transform.position, transform.forward); 13 | } 14 | 15 | void Update() 16 | { 17 | _position += Time.deltaTime * _speed; 18 | 19 | if (_position > _wrapPoint) _position -= _wrapPoint * 2; 20 | 21 | transform.position = transform.forward * _position; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Test/Scroller.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9b2e323884c32c5438a6b303575a27d0 3 | timeCreated: 1463726305 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/Test/Segment.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e6e70a098814914e8aa1c7dddc639a9 3 | timeCreated: 1463726512 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Static.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 181b500d5f4be9c46956ec8cc313ecfb 3 | timeCreated: 1464242859 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Texture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6629655ada3ae6c4497f7fbce0335582 3 | folderAsset: yes 4 | timeCreated: 1463728394 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Texture/LowManOcclusion.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/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/Texture/UV Test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/Assets/Test/Texture/UV Test.png -------------------------------------------------------------------------------- /Assets/Test/Texture/UV Test.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8560d420cafabc24a96f9719e811b213 3 | timeCreated: 1453256715 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: 8 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 | spriteTessellationDetail: -1 50 | textureType: -1 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | sprites: [] 54 | outline: [] 55 | spritePackingTag: 56 | userData: 57 | assetBundleName: 58 | assetBundleVariant: 59 | -------------------------------------------------------------------------------- /Assets/Test/Texture/wood_tiled_02_a.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/Assets/Test/Texture/wood_tiled_02_a.tif -------------------------------------------------------------------------------- /Assets/Test/Texture/wood_tiled_02_a.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69c23a9535a4c2143bdfda7b563b993a 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: 8 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/wood_tiled_02_n.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/Assets/Test/Texture/wood_tiled_02_n.tif -------------------------------------------------------------------------------- /Assets/Test/Texture/wood_tiled_02_n.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 017469a3ea9ca3e4ea89e14f79a6e221 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: 2 31 | aniso: 9 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/wood_tiled_02_o.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/Assets/Test/Texture/wood_tiled_02_o.tif -------------------------------------------------------------------------------- /Assets/Test/Texture/wood_tiled_02_o.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cda04cf139859604badb70af62700f4b 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: 2048 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: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/Test/Texture/wood_tiled_03_o.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/Assets/Test/Texture/wood_tiled_03_o.tif -------------------------------------------------------------------------------- /Assets/Test/Texture/wood_tiled_03_o.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbecf1615df1f4b4db1c8e05461a8386 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: 1024 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/sIBL Archive.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a96824f9803d243a38d56bc8eafbf755 3 | folderAsset: yes 4 | timeCreated: 1436690172 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/Acknowledgement.txt: -------------------------------------------------------------------------------- 1 | The HDR images in this directory are provided from sIBL Archive under the 2 | Creative Commons license (CC BY-NC-SA 3.0 US). Please see the page below for 3 | further details. 4 | 5 | http://www.hdrlabs.com/sibl/archive.html 6 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/Acknowledgement.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60bb4480dbb174616bc9731e372b3406 3 | timeCreated: 1436690642 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/MonValley_G_DirtRoad_3k.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KinoMotion/35d5d5179e60703d1db5eac967715f5ea416e387/Assets/sIBL Archive/MonValley_G_DirtRoad_3k.hdr -------------------------------------------------------------------------------- /Assets/sIBL Archive/MonValley_G_DirtRoad_3k.hdr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29182f375c0b2674fa35000e546dfa4c 3 | timeCreated: 1463725423 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: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | cubemapConvolutionSteps: 7 28 | cubemapConvolutionExponent: 1.5 29 | seamlessCubemap: 0 30 | textureFormat: -1 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: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaIsTransparency: 0 50 | spriteTessellationDetail: -1 51 | textureType: 3 52 | buildTargetSettings: [] 53 | spriteSheet: 54 | sprites: [] 55 | outline: [] 56 | spritePackingTag: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016, 2017 Keijiro Takahashi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /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 | m_VirtualizeEffects: 1 17 | -------------------------------------------------------------------------------- /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_SolverVelocityIterations: 1 14 | m_QueriesHitTriggers: 1 15 | m_EnableAdaptiveForce: 0 16 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 17 | -------------------------------------------------------------------------------- /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/Runner.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: 7 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_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_ShaderSettings_Tier1: 42 | useCascadedShadowMaps: 1 43 | standardShaderQuality: 2 44 | useReflectionProbeBoxProjection: 1 45 | useReflectionProbeBlending: 1 46 | m_ShaderSettings_Tier2: 47 | useCascadedShadowMaps: 1 48 | standardShaderQuality: 2 49 | useReflectionProbeBoxProjection: 1 50 | useReflectionProbeBlending: 1 51 | m_ShaderSettings_Tier3: 52 | useCascadedShadowMaps: 1 53 | standardShaderQuality: 2 54 | useReflectionProbeBoxProjection: 1 55 | useReflectionProbeBlending: 1 56 | m_BuildTargetShaderSettings: [] 57 | m_LightmapStripping: 0 58 | m_FogStripping: 0 59 | m_LightmapKeepPlain: 1 60 | m_LightmapKeepDirCombined: 1 61 | m_LightmapKeepDirSeparate: 1 62 | m_LightmapKeepDynamicPlain: 1 63 | m_LightmapKeepDynamicDirCombined: 1 64 | m_LightmapKeepDynamicDirSeparate: 1 65 | m_FogKeepLinear: 1 66 | m_FogKeepExp: 1 67 | m_FogKeepExp2: 1 68 | -------------------------------------------------------------------------------- /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_AlwaysShowColliders: 0 26 | m_ShowColliderSleep: 1 27 | m_ShowColliderContacts: 0 28 | m_ContactArrowScale: 0.2 29 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 30 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 31 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 32 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 33 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2017.1.1f1 2 | -------------------------------------------------------------------------------- /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: 2 14 | shadowProjection: 1 15 | shadowCascades: 1 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 | Nintendo 3DS: 0 38 | PS3: 0 39 | PS4: 0 40 | PSM: 0 41 | PSP2: 0 42 | Samsung TV: 0 43 | Standalone: 0 44 | Tizen: 0 45 | Web: 0 46 | WebGL: 0 47 | WiiU: 0 48 | Windows Store Apps: 0 49 | XBOX360: 0 50 | XboxOne: 0 51 | iPhone: 0 52 | tvOS: 0 53 | -------------------------------------------------------------------------------- /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.016666668 7 | Maximum Allowed Timestep: 1 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /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 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_Enabled: 0 14 | m_CaptureEditorExceptions: 1 15 | UnityPurchasingSettings: 16 | m_Enabled: 0 17 | m_TestMode: 0 18 | UnityAnalyticsSettings: 19 | m_Enabled: 0 20 | m_InitializeOnStartup: 1 21 | m_TestMode: 0 22 | m_TestEventUrl: 23 | m_TestConfigUrl: 24 | UnityAdsSettings: 25 | m_Enabled: 0 26 | m_InitializeOnStartup: 1 27 | m_TestMode: 0 28 | m_EnabledPlatforms: 4294967295 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | KinoMotion 2 | ========== 3 | 4 | **Motion** is a post-processing effect that simulates motion blur caused by 5 | object/camera movement. 6 | 7 | ![gif](https://i.imgur.com/UkJvWnc.gif) 8 | ![gif](https://i.imgur.com/tJioLuY.gif) 9 | 10 | System Requirements 11 | ------------------- 12 | 13 | - Unity 2017.1 or later 14 | - [Motion vector texture] support 15 | 16 | Rendering motion vector texture requires the RGHalf texture format. It's 17 | supported on most of the desktop/console platform, but rarely supported on the 18 | mobile devices. 19 | 20 | [Motion vector texture]: http://docs.unity3d.com/ScriptReference/DepthTextureMode.MotionVectors.html 21 | 22 | Installation 23 | ------------ 24 | 25 | Download one of the unitypackage files from the [Releases] page and import it 26 | to the project. 27 | 28 | [Releases]: https://github.com/keijiro/KinoMotion/releases 29 | 30 | License 31 | ------- 32 | 33 | [MIT](LICENSE.txt) 34 | --------------------------------------------------------------------------------