├── .gitattributes ├── .gitignore ├── Assets ├── CalibrationScene.meta ├── CalibrationScene │ ├── SceneMaterials.meta │ ├── SceneMaterials │ │ ├── CalibrationFloor.mat │ │ └── CalibrationFloor.mat.meta │ ├── SceneTextures.meta │ └── SceneTextures │ │ ├── CalibrationFloorDiffuse.tif │ │ ├── CalibrationFloorDiffuse.tif.meta │ │ ├── CalibrationFloorNormals.tif │ │ ├── CalibrationFloorNormals.tif.meta │ │ ├── CalibrationFloorSpecularGloss.tif │ │ └── CalibrationFloorSpecularGloss.tif.meta ├── ColorSuite.meta ├── ColorSuite │ ├── ColorSuite.cs │ ├── ColorSuite.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── ColorSuiteEditor.cs │ │ └── ColorSuiteEditor.cs.meta │ ├── Shader.meta │ └── Shader │ │ ├── ColorSuite.shader │ │ └── ColorSuite.shader.meta ├── DeferredAO.meta ├── DeferredAO │ ├── DeferredAO.cs │ ├── DeferredAO.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── DeferredAOEditor.cs │ │ └── DeferredAOEditor.cs.meta │ ├── Shader.meta │ └── Shader │ │ ├── DeferredAO.shader │ │ └── DeferredAO.shader.meta ├── Editor.meta ├── Editor │ ├── PackageTool.cs │ └── PackageTool.cs.meta ├── Kino.meta ├── Kino │ ├── Vignette.meta │ └── Vignette │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── VignetteEditor.cs │ │ └── VignetteEditor.cs.meta │ │ ├── Shader.meta │ │ ├── Shader │ │ ├── Vignette.shader │ │ └── Vignette.shader.meta │ │ ├── Vignette.cs │ │ └── Vignette.cs.meta ├── Kvant.meta ├── Kvant │ ├── Swarm.meta │ └── Swarm │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── SwarmEditor.cs │ │ └── SwarmEditor.cs.meta │ │ ├── Shaders.meta │ │ ├── Shaders │ │ ├── Kernel.shader │ │ ├── Kernel.shader.meta │ │ ├── SimplexNoiseGrad3D.cginc │ │ ├── SimplexNoiseGrad3D.cginc.meta │ │ ├── Surface.shader │ │ └── Surface.shader.meta │ │ ├── Swarm.cs │ │ └── Swarm.cs.meta ├── Reaktion.meta ├── Reaktion │ ├── Editor.meta │ ├── Editor │ │ ├── Utility.meta │ │ └── Utility │ │ │ ├── ConstantMotionEditor.cs │ │ │ ├── ConstantMotionEditor.cs.meta │ │ │ ├── JitterMotionEditor.cs │ │ │ └── JitterMotionEditor.cs.meta │ ├── Internal.meta │ ├── Internal │ │ ├── Perlin.cs │ │ └── Perlin.cs.meta │ ├── Utility.meta │ └── Utility │ │ ├── ConstantMotion.cs │ │ ├── ConstantMotion.cs.meta │ │ ├── JitterMotion.cs │ │ └── JitterMotion.cs.meta ├── Test.meta └── Test │ ├── Attractor.unity │ ├── Attractor.unity.meta │ ├── Flow.unity │ ├── Flow.unity.meta │ ├── Skybox.mat │ ├── Skybox.mat.meta │ ├── TropicalRuins_Env.hdr │ └── TropicalRuins_Env.hdr.meta ├── KvantSwarm.unitypackage ├── ProjectSettings ├── AudioManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityAnalyticsManager.asset └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Unity 2 | Library 3 | Temp 4 | *.pidb 5 | *.userprefs 6 | 7 | # Misc 8 | *.swp 9 | *.lnk 10 | .DS_Store 11 | Thumbs.db 12 | -------------------------------------------------------------------------------- /Assets/CalibrationScene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46fd800d5f1fa43b7a750561c38ce8d0 3 | folderAsset: yes 4 | timeCreated: 1431961201 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/CalibrationScene/SceneMaterials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78e1198a906f74f6e90080ecd5c662bb 3 | folderAsset: yes 4 | timeCreated: 1431961201 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/CalibrationScene/SceneMaterials/CalibrationFloor.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: CalibrationFloor 10 | m_Shader: {fileID: 45, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _DETAIL_MULX2 _LIGHTMAPPING_DYNAMIC_LIGHTMAPS _LIGHTMAPPING_REALTIME 12 | _NORMALMAP _SPECGLOSSMAP _UVSEC_UV1 13 | m_LightmapFlags: 5 14 | m_CustomRenderQueue: -1 15 | stringTagMap: {} 16 | m_SavedProperties: 17 | serializedVersion: 2 18 | m_TexEnvs: 19 | data: 20 | first: 21 | name: _MainTex 22 | second: 23 | m_Texture: {fileID: 2800000, guid: ca7ba913502c8bb44a66350131805326, type: 3} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | data: 27 | first: 28 | name: _BumpMap 29 | second: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | data: 34 | first: 35 | name: _DetailNormalMap 36 | second: 37 | m_Texture: {fileID: 2800000, guid: 768fa469bdce74c4984c44cbb180b832, type: 3} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | data: 41 | first: 42 | name: _ParallaxMap 43 | second: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | data: 48 | first: 49 | name: _OcclusionMap 50 | second: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | data: 55 | first: 56 | name: _EmissionMap 57 | second: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | data: 62 | first: 63 | name: _DetailMask 64 | second: 65 | m_Texture: {fileID: 0} 66 | m_Scale: {x: 1, y: 1} 67 | m_Offset: {x: 0, y: 0} 68 | data: 69 | first: 70 | name: _DetailAlbedoMap 71 | second: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 10, y: 10} 74 | m_Offset: {x: 0, y: 0} 75 | data: 76 | first: 77 | name: _Occlusion 78 | second: 79 | m_Texture: {fileID: 0} 80 | m_Scale: {x: 1, y: 1} 81 | m_Offset: {x: 0, y: 0} 82 | data: 83 | first: 84 | name: _SpecGlossMap 85 | second: 86 | m_Texture: {fileID: 2800000, guid: 6185fa454db669040887c980e20126fe, type: 3} 87 | m_Scale: {x: 1, y: 1} 88 | m_Offset: {x: 0, y: 0} 89 | m_Floats: 90 | data: 91 | first: 92 | name: _SrcBlend 93 | second: 1 94 | data: 95 | first: 96 | name: _DstBlend 97 | second: 0 98 | data: 99 | first: 100 | name: _Cutoff 101 | second: .5 102 | data: 103 | first: 104 | name: _AlphaTestRef 105 | second: .5 106 | data: 107 | first: 108 | name: _Parallax 109 | second: .0199999996 110 | data: 111 | first: 112 | name: _ZWrite 113 | second: 1 114 | data: 115 | first: 116 | name: _Glossiness 117 | second: .349999994 118 | data: 119 | first: 120 | name: _BumpScale 121 | second: 1 122 | data: 123 | first: 124 | name: _OcclusionStrength 125 | second: 1 126 | data: 127 | first: 128 | name: _DetailNormalMapScale 129 | second: .300000012 130 | data: 131 | first: 132 | name: _UVSec 133 | second: 0 134 | data: 135 | first: 136 | name: _Mode 137 | second: 0 138 | data: 139 | first: 140 | name: _Lightmapping 141 | second: 1 142 | data: 143 | first: 144 | name: _EmissionScaleUI 145 | second: 1 146 | m_Colors: 147 | data: 148 | first: 149 | name: _EmissionColor 150 | second: {r: 0, g: 0, b: 0, a: .99999994} 151 | data: 152 | first: 153 | name: _Color 154 | second: {r: .705882311, g: .705882311, b: .705882311, a: 1} 155 | data: 156 | first: 157 | name: _SpecColor 158 | second: {r: .200000003, g: .200000003, b: .200000003, a: 1} 159 | data: 160 | first: 161 | name: _EmissionColorUI 162 | second: {r: 0, g: 0, b: 0, a: 1} 163 | data: 164 | first: 165 | name: _EmissionColorWithMapUI 166 | second: {r: 1, g: 1, b: 1, a: 1} 167 | data: 168 | first: 169 | name: _SpecularColor 170 | second: {r: .117647059, g: .117647059, b: .117647059, a: 1} 171 | -------------------------------------------------------------------------------- /Assets/CalibrationScene/SceneMaterials/CalibrationFloor.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d681c1d72c3c16149abd2f0f25ca628c 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/CalibrationScene/SceneTextures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8db59fd370a304ccd9a3edeb5b8c7334 3 | folderAsset: yes 4 | timeCreated: 1431961201 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/CalibrationScene/SceneTextures/CalibrationFloorDiffuse.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantSwarm/932bb30f70942143c591070be0d1d1e9504125a2/Assets/CalibrationScene/SceneTextures/CalibrationFloorDiffuse.tif -------------------------------------------------------------------------------- /Assets/CalibrationScene/SceneTextures/CalibrationFloorDiffuse.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca7ba913502c8bb44a66350131805326 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: 3 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | allowsAlphaSplitting: 0 39 | spriteMode: 0 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 0 47 | textureType: -1 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | assetBundleVariant: 55 | -------------------------------------------------------------------------------- /Assets/CalibrationScene/SceneTextures/CalibrationFloorNormals.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantSwarm/932bb30f70942143c591070be0d1d1e9504125a2/Assets/CalibrationScene/SceneTextures/CalibrationFloorNormals.tif -------------------------------------------------------------------------------- /Assets/CalibrationScene/SceneTextures/CalibrationFloorNormals.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 768fa469bdce74c4984c44cbb180b832 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: 512 29 | textureSettings: 30 | filterMode: 2 31 | aniso: 3 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | allowsAlphaSplitting: 0 39 | spriteMode: 0 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 0 47 | textureType: 1 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | assetBundleVariant: 55 | -------------------------------------------------------------------------------- /Assets/CalibrationScene/SceneTextures/CalibrationFloorSpecularGloss.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantSwarm/932bb30f70942143c591070be0d1d1e9504125a2/Assets/CalibrationScene/SceneTextures/CalibrationFloorSpecularGloss.tif -------------------------------------------------------------------------------- /Assets/CalibrationScene/SceneTextures/CalibrationFloorSpecularGloss.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6185fa454db669040887c980e20126fe 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: 3 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | allowsAlphaSplitting: 0 39 | spriteMode: 0 40 | spriteExtrude: 1 41 | spriteMeshType: 1 42 | alignment: 0 43 | spritePivot: {x: .5, y: .5} 44 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 45 | spritePixelsToUnits: 100 46 | alphaIsTransparency: 0 47 | textureType: -1 48 | buildTargetSettings: [] 49 | spriteSheet: 50 | sprites: [] 51 | spritePackingTag: 52 | userData: 53 | assetBundleName: 54 | assetBundleVariant: 55 | -------------------------------------------------------------------------------- /Assets/ColorSuite.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92b634cb636824bfb98b32d3fc16d5c4 3 | folderAsset: yes 4 | timeCreated: 1437379338 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ColorSuite/ColorSuite.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2014, 2015 Keijiro Takahashi 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | // this software and associated documentation files (the "Software"), to deal in 6 | // the Software without restriction, including without limitation the rights to 7 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | // the Software, and to permit persons to whom the Software is furnished to do so, 9 | // subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | // 21 | using UnityEngine; 22 | using System.Collections; 23 | 24 | [ExecuteInEditMode] 25 | [ImageEffectTransformsToLDR] 26 | [RequireComponent(typeof(Camera))] 27 | [AddComponentMenu("Image Effects/Color Adjustments/Color Suite")] 28 | public class ColorSuite : MonoBehaviour 29 | { 30 | #region Public Properties 31 | 32 | // White balance. 33 | [SerializeField] float _colorTemp = 0.0f; 34 | [SerializeField] float _colorTint = 0.0f; 35 | 36 | public float colorTemp { 37 | get { return _colorTemp; } 38 | set { _colorTemp = value; } 39 | } 40 | public float colorTint { 41 | get { return _colorTint; } 42 | set { _colorTint = value; } 43 | } 44 | 45 | // Tone mapping. 46 | [SerializeField] bool _toneMapping = false; 47 | [SerializeField] float _exposure = 1.0f; 48 | 49 | public bool toneMapping { 50 | get { return _toneMapping; } 51 | set { _toneMapping = value; } 52 | } 53 | public float exposure { 54 | get { return _exposure; } 55 | set { _exposure = value; } 56 | } 57 | 58 | // Color saturation. 59 | [SerializeField] float _saturation = 1.0f; 60 | 61 | public float saturation { 62 | get { return _saturation; } 63 | set { _saturation = value; } 64 | } 65 | 66 | // Curves. 67 | [SerializeField] AnimationCurve _rCurve = AnimationCurve.Linear(0, 0, 1, 1); 68 | [SerializeField] AnimationCurve _gCurve = AnimationCurve.Linear(0, 0, 1, 1); 69 | [SerializeField] AnimationCurve _bCurve = AnimationCurve.Linear(0, 0, 1, 1); 70 | [SerializeField] AnimationCurve _cCurve = AnimationCurve.Linear(0, 0, 1, 1); 71 | 72 | public AnimationCurve redCurve { 73 | get { return _rCurve; } 74 | set { _rCurve = value; UpdateLUT(); } 75 | } 76 | public AnimationCurve greenCurve { 77 | get { return _gCurve; } 78 | set { _gCurve = value; UpdateLUT(); } 79 | } 80 | public AnimationCurve blueCurve { 81 | get { return _bCurve; } 82 | set { _bCurve = value; UpdateLUT(); } 83 | } 84 | public AnimationCurve rgbCurve { 85 | get { return _cCurve; } 86 | set { _cCurve = value; UpdateLUT(); } 87 | } 88 | 89 | // Dithering. 90 | public enum DitherMode { Off, Ordered, Triangular } 91 | [SerializeField] DitherMode _ditherMode = DitherMode.Off; 92 | 93 | public DitherMode ditherMode { 94 | get { return _ditherMode; } 95 | set { _ditherMode = value; } 96 | } 97 | 98 | #endregion 99 | 100 | #region Internal Properties 101 | 102 | // Reference to the shader. 103 | [SerializeField] Shader shader; 104 | 105 | // Temporary objects. 106 | Material _material; 107 | Texture2D _lutTexture; 108 | 109 | #endregion 110 | 111 | #region Local Functions 112 | 113 | // RGBM encoding. 114 | static Color EncodeRGBM(float r, float g, float b) 115 | { 116 | var a = Mathf.Max(Mathf.Max(r, g), Mathf.Max(b, 1e-6f)); 117 | a = Mathf.Ceil(a * 255) / 255; 118 | return new Color(r / a, g / a, b / a, a); 119 | } 120 | 121 | // An analytical model of chromaticity of the standard illuminant, by Judd et al. 122 | // http://en.wikipedia.org/wiki/Standard_illuminant#Illuminant_series_D 123 | // Slightly modifed to adjust it with the D65 white point (x=0.31271, y=0.32902). 124 | static float StandardIlluminantY(float x) 125 | { 126 | return 2.87f * x - 3.0f * x * x - 0.27509507f; 127 | } 128 | 129 | // CIE xy chromaticity to CAT02 LMS. 130 | // http://en.wikipedia.org/wiki/LMS_color_space#CAT02 131 | static Vector3 CIExyToLMS(float x, float y) 132 | { 133 | var Y = 1.0f; 134 | var X = Y * x / y; 135 | var Z = Y * (1.0f - x - y) / y; 136 | 137 | var L = 0.7328f * X + 0.4296f * Y - 0.1624f * Z; 138 | var M = -0.7036f * X + 1.6975f * Y + 0.0061f * Z; 139 | var S = 0.0030f * X + 0.0136f * Y + 0.9834f * Z; 140 | 141 | return new Vector3(L, M, S); 142 | } 143 | 144 | #endregion 145 | 146 | #region Private Methods 147 | 148 | // Set up the temporary assets. 149 | void Setup() 150 | { 151 | if (_material == null) 152 | { 153 | _material = new Material(shader); 154 | _material.hideFlags = HideFlags.DontSave; 155 | } 156 | 157 | if (_lutTexture == null) 158 | { 159 | _lutTexture = new Texture2D(512, 1, TextureFormat.ARGB32, false, true); 160 | _lutTexture.hideFlags = HideFlags.DontSave; 161 | _lutTexture.wrapMode = TextureWrapMode.Clamp; 162 | UpdateLUT(); 163 | } 164 | } 165 | 166 | // Update the LUT texture. 167 | void UpdateLUT() 168 | { 169 | for (var x = 0; x < _lutTexture.width; x++) 170 | { 171 | var u = 1.0f / (_lutTexture.width - 1) * x; 172 | var r = _cCurve.Evaluate(_rCurve.Evaluate(u)); 173 | var g = _cCurve.Evaluate(_gCurve.Evaluate(u)); 174 | var b = _cCurve.Evaluate(_bCurve.Evaluate(u)); 175 | _lutTexture.SetPixel(x, 0, EncodeRGBM(r, g, b)); 176 | } 177 | _lutTexture.Apply(); 178 | } 179 | 180 | // Calculate the color balance coefficients. 181 | Vector3 CalculateColorBalance() 182 | { 183 | // Get the CIE xy chromaticity of the reference white point. 184 | // Note: 0.31271 = x value on the D65 white point 185 | var x = 0.31271f - _colorTemp * (_colorTemp < 0.0f ? 0.1f : 0.05f); 186 | var y = StandardIlluminantY(x) + _colorTint * 0.05f; 187 | 188 | // Calculate the coefficients in the LMS space. 189 | var w1 = new Vector3(0.949237f, 1.03542f, 1.08728f); // D65 white point 190 | var w2 = CIExyToLMS(x, y); 191 | return new Vector3(w1.x / w2.x, w1.y / w2.y, w1.z / w2.z); 192 | } 193 | 194 | #endregion 195 | 196 | #region Monobehaviour Functions 197 | 198 | void Start() 199 | { 200 | Setup(); 201 | } 202 | 203 | void OnValidate() 204 | { 205 | Setup(); 206 | UpdateLUT(); 207 | } 208 | 209 | void Reset() 210 | { 211 | Setup(); 212 | UpdateLUT(); 213 | } 214 | 215 | void OnRenderImage(RenderTexture source, RenderTexture destination) 216 | { 217 | var linear = QualitySettings.activeColorSpace == ColorSpace.Linear; 218 | 219 | Setup(); 220 | 221 | if (linear) 222 | _material.EnableKeyword("COLORSPACE_LINEAR"); 223 | else 224 | _material.DisableKeyword("COLORSPACE_LINEAR"); 225 | 226 | if (_colorTemp != 0.0f || _colorTint != 0.0f) 227 | { 228 | _material.EnableKeyword("BALANCING_ON"); 229 | _material.SetVector("_Balance", CalculateColorBalance()); 230 | } 231 | else 232 | _material.DisableKeyword("BALANCING_ON"); 233 | 234 | if (_toneMapping && linear) 235 | { 236 | _material.EnableKeyword("TONEMAPPING_ON"); 237 | _material.SetFloat("_Exposure", _exposure); 238 | } 239 | else 240 | _material.DisableKeyword("TONEMAPPING_ON"); 241 | 242 | _material.SetTexture("_Curves", _lutTexture); 243 | _material.SetFloat("_Saturation", _saturation); 244 | 245 | if (_ditherMode == DitherMode.Ordered) 246 | { 247 | _material.EnableKeyword("DITHER_ORDERED"); 248 | _material.DisableKeyword("DITHER_TRIANGULAR"); 249 | } 250 | else if (_ditherMode == DitherMode.Triangular) 251 | { 252 | _material.DisableKeyword("DITHER_ORDERED"); 253 | _material.EnableKeyword("DITHER_TRIANGULAR"); 254 | } 255 | else 256 | { 257 | _material.DisableKeyword("DITHER_ORDERED"); 258 | _material.DisableKeyword("DITHER_TRIANGULAR"); 259 | } 260 | 261 | Graphics.Blit(source, destination, _material); 262 | } 263 | 264 | #endregion 265 | } 266 | -------------------------------------------------------------------------------- /Assets/ColorSuite/ColorSuite.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10593b7d510b64560a297a8af1356dcb 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: 6 | - shader: {fileID: 4800000, guid: dc9775b65c52747e69fc4c854c00d696, type: 3} 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/ColorSuite/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd386d94948a6489a9baa003c1f5b171 3 | folderAsset: yes 4 | timeCreated: 1437379338 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: 4911ca47559e444a8aa3e74b16a42ce1 3 | folderAsset: yes 4 | timeCreated: 1437379338 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ColorSuite/Shader/ColorSuite.shader: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2014, 2015 Keijiro Takahashi 3 | // 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | // this software and associated documentation files (the "Software"), to deal in 6 | // the Software without restriction, including without limitation the rights to 7 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 8 | // the Software, and to permit persons to whom the Software is furnished to do so, 9 | // subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all 12 | // copies or substantial portions of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 16 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 17 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 | // 21 | 22 | Shader "Hidden/ColorSuite" 23 | { 24 | Properties 25 | { 26 | _MainTex ("-", 2D) = ""{} 27 | _Curves ("-", 2D) = ""{} 28 | _Exposure ("-", Float) = 1.0 29 | _Saturation ("-", Float) = 1.0 30 | _Balance ("-", Vector) = (1, 1, 1, 0) 31 | } 32 | 33 | CGINCLUDE 34 | 35 | // Multi-compilation options. 36 | #pragma multi_compile COLORSPACE_SRGB COLORSPACE_LINEAR 37 | #pragma multi_compile BALANCING_OFF BALANCING_ON 38 | #pragma multi_compile TONEMAPPING_OFF TONEMAPPING_ON 39 | #pragma multi_compile DITHER_OFF DITHER_ORDERED DITHER_TRIANGULAR 40 | 41 | #include "UnityCG.cginc" 42 | 43 | sampler2D _MainTex; 44 | float2 _MainTex_TexelSize; 45 | sampler2D _Curves; 46 | float _Exposure; 47 | float _Saturation; 48 | float4 _Balance; 49 | 50 | #if COLORSPACE_LINEAR 51 | 52 | // Color space conversion between sRGB and linear space. 53 | // http://chilliant.blogspot.com/2012/08/srgb-approximations-for-hlsl.html 54 | 55 | float3 srgb_to_linear(float3 c) 56 | { 57 | return c * (c * (c * 0.305306011 + 0.682171111) + 0.012522878); 58 | } 59 | 60 | float3 linear_to_srgb(float3 c) 61 | { 62 | return max(1.055 * pow(c, 0.416666667) - 0.055, 0.0); 63 | } 64 | 65 | #endif 66 | 67 | #if BALANCING_ON 68 | 69 | // Color space conversion between linear RGB and LMS 70 | // based on the CIECAM02 model (CAT02). 71 | // http://en.wikipedia.org/wiki/LMS_color_space#CAT02 72 | 73 | float3 lrgb_to_lms(float3 c) 74 | { 75 | float3x3 m = { 76 | 3.90405e-1f, 5.49941e-1f, 8.92632e-3f, 77 | 7.08416e-2f, 9.63172e-1f, 1.35775e-3f, 78 | 2.31082e-2f, 1.28021e-1f, 9.36245e-1f 79 | }; 80 | return mul(m, c); 81 | } 82 | 83 | float3 lms_to_lrgb(float3 c) 84 | { 85 | float3x3 m = { 86 | 2.85847e+0f, -1.62879e+0f, -2.48910e-2f, 87 | -2.10182e-1f, 1.15820e+0f, 3.24281e-4f, 88 | -4.18120e-2f, -1.18169e-1f, 1.06867e+0f 89 | }; 90 | return mul(m, c); 91 | } 92 | 93 | // Color balance function. 94 | // - The gamma compression/expansion equation used in this function 95 | // differs from the standard sRGB-Linear conversion. 96 | 97 | float3 apply_balance(float3 c) 98 | { 99 | #if !COLORSPACE_LINEAR 100 | // Do the gamma expansion before applying the color balance. 101 | c = pow(c, 2.2); 102 | #endif 103 | 104 | // Apply the color balance in the LMS color space. 105 | c = lms_to_lrgb(lrgb_to_lms(c) * _Balance); 106 | 107 | // It may return a minus value, which should be cropped out. 108 | c = max(c, 0.0); 109 | 110 | #if !COLORSPACE_LINEAR 111 | // Gamma compression. 112 | c = pow(c, 1.0 / 2.2); 113 | #endif 114 | 115 | return c; 116 | } 117 | 118 | #endif 119 | 120 | #if TONEMAPPING_ON 121 | 122 | // John Hable's filmic tone mapping operator. 123 | // http://filmicgames.com/archives/6 124 | 125 | float3 hable_op(float3 c) 126 | { 127 | float A = 0.15; 128 | float B = 0.50; 129 | float C = 0.10; 130 | float D = 0.20; 131 | float E = 0.02; 132 | float F = 0.30; 133 | return ((c * (c * A + B * C) + D * E) / (c * (c * A + B) + D * F)) - E / F; 134 | } 135 | 136 | float3 tone_mapping(float3 c) 137 | { 138 | c *= _Exposure * 4; 139 | c = hable_op(c) / hable_op(11.2); 140 | return pow(c, 1 / 2.2); 141 | } 142 | 143 | #endif 144 | 145 | // Color saturation. 146 | 147 | float luma(float3 c) 148 | { 149 | return 0.212 * c.r + 0.701 * c.g + 0.087 * c.b; 150 | } 151 | 152 | float3 apply_saturation(float3 c) 153 | { 154 | return lerp((float3)luma(c), c, _Saturation); 155 | } 156 | 157 | // RGB curves. 158 | 159 | float3 apply_curves(float3 c) 160 | { 161 | float4 r = tex2D(_Curves, float2(c.r, 0)); 162 | float4 g = tex2D(_Curves, float2(c.g, 0)); 163 | float4 b = tex2D(_Curves, float2(c.b, 0)); 164 | return float3(r.r * r.a, g.g * g.a, b.b * b.a); 165 | } 166 | 167 | #if DITHER_ORDERED 168 | 169 | // Interleaved gradient function from CoD AW. 170 | // http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare 171 | 172 | float interleaved_gradient(float2 uv) 173 | { 174 | float3 magic = float3(0.06711056, 0.00583715, 52.9829189); 175 | return frac(magic.z * frac(dot(uv, magic.xy))); 176 | } 177 | 178 | float3 dither(float2 uv) 179 | { 180 | return (float3)(interleaved_gradient(uv / _MainTex_TexelSize) / 255); 181 | } 182 | 183 | #endif 184 | 185 | #if DITHER_TRIANGULAR 186 | 187 | // Triangular PDF. 188 | 189 | float nrand(float2 uv) 190 | { 191 | return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453); 192 | } 193 | 194 | float3 dither(float2 uv) 195 | { 196 | float r = nrand(uv) + nrand(uv + (float2)1.1) - 0.5; 197 | return (float3)(r / 255); 198 | } 199 | 200 | #endif 201 | 202 | float4 frag(v2f_img i) : SV_Target 203 | { 204 | float4 source = tex2D(_MainTex, i.uv); 205 | float3 rgb = source.rgb; 206 | 207 | #if BALANCING_ON 208 | rgb = apply_balance(rgb); 209 | #endif 210 | 211 | #if COLORSPACE_LINEAR 212 | #if TONEMAPPING_ON 213 | // Apply the tone mapping. 214 | rgb = tone_mapping(rgb); 215 | #else 216 | // Convert the color into the sRGB color space. 217 | rgb = linear_to_srgb(rgb); 218 | #endif 219 | #endif 220 | 221 | // Color saturation. 222 | rgb = apply_saturation(rgb); 223 | 224 | // RGB curves. 225 | rgb = apply_curves(rgb); 226 | 227 | #if !DITHER_OFF 228 | rgb += dither(i.uv); 229 | #endif 230 | 231 | #if COLORSPACE_LINEAR 232 | // Take the color back into the linear color space. 233 | rgb = srgb_to_linear(rgb); 234 | #endif 235 | 236 | return float4(rgb, source.a); 237 | } 238 | 239 | ENDCG 240 | 241 | Subshader 242 | { 243 | Pass 244 | { 245 | ZTest Always Cull Off ZWrite Off 246 | Fog { Mode off } 247 | CGPROGRAM 248 | #pragma target 3.0 249 | #pragma glsl 250 | #pragma vertex vert_img 251 | #pragma fragment frag 252 | ENDCG 253 | } 254 | } 255 | } 256 | -------------------------------------------------------------------------------- /Assets/ColorSuite/Shader/ColorSuite.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc9775b65c52747e69fc4c854c00d696 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/DeferredAO.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9228dd6c5f1bc426abef4bf88e9ce584 3 | folderAsset: yes 4 | timeCreated: 1435398751 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DeferredAO/DeferredAO.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Deferred AO - SSAO image effect for deferred shading 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 | [ExecuteInEditMode] 26 | [RequireComponent(typeof(Camera))] 27 | [AddComponentMenu("Image Effects/Rendering/Deferred AO")] 28 | public class DeferredAO : MonoBehaviour 29 | { 30 | #region Public Properties 31 | 32 | // Effect intensity 33 | 34 | [SerializeField] 35 | float _intensity = 1; 36 | 37 | public float intensity { 38 | get { return _intensity; } 39 | set { _intensity = value; } 40 | } 41 | 42 | // Sample radius 43 | 44 | [SerializeField] 45 | float _sampleRadius = 1; 46 | 47 | public float sampleRadius { 48 | get { return _sampleRadius; } 49 | set { _sampleRadius = value; } 50 | } 51 | 52 | // Range check (rejects distant samples) 53 | 54 | [SerializeField] 55 | bool _rangeCheck = true; 56 | 57 | public bool rangeCheck { 58 | get { return _rangeCheck; } 59 | set { _rangeCheck = value; } 60 | } 61 | 62 | // Fall-off distance 63 | 64 | [SerializeField] 65 | float _fallOffDistance = 100; 66 | 67 | public float fallOffDistance { 68 | get { return _fallOffDistance; } 69 | set { _fallOffDistance = value; } 70 | } 71 | 72 | // Sample count 73 | 74 | public enum SampleCount { Low, Medium, High, Overkill } 75 | 76 | [SerializeField] 77 | SampleCount _sampleCount = SampleCount.Medium; 78 | 79 | public SampleCount sampleCount { 80 | get { return _sampleCount; } 81 | set { _sampleCount = value; } 82 | } 83 | 84 | #endregion 85 | 86 | #region Private Resources 87 | 88 | [SerializeField] 89 | Shader _shader; 90 | 91 | Material _material; 92 | 93 | bool CheckDeferredShading() 94 | { 95 | var path = GetComponent().actualRenderingPath; 96 | return path == RenderingPath.DeferredShading; 97 | } 98 | 99 | #endregion 100 | 101 | #region MonoBehaviour Functions 102 | 103 | [ImageEffectOpaque] 104 | void OnRenderImage(RenderTexture source, RenderTexture destination) 105 | { 106 | if (!CheckDeferredShading()) { 107 | Graphics.Blit(source, destination); 108 | return; 109 | } 110 | 111 | if (_material == null) { 112 | _material = new Material(_shader); 113 | _material.hideFlags = HideFlags.DontSave; 114 | } 115 | 116 | _material.SetFloat("_Radius", _sampleRadius); 117 | _material.SetFloat("_Intensity", _intensity); 118 | _material.SetFloat("_FallOff", _fallOffDistance); 119 | 120 | _material.shaderKeywords = null; 121 | 122 | if (_rangeCheck) 123 | _material.EnableKeyword("_RANGE_CHECK"); 124 | 125 | if (_sampleCount == SampleCount.Medium) 126 | _material.EnableKeyword("_SAMPLE_MEDIUM"); 127 | else if (_sampleCount == SampleCount.High) 128 | _material.EnableKeyword("_SAMPLE_HIGH"); 129 | else if (_sampleCount == SampleCount.Overkill) 130 | _material.EnableKeyword("_SAMPLE_OVERKILL"); 131 | 132 | Graphics.Blit(source, destination, _material, 0); 133 | } 134 | 135 | #endregion 136 | } 137 | -------------------------------------------------------------------------------- /Assets/DeferredAO/DeferredAO.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f6a516d891854931acf7fb785c812ec 3 | timeCreated: 1435398836 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _shader: {fileID: 4800000, guid: c928e16c12e994a70928a9181450d18c, type: 3} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/DeferredAO/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 86aa7a07c1e4f4d8d93c38a39c302fd2 3 | folderAsset: yes 4 | timeCreated: 1435499990 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DeferredAO/Editor/DeferredAOEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Deferred AO - SSAO image effect for deferred shading 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 | [CanEditMultipleObjects] 27 | [CustomEditor(typeof(DeferredAO))] 28 | public class DeferredAOEditor : Editor 29 | { 30 | SerializedProperty _intensity; 31 | SerializedProperty _sampleRadius; 32 | SerializedProperty _rangeCheck; 33 | SerializedProperty _fallOffDistance; 34 | SerializedProperty _sampleCount; 35 | 36 | void OnEnable() 37 | { 38 | _intensity = serializedObject.FindProperty("_intensity"); 39 | _sampleRadius = serializedObject.FindProperty("_sampleRadius"); 40 | _rangeCheck = serializedObject.FindProperty("_rangeCheck"); 41 | _fallOffDistance = serializedObject.FindProperty("_fallOffDistance"); 42 | _sampleCount = serializedObject.FindProperty("_sampleCount"); 43 | } 44 | 45 | bool CheckDisabled() 46 | { 47 | var cam = ((DeferredAO)target).GetComponent(); 48 | return cam.actualRenderingPath != RenderingPath.DeferredShading; 49 | } 50 | 51 | public override void OnInspectorGUI() 52 | { 53 | serializedObject.Update(); 54 | 55 | if (CheckDisabled()) 56 | { 57 | var text = "To enable the effect, change Rendering Path to Deferred."; 58 | EditorGUILayout.HelpBox(text, MessageType.Warning); 59 | } 60 | else 61 | { 62 | EditorGUILayout.PropertyField(_intensity); 63 | EditorGUILayout.PropertyField(_sampleRadius); 64 | EditorGUILayout.PropertyField(_rangeCheck); 65 | EditorGUILayout.PropertyField(_fallOffDistance); 66 | EditorGUILayout.PropertyField(_sampleCount); 67 | } 68 | 69 | serializedObject.ApplyModifiedProperties(); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Assets/DeferredAO/Editor/DeferredAOEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc11bf4e6f30c46d98811ebcbab0bf98 3 | timeCreated: 1435500000 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/DeferredAO/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f49a98fd01d54b5893810f5bd1bcdd3 3 | folderAsset: yes 4 | timeCreated: 1435499972 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/DeferredAO/Shader/DeferredAO.shader: -------------------------------------------------------------------------------- 1 | // 2 | // Deferred AO - SSAO image effect for deferred shading 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/DeferredAO" 24 | { 25 | Properties 26 | { 27 | _MainTex("-", 2D) = "" {} 28 | } 29 | CGINCLUDE 30 | 31 | #include "UnityCG.cginc" 32 | 33 | #pragma multi_compile _ _RANGE_CHECK 34 | #pragma multi_compile _SAMPLE_LOW _SAMPLE_MEDIUM _SAMPLE_HIGH _SAMPLE_OVERKILL 35 | 36 | sampler2D _MainTex; 37 | float2 _MainTex_TexelSize; 38 | 39 | sampler2D_float _CameraDepthTexture; 40 | sampler2D _CameraGBufferTexture2; 41 | float4x4 _WorldToCamera; 42 | 43 | float _Intensity; 44 | float _Radius; 45 | float _FallOff; 46 | 47 | #if _SAMPLE_LOW 48 | static const int SAMPLE_COUNT = 8; 49 | #elif _SAMPLE_MEDIUM 50 | static const int SAMPLE_COUNT = 16; 51 | #elif _SAMPLE_HIGH 52 | static const int SAMPLE_COUNT = 24; 53 | #else 54 | static const int SAMPLE_COUNT = 80; 55 | #endif 56 | 57 | float nrand(float2 uv, float dx, float dy) 58 | { 59 | uv += float2(dx, dy + _Time.x); 60 | return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453); 61 | } 62 | 63 | float3 spherical_kernel(float2 uv, float index) 64 | { 65 | // Uniformaly distributed points 66 | // http://mathworld.wolfram.com/SpherePointPicking.html 67 | float u = nrand(uv, 0, index) * 2 - 1; 68 | float theta = nrand(uv, 1, index) * UNITY_PI * 2; 69 | float u2 = sqrt(1 - u * u); 70 | float3 v = float3(u2 * cos(theta), u2 * sin(theta), u); 71 | // Adjustment for distance distribution. 72 | float l = index / SAMPLE_COUNT; 73 | return v * lerp(0.1, 1.0, l * l); 74 | } 75 | 76 | half4 frag_ao(v2f_img i) : SV_Target 77 | { 78 | half4 src = tex2D(_MainTex, i.uv); 79 | 80 | // Sample a linear depth on the depth buffer. 81 | float depth_o = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv); 82 | depth_o = LinearEyeDepth(depth_o); 83 | 84 | // This early-out flow control is not allowed in HLSL. 85 | // if (depth_o > _FallOff) return src; 86 | 87 | // Sample a view-space normal vector on the g-buffer. 88 | float3 norm_o = tex2D(_CameraGBufferTexture2, i.uv).xyz * 2 - 1; 89 | norm_o = mul((float3x3)_WorldToCamera, norm_o); 90 | 91 | // Reconstruct the view-space position. 92 | float2 p11_22 = float2(unity_CameraProjection._11, unity_CameraProjection._22); 93 | float2 p13_31 = float2(unity_CameraProjection._13, unity_CameraProjection._23); 94 | float3 pos_o = float3((i.uv * 2 - 1 - p13_31) / p11_22, 1) * depth_o; 95 | 96 | float3x3 proj = (float3x3)unity_CameraProjection; 97 | 98 | float occ = 0.0; 99 | for (int s = 0; s < SAMPLE_COUNT; s++) 100 | { 101 | float3 delta = spherical_kernel(i.uv, s); 102 | 103 | // Wants a sample in normal oriented hemisphere. 104 | delta *= (dot(norm_o, delta) >= 0) * 2 - 1; 105 | 106 | // Sampling point. 107 | float3 pos_s = pos_o + delta * _Radius; 108 | 109 | // Re-project the sampling point. 110 | float3 pos_sc = mul(proj, pos_s); 111 | float2 uv_s = (pos_sc.xy / pos_s.z + 1) * 0.5; 112 | 113 | // Sample a linear depth at the sampling point. 114 | float depth_s = LinearEyeDepth(SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, uv_s)); 115 | 116 | // Occlusion test. 117 | float dist = pos_s.z - depth_s; 118 | #if _RANGE_CHECK 119 | occ += (dist > 0.01 * _Radius) * (dist < _Radius); 120 | #else 121 | occ += (dist > 0.01 * _Radius); 122 | #endif 123 | } 124 | 125 | float falloff = 1.0 - depth_o / _FallOff; 126 | occ = saturate(occ * _Intensity * falloff / SAMPLE_COUNT); 127 | 128 | return half4(lerp(src.rgb, (half3)0.0, occ), src.a); 129 | } 130 | 131 | ENDCG 132 | SubShader 133 | { 134 | Pass 135 | { 136 | ZTest Always Cull Off ZWrite Off 137 | CGPROGRAM 138 | #pragma vertex vert_img 139 | #pragma fragment frag_ao 140 | #pragma target 3.0 141 | ENDCG 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /Assets/DeferredAO/Shader/DeferredAO.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c928e16c12e994a70928a9181450d18c 3 | timeCreated: 1435398831 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd3b771e2f9df4f6bb8d4b3e01545173 3 | folderAsset: yes 4 | timeCreated: 1432478651 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/Kvant", "KvantSwarm.unitypackage", ExportPackageOptions.Recurse); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Editor/PackageTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc644de3901e8432f940390f70075011 3 | timeCreated: 1437574643 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.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/Vignette.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d43a8ab8eb36c346bdf5c760580b019 3 | folderAsset: yes 4 | timeCreated: 1439534051 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ad044d970086bc48b37420227aaa504 3 | folderAsset: yes 4 | timeCreated: 1439538202 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Editor/VignetteEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // KinoVignette - Natural vignetting effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | using UnityEngine; 24 | using UnityEditor; 25 | 26 | namespace Kino 27 | { 28 | [CanEditMultipleObjects] 29 | [CustomEditor(typeof(Vignette))] 30 | public class VignetteEditor : Editor 31 | { 32 | SerializedProperty _falloff; 33 | 34 | void OnEnable() 35 | { 36 | _falloff = serializedObject.FindProperty("_falloff"); 37 | } 38 | 39 | public override void OnInspectorGUI() 40 | { 41 | serializedObject.Update(); 42 | 43 | EditorGUILayout.PropertyField(_falloff); 44 | 45 | serializedObject.ApplyModifiedProperties(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Editor/VignetteEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01095d10408c28d429dcdb7841e375a5 3 | timeCreated: 1439538208 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8e0d748f5d5fd8479f21c06cddbc912 3 | folderAsset: yes 4 | timeCreated: 1439534088 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Shader/Vignette.shader: -------------------------------------------------------------------------------- 1 | // 2 | // KinoVignette - Natural vignetting effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | Shader "Hidden/Kino/Vignette" 24 | { 25 | Properties 26 | { 27 | _MainTex ("-", 2D) = "" {} 28 | } 29 | 30 | CGINCLUDE 31 | 32 | #include "UnityCG.cginc" 33 | 34 | sampler2D _MainTex; 35 | float2 _Aspect; 36 | float _Falloff; 37 | 38 | half4 frag(v2f_img i) : SV_Target 39 | { 40 | float2 coord = (i.uv - 0.5) * _Aspect * 2; 41 | float rf = sqrt(dot(coord, coord)) * _Falloff; 42 | float rf2_1 = rf * rf + 1.0; 43 | float e = 1.0 / (rf2_1 * rf2_1); 44 | 45 | half4 src = tex2D(_MainTex, i.uv); 46 | return half4(src.rgb * e, src.a); 47 | } 48 | 49 | ENDCG 50 | 51 | SubShader 52 | { 53 | Pass 54 | { 55 | ZTest Always Cull Off ZWrite Off 56 | CGPROGRAM 57 | #pragma vertex vert_img 58 | #pragma fragment frag 59 | ENDCG 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Shader/Vignette.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89a223cbeee1935419811f8736c0a9b3 3 | timeCreated: 1439534076 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Vignette.cs: -------------------------------------------------------------------------------- 1 | // 2 | // KinoVignette - Natural vignetting effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | // this software and associated documentation files (the "Software"), to deal in 8 | // the Software without restriction, including without limitation the rights to 9 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | // the Software, and to permit persons to whom the Software is furnished to do so, 11 | // subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in all 14 | // copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | // 23 | using UnityEngine; 24 | 25 | namespace Kino 26 | { 27 | [ExecuteInEditMode] 28 | [RequireComponent(typeof(Camera))] 29 | [AddComponentMenu("Kino Image Effects/Vignette")] 30 | public class Vignette : MonoBehaviour 31 | { 32 | #region Public Properties 33 | 34 | // Natural vignetting falloff 35 | [SerializeField, Range(0.0f, 1.0f)] 36 | float _falloff = 0.5f; 37 | 38 | public float intensity { 39 | get { return _falloff; } 40 | set { _falloff = value; } 41 | } 42 | 43 | #endregion 44 | 45 | #region Private Properties 46 | 47 | [SerializeField] Shader _shader; 48 | Material _material; 49 | 50 | #endregion 51 | 52 | #region MonoBehaviour Functions 53 | 54 | void OnRenderImage(RenderTexture source, RenderTexture destination) 55 | { 56 | if (_material == null) 57 | { 58 | _material = new Material(_shader); 59 | _material.hideFlags = HideFlags.DontSave; 60 | } 61 | 62 | var cam = GetComponent(); 63 | _material.SetVector("_Aspect", new Vector2(cam.aspect, 1)); 64 | _material.SetFloat("_Falloff", _falloff); 65 | 66 | Graphics.Blit(source, destination, _material, 0); 67 | } 68 | 69 | #endregion 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Assets/Kino/Vignette/Vignette.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6fc18a55c333d51489e5ee49b3cbff50 3 | timeCreated: 1439534795 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _shader: {fileID: 4800000, guid: 89a223cbeee1935419811f8736c0a9b3, type: 3} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Kvant.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8be732b80b8b445e5bd196d2b01ed59c 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb1748d9694be4964b9445736edca0f9 3 | folderAsset: yes 4 | timeCreated: 1437052186 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8dcabc7e37b034ef8a41972702ae7fc8 3 | folderAsset: yes 4 | timeCreated: 1437567619 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Editor/SwarmEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Custom editor class for Swarm 3 | // 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | namespace Kvant 8 | { 9 | [CanEditMultipleObjects, CustomEditor(typeof(Swarm))] 10 | public class SwarmEditor : Editor 11 | { 12 | SerializedProperty _lineCount; 13 | SerializedProperty _historyLength; 14 | SerializedProperty _throttle; 15 | SerializedProperty _flow; 16 | 17 | SerializedProperty _attractor; 18 | SerializedProperty _attractorPosition; 19 | SerializedProperty _attractorRadius; 20 | SerializedProperty _forcePerDistance; 21 | SerializedProperty _forceRandomness; 22 | SerializedProperty _drag; 23 | 24 | SerializedProperty _noiseAmplitude; 25 | SerializedProperty _noiseFrequency; 26 | SerializedProperty _noiseSpread; 27 | SerializedProperty _noiseMotion; 28 | 29 | SerializedProperty _swirlAmplitude; 30 | SerializedProperty _swirlFrequency; 31 | 32 | SerializedProperty _lineWidth; 33 | SerializedProperty _lineWidthRandomness; 34 | SerializedProperty _colorMode; 35 | SerializedProperty _color1; 36 | SerializedProperty _color2; 37 | SerializedProperty _metallic; 38 | SerializedProperty _smoothness; 39 | 40 | SerializedProperty _castShadows; 41 | SerializedProperty _receiveShadows; 42 | 43 | SerializedProperty _fixTimeStep; 44 | SerializedProperty _stepsPerSecond; 45 | SerializedProperty _randomSeed; 46 | 47 | static GUIContent _textAmplitude = new GUIContent("Amplitude"); 48 | static GUIContent _textFlow = new GUIContent("Flow Vector"); 49 | static GUIContent _textFrequency = new GUIContent("Frequency"); 50 | static GUIContent _textMotion = new GUIContent("Motion"); 51 | static GUIContent _textSpread = new GUIContent("Spread"); 52 | 53 | void OnEnable() 54 | { 55 | _lineCount = serializedObject.FindProperty("_lineCount"); 56 | _historyLength = serializedObject.FindProperty("_historyLength"); 57 | _throttle = serializedObject.FindProperty("_throttle"); 58 | _flow = serializedObject.FindProperty("_flow"); 59 | 60 | _attractor = serializedObject.FindProperty("_attractor"); 61 | _attractorPosition = serializedObject.FindProperty("_attractorPosition"); 62 | _attractorRadius = serializedObject.FindProperty("_attractorRadius"); 63 | _forcePerDistance = serializedObject.FindProperty("_forcePerDistance"); 64 | _forceRandomness = serializedObject.FindProperty("_forceRandomness"); 65 | _drag = serializedObject.FindProperty("_drag"); 66 | 67 | _noiseAmplitude = serializedObject.FindProperty("_noiseAmplitude"); 68 | _noiseFrequency = serializedObject.FindProperty("_noiseFrequency"); 69 | _noiseSpread = serializedObject.FindProperty("_noiseSpread"); 70 | _noiseMotion = serializedObject.FindProperty("_noiseMotion"); 71 | 72 | _swirlAmplitude = serializedObject.FindProperty("_swirlAmplitude"); 73 | _swirlFrequency = serializedObject.FindProperty("_swirlFrequency"); 74 | 75 | _lineWidth = serializedObject.FindProperty("_lineWidth"); 76 | _lineWidthRandomness = serializedObject.FindProperty("_lineWidthRandomness"); 77 | 78 | _colorMode = serializedObject.FindProperty("_colorMode"); 79 | _color1 = serializedObject.FindProperty("_color1"); 80 | _color2 = serializedObject.FindProperty("_color2"); 81 | _metallic = serializedObject.FindProperty("_metallic"); 82 | _smoothness = serializedObject.FindProperty("_smoothness"); 83 | 84 | _castShadows = serializedObject.FindProperty("_castShadows"); 85 | _receiveShadows = serializedObject.FindProperty("_receiveShadows"); 86 | 87 | _fixTimeStep = serializedObject.FindProperty("_fixTimeStep"); 88 | _stepsPerSecond = serializedObject.FindProperty("_stepsPerSecond"); 89 | _randomSeed = serializedObject.FindProperty("_randomSeed"); 90 | } 91 | 92 | public override void OnInspectorGUI() 93 | { 94 | var instance = target as Swarm; 95 | 96 | serializedObject.Update(); 97 | 98 | EditorGUI.BeginChangeCheck(); 99 | 100 | EditorGUILayout.PropertyField(_lineCount); 101 | EditorGUILayout.PropertyField(_historyLength); 102 | 103 | if (EditorGUI.EndChangeCheck()) instance.Restart(); 104 | 105 | EditorGUILayout.PropertyField(_throttle); 106 | EditorGUILayout.PropertyField(_flow, _textFlow); 107 | 108 | EditorGUILayout.Space(); 109 | 110 | EditorGUILayout.LabelField("Dynamics", EditorStyles.boldLabel); 111 | EditorGUILayout.PropertyField(_attractor); 112 | if (_attractor.hasMultipleDifferentValues || 113 | _attractor.objectReferenceValue == null) 114 | EditorGUILayout.PropertyField(_attractorPosition); 115 | EditorGUILayout.PropertyField(_attractorRadius); 116 | EditorGUILayout.PropertyField(_forcePerDistance); 117 | EditorGUILayout.PropertyField(_forceRandomness); 118 | EditorGUILayout.PropertyField(_drag); 119 | 120 | EditorGUILayout.Space(); 121 | 122 | EditorGUILayout.LabelField("Turbulent Noise", EditorStyles.boldLabel); 123 | EditorGUILayout.PropertyField(_noiseAmplitude, _textAmplitude); 124 | EditorGUILayout.PropertyField(_noiseFrequency, _textFrequency); 125 | EditorGUILayout.PropertyField(_noiseSpread, _textSpread); 126 | EditorGUILayout.PropertyField(_noiseMotion, _textMotion); 127 | 128 | EditorGUILayout.Space(); 129 | 130 | EditorGUILayout.PropertyField(_swirlAmplitude); 131 | EditorGUILayout.PropertyField(_swirlFrequency); 132 | 133 | EditorGUILayout.Space(); 134 | 135 | EditorGUILayout.LabelField("Render Settings", EditorStyles.boldLabel); 136 | EditorGUILayout.PropertyField(_lineWidth); 137 | EditorGUILayout.PropertyField(_lineWidthRandomness); 138 | 139 | EditorGUILayout.Space(); 140 | 141 | EditorGUILayout.PropertyField(_colorMode); 142 | EditorGUILayout.PropertyField(_color1); 143 | EditorGUILayout.PropertyField(_color2); 144 | EditorGUILayout.Slider(_metallic, 0, 1); 145 | EditorGUILayout.Slider(_smoothness, 0, 1); 146 | 147 | EditorGUILayout.Space(); 148 | 149 | EditorGUILayout.PropertyField(_castShadows); 150 | EditorGUILayout.PropertyField(_receiveShadows); 151 | 152 | EditorGUILayout.Space(); 153 | 154 | EditorGUILayout.PropertyField(_fixTimeStep); 155 | if (_fixTimeStep.hasMultipleDifferentValues || _fixTimeStep.boolValue) 156 | EditorGUILayout.PropertyField(_stepsPerSecond); 157 | 158 | EditorGUI.BeginChangeCheck(); 159 | EditorGUILayout.PropertyField(_randomSeed); 160 | if (EditorGUI.EndChangeCheck()) instance.Restart(); 161 | 162 | serializedObject.ApplyModifiedProperties(); 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Editor/SwarmEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ffa3975e3bc84e5da9a7ce90cce72a4 3 | timeCreated: 1437997059 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/Kvant/Swarm/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb1472caaa0ec412fac443254c3451a2 3 | folderAsset: yes 4 | timeCreated: 1437138755 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Shaders/Kernel.shader: -------------------------------------------------------------------------------- 1 | // 2 | // GPGPU kernels for Swarm 3 | // 4 | // Position buffer format: 5 | // .xyz = particle position 6 | // .w = random number 7 | // 8 | // Velocity buffer format: 9 | // .xyz = particle velocity 10 | // .w = 0 11 | // 12 | Shader "Hidden/Kvant/Swarm/Kernel" 13 | { 14 | Properties 15 | { 16 | _PositionTex ("-", 2D) = ""{} 17 | _VelocityTex ("-", 2D) = ""{} 18 | } 19 | 20 | CGINCLUDE 21 | 22 | #include "UnityCG.cginc" 23 | #include "SimplexNoiseGrad3D.cginc" 24 | 25 | sampler2D _PositionTex; 26 | sampler2D _VelocityTex; 27 | float4 _PositionTex_TexelSize; 28 | float4 _VelocityTex_TexelSize; 29 | 30 | float3 _Acceleration; // min, max, drag 31 | float4 _Attractor; // x, y, z, spread 32 | float3 _Flow; 33 | float3 _NoiseParams; // amplitude, frequency, spread 34 | float3 _NoiseOffset; 35 | float2 _SwirlParams; // amplitude, frequency 36 | float2 _Config; // deltaTime, randomSeed 37 | 38 | // pseudo random number generator 39 | float nrand(float2 uv, float salt) 40 | { 41 | uv += float2(salt, _Config.y); 42 | return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453); 43 | } 44 | 45 | // divergence-free noise vector field 46 | float3 dfnoise_field(float3 p, float k) 47 | { 48 | p += float3(0.9, 1.0, 1.1) * k * _NoiseParams.z; 49 | float3 n1 = snoise_grad(p); 50 | float3 n2 = snoise_grad(p + float3(15.3, 13.1, 17.4)); 51 | return cross(n1, n2); 52 | } 53 | 54 | // attractor position with spread parameter 55 | float3 attract_point(float2 uv) 56 | { 57 | float3 r = float3(nrand(uv, 0), nrand(uv, 1), nrand(uv, 2)); 58 | return _Attractor.xyz + (r - 0.5) * _Attractor.w; 59 | } 60 | 61 | // pass 0: position initialization 62 | float4 frag_init_position(v2f_img i) : SV_Target 63 | { 64 | return float4(attract_point(i.uv.y + 2), nrand(i.uv.y, 6)); 65 | } 66 | 67 | // pass 1: velocity initialization 68 | float4 frag_init_velocity(v2f_img i) : SV_Target 69 | { 70 | return (float4)0; 71 | } 72 | 73 | // pass 2: position update 74 | float4 frag_update_position(v2f_img i) : SV_Target 75 | { 76 | // u=0: p <- head position 77 | // u>0: p <- one newer entry in the history array 78 | float2 uv_prev = float2(_PositionTex_TexelSize.x, 0); 79 | float4 p = tex2D(_PositionTex, i.uv - uv_prev); 80 | 81 | // velocity vector for the head point (u=0) 82 | float3 v0 = tex2D(_VelocityTex, i.uv).xyz; 83 | 84 | // velocity vector for the tail points (u>0) 85 | float3 np = (p.xyz + _NoiseOffset) * _SwirlParams.y; 86 | float3 v1 = _Flow + dfnoise_field(np, i.uv.y) * _SwirlParams.x; 87 | 88 | // applying the velocity vector 89 | float u_0 = i.uv.x < _PositionTex_TexelSize.x; 90 | p.xyz += lerp(v1, v0, u_0) * _Config.x; 91 | 92 | return p; 93 | } 94 | 95 | // pass 3: velocity update 96 | float4 frag_update_velocity(v2f_img i) : SV_Target 97 | { 98 | // only needs the leftmost pixel 99 | float2 uv = i.uv * float2(0, 1); 100 | 101 | // head point position/velocity 102 | float3 p = tex2D(_PositionTex, uv).xyz; 103 | float3 v = tex2D(_VelocityTex, uv).xyz; 104 | 105 | // force from the attactor 106 | float accel = lerp(_Acceleration.x, _Acceleration.y, nrand(uv, 7)); 107 | float3 fa = (attract_point(uv) - p) * accel; 108 | 109 | // force from the noise vector field 110 | float3 np = (p + _NoiseOffset) * _NoiseParams.y; 111 | float3 fn = dfnoise_field(np, uv.y) * _NoiseParams.x; 112 | 113 | // applying drag and acceleration force 114 | v = v * _Acceleration.z + (fa + fn) * _Config.x; 115 | 116 | return float4(v, 0); 117 | } 118 | 119 | ENDCG 120 | 121 | SubShader 122 | { 123 | Pass 124 | { 125 | CGPROGRAM 126 | #pragma target 3.0 127 | #pragma vertex vert_img 128 | #pragma fragment frag_init_position 129 | ENDCG 130 | } 131 | Pass 132 | { 133 | CGPROGRAM 134 | #pragma target 3.0 135 | #pragma vertex vert_img 136 | #pragma fragment frag_init_velocity 137 | ENDCG 138 | } 139 | Pass 140 | { 141 | CGPROGRAM 142 | #pragma target 3.0 143 | #pragma vertex vert_img 144 | #pragma fragment frag_update_position 145 | ENDCG 146 | } 147 | Pass 148 | { 149 | CGPROGRAM 150 | #pragma target 3.0 151 | #pragma vertex vert_img 152 | #pragma fragment frag_update_velocity 153 | ENDCG 154 | } 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Shaders/Kernel.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab176efa7135a4f038c7b318a0b3c9ef 3 | timeCreated: 1437139790 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Shaders/SimplexNoiseGrad3D.cginc: -------------------------------------------------------------------------------- 1 | // 2 | // Noise Shader Library for Unity - https://github.com/keijiro/NoiseShader 3 | // 4 | // Original work (webgl-noise) Copyright (C) 2011 Ashima Arts. 5 | // Translation and modification was made by Keijiro Takahashi. 6 | // 7 | // This shader is based on the webgl-noise GLSL shader. For further details 8 | // of the original shader, please see the following description from the 9 | // original source code. 10 | // 11 | 12 | // 13 | // Description : Array and textureless GLSL 2D/3D/4D simplex 14 | // noise functions. 15 | // Author : Ian McEwan, Ashima Arts. 16 | // Maintainer : ijm 17 | // Lastmod : 20110822 (ijm) 18 | // License : Copyright (C) 2011 Ashima Arts. All rights reserved. 19 | // Distributed under the MIT License. See LICENSE file. 20 | // https://github.com/ashima/webgl-noise 21 | // 22 | 23 | float3 mod289(float3 x) 24 | { 25 | return x - floor(x / 289.0) * 289.0; 26 | } 27 | 28 | float4 mod289(float4 x) 29 | { 30 | return x - floor(x / 289.0) * 289.0; 31 | } 32 | 33 | float4 permute(float4 x) 34 | { 35 | return mod289((x * 34.0 + 1.0) * x); 36 | } 37 | 38 | float4 taylorInvSqrt(float4 r) 39 | { 40 | return 1.79284291400159 - r * 0.85373472095314; 41 | } 42 | 43 | float3 snoise_grad(float3 v) 44 | { 45 | const float2 C = float2(1.0 / 6.0, 1.0 / 3.0); 46 | 47 | // First corner 48 | float3 i = floor(v + dot(v, C.yyy)); 49 | float3 x0 = v - i + dot(i, C.xxx); 50 | 51 | // Other corners 52 | float3 g = step(x0.yzx, x0.xyz); 53 | float3 l = 1.0 - g; 54 | float3 i1 = min(g.xyz, l.zxy); 55 | float3 i2 = max(g.xyz, l.zxy); 56 | 57 | // x1 = x0 - i1 + 1.0 * C.xxx; 58 | // x2 = x0 - i2 + 2.0 * C.xxx; 59 | // x3 = x0 - 1.0 + 3.0 * C.xxx; 60 | float3 x1 = x0 - i1 + C.xxx; 61 | float3 x2 = x0 - i2 + C.yyy; 62 | float3 x3 = x0 - 0.5; 63 | 64 | // Permutations 65 | i = mod289(i); // Avoid truncation effects in permutation 66 | float4 p = 67 | permute(permute(permute(i.z + float4(0.0, i1.z, i2.z, 1.0)) 68 | + i.y + float4(0.0, i1.y, i2.y, 1.0)) 69 | + i.x + float4(0.0, i1.x, i2.x, 1.0)); 70 | 71 | // Gradients: 7x7 points over a square, mapped onto an octahedron. 72 | // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) 73 | float4 j = p - 49.0 * floor(p / 49.0); // mod(p,7*7) 74 | 75 | float4 x_ = floor(j / 7.0); 76 | float4 y_ = floor(j - 7.0 * x_); // mod(j,N) 77 | 78 | float4 x = (x_ * 2.0 + 0.5) / 7.0 - 1.0; 79 | float4 y = (y_ * 2.0 + 0.5) / 7.0 - 1.0; 80 | 81 | float4 h = 1.0 - abs(x) - abs(y); 82 | 83 | float4 b0 = float4(x.xy, y.xy); 84 | float4 b1 = float4(x.zw, y.zw); 85 | 86 | //float4 s0 = float4(lessThan(b0, 0.0)) * 2.0 - 1.0; 87 | //float4 s1 = float4(lessThan(b1, 0.0)) * 2.0 - 1.0; 88 | float4 s0 = floor(b0) * 2.0 + 1.0; 89 | float4 s1 = floor(b1) * 2.0 + 1.0; 90 | float4 sh = -step(h, 0.0); 91 | 92 | float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; 93 | float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; 94 | 95 | float3 g0 = float3(a0.xy, h.x); 96 | float3 g1 = float3(a0.zw, h.y); 97 | float3 g2 = float3(a1.xy, h.z); 98 | float3 g3 = float3(a1.zw, h.w); 99 | 100 | // Normalise gradients 101 | float4 norm = taylorInvSqrt(float4(dot(g0, g0), dot(g1, g1), dot(g2, g2), dot(g3, g3))); 102 | g0 *= norm.x; 103 | g1 *= norm.y; 104 | g2 *= norm.z; 105 | g3 *= norm.w; 106 | 107 | // Compute gradient of noise function at P 108 | float4 m = max(0.6 - float4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0); 109 | float4 m2 = m * m; 110 | float4 m3 = m2 * m; 111 | float4 m4 = m2 * m2; 112 | float3 grad = 113 | -6.0 * m3.x * x0 * dot(x0, g0) + m4.x * g0 + 114 | -6.0 * m3.y * x1 * dot(x1, g1) + m4.y * g1 + 115 | -6.0 * m3.z * x2 * dot(x2, g2) + m4.z * g2 + 116 | -6.0 * m3.w * x3 * dot(x3, g3) + m4.w * g3; 117 | return 42.0 * grad; 118 | } 119 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Shaders/SimplexNoiseGrad3D.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 034b4f1054e72a84abfd0f3df4f8e82d 3 | timeCreated: 1449560142 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Shaders/Surface.shader: -------------------------------------------------------------------------------- 1 | // 2 | // Surface shader for Swarm 3 | // 4 | // Texture format: 5 | // 6 | // _PositionTex.xyz = position 7 | // _PositionTex.w = random number 8 | // 9 | Shader "Hidden/Kvant/Swarm/Surface" 10 | { 11 | Properties 12 | { 13 | _PositionTex ("-", 2D) = ""{} 14 | _Color1 ("-", Color) = (1, 1, 1, 1) 15 | _Color2 ("-", Color) = (1, 1, 1, 1) 16 | } 17 | 18 | CGINCLUDE 19 | 20 | #pragma multi_compile COLOR_RANDOM COLOR_SMOOTH 21 | 22 | sampler2D _PositionTex; 23 | float4 _PositionTex_TexelSize; 24 | 25 | half4 _Color1; 26 | half4 _Color2; 27 | half _Metallic; 28 | half _Smoothness; 29 | 30 | float2 _LineWidth; // min, max 31 | float _Throttle; 32 | float _Flip; 33 | 34 | float2 _BufferOffset; 35 | 36 | struct Input { 37 | half color; 38 | }; 39 | 40 | // pseudo random number generator 41 | float nrand(float2 uv, float salt) 42 | { 43 | uv += float2(salt, 0); 44 | return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453); 45 | } 46 | 47 | void vert(inout appdata_full v, out Input data) 48 | { 49 | UNITY_INITIALIZE_OUTPUT(Input, data); 50 | 51 | float4 uv = float4(v.texcoord + _BufferOffset, 0, 0); 52 | float4 duv = float4(_PositionTex_TexelSize.x, 0, 0, 0); 53 | 54 | // line number 55 | float ln = uv.y; 56 | 57 | // adjacent vertices 58 | float3 p1 = tex2Dlod(_PositionTex, uv - duv * 2).xyz; 59 | float3 p2 = tex2Dlod(_PositionTex, uv ).xyz; 60 | float3 p3 = tex2Dlod(_PositionTex, uv + duv * 2).xyz; 61 | 62 | // binormal vector 63 | float3 bn = normalize(cross(p3 - p2, p2 - p1)) * _Flip; 64 | 65 | // line width 66 | float lw = lerp(_LineWidth.x, _LineWidth.y, nrand(ln, 10)); 67 | lw *= saturate((_Throttle - ln) / _PositionTex_TexelSize.y); 68 | 69 | v.vertex.xyz = p2 + bn * lw * v.vertex.x; 70 | v.normal = normalize(cross(bn, p2 - p1)); 71 | 72 | #if COLOR_RANDOM 73 | data.color = nrand(ln, 11); 74 | #else 75 | data.color = ln; 76 | #endif 77 | } 78 | 79 | ENDCG 80 | 81 | SubShader 82 | { 83 | Tags { "RenderType"="Opaque" } 84 | 85 | CGPROGRAM 86 | 87 | #pragma surface surf Standard vertex:vert nolightmap addshadow 88 | #pragma target 3.0 89 | 90 | void surf(Input IN, inout SurfaceOutputStandard o) 91 | { 92 | o.Albedo = lerp(_Color1, _Color2, IN.color); 93 | o.Metallic = _Metallic; 94 | o.Smoothness = _Smoothness; 95 | } 96 | 97 | ENDCG 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Shaders/Surface.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ebdc691e18a6342eeac2c370efde4a89 3 | timeCreated: 1437922088 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Swarm.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Swarm - flowing lines animation 3 | // 4 | using UnityEngine; 5 | using UnityEngine.Rendering; 6 | 7 | namespace Kvant 8 | { 9 | [ExecuteInEditMode, AddComponentMenu("Kvant/Swarm")] 10 | public class Swarm : MonoBehaviour 11 | { 12 | #region Basic Settings 13 | 14 | [SerializeField] 15 | int _lineCount = 128; 16 | 17 | [SerializeField] 18 | int _historyLength = 128; 19 | 20 | [SerializeField, Range(0, 1)] 21 | float _throttle = 1.0f; 22 | 23 | public float throttle { 24 | get { return _throttle; } 25 | set { _throttle = value; } 26 | } 27 | 28 | [SerializeField] 29 | Vector3 _flow = Vector3.zero; 30 | 31 | public Vector3 flow { 32 | get { return _flow; } 33 | set { _flow = value; } 34 | } 35 | 36 | #endregion 37 | 38 | #region Attractor Parameters 39 | 40 | [SerializeField] 41 | Transform _attractor; 42 | 43 | public Transform attractor { 44 | get { return _attractor; } 45 | set { _attractor = value; } 46 | } 47 | 48 | [SerializeField] 49 | Vector3 _attractorPosition = Vector3.zero; 50 | 51 | public Vector3 attractorPosition { 52 | get { return _attractorPosition; } 53 | set { _attractorPosition = value; } 54 | } 55 | 56 | [SerializeField] 57 | float _attractorRadius = 0.1f; 58 | 59 | public float attractorRadius { 60 | get { return _attractorRadius; } 61 | set { _attractorRadius = value; } 62 | } 63 | 64 | [SerializeField] 65 | float _forcePerDistance = 2.0f; 66 | 67 | public float forcePerDistance { 68 | get { return _forcePerDistance; } 69 | set { _forcePerDistance = value; } 70 | } 71 | 72 | [SerializeField, Range(0, 1)] 73 | float _forceRandomness = 0.2f; 74 | 75 | public float forceRandomness { 76 | get { return _forceRandomness; } 77 | set { _forceRandomness = value; } 78 | } 79 | 80 | [SerializeField, Range(0, 6)] 81 | float _drag = 2.0f; 82 | 83 | public float drag { 84 | get { return _drag; } 85 | set { _drag = value; } 86 | } 87 | 88 | #endregion 89 | 90 | #region Turbulent Noise Parameters 91 | 92 | [SerializeField] 93 | float _noiseAmplitude = 1.5f; 94 | 95 | public float noiseAmplitude { 96 | get { return _noiseAmplitude; } 97 | set { _noiseAmplitude = value; } 98 | } 99 | 100 | [SerializeField] 101 | float _noiseFrequency = 0.1f; 102 | 103 | public float noiseFrequency { 104 | get { return _noiseFrequency; } 105 | set { _noiseFrequency = value; } 106 | } 107 | 108 | [SerializeField] 109 | float _noiseSpread = 0.5f; 110 | 111 | public float noiseSpread { 112 | get { return _noiseSpread; } 113 | set { _noiseSpread = value; } 114 | } 115 | 116 | [SerializeField] 117 | float _noiseMotion = 0.5f; 118 | 119 | public float noiseMotion { 120 | get { return _noiseMotion; } 121 | set { _noiseMotion = value; } 122 | } 123 | 124 | [SerializeField] 125 | float _swirlAmplitude = 0.1f; 126 | 127 | public float swirlAmplitude { 128 | get { return _swirlAmplitude; } 129 | set { _swirlAmplitude = value; } 130 | } 131 | 132 | [SerializeField] 133 | float _swirlFrequency = 0.15f; 134 | 135 | public float swirlFrequency { 136 | get { return _swirlFrequency; } 137 | set { _swirlFrequency = value; } 138 | } 139 | 140 | #endregion 141 | 142 | #region Render Settings 143 | 144 | [SerializeField] 145 | float _lineWidth = 0.1f; 146 | 147 | public float lineWidth { 148 | get { return _lineWidth; } 149 | set { _lineWidth = value; } 150 | } 151 | 152 | [SerializeField, Range(0, 1)] 153 | float _lineWidthRandomness = 0.5f; 154 | 155 | public float lineWidthRandomness { 156 | get { return _lineWidthRandomness; } 157 | set { _lineWidthRandomness = value; } 158 | } 159 | 160 | public enum ColorMode { Random, Smooth } 161 | 162 | [SerializeField] 163 | ColorMode _colorMode = ColorMode.Random; 164 | 165 | public ColorMode colorMode { 166 | get { return _colorMode; } 167 | set { _colorMode = value; } 168 | } 169 | 170 | [SerializeField] 171 | Color _color1 = Color.white; 172 | 173 | public Color color { 174 | get { return _color1; } 175 | set { _color1 = value; } 176 | } 177 | 178 | [SerializeField] 179 | Color _color2 = Color.gray; 180 | 181 | public Color color2 { 182 | get { return _color2; } 183 | set { _color2 = value; } 184 | } 185 | 186 | [SerializeField, Range(0, 1)] 187 | float _metallic = 0.5f; 188 | 189 | public float metallic { 190 | get { return _metallic; } 191 | set { _metallic = value; } 192 | } 193 | 194 | [SerializeField, Range(0, 1)] 195 | float _smoothness = 0.5f; 196 | 197 | public float smoothness { 198 | get { return _smoothness; } 199 | set { _smoothness = value; } 200 | } 201 | 202 | [SerializeField] 203 | ShadowCastingMode _castShadows; 204 | 205 | public ShadowCastingMode castShadows { 206 | get { return _castShadows; } 207 | set { _castShadows = value; } 208 | } 209 | 210 | [SerializeField] 211 | bool _receiveShadows = false; 212 | 213 | public bool receiveShadows { 214 | get { return _receiveShadows; } 215 | set { _receiveShadows = value; } 216 | } 217 | 218 | #endregion 219 | 220 | #region Misc Settings 221 | 222 | [SerializeField] 223 | bool _fixTimeStep = false; 224 | 225 | [SerializeField] 226 | float _stepsPerSecond = 60; 227 | 228 | [SerializeField] 229 | int _randomSeed = 0; 230 | 231 | #endregion 232 | 233 | #region Public Methods 234 | 235 | public void Restart() 236 | { 237 | _needsReset = true; 238 | } 239 | 240 | public void Restart(int newRandomSeed) 241 | { 242 | _randomSeed = newRandomSeed; 243 | _needsReset = true; 244 | } 245 | 246 | #endregion 247 | 248 | #region Custom Shaders 249 | 250 | [SerializeField] Shader _kernelShader; 251 | [SerializeField] Shader _lineShader; 252 | Material _kernelMaterial; 253 | Material _lineMaterial; 254 | 255 | #endregion 256 | 257 | #region Private Objects And Properties 258 | 259 | RenderTexture _positionBuffer1; 260 | RenderTexture _positionBuffer2; 261 | RenderTexture _velocityBuffer1; 262 | RenderTexture _velocityBuffer2; 263 | Mesh _mesh; 264 | bool _needsReset = true; 265 | Vector3 _noiseOffset; 266 | 267 | // Returns how many draw calls are needed to draw all lines. 268 | int DrawCount { 269 | get { 270 | var total = _historyLength * _lineCount * 2; 271 | if (total < 65000) return 1; 272 | return total / 65000 + 1; 273 | } 274 | } 275 | 276 | // Returns the actual total number of lines. 277 | int TotalLineCount { 278 | get { return _lineCount - _lineCount % DrawCount; } 279 | } 280 | 281 | // Returns how many lines in one draw call. 282 | int LinesPerDraw { 283 | get { 284 | return _lineCount / DrawCount; 285 | } 286 | } 287 | 288 | #endregion 289 | 290 | #region Resource Management 291 | 292 | Material CreateMaterial(Shader shader) 293 | { 294 | var material = new Material(shader); 295 | material.hideFlags = HideFlags.DontSave; 296 | return material; 297 | } 298 | 299 | RenderTexture CreateBuffer(bool forVelocity) 300 | { 301 | var format = RenderTextureFormat.ARGBFloat; 302 | var width = forVelocity ? 1 : _historyLength; 303 | var buffer = new RenderTexture(width, TotalLineCount, 0, format); 304 | buffer.hideFlags = HideFlags.DontSave; 305 | buffer.filterMode = FilterMode.Point; 306 | buffer.wrapMode = TextureWrapMode.Clamp; 307 | return buffer; 308 | } 309 | 310 | Mesh CreateMesh() 311 | { 312 | var nx = _historyLength; 313 | var ny = LinesPerDraw; 314 | 315 | var inx = 1.0f / nx; 316 | var iny = 1.0f / TotalLineCount; 317 | 318 | // vertex and texcoord array 319 | var va = new Vector3[(nx - 2) * ny * 2]; 320 | var ta = new Vector2[(nx - 2) * ny * 2]; 321 | 322 | var offs = 0; 323 | for (var y = 0; y < ny; y++) 324 | { 325 | var v = iny * y; 326 | for (var x = 1; x < nx - 1; x++) 327 | { 328 | va[offs] = Vector3.right * -0.5f; 329 | va[offs + 1] = Vector3.right * 0.5f; 330 | ta[offs] = ta[offs + 1] = new Vector2(inx * x, v); 331 | offs += 2; 332 | } 333 | } 334 | 335 | // index array 336 | var ia = new int[ny * (nx - 3) * 6]; 337 | offs = 0; 338 | for (var y = 0; y < ny; y++) 339 | { 340 | var vi = y * (nx - 2) * 2; 341 | for (var x = 0; x < nx - 3; x++) 342 | { 343 | ia[offs++] = vi; 344 | ia[offs++] = vi + 1; 345 | ia[offs++] = vi + 2; 346 | ia[offs++] = vi + 1; 347 | ia[offs++] = vi + 3; 348 | ia[offs++] = vi + 2; 349 | vi += 2; 350 | } 351 | } 352 | 353 | // mesh object initialization 354 | var mesh = new Mesh(); 355 | mesh.hideFlags = HideFlags.DontSave; 356 | mesh.vertices = va; 357 | mesh.uv = ta; 358 | mesh.SetIndices(ia, MeshTopology.Triangles, 0); 359 | mesh.Optimize(); 360 | 361 | // avoid being culled 362 | mesh.bounds = new Bounds(Vector3.zero, Vector3.one * 100); 363 | 364 | return mesh; 365 | } 366 | 367 | void StepKernel(float deltaTime) 368 | { 369 | // GPGPU buffer swap 370 | var pb = _positionBuffer1; 371 | var vb = _velocityBuffer1; 372 | _positionBuffer1 = _positionBuffer2; 373 | _velocityBuffer1 = _velocityBuffer2; 374 | _positionBuffer2 = pb; 375 | _velocityBuffer2 = vb; 376 | 377 | // private state update 378 | _noiseOffset += (_flow + Vector3.one * _noiseMotion) * deltaTime; 379 | 380 | // invoking velocity update kernel 381 | UpdateKernelShader(deltaTime); 382 | _kernelMaterial.SetTexture("_PositionTex", _positionBuffer1); 383 | _kernelMaterial.SetTexture("_VelocityTex", _velocityBuffer1); 384 | Graphics.Blit(null, _velocityBuffer2, _kernelMaterial, 3); 385 | 386 | // invoking position update kernel 387 | _kernelMaterial.SetTexture("_VelocityTex", _velocityBuffer2); 388 | Graphics.Blit(null, _positionBuffer2, _kernelMaterial, 2); 389 | } 390 | 391 | void UpdateKernelShader(float deltaTime) 392 | { 393 | var m = _kernelMaterial; 394 | 395 | m.SetVector("_Flow", _flow); 396 | 397 | var minForce = _forcePerDistance * (1 - _forceRandomness); 398 | var drag = Mathf.Exp(-_drag * deltaTime); 399 | m.SetVector("_Acceleration", new Vector3(minForce, _forcePerDistance, drag)); 400 | 401 | var pos = _attractor ? _attractor.position : _attractorPosition; 402 | pos = transform.InverseTransformPoint(pos); 403 | m.SetVector("_Attractor", new Vector4(pos.x, pos.y, pos.z, _attractorRadius)); 404 | 405 | m.SetVector("_NoiseParams", new Vector3(_noiseAmplitude, _noiseFrequency, _noiseSpread)); 406 | m.SetVector("_NoiseOffset", _noiseOffset); 407 | m.SetVector("_SwirlParams", new Vector2(_swirlAmplitude, _swirlFrequency)); 408 | 409 | m.SetVector("_Config", new Vector2(deltaTime, _randomSeed)); 410 | } 411 | 412 | void UpdateLineShader() 413 | { 414 | var m = _lineMaterial; 415 | 416 | m.SetColor("_Color1", _color1); 417 | m.SetColor("_Color2", _color2); 418 | m.SetFloat("_Metallic", _metallic); 419 | m.SetFloat("_Smoothness", _smoothness); 420 | 421 | m.SetVector("_LineWidth", new Vector2(1 -_lineWidthRandomness, 1) * _lineWidth); 422 | m.SetFloat("_Throttle", _throttle); 423 | 424 | m.SetTexture("_PositionTex", _positionBuffer2); 425 | m.SetTexture("_VelocityTex", _velocityBuffer2); 426 | 427 | if (_colorMode == ColorMode.Smooth) 428 | m.EnableKeyword("COLOR_SMOOTH"); 429 | else 430 | m.DisableKeyword("COLOR_SMOOTH"); 431 | } 432 | 433 | void ResetResources() 434 | { 435 | // parameter sanitization 436 | _lineCount = Mathf.Clamp(_lineCount, 1, 8192); 437 | _historyLength = Mathf.Clamp(_historyLength, 8, 1024); 438 | 439 | // mesh object 440 | if (_mesh) DestroyImmediate(_mesh); 441 | _mesh = CreateMesh(); 442 | 443 | // GPGPU buffers 444 | if (_positionBuffer1) DestroyImmediate(_positionBuffer1); 445 | if (_positionBuffer2) DestroyImmediate(_positionBuffer2); 446 | if (_velocityBuffer1) DestroyImmediate(_velocityBuffer1); 447 | if (_velocityBuffer2) DestroyImmediate(_velocityBuffer2); 448 | 449 | _positionBuffer1 = CreateBuffer(false); 450 | _positionBuffer2 = CreateBuffer(false); 451 | _velocityBuffer1 = CreateBuffer(true); 452 | _velocityBuffer2 = CreateBuffer(true); 453 | 454 | // shader materials 455 | if (!_kernelMaterial) _kernelMaterial = CreateMaterial(_kernelShader); 456 | if (!_lineMaterial) _lineMaterial = CreateMaterial(_lineShader); 457 | } 458 | 459 | void ResetState() 460 | { 461 | _noiseOffset = Vector3.one * _randomSeed; 462 | UpdateKernelShader(0); 463 | Graphics.Blit(null, _positionBuffer2, _kernelMaterial, 0); 464 | Graphics.Blit(null, _velocityBuffer2, _kernelMaterial, 1); 465 | } 466 | 467 | #endregion 468 | 469 | #region MonoBehaviour Functions 470 | 471 | void Reset() 472 | { 473 | _needsReset = true; 474 | } 475 | 476 | void OnDestroy() 477 | { 478 | if (_mesh) DestroyImmediate(_mesh); 479 | if (_positionBuffer1) DestroyImmediate(_positionBuffer1); 480 | if (_positionBuffer2) DestroyImmediate(_positionBuffer2); 481 | if (_velocityBuffer1) DestroyImmediate(_velocityBuffer1); 482 | if (_velocityBuffer2) DestroyImmediate(_velocityBuffer2); 483 | if (_kernelMaterial) DestroyImmediate(_kernelMaterial); 484 | if (_lineMaterial) DestroyImmediate(_lineMaterial); 485 | } 486 | 487 | void Update() 488 | { 489 | if (_needsReset) 490 | { 491 | ResetResources(); 492 | ResetState(); 493 | _needsReset = false; 494 | } 495 | 496 | if (Application.isPlaying) 497 | { 498 | float deltaTime; 499 | int steps; 500 | 501 | if (_fixTimeStep) 502 | { 503 | // fixed time step 504 | deltaTime = 1.0f / _stepsPerSecond; 505 | steps = Mathf.RoundToInt(Time.deltaTime * _stepsPerSecond); 506 | } 507 | else 508 | { 509 | // variable time step 510 | deltaTime = Time.smoothDeltaTime; 511 | steps = 1; 512 | } 513 | 514 | // time steps 515 | for (var i = 0; i < steps; i++) 516 | StepKernel(deltaTime); 517 | } 518 | else 519 | { 520 | ResetState(); 521 | 522 | // warming up 523 | for (var i = 0; i < 32; i++) 524 | StepKernel(0.1f); 525 | } 526 | 527 | // drawing lines 528 | UpdateLineShader(); 529 | 530 | var matrix = transform.localToWorldMatrix; 531 | var stride = LinesPerDraw; 532 | var total = TotalLineCount; 533 | 534 | var props = new MaterialPropertyBlock(); 535 | var uv = new Vector2(0.5f / _historyLength, 0); 536 | 537 | for (var i = 0; i < total; i += stride) 538 | { 539 | uv.y = (0.5f + i) / total; 540 | props.SetVector("_BufferOffset", uv); 541 | 542 | // front face 543 | props.SetFloat("_Flip", 1); 544 | Graphics.DrawMesh( 545 | _mesh, matrix, _lineMaterial, gameObject.layer, 546 | null, 0, props, _castShadows, _receiveShadows 547 | ); 548 | 549 | // back face 550 | props.SetFloat("_Flip", -1); 551 | Graphics.DrawMesh( 552 | _mesh, matrix, _lineMaterial, gameObject.layer, 553 | null, 0, props, _castShadows, _receiveShadows 554 | ); 555 | } 556 | } 557 | 558 | #endregion 559 | } 560 | } 561 | -------------------------------------------------------------------------------- /Assets/Kvant/Swarm/Swarm.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 51c30eda798174ab2be4fb13ae65946d 3 | timeCreated: 1437922642 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _kernelShader: {fileID: 4800000, guid: ab176efa7135a4f038c7b318a0b3c9ef, type: 3} 9 | - _lineShader: {fileID: 4800000, guid: ebdc691e18a6342eeac2c370efde4a89, type: 3} 10 | executionOrder: 0 11 | icon: {instanceID: 0} 12 | userData: 13 | assetBundleName: 14 | assetBundleVariant: 15 | -------------------------------------------------------------------------------- /Assets/Reaktion.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 487429d9beca24ae78ab8ac96eb73dde 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Reaktion/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 263f8cf5a4c1141e6a79dc1c86d69dc2 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Reaktion/Editor/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c8c8f5affaaa4616a15e69dda142154 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Reaktion/Editor/Utility/ConstantMotionEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Reaktion - An audio reactive animation toolkit for Unity. 3 | // 4 | // Copyright (C) 2013, 2014 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 | using System.Collections; 26 | 27 | namespace Reaktion { 28 | 29 | // Custom property drawer for TransformElement. 30 | [CustomPropertyDrawer(typeof(ConstantMotion.TransformElement))] 31 | class ConstantMotionElementDrawer : PropertyDrawer 32 | { 33 | // Labels and values for TransformMode. 34 | static GUIContent[] modeLabels = { 35 | new GUIContent("Off"), 36 | new GUIContent("X Axis"), 37 | new GUIContent("Y Axis"), 38 | new GUIContent("Z Axis"), 39 | new GUIContent("Arbitrary Vector"), 40 | new GUIContent("Random Vector") 41 | }; 42 | static int[] modeValues = { 0, 1, 2, 3, 4, 5 }; 43 | 44 | static int GetExpansionLevel(SerializedProperty property) 45 | { 46 | var mode = property.FindPropertyRelative("mode"); 47 | // Fully expand if it has different values. 48 | if (mode.hasMultipleDifferentValues) return 2; 49 | // "Off" 50 | if (mode.enumValueIndex == 0) return 0; 51 | // Fully expand if it's in Arbitrary mode. 52 | if (mode.enumValueIndex == (int)ConstantMotion.TransformMode.Arbitrary) return 2; 53 | // Expand one level. 54 | return 1; 55 | } 56 | 57 | public override float GetPropertyHeight(SerializedProperty property, GUIContent label) 58 | { 59 | int rows = new int[]{1, 3, 4}[GetExpansionLevel(property)]; 60 | return EditorGUIUtility.singleLineHeight * rows + 61 | EditorGUIUtility.standardVerticalSpacing * (rows - 1); 62 | } 63 | 64 | public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) 65 | { 66 | EditorGUI.BeginProperty(position, label, property); 67 | 68 | position.height = EditorGUIUtility.singleLineHeight; 69 | var rowHeight = EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; 70 | 71 | // Transform mode selector drop-down. 72 | EditorGUI.IntPopup(position, property.FindPropertyRelative("mode"), modeLabels, modeValues, label); 73 | position.y += rowHeight; 74 | 75 | var expansion = GetExpansionLevel(property); 76 | if (expansion > 0) 77 | { 78 | // Insert an indent. 79 | position.x += 16; 80 | position.width -= 16; 81 | EditorGUIUtility.labelWidth -= 16; 82 | 83 | if (expansion == 2) 84 | { 85 | // Vector box. 86 | EditorGUI.PropertyField(position, property.FindPropertyRelative("arbitraryVector"), GUIContent.none); 87 | position.y += rowHeight; 88 | } 89 | 90 | // Velocity box. 91 | EditorGUI.PropertyField(position, property.FindPropertyRelative("velocity"), new GUIContent("Velocity")); 92 | position.y += EditorGUIUtility.singleLineHeight + EditorGUIUtility.standardVerticalSpacing; 93 | 94 | // Randomness slider. 95 | EditorGUI.Slider(position, property.FindPropertyRelative("randomness"), 0, 1, new GUIContent("Randomness")); 96 | } 97 | 98 | EditorGUI.EndProperty(); 99 | } 100 | } 101 | 102 | [CustomEditor(typeof(ConstantMotion)), CanEditMultipleObjects] 103 | public class ConstantMotionEditor : Editor 104 | { 105 | SerializedProperty propPosition; 106 | SerializedProperty propRotation; 107 | SerializedProperty propUseLocalCoordinate; 108 | GUIContent labelLocalCoordinate; 109 | 110 | void OnEnable() 111 | { 112 | propPosition = serializedObject.FindProperty("position"); 113 | propRotation = serializedObject.FindProperty("rotation"); 114 | propUseLocalCoordinate = serializedObject.FindProperty("useLocalCoordinate"); 115 | labelLocalCoordinate = new GUIContent("Local Coordinate"); 116 | } 117 | 118 | public override void OnInspectorGUI() 119 | { 120 | serializedObject.Update(); 121 | EditorGUILayout.PropertyField(propPosition); 122 | EditorGUILayout.PropertyField(propRotation); 123 | EditorGUILayout.PropertyField(propUseLocalCoordinate, labelLocalCoordinate); 124 | serializedObject.ApplyModifiedProperties(); 125 | } 126 | } 127 | 128 | } // namespace Reaktion 129 | -------------------------------------------------------------------------------- /Assets/Reaktion/Editor/Utility/ConstantMotionEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af7f5def51f424dc4baac2ab376b2c60 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Reaktion/Editor/Utility/JitterMotionEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Reaktion - An audio reactive animation toolkit for Unity. 3 | // 4 | // Copyright (C) 2013, 2014 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 | using System.Collections; 26 | 27 | namespace Reaktion { 28 | 29 | [CustomEditor(typeof(JitterMotion)), CanEditMultipleObjects] 30 | public class JitterMotionEditor : Editor 31 | { 32 | SerializedProperty propPositionFrequency; 33 | SerializedProperty propRotationFrequency; 34 | 35 | SerializedProperty propPositionAmount; 36 | SerializedProperty propRotationAmount; 37 | 38 | SerializedProperty propPositionComponents; 39 | SerializedProperty propRotationComponents; 40 | 41 | SerializedProperty propPositionOctave; 42 | SerializedProperty propRotationOctave; 43 | 44 | GUIContent labelFrequency; 45 | GUIContent labelAmount; 46 | GUIContent labelOctave; 47 | 48 | void OnEnable() 49 | { 50 | propPositionFrequency = serializedObject.FindProperty("positionFrequency"); 51 | propRotationFrequency = serializedObject.FindProperty("rotationFrequency"); 52 | 53 | propPositionAmount = serializedObject.FindProperty("positionAmount"); 54 | propRotationAmount = serializedObject.FindProperty("rotationAmount"); 55 | 56 | propPositionComponents = serializedObject.FindProperty("positionComponents"); 57 | propRotationComponents = serializedObject.FindProperty("rotationComponents"); 58 | 59 | propPositionOctave = serializedObject.FindProperty("positionOctave"); 60 | propRotationOctave = serializedObject.FindProperty("rotationOctave"); 61 | 62 | labelFrequency = new GUIContent("Frequency"); 63 | labelAmount = new GUIContent("Noise Strength"); 64 | labelOctave = new GUIContent("Fractal Level"); 65 | } 66 | 67 | public override void OnInspectorGUI() 68 | { 69 | serializedObject.Update(); 70 | 71 | EditorGUILayout.LabelField("Position"); 72 | EditorGUI.indentLevel++; 73 | EditorGUILayout.PropertyField(propPositionAmount, labelAmount); 74 | EditorGUILayout.PropertyField(propPositionComponents, GUIContent.none); 75 | EditorGUILayout.PropertyField(propPositionFrequency, labelFrequency); 76 | EditorGUILayout.IntSlider(propPositionOctave, 1, 8, labelOctave); 77 | EditorGUI.indentLevel--; 78 | 79 | EditorGUILayout.LabelField("Rotation"); 80 | EditorGUI.indentLevel++; 81 | EditorGUILayout.PropertyField(propRotationAmount, labelAmount); 82 | EditorGUILayout.PropertyField(propRotationComponents, GUIContent.none); 83 | EditorGUILayout.PropertyField(propRotationFrequency, labelFrequency); 84 | EditorGUILayout.IntSlider(propRotationOctave, 1, 8, labelOctave); 85 | EditorGUI.indentLevel--; 86 | 87 | serializedObject.ApplyModifiedProperties(); 88 | } 89 | } 90 | 91 | } // namespace Reaktion 92 | -------------------------------------------------------------------------------- /Assets/Reaktion/Editor/Utility/JitterMotionEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 268ea7a40f25a4aca9338ec15fae8021 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Reaktion/Internal.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 326e33d18c9d64154b21ab0147da9239 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Reaktion/Internal/Perlin.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Reaktion - An audio reactive animation toolkit for Unity. 3 | // 4 | // Copyright (C) 2013, 2014 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 | 24 | using UnityEngine; 25 | using System.Runtime.InteropServices; 26 | 27 | namespace Reaktion { 28 | 29 | public static class Perlin 30 | { 31 | // 32 | // Based on the original implementation by Ken Perlin 33 | // http://mrl.nyu.edu/~perlin/noise/ 34 | // 35 | 36 | #region Noise functions 37 | 38 | public static float Noise (float x) 39 | { 40 | var X = Mathf.FloorToInt (x) & 0xff; 41 | x -= Mathf.Floor (x); 42 | return Lerp (Fade (x), Grad(X, x), Grad (X + 1, x - 1)); 43 | } 44 | 45 | public static float Noise (float x, float y) 46 | { 47 | var X = Mathf.FloorToInt (x) & 0xff; 48 | var Y = Mathf.FloorToInt (y) & 0xff; 49 | x -= Mathf.Floor (x); 50 | y -= Mathf.Floor (y); 51 | var u = Fade (x); 52 | var v = Fade (y); 53 | var A = (perm [X ] + Y) & 0xff; 54 | var B = (perm [X + 1] + Y) & 0xff; 55 | return Lerp (v, Lerp (u, Grad (A , x, y ), Grad (B, x - 1, y )), 56 | Lerp (u, Grad (A + 1, x, y - 1), Grad (B + 1, x - 1, y - 1))); 57 | } 58 | 59 | public static float Noise (Vector2 coord) 60 | { 61 | return Noise (coord.x, coord.y); 62 | } 63 | 64 | public static float Noise (float x, float y, float z) 65 | { 66 | var X = Mathf.FloorToInt (x) & 0xff; 67 | var Y = Mathf.FloorToInt (y) & 0xff; 68 | var Z = Mathf.FloorToInt (z) & 0xff; 69 | x -= Mathf.Floor (x); 70 | y -= Mathf.Floor (y); 71 | z -= Mathf.Floor (z); 72 | var u = Fade (x); 73 | var v = Fade (y); 74 | var w = Fade (z); 75 | var A = (perm [X ] + Y) & 0xff; 76 | var B = (perm [X + 1] + Y) & 0xff; 77 | var AA = (perm [A ] + Z) & 0xff; 78 | var BA = (perm [B ] + Z) & 0xff; 79 | var AB = (perm [A + 1] + Z) & 0xff; 80 | var BB = (perm [B + 1] + Z) & 0xff; 81 | return Lerp (w, Lerp (v, Lerp (u, Grad (AA , x , y , z ), Grad (BA , x - 1, y , z )), 82 | Lerp (u, Grad (AB , x , y - 1, z ), Grad (BB , x - 1, y - 1, z ))), 83 | Lerp (v, Lerp (u, Grad (AA + 1, x , y , z - 1), Grad (BA + 1, x - 1, y , z - 1)), 84 | Lerp (u, Grad (AB + 1, x , y - 1, z - 1), Grad (BB + 1, x - 1, y - 1, z - 1)))); 85 | } 86 | 87 | public static float Noise (Vector3 coord) 88 | { 89 | return Noise (coord.x, coord.y, coord.z); 90 | } 91 | 92 | #endregion 93 | 94 | #region fBm functions 95 | 96 | public static float Fbm (float x, int octave) 97 | { 98 | var f = 0.0f; 99 | var w = 0.5f; 100 | for (var i = 0; i < octave; i++) { 101 | f += w * Noise (x); 102 | x *= 2.0f; 103 | w *= 0.5f; 104 | } 105 | return f; 106 | } 107 | 108 | public static float Fbm (Vector2 coord, int octave) 109 | { 110 | var f = 0.0f; 111 | var w = 0.5f; 112 | for (var i = 0; i < octave; i++) { 113 | f += w * Noise (coord); 114 | coord *= 2.0f; 115 | w *= 0.5f; 116 | } 117 | return f; 118 | } 119 | 120 | public static float Fbm (Vector3 coord, int octave) 121 | { 122 | var f = 0.0f; 123 | var w = 0.5f; 124 | for (var i = 0; i < octave; i++) { 125 | f += w * Noise (coord); 126 | coord *= 2.0f; 127 | w *= 0.5f; 128 | } 129 | return f; 130 | } 131 | 132 | #endregion 133 | 134 | #region Private functions 135 | 136 | static float Fade (float t) 137 | { 138 | return t * t * t * (t * (t * 6 - 15) + 10); 139 | } 140 | 141 | static float Lerp (float t, float a, float b) 142 | { 143 | return a + t * (b - a); 144 | } 145 | 146 | static float Grad (int i, float x) 147 | { 148 | return (perm [i] & 1) != 0 ? x : -x; 149 | } 150 | 151 | static float Grad (int i, float x, float y) 152 | { 153 | var h = perm [i]; 154 | return ((h & 1) != 0 ? x : -x) + ((h & 2) != 0 ? y : -y); 155 | } 156 | 157 | static float Grad (int i, float x, float y, float z) 158 | { 159 | var h = perm [i] & 15; 160 | var u = h < 8 ? x : y; 161 | var v = h < 4 ? y : (h == 12 || h == 14 ? x : z); 162 | return ((h & 1) != 0 ? u : -u) + ((h & 2) != 0 ? v : -v); 163 | } 164 | 165 | static int[] perm = { 166 | 151,160,137,91,90,15, 167 | 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23, 168 | 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33, 169 | 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166, 170 | 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244, 171 | 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196, 172 | 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123, 173 | 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42, 174 | 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9, 175 | 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228, 176 | 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107, 177 | 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254, 178 | 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180, 179 | 151 180 | }; 181 | 182 | #endregion 183 | } 184 | 185 | } // namespace Reaktion 186 | -------------------------------------------------------------------------------- /Assets/Reaktion/Internal/Perlin.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f982ffe3e8ec84582a4b361630ea004a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Reaktion/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d874762c14cf4223bd1bcfc86500326 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Reaktion/Utility/ConstantMotion.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Reaktion - An audio reactive animation toolkit for Unity. 3 | // 4 | // Copyright (C) 2013, 2014 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 Reaktion { 26 | 27 | public class ConstantMotion : MonoBehaviour 28 | { 29 | public enum TransformMode { 30 | Off, XAxis, YAxis, ZAxis, Arbitrary, Random 31 | }; 32 | 33 | // A class for handling each transformation. 34 | [System.Serializable] 35 | public class TransformElement 36 | { 37 | public TransformMode mode = TransformMode.Off; 38 | public float velocity = 1; 39 | 40 | // Used only in the arbitrary mode. 41 | public Vector3 arbitraryVector = Vector3.up; 42 | 43 | // Affects velocity. 44 | public float randomness = 0; 45 | 46 | // Randomizer states. 47 | Vector3 randomVector; 48 | float randomScalar; 49 | 50 | public void Initialize() 51 | { 52 | randomVector = Random.onUnitSphere; 53 | randomScalar = Random.value; 54 | } 55 | 56 | // Get a vector corresponds to the current transform mode. 57 | public Vector3 Vector { 58 | get { 59 | switch (mode) 60 | { 61 | case TransformMode.XAxis: return Vector3.right; 62 | case TransformMode.YAxis: return Vector3.up; 63 | case TransformMode.ZAxis: return Vector3.forward; 64 | case TransformMode.Arbitrary: return arbitraryVector; 65 | case TransformMode.Random: return randomVector; 66 | } 67 | return Vector3.zero; 68 | } 69 | } 70 | 71 | // Get the current delta value. 72 | public float Delta { 73 | get { 74 | var scale = (1.0f - randomness * randomScalar); 75 | return velocity * scale * Time.deltaTime; 76 | } 77 | } 78 | } 79 | 80 | public TransformElement position = new TransformElement(); 81 | public TransformElement rotation = new TransformElement{ velocity = 30 }; 82 | public bool useLocalCoordinate = true; 83 | 84 | void Awake() 85 | { 86 | position.Initialize(); 87 | rotation.Initialize(); 88 | } 89 | 90 | void Update() 91 | { 92 | if (position.mode != TransformMode.Off) 93 | { 94 | if (useLocalCoordinate) 95 | transform.localPosition += position.Vector * position.Delta; 96 | else 97 | transform.position += position.Vector * position.Delta; 98 | } 99 | 100 | if (rotation.mode != TransformMode.Off) 101 | { 102 | var delta = Quaternion.AngleAxis(rotation.Delta, rotation.Vector); 103 | if (useLocalCoordinate) 104 | transform.localRotation = delta * transform.localRotation; 105 | else 106 | transform.rotation = delta * transform.rotation; 107 | } 108 | } 109 | } 110 | 111 | } // namespace Reaktion 112 | -------------------------------------------------------------------------------- /Assets/Reaktion/Utility/ConstantMotion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f91a6fa75d39940268b68c6204273e22 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Reaktion/Utility/JitterMotion.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Reaktion - An audio reactive animation toolkit for Unity. 3 | // 4 | // Copyright (C) 2013, 2014 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 Reaktion { 26 | 27 | public class JitterMotion : MonoBehaviour 28 | { 29 | public float positionFrequency = 0.2f; 30 | public float rotationFrequency = 0.2f; 31 | 32 | public float positionAmount = 1.0f; 33 | public float rotationAmount = 30.0f; 34 | 35 | public Vector3 positionComponents = Vector3.one; 36 | public Vector3 rotationComponents = new Vector3(1, 1, 0); 37 | 38 | public int positionOctave = 3; 39 | public int rotationOctave = 3; 40 | 41 | float timePosition; 42 | float timeRotation; 43 | 44 | Vector2[] noiseVectors; 45 | 46 | Vector3 initialPosition; 47 | Quaternion initialRotation; 48 | 49 | void Awake() 50 | { 51 | timePosition = Random.value * 10; 52 | timeRotation = Random.value * 10; 53 | 54 | noiseVectors = new Vector2[6]; 55 | 56 | for (var i = 0; i < 6; i++) 57 | { 58 | var theta = Random.value * Mathf.PI * 2; 59 | noiseVectors[i].Set(Mathf.Cos(theta), Mathf.Sin(theta)); 60 | } 61 | 62 | initialPosition = transform.localPosition; 63 | initialRotation = transform.localRotation; 64 | } 65 | 66 | void Update() 67 | { 68 | timePosition += Time.deltaTime * positionFrequency; 69 | timeRotation += Time.deltaTime * rotationFrequency; 70 | 71 | if (positionAmount != 0.0f) 72 | { 73 | var p = new Vector3( 74 | Fbm(noiseVectors[0] * timePosition, positionOctave), 75 | Fbm(noiseVectors[1] * timePosition, positionOctave), 76 | Fbm(noiseVectors[2] * timePosition, positionOctave) 77 | ); 78 | p = Vector3.Scale(p, positionComponents) * positionAmount * 2; 79 | transform.localPosition = initialPosition + p; 80 | } 81 | 82 | if (rotationAmount != 0.0f) 83 | { 84 | var r = new Vector3( 85 | Fbm(noiseVectors[3] * timeRotation, rotationOctave), 86 | Fbm(noiseVectors[4] * timeRotation, rotationOctave), 87 | Fbm(noiseVectors[5] * timeRotation, rotationOctave) 88 | ); 89 | r = Vector3.Scale(r, rotationComponents) * rotationAmount * 2; 90 | transform.localRotation = Quaternion.Euler(r) * initialRotation; 91 | } 92 | } 93 | 94 | static float Fbm(Vector2 coord, int octave) 95 | { 96 | var f = 0.0f; 97 | var w = 1.0f; 98 | for (var i = 0; i < octave; i++) 99 | { 100 | f += w * Perlin.Noise(coord.x, coord.y) * 0.5f; 101 | coord *= 2; 102 | w *= 0.5f; 103 | } 104 | return f; 105 | } 106 | } 107 | 108 | } // namespace Reaktion 109 | -------------------------------------------------------------------------------- /Assets/Reaktion/Utility/JitterMotion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d637268abbbb5428e991dd9ec93136f2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0707b639c58f50444b8d7949e60e02b4 3 | folderAsset: yes 4 | timeCreated: 1449641015 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Attractor.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | SceneSettings: 5 | m_ObjectHideFlags: 0 6 | m_PVSData: 7 | m_PVSObjectsArray: [] 8 | m_PVSPortalsArray: [] 9 | m_OcclusionBakeSettings: 10 | smallestOccluder: 5 11 | smallestHole: .25 12 | backfaceThreshold: 100 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 6 17 | m_Fog: 0 18 | m_FogColor: {r: .5, g: .5, b: .5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: .00999999978 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: .211999997, g: .226999998, b: .259000003, a: 1} 24 | m_AmbientEquatorColor: {r: .114, g: .125, b: .133000001, a: 1} 25 | m_AmbientGroundColor: {r: .0469999984, g: .0430000015, b: .0350000001, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SkyboxMaterial: {fileID: 2100000, guid: 07c0f0330c8a24547b7b7695d09d7e35, type: 2} 29 | m_HaloStrength: .5 30 | m_FlareStrength: 1 31 | m_FlareFadeSpeed: 3 32 | m_HaloTexture: {fileID: 0} 33 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 34 | m_DefaultReflectionMode: 0 35 | m_DefaultReflectionResolution: 128 36 | m_ReflectionBounces: 1 37 | m_ReflectionIntensity: 1 38 | m_CustomReflection: {fileID: 0} 39 | m_Sun: {fileID: 0} 40 | --- !u!157 &3 41 | LightmapSettings: 42 | m_ObjectHideFlags: 0 43 | serializedVersion: 5 44 | m_GIWorkflowMode: 0 45 | m_LightmapsMode: 1 46 | m_GISettings: 47 | serializedVersion: 2 48 | m_BounceScale: 1 49 | m_IndirectOutputScale: 1 50 | m_AlbedoBoost: 1 51 | m_TemporalCoherenceThreshold: 1 52 | m_EnvironmentLightingMode: 0 53 | m_EnableBakedLightmaps: 1 54 | m_EnableRealtimeLightmaps: 1 55 | m_LightmapEditorSettings: 56 | serializedVersion: 3 57 | m_Resolution: 2 58 | m_BakeResolution: 40 59 | m_TextureWidth: 1024 60 | m_TextureHeight: 1024 61 | m_AOMaxDistance: 1 62 | m_Padding: 2 63 | m_CompAOExponent: 0 64 | m_LightmapParameters: {fileID: 0} 65 | m_TextureCompression: 1 66 | m_FinalGather: 0 67 | m_FinalGatherRayCount: 1024 68 | m_ReflectionCompression: 2 69 | m_LightmapSnapshot: {fileID: 0} 70 | m_RuntimeCPUUsage: 25 71 | --- !u!196 &4 72 | NavMeshSettings: 73 | serializedVersion: 2 74 | m_ObjectHideFlags: 0 75 | m_BuildSettings: 76 | serializedVersion: 2 77 | agentRadius: .5 78 | agentHeight: 2 79 | agentSlope: 45 80 | agentClimb: .400000006 81 | ledgeDropHeight: 0 82 | maxJumpAcrossDistance: 0 83 | accuratePlacement: 0 84 | minRegionArea: 2 85 | cellSize: .166666672 86 | manualCellSize: 0 87 | m_NavMeshData: {fileID: 0} 88 | --- !u!1 &201321411 89 | GameObject: 90 | m_ObjectHideFlags: 0 91 | m_PrefabParentObject: {fileID: 0} 92 | m_PrefabInternal: {fileID: 0} 93 | serializedVersion: 4 94 | m_Component: 95 | - 4: {fileID: 201321416} 96 | - 20: {fileID: 201321415} 97 | - 92: {fileID: 201321414} 98 | - 124: {fileID: 201321413} 99 | - 81: {fileID: 201321412} 100 | - 114: {fileID: 201321417} 101 | - 114: {fileID: 201321419} 102 | - 114: {fileID: 201321418} 103 | m_Layer: 0 104 | m_Name: Main Camera 105 | m_TagString: MainCamera 106 | m_Icon: {fileID: 0} 107 | m_NavMeshLayer: 0 108 | m_StaticEditorFlags: 0 109 | m_IsActive: 1 110 | --- !u!81 &201321412 111 | AudioListener: 112 | m_ObjectHideFlags: 0 113 | m_PrefabParentObject: {fileID: 0} 114 | m_PrefabInternal: {fileID: 0} 115 | m_GameObject: {fileID: 201321411} 116 | m_Enabled: 1 117 | --- !u!124 &201321413 118 | Behaviour: 119 | m_ObjectHideFlags: 0 120 | m_PrefabParentObject: {fileID: 0} 121 | m_PrefabInternal: {fileID: 0} 122 | m_GameObject: {fileID: 201321411} 123 | m_Enabled: 1 124 | --- !u!92 &201321414 125 | Behaviour: 126 | m_ObjectHideFlags: 0 127 | m_PrefabParentObject: {fileID: 0} 128 | m_PrefabInternal: {fileID: 0} 129 | m_GameObject: {fileID: 201321411} 130 | m_Enabled: 1 131 | --- !u!20 &201321415 132 | Camera: 133 | m_ObjectHideFlags: 0 134 | m_PrefabParentObject: {fileID: 0} 135 | m_PrefabInternal: {fileID: 0} 136 | m_GameObject: {fileID: 201321411} 137 | m_Enabled: 1 138 | serializedVersion: 2 139 | m_ClearFlags: 1 140 | m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} 141 | m_NormalizedViewPortRect: 142 | serializedVersion: 2 143 | x: 0 144 | y: 0 145 | width: 1 146 | height: 1 147 | near clip plane: .300000012 148 | far clip plane: 100 149 | field of view: 20 150 | orthographic: 0 151 | orthographic size: 5 152 | m_Depth: -1 153 | m_CullingMask: 154 | serializedVersion: 2 155 | m_Bits: 4294967295 156 | m_RenderingPath: 3 157 | m_TargetTexture: {fileID: 0} 158 | m_TargetDisplay: 0 159 | m_TargetEye: 3 160 | m_HDR: 1 161 | m_OcclusionCulling: 0 162 | m_StereoConvergence: 10 163 | m_StereoSeparation: .0219999999 164 | m_StereoMirrorMode: 0 165 | --- !u!4 &201321416 166 | Transform: 167 | m_ObjectHideFlags: 0 168 | m_PrefabParentObject: {fileID: 0} 169 | m_PrefabInternal: {fileID: 0} 170 | m_GameObject: {fileID: 201321411} 171 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 172 | m_LocalPosition: {x: 0, y: 0, z: -10} 173 | m_LocalScale: {x: 1, y: 1, z: 1} 174 | m_Children: [] 175 | m_Father: {fileID: 0} 176 | m_RootOrder: 0 177 | --- !u!114 &201321417 178 | MonoBehaviour: 179 | m_ObjectHideFlags: 0 180 | m_PrefabParentObject: {fileID: 0} 181 | m_PrefabInternal: {fileID: 0} 182 | m_GameObject: {fileID: 201321411} 183 | m_Enabled: 1 184 | m_EditorHideFlags: 0 185 | m_Script: {fileID: 11500000, guid: 2f6a516d891854931acf7fb785c812ec, type: 3} 186 | m_Name: 187 | m_EditorClassIdentifier: 188 | _intensity: 1.29999995 189 | _sampleRadius: 1.5 190 | _rangeCheck: 1 191 | _fallOffDistance: 100 192 | _sampleCount: 1 193 | _shader: {fileID: 4800000, guid: c928e16c12e994a70928a9181450d18c, type: 3} 194 | --- !u!114 &201321418 195 | MonoBehaviour: 196 | m_ObjectHideFlags: 0 197 | m_PrefabParentObject: {fileID: 0} 198 | m_PrefabInternal: {fileID: 0} 199 | m_GameObject: {fileID: 201321411} 200 | m_Enabled: 1 201 | m_EditorHideFlags: 0 202 | m_Script: {fileID: 11500000, guid: 10593b7d510b64560a297a8af1356dcb, type: 3} 203 | m_Name: 204 | m_EditorClassIdentifier: 205 | _colorTemp: .170000002 206 | _colorTint: .159999996 207 | _toneMapping: 1 208 | _exposure: 1.29999995 209 | _saturation: 1 210 | _rCurve: 211 | serializedVersion: 2 212 | m_Curve: 213 | - time: 0 214 | value: 0 215 | inSlope: 1.14374995 216 | outSlope: 1.14374995 217 | tangentMode: 0 218 | - time: 1 219 | value: 1 220 | inSlope: 1.03977323 221 | outSlope: 1.03977323 222 | tangentMode: 0 223 | m_PreInfinity: 2 224 | m_PostInfinity: 2 225 | _gCurve: 226 | serializedVersion: 2 227 | m_Curve: 228 | - time: 0 229 | value: 0 230 | inSlope: 1 231 | outSlope: 1 232 | tangentMode: 10 233 | - time: 1 234 | value: 1 235 | inSlope: 1 236 | outSlope: 1 237 | tangentMode: 10 238 | m_PreInfinity: 2 239 | m_PostInfinity: 2 240 | _bCurve: 241 | serializedVersion: 2 242 | m_Curve: 243 | - time: 0 244 | value: 0 245 | inSlope: 1.11888576 246 | outSlope: 1.11888576 247 | tangentMode: 0 248 | - time: 1 249 | value: 1 250 | inSlope: 1.27083421 251 | outSlope: 1.27083421 252 | tangentMode: 0 253 | m_PreInfinity: 2 254 | m_PostInfinity: 2 255 | _cCurve: 256 | serializedVersion: 2 257 | m_Curve: 258 | - time: .00983606558 259 | value: -.0624999925 260 | inSlope: 0 261 | outSlope: 1.20970011 262 | tangentMode: 21 263 | - time: .909594238 264 | value: 1.02593756 265 | inSlope: 1.20970011 266 | outSlope: 0 267 | tangentMode: 21 268 | m_PreInfinity: 2 269 | m_PostInfinity: 2 270 | _ditherMode: 1 271 | shader: {fileID: 4800000, guid: dc9775b65c52747e69fc4c854c00d696, type: 3} 272 | --- !u!114 &201321419 273 | MonoBehaviour: 274 | m_ObjectHideFlags: 0 275 | m_PrefabParentObject: {fileID: 0} 276 | m_PrefabInternal: {fileID: 0} 277 | m_GameObject: {fileID: 201321411} 278 | m_Enabled: 1 279 | m_EditorHideFlags: 0 280 | m_Script: {fileID: 11500000, guid: 6fc18a55c333d51489e5ee49b3cbff50, type: 3} 281 | m_Name: 282 | m_EditorClassIdentifier: 283 | _falloff: .5 284 | _shader: {fileID: 4800000, guid: 89a223cbeee1935419811f8736c0a9b3, type: 3} 285 | --- !u!1 &530349849 286 | GameObject: 287 | m_ObjectHideFlags: 0 288 | m_PrefabParentObject: {fileID: 0} 289 | m_PrefabInternal: {fileID: 0} 290 | serializedVersion: 4 291 | m_Component: 292 | - 4: {fileID: 530349851} 293 | - 108: {fileID: 530349850} 294 | m_Layer: 0 295 | m_Name: Directional Light 296 | m_TagString: Untagged 297 | m_Icon: {fileID: 0} 298 | m_NavMeshLayer: 0 299 | m_StaticEditorFlags: 0 300 | m_IsActive: 1 301 | --- !u!108 &530349850 302 | Light: 303 | m_ObjectHideFlags: 0 304 | m_PrefabParentObject: {fileID: 0} 305 | m_PrefabInternal: {fileID: 0} 306 | m_GameObject: {fileID: 530349849} 307 | m_Enabled: 1 308 | serializedVersion: 6 309 | m_Type: 1 310 | m_Color: {r: 1, g: .996957421, b: .95588237, a: 1} 311 | m_Intensity: 1 312 | m_Range: 10 313 | m_SpotAngle: 30 314 | m_CookieSize: 10 315 | m_Shadows: 316 | m_Type: 2 317 | m_Resolution: -1 318 | m_Strength: 1 319 | m_Bias: .0500000007 320 | m_NormalBias: .400000006 321 | m_Cookie: {fileID: 0} 322 | m_DrawHalo: 0 323 | m_Flare: {fileID: 0} 324 | m_RenderMode: 0 325 | m_CullingMask: 326 | serializedVersion: 2 327 | m_Bits: 4294967295 328 | m_Lightmapping: 4 329 | m_BounceIntensity: 1 330 | m_ShadowRadius: 0 331 | m_ShadowAngle: 0 332 | m_AreaSize: {x: 1, y: 1} 333 | --- !u!4 &530349851 334 | Transform: 335 | m_ObjectHideFlags: 0 336 | m_PrefabParentObject: {fileID: 0} 337 | m_PrefabInternal: {fileID: 0} 338 | m_GameObject: {fileID: 530349849} 339 | m_LocalRotation: {x: .146446586, y: -.853553474, z: .353553444, w: .353553295} 340 | m_LocalPosition: {x: 0, y: 3, z: 0} 341 | m_LocalScale: {x: 1, y: 1, z: 1} 342 | m_Children: [] 343 | m_Father: {fileID: 0} 344 | m_RootOrder: 1 345 | --- !u!1 &1377882077 346 | GameObject: 347 | m_ObjectHideFlags: 0 348 | m_PrefabParentObject: {fileID: 0} 349 | m_PrefabInternal: {fileID: 0} 350 | serializedVersion: 4 351 | m_Component: 352 | - 4: {fileID: 1377882079} 353 | - 114: {fileID: 1377882078} 354 | m_Layer: 0 355 | m_Name: Swarm 356 | m_TagString: Untagged 357 | m_Icon: {fileID: 0} 358 | m_NavMeshLayer: 0 359 | m_StaticEditorFlags: 0 360 | m_IsActive: 1 361 | --- !u!114 &1377882078 362 | MonoBehaviour: 363 | m_ObjectHideFlags: 0 364 | m_PrefabParentObject: {fileID: 0} 365 | m_PrefabInternal: {fileID: 0} 366 | m_GameObject: {fileID: 1377882077} 367 | m_Enabled: 1 368 | m_EditorHideFlags: 0 369 | m_Script: {fileID: 11500000, guid: 51c30eda798174ab2be4fb13ae65946d, type: 3} 370 | m_Name: 371 | m_EditorClassIdentifier: 372 | _lineCount: 1400 373 | _historyLength: 200 374 | _throttle: 1 375 | _flow: {x: 0, y: 0, z: 0} 376 | _attractor: {fileID: 0} 377 | _attractorPosition: {x: 0, y: 0, z: 0} 378 | _attractorRadius: 0 379 | _forcePerDistance: 2 380 | _forceRandomness: .150000006 381 | _drag: 2 382 | _noiseAmplitude: 2 383 | _noiseFrequency: .100000001 384 | _noiseSpread: .300000012 385 | _noiseMotion: 1 386 | _swirlAmplitude: .0599999987 387 | _swirlFrequency: .119999997 388 | _lineWidth: .0399999991 389 | _lineWidthRandomness: .800000012 390 | _colorMode: 0 391 | _color1: {r: 1, g: 1, b: 1, a: 1} 392 | _color2: {r: .323529422, g: .323529422, b: .323529422, a: 1} 393 | _metallic: .850000024 394 | _smoothness: .550000012 395 | _castShadows: 1 396 | _receiveShadows: 1 397 | _fixTimeStep: 1 398 | _stepsPerSecond: 60 399 | _randomSeed: 300 400 | _kernelShader: {fileID: 4800000, guid: ab176efa7135a4f038c7b318a0b3c9ef, type: 3} 401 | _lineShader: {fileID: 4800000, guid: ebdc691e18a6342eeac2c370efde4a89, type: 3} 402 | --- !u!4 &1377882079 403 | Transform: 404 | m_ObjectHideFlags: 0 405 | m_PrefabParentObject: {fileID: 0} 406 | m_PrefabInternal: {fileID: 0} 407 | m_GameObject: {fileID: 1377882077} 408 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 409 | m_LocalPosition: {x: 0, y: 0, z: 0} 410 | m_LocalScale: {x: 1, y: 1, z: 1} 411 | m_Children: [] 412 | m_Father: {fileID: 0} 413 | m_RootOrder: 2 414 | --- !u!1 &2013814885 415 | GameObject: 416 | m_ObjectHideFlags: 0 417 | m_PrefabParentObject: {fileID: 0} 418 | m_PrefabInternal: {fileID: 0} 419 | serializedVersion: 4 420 | m_Component: 421 | - 4: {fileID: 2013814888} 422 | - 33: {fileID: 2013814887} 423 | - 23: {fileID: 2013814886} 424 | m_Layer: 0 425 | m_Name: Plane 426 | m_TagString: Untagged 427 | m_Icon: {fileID: 0} 428 | m_NavMeshLayer: 0 429 | m_StaticEditorFlags: 0 430 | m_IsActive: 1 431 | --- !u!23 &2013814886 432 | MeshRenderer: 433 | m_ObjectHideFlags: 0 434 | m_PrefabParentObject: {fileID: 0} 435 | m_PrefabInternal: {fileID: 0} 436 | m_GameObject: {fileID: 2013814885} 437 | m_Enabled: 1 438 | m_CastShadows: 1 439 | m_ReceiveShadows: 1 440 | m_Materials: 441 | - {fileID: 2100000, guid: d681c1d72c3c16149abd2f0f25ca628c, type: 2} 442 | m_SubsetIndices: 443 | m_StaticBatchRoot: {fileID: 0} 444 | m_UseLightProbes: 1 445 | m_ReflectionProbeUsage: 1 446 | m_ProbeAnchor: {fileID: 0} 447 | m_ScaleInLightmap: 1 448 | m_PreserveUVs: 1 449 | m_IgnoreNormalsForChartDetection: 0 450 | m_ImportantGI: 0 451 | m_MinimumChartSize: 4 452 | m_AutoUVMaxDistance: .5 453 | m_AutoUVMaxAngle: 89 454 | m_LightmapParameters: {fileID: 0} 455 | m_SortingLayerID: 0 456 | m_SortingOrder: 0 457 | --- !u!33 &2013814887 458 | MeshFilter: 459 | m_ObjectHideFlags: 0 460 | m_PrefabParentObject: {fileID: 0} 461 | m_PrefabInternal: {fileID: 0} 462 | m_GameObject: {fileID: 2013814885} 463 | m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0} 464 | --- !u!4 &2013814888 465 | Transform: 466 | m_ObjectHideFlags: 0 467 | m_PrefabParentObject: {fileID: 0} 468 | m_PrefabInternal: {fileID: 0} 469 | m_GameObject: {fileID: 2013814885} 470 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 471 | m_LocalPosition: {x: 0, y: -1.5, z: 0} 472 | m_LocalScale: {x: 1, y: 1, z: 1} 473 | m_Children: [] 474 | m_Father: {fileID: 0} 475 | m_RootOrder: 3 476 | -------------------------------------------------------------------------------- /Assets/Test/Attractor.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f922b0d05e0af6489e614e3dde76282 3 | timeCreated: 1449641708 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Flow.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | SceneSettings: 5 | m_ObjectHideFlags: 0 6 | m_PVSData: 7 | m_PVSObjectsArray: [] 8 | m_PVSPortalsArray: [] 9 | m_OcclusionBakeSettings: 10 | smallestOccluder: 5 11 | smallestHole: .25 12 | backfaceThreshold: 100 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 6 17 | m_Fog: 0 18 | m_FogColor: {r: .5, g: .5, b: .5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: .00999999978 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: .329584748, g: .329745829, b: .352941155, a: 1} 24 | m_AmbientEquatorColor: {r: .153438553, g: .159697503, b: .161764681, a: 1} 25 | m_AmbientGroundColor: {r: .132352948, g: .121647939, b: .100237899, a: 1} 26 | m_AmbientIntensity: 4 27 | m_AmbientMode: 1 28 | m_SkyboxMaterial: {fileID: 0} 29 | m_HaloStrength: .5 30 | m_FlareStrength: 1 31 | m_FlareFadeSpeed: 3 32 | m_HaloTexture: {fileID: 0} 33 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 34 | m_DefaultReflectionMode: 0 35 | m_DefaultReflectionResolution: 128 36 | m_ReflectionBounces: 1 37 | m_ReflectionIntensity: 1 38 | m_CustomReflection: {fileID: 0} 39 | m_Sun: {fileID: 0} 40 | --- !u!157 &3 41 | LightmapSettings: 42 | m_ObjectHideFlags: 0 43 | serializedVersion: 5 44 | m_GIWorkflowMode: 0 45 | m_LightmapsMode: 1 46 | m_GISettings: 47 | serializedVersion: 2 48 | m_BounceScale: 1 49 | m_IndirectOutputScale: 1 50 | m_AlbedoBoost: 1 51 | m_TemporalCoherenceThreshold: 1 52 | m_EnvironmentLightingMode: 0 53 | m_EnableBakedLightmaps: 1 54 | m_EnableRealtimeLightmaps: 1 55 | m_LightmapEditorSettings: 56 | serializedVersion: 3 57 | m_Resolution: 2 58 | m_BakeResolution: 40 59 | m_TextureWidth: 1024 60 | m_TextureHeight: 1024 61 | m_AOMaxDistance: 1 62 | m_Padding: 2 63 | m_CompAOExponent: 0 64 | m_LightmapParameters: {fileID: 0} 65 | m_TextureCompression: 1 66 | m_FinalGather: 0 67 | m_FinalGatherRayCount: 1024 68 | m_ReflectionCompression: 2 69 | m_LightmapSnapshot: {fileID: 0} 70 | m_RuntimeCPUUsage: 25 71 | --- !u!196 &4 72 | NavMeshSettings: 73 | serializedVersion: 2 74 | m_ObjectHideFlags: 0 75 | m_BuildSettings: 76 | serializedVersion: 2 77 | agentRadius: .5 78 | agentHeight: 2 79 | agentSlope: 45 80 | agentClimb: .400000006 81 | ledgeDropHeight: 0 82 | maxJumpAcrossDistance: 0 83 | accuratePlacement: 0 84 | minRegionArea: 2 85 | cellSize: .166666672 86 | manualCellSize: 0 87 | m_NavMeshData: {fileID: 0} 88 | --- !u!1 &64368772 89 | GameObject: 90 | m_ObjectHideFlags: 0 91 | m_PrefabParentObject: {fileID: 0} 92 | m_PrefabInternal: {fileID: 0} 93 | serializedVersion: 4 94 | m_Component: 95 | - 4: {fileID: 64368774} 96 | - 108: {fileID: 64368773} 97 | m_Layer: 0 98 | m_Name: Directional light 99 | m_TagString: Untagged 100 | m_Icon: {fileID: 0} 101 | m_NavMeshLayer: 0 102 | m_StaticEditorFlags: 0 103 | m_IsActive: 1 104 | --- !u!108 &64368773 105 | Light: 106 | m_ObjectHideFlags: 0 107 | m_PrefabParentObject: {fileID: 0} 108 | m_PrefabInternal: {fileID: 0} 109 | m_GameObject: {fileID: 64368772} 110 | m_Enabled: 1 111 | serializedVersion: 6 112 | m_Type: 1 113 | m_Color: {r: 1, g: 1, b: 1, a: 1} 114 | m_Intensity: .75 115 | m_Range: 10 116 | m_SpotAngle: 30 117 | m_CookieSize: 10 118 | m_Shadows: 119 | m_Type: 2 120 | m_Resolution: -1 121 | m_Strength: 1 122 | m_Bias: .0299999993 123 | m_NormalBias: 0 124 | m_Cookie: {fileID: 0} 125 | m_DrawHalo: 0 126 | m_Flare: {fileID: 0} 127 | m_RenderMode: 0 128 | m_CullingMask: 129 | serializedVersion: 2 130 | m_Bits: 4294967295 131 | m_Lightmapping: 4 132 | m_BounceIntensity: 1 133 | m_ShadowRadius: 0 134 | m_ShadowAngle: 0 135 | m_AreaSize: {x: 1, y: 1} 136 | --- !u!4 &64368774 137 | Transform: 138 | m_ObjectHideFlags: 0 139 | m_PrefabParentObject: {fileID: 0} 140 | m_PrefabInternal: {fileID: 0} 141 | m_GameObject: {fileID: 64368772} 142 | m_LocalRotation: {x: .408217937, y: -.234569728, z: .109381676, w: .875426054} 143 | m_LocalPosition: {x: 0, y: 3, z: 0} 144 | m_LocalScale: {x: 1, y: 1, z: 1} 145 | m_Children: [] 146 | m_Father: {fileID: 0} 147 | m_RootOrder: 1 148 | --- !u!1 &201321411 149 | GameObject: 150 | m_ObjectHideFlags: 0 151 | m_PrefabParentObject: {fileID: 0} 152 | m_PrefabInternal: {fileID: 0} 153 | serializedVersion: 4 154 | m_Component: 155 | - 4: {fileID: 201321416} 156 | - 20: {fileID: 201321415} 157 | - 92: {fileID: 201321414} 158 | - 124: {fileID: 201321413} 159 | - 81: {fileID: 201321412} 160 | - 114: {fileID: 201321417} 161 | - 114: {fileID: 201321419} 162 | - 114: {fileID: 201321418} 163 | m_Layer: 0 164 | m_Name: Main Camera 165 | m_TagString: MainCamera 166 | m_Icon: {fileID: 0} 167 | m_NavMeshLayer: 0 168 | m_StaticEditorFlags: 0 169 | m_IsActive: 1 170 | --- !u!81 &201321412 171 | AudioListener: 172 | m_ObjectHideFlags: 0 173 | m_PrefabParentObject: {fileID: 0} 174 | m_PrefabInternal: {fileID: 0} 175 | m_GameObject: {fileID: 201321411} 176 | m_Enabled: 1 177 | --- !u!124 &201321413 178 | Behaviour: 179 | m_ObjectHideFlags: 0 180 | m_PrefabParentObject: {fileID: 0} 181 | m_PrefabInternal: {fileID: 0} 182 | m_GameObject: {fileID: 201321411} 183 | m_Enabled: 1 184 | --- !u!92 &201321414 185 | Behaviour: 186 | m_ObjectHideFlags: 0 187 | m_PrefabParentObject: {fileID: 0} 188 | m_PrefabInternal: {fileID: 0} 189 | m_GameObject: {fileID: 201321411} 190 | m_Enabled: 1 191 | --- !u!20 &201321415 192 | Camera: 193 | m_ObjectHideFlags: 0 194 | m_PrefabParentObject: {fileID: 0} 195 | m_PrefabInternal: {fileID: 0} 196 | m_GameObject: {fileID: 201321411} 197 | m_Enabled: 1 198 | serializedVersion: 2 199 | m_ClearFlags: 2 200 | m_BackGroundColor: {r: .283845156, g: .291252524, b: .308823526, a: .0196078438} 201 | m_NormalizedViewPortRect: 202 | serializedVersion: 2 203 | x: 0 204 | y: 0 205 | width: 1 206 | height: 1 207 | near clip plane: .300000012 208 | far clip plane: 100 209 | field of view: 23 210 | orthographic: 0 211 | orthographic size: 5 212 | m_Depth: -1 213 | m_CullingMask: 214 | serializedVersion: 2 215 | m_Bits: 4294967295 216 | m_RenderingPath: 3 217 | m_TargetTexture: {fileID: 0} 218 | m_TargetDisplay: 0 219 | m_TargetEye: 3 220 | m_HDR: 1 221 | m_OcclusionCulling: 0 222 | m_StereoConvergence: 10 223 | m_StereoSeparation: .0219999999 224 | m_StereoMirrorMode: 0 225 | --- !u!4 &201321416 226 | Transform: 227 | m_ObjectHideFlags: 0 228 | m_PrefabParentObject: {fileID: 0} 229 | m_PrefabInternal: {fileID: 0} 230 | m_GameObject: {fileID: 201321411} 231 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 232 | m_LocalPosition: {x: 0, y: 0, z: 0} 233 | m_LocalScale: {x: 1, y: 1, z: 1} 234 | m_Children: [] 235 | m_Father: {fileID: 314557407} 236 | m_RootOrder: 0 237 | --- !u!114 &201321417 238 | MonoBehaviour: 239 | m_ObjectHideFlags: 0 240 | m_PrefabParentObject: {fileID: 0} 241 | m_PrefabInternal: {fileID: 0} 242 | m_GameObject: {fileID: 201321411} 243 | m_Enabled: 1 244 | m_EditorHideFlags: 0 245 | m_Script: {fileID: 11500000, guid: 2f6a516d891854931acf7fb785c812ec, type: 3} 246 | m_Name: 247 | m_EditorClassIdentifier: 248 | _intensity: 1.29999995 249 | _sampleRadius: 1 250 | _rangeCheck: 1 251 | _fallOffDistance: 100 252 | _sampleCount: 1 253 | _shader: {fileID: 4800000, guid: c928e16c12e994a70928a9181450d18c, type: 3} 254 | --- !u!114 &201321418 255 | MonoBehaviour: 256 | m_ObjectHideFlags: 0 257 | m_PrefabParentObject: {fileID: 0} 258 | m_PrefabInternal: {fileID: 0} 259 | m_GameObject: {fileID: 201321411} 260 | m_Enabled: 1 261 | m_EditorHideFlags: 0 262 | m_Script: {fileID: 11500000, guid: 10593b7d510b64560a297a8af1356dcb, type: 3} 263 | m_Name: 264 | m_EditorClassIdentifier: 265 | _colorTemp: -.00999999978 266 | _colorTint: -.0199999996 267 | _toneMapping: 1 268 | _exposure: .75 269 | _saturation: 1.14999998 270 | _rCurve: 271 | serializedVersion: 2 272 | m_Curve: 273 | - time: 0 274 | value: 0 275 | inSlope: .623863578 276 | outSlope: .623863578 277 | tangentMode: 0 278 | - time: 1 279 | value: 1 280 | inSlope: .726191103 281 | outSlope: .726191103 282 | tangentMode: 0 283 | m_PreInfinity: 2 284 | m_PostInfinity: 2 285 | _gCurve: 286 | serializedVersion: 2 287 | m_Curve: 288 | - time: 0 289 | value: 0 290 | inSlope: 1.10828471 291 | outSlope: 1.10828471 292 | tangentMode: 0 293 | - time: 1 294 | value: 1 295 | inSlope: 1.27083421 296 | outSlope: 1.27083421 297 | tangentMode: 0 298 | m_PreInfinity: 2 299 | m_PostInfinity: 2 300 | _bCurve: 301 | serializedVersion: 2 302 | m_Curve: 303 | - time: 0 304 | value: 0 305 | inSlope: 1.11888576 306 | outSlope: 1.11888576 307 | tangentMode: 0 308 | - time: 1 309 | value: 1 310 | inSlope: .833984852 311 | outSlope: .833984852 312 | tangentMode: 0 313 | m_PreInfinity: 2 314 | m_PostInfinity: 2 315 | _cCurve: 316 | serializedVersion: 2 317 | m_Curve: 318 | - time: .00655737706 319 | value: -.00624999963 320 | inSlope: 0 321 | outSlope: 1.05902779 322 | tangentMode: 21 323 | - time: .950819671 324 | value: .993749976 325 | inSlope: 1.05902779 326 | outSlope: 0 327 | tangentMode: 21 328 | m_PreInfinity: 2 329 | m_PostInfinity: 2 330 | _ditherMode: 1 331 | shader: {fileID: 4800000, guid: dc9775b65c52747e69fc4c854c00d696, type: 3} 332 | --- !u!114 &201321419 333 | MonoBehaviour: 334 | m_ObjectHideFlags: 0 335 | m_PrefabParentObject: {fileID: 0} 336 | m_PrefabInternal: {fileID: 0} 337 | m_GameObject: {fileID: 201321411} 338 | m_Enabled: 1 339 | m_EditorHideFlags: 0 340 | m_Script: {fileID: 11500000, guid: 6fc18a55c333d51489e5ee49b3cbff50, type: 3} 341 | m_Name: 342 | m_EditorClassIdentifier: 343 | _falloff: .5 344 | _shader: {fileID: 4800000, guid: 89a223cbeee1935419811f8736c0a9b3, type: 3} 345 | --- !u!1 &314557405 346 | GameObject: 347 | m_ObjectHideFlags: 0 348 | m_PrefabParentObject: {fileID: 0} 349 | m_PrefabInternal: {fileID: 0} 350 | serializedVersion: 4 351 | m_Component: 352 | - 4: {fileID: 314557407} 353 | - 114: {fileID: 314557406} 354 | m_Layer: 0 355 | m_Name: Camera Arm 356 | m_TagString: Untagged 357 | m_Icon: {fileID: 0} 358 | m_NavMeshLayer: 0 359 | m_StaticEditorFlags: 0 360 | m_IsActive: 1 361 | --- !u!114 &314557406 362 | MonoBehaviour: 363 | m_ObjectHideFlags: 0 364 | m_PrefabParentObject: {fileID: 0} 365 | m_PrefabInternal: {fileID: 0} 366 | m_GameObject: {fileID: 314557405} 367 | m_Enabled: 1 368 | m_EditorHideFlags: 0 369 | m_Script: {fileID: 11500000, guid: d637268abbbb5428e991dd9ec93136f2, type: 3} 370 | m_Name: 371 | m_EditorClassIdentifier: 372 | positionFrequency: .0500000007 373 | rotationFrequency: .200000003 374 | positionAmount: 4 375 | rotationAmount: 0 376 | positionComponents: {x: 0, y: 0, z: 1} 377 | rotationComponents: {x: 1, y: 1, z: 0} 378 | positionOctave: 2 379 | rotationOctave: 3 380 | --- !u!4 &314557407 381 | Transform: 382 | m_ObjectHideFlags: 0 383 | m_PrefabParentObject: {fileID: 0} 384 | m_PrefabInternal: {fileID: 0} 385 | m_GameObject: {fileID: 314557405} 386 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 387 | m_LocalPosition: {x: 0, y: 0, z: -10} 388 | m_LocalScale: {x: 1, y: 1, z: 1} 389 | m_Children: 390 | - {fileID: 201321416} 391 | m_Father: {fileID: 1670721615} 392 | m_RootOrder: 0 393 | --- !u!1 &1377882077 394 | GameObject: 395 | m_ObjectHideFlags: 0 396 | m_PrefabParentObject: {fileID: 0} 397 | m_PrefabInternal: {fileID: 0} 398 | serializedVersion: 4 399 | m_Component: 400 | - 4: {fileID: 1377882079} 401 | - 114: {fileID: 1377882078} 402 | m_Layer: 0 403 | m_Name: Swarm 404 | m_TagString: Untagged 405 | m_Icon: {fileID: 0} 406 | m_NavMeshLayer: 0 407 | m_StaticEditorFlags: 0 408 | m_IsActive: 1 409 | --- !u!114 &1377882078 410 | MonoBehaviour: 411 | m_ObjectHideFlags: 0 412 | m_PrefabParentObject: {fileID: 0} 413 | m_PrefabInternal: {fileID: 0} 414 | m_GameObject: {fileID: 1377882077} 415 | m_Enabled: 1 416 | m_EditorHideFlags: 0 417 | m_Script: {fileID: 11500000, guid: 51c30eda798174ab2be4fb13ae65946d, type: 3} 418 | m_Name: 419 | m_EditorClassIdentifier: 420 | _lineCount: 1400 421 | _historyLength: 200 422 | _throttle: 1 423 | _flow: {x: -2.5, y: 0, z: 0} 424 | _attractor: {fileID: 0} 425 | _attractorPosition: {x: 0, y: 0, z: 0} 426 | _attractorRadius: .00999999978 427 | _forcePerDistance: 2 428 | _forceRandomness: .200000003 429 | _drag: 1.39999998 430 | _noiseAmplitude: 1.60000002 431 | _noiseFrequency: .0799999982 432 | _noiseSpread: .400000006 433 | _noiseMotion: 0 434 | _swirlAmplitude: .0399999991 435 | _swirlFrequency: .104999997 436 | _lineWidth: .100000001 437 | _lineWidthRandomness: 1 438 | _colorMode: 0 439 | _color1: {r: 1, g: .397058845, b: .484381229, a: 1} 440 | _color2: {r: .757352948, g: .211613342, b: .290651381, a: 1} 441 | _metallic: .5 442 | _smoothness: .600000024 443 | _castShadows: 1 444 | _receiveShadows: 1 445 | _fixTimeStep: 1 446 | _stepsPerSecond: 60 447 | _randomSeed: 0 448 | _kernelShader: {fileID: 4800000, guid: ab176efa7135a4f038c7b318a0b3c9ef, type: 3} 449 | _lineShader: {fileID: 4800000, guid: ebdc691e18a6342eeac2c370efde4a89, type: 3} 450 | --- !u!4 &1377882079 451 | Transform: 452 | m_ObjectHideFlags: 0 453 | m_PrefabParentObject: {fileID: 0} 454 | m_PrefabInternal: {fileID: 0} 455 | m_GameObject: {fileID: 1377882077} 456 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 457 | m_LocalPosition: {x: 0, y: 0, z: 0} 458 | m_LocalScale: {x: 1, y: 1, z: 1} 459 | m_Children: [] 460 | m_Father: {fileID: 0} 461 | m_RootOrder: 2 462 | --- !u!1 &1670721614 463 | GameObject: 464 | m_ObjectHideFlags: 0 465 | m_PrefabParentObject: {fileID: 0} 466 | m_PrefabInternal: {fileID: 0} 467 | serializedVersion: 4 468 | m_Component: 469 | - 4: {fileID: 1670721615} 470 | - 114: {fileID: 1670721616} 471 | m_Layer: 0 472 | m_Name: Camera Pivot 473 | m_TagString: Untagged 474 | m_Icon: {fileID: 0} 475 | m_NavMeshLayer: 0 476 | m_StaticEditorFlags: 0 477 | m_IsActive: 1 478 | --- !u!4 &1670721615 479 | Transform: 480 | m_ObjectHideFlags: 0 481 | m_PrefabParentObject: {fileID: 0} 482 | m_PrefabInternal: {fileID: 0} 483 | m_GameObject: {fileID: 1670721614} 484 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 485 | m_LocalPosition: {x: 0, y: 0, z: 0} 486 | m_LocalScale: {x: 1, y: 1, z: 1} 487 | m_Children: 488 | - {fileID: 314557407} 489 | m_Father: {fileID: 0} 490 | m_RootOrder: 0 491 | --- !u!114 &1670721616 492 | MonoBehaviour: 493 | m_ObjectHideFlags: 0 494 | m_PrefabParentObject: {fileID: 0} 495 | m_PrefabInternal: {fileID: 0} 496 | m_GameObject: {fileID: 1670721614} 497 | m_Enabled: 1 498 | m_EditorHideFlags: 0 499 | m_Script: {fileID: 11500000, guid: d637268abbbb5428e991dd9ec93136f2, type: 3} 500 | m_Name: 501 | m_EditorClassIdentifier: 502 | positionFrequency: .100000001 503 | rotationFrequency: .0599999987 504 | positionAmount: 1 505 | rotationAmount: 70 506 | positionComponents: {x: 1, y: 1, z: 1} 507 | rotationComponents: {x: 1, y: 1, z: 1} 508 | positionOctave: 3 509 | rotationOctave: 3 510 | -------------------------------------------------------------------------------- /Assets/Test/Flow.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d402d818fd1ec304a891d0d5562280db 3 | timeCreated: 1449639949 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Skybox.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Skybox 10 | m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _SUNDISK_HIGH_QUALITY 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: 1000 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _DetailNormalMap 35 | second: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | data: 40 | first: 41 | name: _Tex 42 | second: 43 | m_Texture: {fileID: 8900000, guid: 35ac38fcbb20240b9aa4af1a593245d6, type: 3} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | data: 47 | first: 48 | name: _ParallaxMap 49 | second: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | data: 54 | first: 55 | name: _OcclusionMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | data: 61 | first: 62 | name: _EmissionMap 63 | second: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | data: 68 | first: 69 | name: _DetailMask 70 | second: 71 | m_Texture: {fileID: 0} 72 | m_Scale: {x: 1, y: 1} 73 | m_Offset: {x: 0, y: 0} 74 | data: 75 | first: 76 | name: _DetailAlbedoMap 77 | second: 78 | m_Texture: {fileID: 0} 79 | m_Scale: {x: 1, y: 1} 80 | m_Offset: {x: 0, y: 0} 81 | data: 82 | first: 83 | name: _MetallicGlossMap 84 | second: 85 | m_Texture: {fileID: 0} 86 | m_Scale: {x: 1, y: 1} 87 | m_Offset: {x: 0, y: 0} 88 | m_Floats: 89 | data: 90 | first: 91 | name: _SrcBlend 92 | second: 1 93 | data: 94 | first: 95 | name: _DstBlend 96 | second: 0 97 | data: 98 | first: 99 | name: _Cutoff 100 | second: .5 101 | data: 102 | first: 103 | name: _Exposure 104 | second: .800000012 105 | data: 106 | first: 107 | name: _SunDisk 108 | second: 2 109 | data: 110 | first: 111 | name: _SunSize 112 | second: .0399999991 113 | data: 114 | first: 115 | name: _AtmosphereThickness 116 | second: 1 117 | data: 118 | first: 119 | name: _Parallax 120 | second: .0199999996 121 | data: 122 | first: 123 | name: _ZWrite 124 | second: 1 125 | data: 126 | first: 127 | name: _Glossiness 128 | second: .5 129 | data: 130 | first: 131 | name: _BumpScale 132 | second: 1 133 | data: 134 | first: 135 | name: _OcclusionStrength 136 | second: 1 137 | data: 138 | first: 139 | name: _DetailNormalMapScale 140 | second: 1 141 | data: 142 | first: 143 | name: _UVSec 144 | second: 0 145 | data: 146 | first: 147 | name: _Mode 148 | second: 0 149 | data: 150 | first: 151 | name: _Metallic 152 | second: 0 153 | data: 154 | first: 155 | name: _Rotation 156 | second: 251 157 | m_Colors: 158 | data: 159 | first: 160 | name: _EmissionColor 161 | second: {r: 0, g: 0, b: 0, a: 1} 162 | data: 163 | first: 164 | name: _Color 165 | second: {r: 1, g: 1, b: 1, a: 1} 166 | data: 167 | first: 168 | name: _GroundColor 169 | second: {r: .368999988, g: .349000007, b: .340999991, a: 1} 170 | data: 171 | first: 172 | name: _SkyTint 173 | second: {r: .5, g: .5, b: .5, a: 1} 174 | data: 175 | first: 176 | name: _Tint 177 | second: {r: .5, g: .5, b: .5, a: .5} 178 | -------------------------------------------------------------------------------- /Assets/Test/Skybox.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 07c0f0330c8a24547b7b7695d09d7e35 3 | timeCreated: 1449639743 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/TropicalRuins_Env.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantSwarm/932bb30f70942143c591070be0d1d1e9504125a2/Assets/Test/TropicalRuins_Env.hdr -------------------------------------------------------------------------------- /Assets/Test/TropicalRuins_Env.hdr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35ac38fcbb20240b9aa4af1a593245d6 3 | timeCreated: 1449648745 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 8900000: generatedCubemap 8 | serializedVersion: 2 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 1 12 | linearTexture: 0 13 | correctGamma: 0 14 | fadeOut: 0 15 | borderMipMap: 0 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: .25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | cubemapConvolutionSteps: 8 28 | cubemapConvolutionExponent: 1.5 29 | seamlessCubemap: 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: .5, y: .5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaIsTransparency: 0 50 | textureType: 3 51 | buildTargetSettings: [] 52 | spriteSheet: 53 | sprites: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /KvantSwarm.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantSwarm/932bb30f70942143c591070be0d1d1e9504125a2/KvantSwarm.unitypackage -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_DisableAudio: 0 15 | -------------------------------------------------------------------------------- /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 | m_Gravity: {x: 0, y: -9.81000042, z: 0} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_BounceThreshold: 2 9 | m_SleepThreshold: .00499999989 10 | m_DefaultContactOffset: .00999999978 11 | m_SolverIterationCount: 6 12 | m_RaycastsHitTriggers: 1 13 | m_EnableAdaptiveForce: 0 14 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 15 | -------------------------------------------------------------------------------- /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/Attractor.unity 10 | - enabled: 1 11 | path: Assets/Test/Flow.unity 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: 3 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_LegacyDeferred: 11 | m_Mode: 1 12 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 13 | m_AlwaysIncludedShaders: 14 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 15 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 16 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 17 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 18 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 19 | - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} 20 | m_PreloadedShaders: [] 21 | m_LightmapStripping: 0 22 | m_LightmapKeepPlain: 1 23 | m_LightmapKeepDirCombined: 1 24 | m_LightmapKeepDirSeparate: 1 25 | m_LightmapKeepDynamic: 1 26 | m_FogStripping: 0 27 | m_FogKeepLinear: 1 28 | m_FogKeepExp: 1 29 | m_FogKeepExp2: 1 30 | -------------------------------------------------------------------------------- /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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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: .100000001 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: .100000001 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: .100000001 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: .189999998 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: .189999998 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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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: .00100000005 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 | m_Gravity: {x: 0, y: -9.81000042} 7 | m_DefaultMaterial: {fileID: 0} 8 | m_VelocityIterations: 8 9 | m_PositionIterations: 3 10 | m_VelocityThreshold: 1 11 | m_MaxLinearCorrection: .200000003 12 | m_MaxAngularCorrection: 8 13 | m_MaxTranslationSpeed: 100 14 | m_MaxRotationSpeed: 360 15 | m_MinPenetrationForPenalty: .00999999978 16 | m_BaumgarteScale: .200000003 17 | m_BaumgarteTimeOfImpactScale: .75 18 | m_TimeToSleep: .5 19 | m_LinearSleepTolerance: .00999999978 20 | m_AngularSleepTolerance: 2 21 | m_RaycastsHitTriggers: 1 22 | m_RaycastsStartInColliders: 1 23 | m_ChangeStopsCallbacks: 0 24 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 25 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | AndroidProfiler: 0 8 | defaultScreenOrientation: 4 9 | targetDevice: 2 10 | targetResolution: 0 11 | useOnDemandResources: 0 12 | accelerometerFrequency: 60 13 | companyName: DefaultCompany 14 | productName: KvantSwarm 15 | defaultCursor: {fileID: 0} 16 | cursorHotspot: {x: 0, y: 0} 17 | m_ShowUnitySplashScreen: 1 18 | defaultScreenWidth: 1024 19 | defaultScreenHeight: 768 20 | defaultScreenWidthWeb: 960 21 | defaultScreenHeightWeb: 600 22 | m_RenderingPath: 1 23 | m_MobileRenderingPath: 1 24 | m_ActiveColorSpace: 1 25 | m_MTRendering: 1 26 | m_MobileMTRendering: 0 27 | m_Stereoscopic3D: 0 28 | iosShowActivityIndicatorOnLoading: -1 29 | androidShowActivityIndicatorOnLoading: -1 30 | iosAppInBackgroundBehavior: 0 31 | displayResolutionDialog: 1 32 | iosAllowHTTPDownload: 1 33 | allowedAutorotateToPortrait: 1 34 | allowedAutorotateToPortraitUpsideDown: 1 35 | allowedAutorotateToLandscapeRight: 1 36 | allowedAutorotateToLandscapeLeft: 1 37 | useOSAutorotation: 1 38 | use32BitDisplayBuffer: 1 39 | disableDepthAndStencilBuffers: 0 40 | defaultIsFullScreen: 1 41 | defaultIsNativeResolution: 1 42 | runInBackground: 0 43 | captureSingleScreen: 0 44 | Override IPod Music: 0 45 | Prepare IOS For Recording: 0 46 | submitAnalytics: 1 47 | usePlayerLog: 1 48 | bakeCollisionMeshes: 0 49 | forceSingleInstance: 0 50 | resizableWindow: 0 51 | useMacAppStoreValidation: 0 52 | gpuSkinning: 0 53 | xboxPIXTextureCapture: 0 54 | xboxEnableAvatar: 0 55 | xboxEnableKinect: 0 56 | xboxEnableKinectAutoTracking: 0 57 | xboxEnableFitness: 0 58 | visibleInBackground: 0 59 | macFullscreenMode: 2 60 | d3d9FullscreenMode: 1 61 | d3d11FullscreenMode: 1 62 | xboxSpeechDB: 0 63 | xboxEnableHeadOrientation: 0 64 | xboxEnableGuest: 0 65 | n3dsDisableStereoscopicView: 0 66 | n3dsEnableSharedListOpt: 1 67 | n3dsEnableVSync: 0 68 | xboxOneResolution: 0 69 | ps3SplashScreen: {fileID: 0} 70 | videoMemoryForVertexBuffers: 0 71 | psp2PowerMode: 0 72 | psp2AcquireBGM: 1 73 | wiiUTVResolution: 0 74 | wiiUGamePadMSAA: 1 75 | wiiUSupportsNunchuk: 0 76 | wiiUSupportsClassicController: 0 77 | wiiUSupportsBalanceBoard: 0 78 | wiiUSupportsMotionPlus: 0 79 | wiiUSupportsProController: 0 80 | wiiUAllowScreenCapture: 1 81 | wiiUControllerCount: 0 82 | m_SupportedAspectRatios: 83 | 4:3: 1 84 | 5:4: 1 85 | 16:10: 1 86 | 16:9: 1 87 | Others: 1 88 | bundleIdentifier: com.Company.ProductName 89 | bundleVersion: 1.0 90 | preloadedAssets: [] 91 | metroEnableIndependentInputSource: 0 92 | metroEnableLowLatencyPresentationAPI: 0 93 | xboxOneDisableKinectGpuReservation: 0 94 | virtualRealitySupported: 0 95 | productGUID: 18b3b877b35e545bfbc5b7163a714325 96 | AndroidBundleVersionCode: 1 97 | AndroidMinSdkVersion: 9 98 | AndroidPreferredInstallLocation: 1 99 | aotOptions: 100 | apiCompatibilityLevel: 2 101 | stripEngineCode: 1 102 | iPhoneStrippingLevel: 0 103 | iPhoneScriptCallOptimization: 0 104 | iPhoneBuildNumber: 0 105 | ForceInternetPermission: 0 106 | ForceSDCardPermission: 0 107 | CreateWallpaper: 0 108 | APKExpansionFiles: 0 109 | preloadShaders: 0 110 | StripUnusedMeshComponents: 0 111 | VertexChannelCompressionMask: 112 | serializedVersion: 2 113 | m_Bits: 238 114 | iPhoneSdkVersion: 988 115 | iPhoneTargetOSVersion: 22 116 | uIPrerenderedIcon: 0 117 | uIRequiresPersistentWiFi: 0 118 | uIRequiresFullScreen: 1 119 | uIStatusBarHidden: 1 120 | uIExitOnSuspend: 0 121 | uIStatusBarStyle: 0 122 | iPhoneSplashScreen: {fileID: 0} 123 | iPhoneHighResSplashScreen: {fileID: 0} 124 | iPhoneTallHighResSplashScreen: {fileID: 0} 125 | iPhone47inSplashScreen: {fileID: 0} 126 | iPhone55inPortraitSplashScreen: {fileID: 0} 127 | iPhone55inLandscapeSplashScreen: {fileID: 0} 128 | iPadPortraitSplashScreen: {fileID: 0} 129 | iPadHighResPortraitSplashScreen: {fileID: 0} 130 | iPadLandscapeSplashScreen: {fileID: 0} 131 | iPadHighResLandscapeSplashScreen: {fileID: 0} 132 | iOSLaunchScreenType: 0 133 | iOSLaunchScreenPortrait: {fileID: 0} 134 | iOSLaunchScreenLandscape: {fileID: 0} 135 | iOSLaunchScreenBackgroundColor: 136 | serializedVersion: 2 137 | rgba: 0 138 | iOSLaunchScreenFillPct: 100 139 | iOSLaunchScreenSize: 100 140 | iOSLaunchScreenCustomXibPath: 141 | iOSLaunchScreeniPadType: 0 142 | iOSLaunchScreeniPadImage: {fileID: 0} 143 | iOSLaunchScreeniPadBackgroundColor: 144 | serializedVersion: 2 145 | rgba: 0 146 | iOSLaunchScreeniPadFillPct: 100 147 | iOSLaunchScreeniPadSize: 100 148 | iOSLaunchScreeniPadCustomXibPath: 149 | iOSDeviceRequirements: [] 150 | AndroidTargetDevice: 0 151 | AndroidSplashScreenScale: 0 152 | androidSplashScreen: {fileID: 0} 153 | AndroidKeystoreName: 154 | AndroidKeyaliasName: 155 | AndroidTVCompatibility: 1 156 | AndroidIsGame: 1 157 | androidEnableBanner: 1 158 | m_AndroidBanners: 159 | - width: 320 160 | height: 180 161 | banner: {fileID: 0} 162 | androidGamepadSupportLevel: 0 163 | resolutionDialogBanner: {fileID: 0} 164 | m_BuildTargetIcons: 165 | - m_BuildTarget: 166 | m_Icons: 167 | - serializedVersion: 2 168 | m_Icon: {fileID: 0} 169 | m_Width: 128 170 | m_Height: 128 171 | m_BuildTargetBatching: [] 172 | m_BuildTargetGraphicsAPIs: [] 173 | webPlayerTemplate: APPLICATION:Default 174 | m_TemplateCustomTags: {} 175 | wiiUTitleID: 0005000011000000 176 | wiiUGroupID: 00010000 177 | wiiUCommonSaveSize: 4096 178 | wiiUAccountSaveSize: 2048 179 | wiiUOlvAccessKey: 0 180 | wiiUTinCode: 0 181 | wiiUJoinGameId: 0 182 | wiiUJoinGameModeMask: 0000000000000000 183 | wiiUCommonBossSize: 0 184 | wiiUAccountBossSize: 0 185 | wiiUAddOnUniqueIDs: [] 186 | wiiUMainThreadStackSize: 3072 187 | wiiULoaderThreadStackSize: 1024 188 | wiiUSystemHeapSize: 128 189 | wiiUTVStartupScreen: {fileID: 0} 190 | wiiUGamePadStartupScreen: {fileID: 0} 191 | wiiUProfilerLibPath: 192 | actionOnDotNetUnhandledException: 1 193 | enableInternalProfiler: 0 194 | logObjCUncaughtExceptions: 1 195 | enableCrashReportAPI: 0 196 | locationUsageDescription: 197 | XboxTitleId: 198 | XboxImageXexPath: 199 | XboxSpaPath: 200 | XboxGenerateSpa: 0 201 | XboxDeployKinectResources: 0 202 | XboxSplashScreen: {fileID: 0} 203 | xboxEnableSpeech: 0 204 | xboxAdditionalTitleMemorySize: 0 205 | xboxDeployKinectHeadOrientation: 0 206 | xboxDeployKinectHeadPosition: 0 207 | ps3TitleConfigPath: 208 | ps3DLCConfigPath: 209 | ps3ThumbnailPath: 210 | ps3BackgroundPath: 211 | ps3SoundPath: 212 | ps3NPAgeRating: 12 213 | ps3TrophyCommId: 214 | ps3NpCommunicationPassphrase: 215 | ps3TrophyPackagePath: 216 | ps3BootCheckMaxSaveGameSizeKB: 128 217 | ps3TrophyCommSig: 218 | ps3SaveGameSlots: 1 219 | ps3TrialMode: 0 220 | ps3VideoMemoryForAudio: 0 221 | ps3EnableVerboseMemoryStats: 0 222 | ps3UseSPUForUmbra: 0 223 | ps3EnableMoveSupport: 1 224 | ps3DisableDolbyEncoding: 0 225 | ps4NPAgeRating: 12 226 | ps4NPTitleSecret: 227 | ps4NPTrophyPackPath: 228 | ps4ParentalLevel: 1 229 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 230 | ps4Category: 0 231 | ps4MasterVersion: 01.00 232 | ps4AppVersion: 01.00 233 | ps4AppType: 0 234 | ps4ParamSfxPath: 235 | ps4VideoOutPixelFormat: 0 236 | ps4VideoOutResolution: 4 237 | ps4PronunciationXMLPath: 238 | ps4PronunciationSIGPath: 239 | ps4BackgroundImagePath: 240 | ps4StartupImagePath: 241 | ps4SaveDataImagePath: 242 | ps4SdkOverride: 243 | ps4BGMPath: 244 | ps4ShareFilePath: 245 | ps4ShareOverlayImagePath: 246 | ps4PrivacyGuardImagePath: 247 | ps4NPtitleDatPath: 248 | ps4RemotePlayKeyAssignment: -1 249 | ps4RemotePlayKeyMappingDir: 250 | ps4EnterButtonAssignment: 1 251 | ps4ApplicationParam1: 0 252 | ps4ApplicationParam2: 0 253 | ps4ApplicationParam3: 0 254 | ps4ApplicationParam4: 0 255 | ps4DownloadDataSize: 0 256 | ps4GarlicHeapSize: 2048 257 | ps4Passcode: WqBlQ9wQj99nsQzldVI5ZuGXbEWRK5Rh 258 | ps4pnSessions: 1 259 | ps4pnPresence: 1 260 | ps4pnFriends: 1 261 | ps4pnGameCustomData: 1 262 | playerPrefsSupport: 0 263 | ps4ReprojectionSupport: 0 264 | ps4UseAudio3dBackend: 0 265 | ps4Audio3dVirtualSpeakerCount: 14 266 | ps4attribCpuUsage: 0 267 | ps4SocialScreenEnabled: 0 268 | ps4attribUserManagement: 0 269 | ps4attribMoveSupport: 0 270 | ps4attrib3DSupport: 0 271 | ps4attribShareSupport: 0 272 | ps4IncludedModules: [] 273 | monoEnv: 274 | psp2Splashimage: {fileID: 0} 275 | psp2NPTrophyPackPath: 276 | psp2NPSupportGBMorGJP: 0 277 | psp2NPAgeRating: 12 278 | psp2NPTitleDatPath: 279 | psp2NPCommsID: 280 | psp2NPCommunicationsID: 281 | psp2NPCommsPassphrase: 282 | psp2NPCommsSig: 283 | psp2ParamSfxPath: 284 | psp2ManualPath: 285 | psp2LiveAreaGatePath: 286 | psp2LiveAreaBackroundPath: 287 | psp2LiveAreaPath: 288 | psp2LiveAreaTrialPath: 289 | psp2PatchChangeInfoPath: 290 | psp2PatchOriginalPackage: 291 | psp2PackagePassword: RXdCdG5nG5azdNMK66MuCV6GXi5xr84P 292 | psp2KeystoneFile: 293 | psp2MemoryExpansionMode: 0 294 | psp2DRMType: 0 295 | psp2StorageType: 0 296 | psp2MediaCapacity: 0 297 | psp2DLCConfigPath: 298 | psp2ThumbnailPath: 299 | psp2BackgroundPath: 300 | psp2SoundPath: 301 | psp2TrophyCommId: 302 | psp2TrophyPackagePath: 303 | psp2PackagedResourcesPath: 304 | psp2SaveDataQuota: 10240 305 | psp2ParentalLevel: 1 306 | psp2ShortTitle: Not Set 307 | psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF 308 | psp2Category: 0 309 | psp2MasterVersion: 01.00 310 | psp2AppVersion: 01.00 311 | psp2TVBootMode: 0 312 | psp2EnterButtonAssignment: 2 313 | psp2TVDisableEmu: 0 314 | psp2AllowTwitterDialog: 1 315 | psp2Upgradable: 0 316 | psp2HealthWarning: 0 317 | psp2UseLibLocation: 0 318 | psp2InfoBarOnStartup: 0 319 | psp2InfoBarColor: 0 320 | psmSplashimage: {fileID: 0} 321 | spritePackerPolicy: 322 | scriptingDefineSymbols: {} 323 | metroPackageName: KvantSwarm 324 | metroPackageLogo: 325 | metroPackageLogo140: 326 | metroPackageLogo180: 327 | metroPackageLogo240: 328 | metroPackageVersion: 329 | metroCertificatePath: 330 | metroCertificatePassword: 331 | metroCertificateSubject: 332 | metroCertificateIssuer: 333 | metroCertificateNotAfter: 0000000000000000 334 | metroApplicationDescription: KvantSwarm 335 | metroStoreTileLogo80: 336 | metroStoreTileLogo: 337 | metroStoreTileLogo140: 338 | metroStoreTileLogo180: 339 | metroStoreTileWideLogo80: 340 | metroStoreTileWideLogo: 341 | metroStoreTileWideLogo140: 342 | metroStoreTileWideLogo180: 343 | metroStoreTileSmallLogo80: 344 | metroStoreTileSmallLogo: 345 | metroStoreTileSmallLogo140: 346 | metroStoreTileSmallLogo180: 347 | metroStoreSmallTile80: 348 | metroStoreSmallTile: 349 | metroStoreSmallTile140: 350 | metroStoreSmallTile180: 351 | metroStoreLargeTile80: 352 | metroStoreLargeTile: 353 | metroStoreLargeTile140: 354 | metroStoreLargeTile180: 355 | metroStoreSplashScreenImage: 356 | metroStoreSplashScreenImage140: 357 | metroStoreSplashScreenImage180: 358 | metroPhoneAppIcon: 359 | metroPhoneAppIcon140: 360 | metroPhoneAppIcon240: 361 | metroPhoneSmallTile: 362 | metroPhoneSmallTile140: 363 | metroPhoneSmallTile240: 364 | metroPhoneMediumTile: 365 | metroPhoneMediumTile140: 366 | metroPhoneMediumTile240: 367 | metroPhoneWideTile: 368 | metroPhoneWideTile140: 369 | metroPhoneWideTile240: 370 | metroPhoneSplashScreenImage: 371 | metroPhoneSplashScreenImage140: 372 | metroPhoneSplashScreenImage240: 373 | metroTileShortName: 374 | metroCommandLineArgsFile: 375 | metroTileShowName: 0 376 | metroMediumTileShowName: 0 377 | metroLargeTileShowName: 0 378 | metroWideTileShowName: 0 379 | metroDefaultTileSize: 1 380 | metroTileForegroundText: 1 381 | metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1} 382 | metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1} 383 | metroSplashScreenUseBackgroundColor: 0 384 | platformCapabilities: {} 385 | metroFTAName: 386 | metroFTAFileTypes: [] 387 | metroProtocolName: 388 | metroCompilationOverrides: 1 389 | blackberryDeviceAddress: 390 | blackberryDevicePassword: 391 | blackberryTokenPath: 392 | blackberryTokenExires: 393 | blackberryTokenAuthor: 394 | blackberryTokenAuthorId: 395 | blackberryCskPassword: 396 | blackberrySaveLogPath: 397 | blackberrySharedPermissions: 0 398 | blackberryCameraPermissions: 0 399 | blackberryGPSPermissions: 0 400 | blackberryDeviceIDPermissions: 0 401 | blackberryMicrophonePermissions: 0 402 | blackberryGamepadSupport: 0 403 | blackberryBuildId: 0 404 | blackberryLandscapeSplashScreen: {fileID: 0} 405 | blackberryPortraitSplashScreen: {fileID: 0} 406 | blackberrySquareSplashScreen: {fileID: 0} 407 | tizenProductDescription: 408 | tizenProductURL: 409 | tizenSigningProfileName: 410 | tizenGPSPermissions: 0 411 | tizenMicrophonePermissions: 0 412 | n3dsUseExtSaveData: 0 413 | n3dsCompressStaticMem: 1 414 | n3dsExtSaveDataNumber: 0x12345 415 | n3dsStackSize: 131072 416 | n3dsTargetPlatform: 2 417 | n3dsRegion: 7 418 | n3dsMediaSize: 0 419 | n3dsLogoStyle: 3 420 | n3dsTitle: GameName 421 | n3dsProductCode: 422 | n3dsApplicationId: 0xFF3FF 423 | stvDeviceAddress: 424 | stvProductDescription: 425 | stvProductAuthor: 426 | stvProductAuthorEmail: 427 | stvProductLink: 428 | stvProductCategory: 0 429 | XboxOneProductId: 430 | XboxOneUpdateKey: 431 | XboxOneSandboxId: 432 | XboxOneContentId: 433 | XboxOneTitleId: 434 | XboxOneSCId: 435 | XboxOneGameOsOverridePath: 436 | XboxOnePackagingOverridePath: 437 | XboxOneAppManifestOverridePath: 438 | XboxOnePackageEncryption: 0 439 | XboxOnePackageUpdateGranularity: 2 440 | XboxOneDescription: 441 | XboxOneIsContentPackage: 0 442 | XboxOneEnableGPUVariability: 0 443 | XboxOneSockets: {} 444 | XboxOneSplashScreen: {fileID: 0} 445 | XboxOneAllowedProductIds: [] 446 | XboxOnePersistentLocalStorageSize: 0 447 | intPropertyNames: 448 | - Android::ScriptingBackend 449 | - Metro::ScriptingBackend 450 | - Standalone::ScriptingBackend 451 | - WP8::ScriptingBackend 452 | - WebGL::ScriptingBackend 453 | - WebGL::audioCompressionFormat 454 | - WebGL::exceptionSupport 455 | - WebGL::memorySize 456 | - WebPlayer::ScriptingBackend 457 | - iOS::Architecture 458 | - iOS::EnableIncrementalBuildSupportForIl2cpp 459 | - iOS::ScriptingBackend 460 | Android::ScriptingBackend: 0 461 | Metro::ScriptingBackend: 2 462 | Standalone::ScriptingBackend: 0 463 | WP8::ScriptingBackend: 2 464 | WebGL::ScriptingBackend: 1 465 | WebGL::audioCompressionFormat: 4 466 | WebGL::exceptionSupport: 1 467 | WebGL::memorySize: 256 468 | WebPlayer::ScriptingBackend: 0 469 | iOS::Architecture: 2 470 | iOS::EnableIncrementalBuildSupportForIl2cpp: 1 471 | iOS::ScriptingBackend: 1 472 | boolPropertyNames: 473 | - WebGL::analyzeBuildSize 474 | - WebGL::dataCaching 475 | - WebGL::useEmbeddedResources 476 | - XboxOne::enus 477 | WebGL::analyzeBuildSize: 0 478 | WebGL::dataCaching: 0 479 | WebGL::useEmbeddedResources: 0 480 | XboxOne::enus: 1 481 | stringPropertyNames: 482 | - WebGL::emscriptenArgs 483 | - WebGL::template 484 | - additionalIl2CppArgs::additionalIl2CppArgs 485 | WebGL::emscriptenArgs: 486 | WebGL::template: APPLICATION:Default 487 | additionalIl2CppArgs::additionalIl2CppArgs: 488 | firstStreamedSceneWithResources: 0 489 | cloudProjectId: 490 | projectName: 491 | organizationId: 492 | cloudEnabled: 0 493 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.2.3f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 0 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Good 11 | pixelLightCount: 2 12 | shadows: 2 13 | shadowResolution: 2 14 | shadowProjection: 1 15 | shadowCascades: 2 16 | shadowDistance: 25 17 | shadowNearPlaneOffset: 2 18 | shadowCascade2Split: .333333343 19 | shadowCascade4Split: {x: .0666666701, y: .200000003, z: .466666669} 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 | excludedTargetPlatforms: [] 33 | m_PerPlatformDefaultQuality: 34 | Android: 2 35 | BlackBerry: 2 36 | GLES Emulation: 5 37 | PS3: 5 38 | PS4: 5 39 | PSM: 5 40 | PSP2: 5 41 | Samsung TV: 2 42 | Standalone: 5 43 | Tizen: 2 44 | WP8: 5 45 | Web: 5 46 | WebGL: 3 47 | Windows Store Apps: 5 48 | XBOX360: 5 49 | XboxOne: 5 50 | iPhone: 2 51 | -------------------------------------------------------------------------------- /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: .0199999996 7 | Maximum Allowed Timestep: .333333343 8 | m_TimeScale: 1 9 | -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!292 &1 4 | UnityAdsSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_InitializeOnStartup: 1 8 | m_TestMode: 0 9 | m_EnabledPlatforms: 4294967295 10 | m_IosGameId: 11 | m_AndroidGameId: 12 | -------------------------------------------------------------------------------- /ProjectSettings/UnityAnalyticsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!303 &1 4 | UnityAnalyticsManager: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_InitializeOnStartup: 1 8 | m_TestMode: 0 9 | m_TestEventUrl: 10 | m_TestConfigUrl: 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Kvant/Swarm v2 2 | ============== 3 | 4 | *Swarm* is a specialized renderer/animator that draws organic flowing lines with 5 | a physically based shader. It fully utilizes GPU to process flowing animation 6 | and mesh deformation, and thus it can draw very large number of lines without 7 | consuming precious CPU time. 8 | 9 | ![gif](http://45.media.tumblr.com/65956e640f88d08da86ae7b238eb9889/tumblr_nz32r08PoG1qio469o1_400.gif) 10 | ![gif](http://49.media.tumblr.com/6d2ddb78263867686bd1f7e9934eaf42/tumblr_nz32r08PoG1qio469o2_400.gif) 11 | 12 | ![gif](http://49.media.tumblr.com/adb02e99da464a69137c407f2b9a9cff/tumblr_nz32rxg18E1qio469o1_400.gif) 13 | ![gif](http://49.media.tumblr.com/b60a64d4815d6bda1221afbf4598be92/tumblr_nz32rxg18E1qio469o2_400.gif) 14 | 15 | *Swarm* is part of the *Kvant* effect suite. Please see the [GitHub 16 | repositories][kvant] for further information about the suite. 17 | 18 | [kvant]: https://github.com/search?q=kvant+user%3Akeijiro&type=Repositories 19 | 20 | System Requirements 21 | ------------------- 22 | 23 | Unity 5.1 or later versions. 24 | 25 | *Kvant* effects require floating-point HDR textures to store animation state. 26 | Most of mobile devices don't fulfill this requirement at the moment. 27 | 28 | No Backward Compatibility 29 | ------------------------- 30 | 31 | This version (v2) is not compatible with the previous versions. You can't simply 32 | upgrade the previous implementation or use two different versions in the same 33 | project. Sorry for the inconvenience! 34 | 35 | License 36 | ------- 37 | 38 | Copyright (C) 2015 Keijiro Takahashi 39 | 40 | Permission is hereby granted, free of charge, to any person obtaining a copy of 41 | this software and associated documentation files (the "Software"), to deal in 42 | the Software without restriction, including without limitation the rights to 43 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 44 | the Software, and to permit persons to whom the Software is furnished to do so, 45 | subject to the following conditions: 46 | 47 | The above copyright notice and this permission notice shall be included in all 48 | copies or substantial portions of the Software. 49 | 50 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 51 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 52 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 53 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 54 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 55 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 56 | --------------------------------------------------------------------------------