├── KvantWall.unitypackage ├── ProjectSettings ├── ProjectVersion.txt ├── NetworkManager.asset ├── TimeManager.asset ├── EditorBuildSettings.asset ├── UnityAnalyticsManager.asset ├── UnityAdsSettings.asset ├── AudioManager.asset ├── EditorSettings.asset ├── TagManager.asset ├── DynamicsManager.asset ├── Physics2DSettings.asset ├── GraphicsSettings.asset ├── NavMeshAreas.asset ├── QualitySettings.asset └── InputManager.asset ├── Assets ├── Textures │ ├── Concrete AO.tga │ ├── Concrete Albedo.tga │ ├── Concrete Normal.tga │ ├── Concrete AO.tga.meta │ ├── Concrete Albedo.tga.meta │ └── Concrete Normal.tga.meta ├── sIBL Archive │ ├── waterfall_Env.exr │ ├── NarrowPath_Env.hdr │ ├── Circus_Backstage_Env.hdr │ ├── Acknowledgement.txt.meta │ ├── Acknowledgement.txt │ ├── NarrowPath_Env.hdr.meta │ ├── waterfall_Env.exr.meta │ └── Circus_Backstage_Env.hdr.meta ├── Kvant.meta ├── Test │ ├── Test 1.unity.meta │ ├── Test 2.unity.meta │ ├── Test 3.unity.meta │ ├── Wall 1.mat.meta │ ├── Wall 2.mat.meta │ ├── Wall 3.mat.meta │ ├── Skybox 1.mat.meta │ ├── Skybox 2.mat.meta │ ├── Skybox 3.mat.meta │ ├── Wall 3b.mat.meta │ ├── Skybox 2.mat │ ├── Skybox 3.mat │ ├── Skybox 1.mat │ ├── Wall 3b.mat │ ├── Wall 1.mat │ ├── Wall 2.mat │ ├── Wall 3.mat │ └── Test 2.unity ├── Kino.meta ├── Test.meta ├── Editor.meta ├── Kino │ ├── Fog.meta │ ├── Bloom.meta │ ├── Vignette.meta │ ├── Bloom │ │ ├── Editor.meta │ │ ├── Shader.meta │ │ ├── Shader │ │ │ ├── Bloom.shader.meta │ │ │ └── Bloom.shader │ │ ├── Editor │ │ │ ├── BloomEditor.cs.meta │ │ │ └── BloomEditor.cs │ │ ├── Bloom.cs.meta │ │ └── Bloom.cs │ ├── Fog │ │ ├── Editor.meta │ │ ├── Shader.meta │ │ ├── Shader │ │ │ ├── Fog.shader.meta │ │ │ └── Fog.shader │ │ ├── Editor │ │ │ ├── FogEditor.cs.meta │ │ │ └── FogEditor.cs │ │ ├── Fog.cs.meta │ │ └── Fog.cs │ └── Vignette │ │ ├── Editor.meta │ │ ├── Shader.meta │ │ ├── Shader │ │ ├── Vignette.shader.meta │ │ └── Vignette.shader │ │ ├── Editor │ │ ├── VignetteEditor.cs.meta │ │ └── VignetteEditor.cs │ │ ├── Vignette.cs.meta │ │ └── Vignette.cs ├── Kvant │ ├── Wall │ │ ├── Shaders │ │ │ ├── Default Wall.mat.meta │ │ │ ├── Debug.shader.meta │ │ │ ├── Kernel.shader.meta │ │ │ ├── Surface.shader.meta │ │ │ ├── SimplexNoiseExt3D.cginc.meta │ │ │ ├── Debug.shader │ │ │ ├── Surface.shader │ │ │ ├── Default Wall.mat │ │ │ ├── Kernel.shader │ │ │ └── SimplexNoiseExt3D.cginc │ │ ├── Editor.meta │ │ ├── Scripts.meta │ │ ├── Shaders.meta │ │ ├── WallScroller.cs.meta │ │ ├── Editor │ │ │ ├── WallEditor.cs.meta │ │ │ ├── WallMaterialEditor.cs.meta │ │ │ ├── WallScrollerEditor.cs.meta │ │ │ ├── WallScrollerEditor.cs │ │ │ ├── WallMaterialEditor.cs │ │ │ └── WallEditor.cs │ │ ├── Scripts │ │ │ ├── BulkMesh.cs.meta │ │ │ └── BulkMesh.cs │ │ ├── Wall.cs.meta │ │ └── WallScroller.cs │ └── Wall.meta ├── Reaktion.meta ├── Textures.meta ├── DeferredAO.meta ├── sIBL Archive.meta ├── DeferredAO │ ├── Editor.meta │ ├── Shader.meta │ ├── Shader │ │ ├── DeferredAO.shader.meta │ │ └── DeferredAO.shader │ ├── Editor │ │ ├── DeferredAOEditor.cs.meta │ │ └── DeferredAOEditor.cs │ ├── DeferredAO.cs.meta │ └── DeferredAO.cs ├── Reaktion │ ├── Editor.meta │ ├── Utility.meta │ ├── Editor │ │ ├── Utility.meta │ │ └── Utility │ │ │ ├── ConstantMotionEditor.cs.meta │ │ │ ├── JitterMotionEditor.cs.meta │ │ │ ├── JitterMotionEditor.cs │ │ │ └── ConstantMotionEditor.cs │ └── Utility │ │ ├── ConstantMotion.cs.meta │ │ ├── JitterMotion.cs.meta │ │ ├── JitterMotion.cs │ │ └── ConstantMotion.cs └── Editor │ ├── PackageTool.cs │ └── PackageTool.cs.meta ├── .gitignore ├── .gitattributes └── README.md /KvantWall.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantWall/HEAD/KvantWall.unitypackage -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.2.1f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /Assets/Textures/Concrete AO.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantWall/HEAD/Assets/Textures/Concrete AO.tga -------------------------------------------------------------------------------- /Assets/Textures/Concrete Albedo.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantWall/HEAD/Assets/Textures/Concrete Albedo.tga -------------------------------------------------------------------------------- /Assets/Textures/Concrete Normal.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantWall/HEAD/Assets/Textures/Concrete Normal.tga -------------------------------------------------------------------------------- /Assets/sIBL Archive/waterfall_Env.exr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantWall/HEAD/Assets/sIBL Archive/waterfall_Env.exr -------------------------------------------------------------------------------- /Assets/sIBL Archive/NarrowPath_Env.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantWall/HEAD/Assets/sIBL Archive/NarrowPath_Env.hdr -------------------------------------------------------------------------------- /Assets/sIBL Archive/Circus_Backstage_Env.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantWall/HEAD/Assets/sIBL Archive/Circus_Backstage_Env.hdr -------------------------------------------------------------------------------- /Assets/Kvant.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8be732b80b8b445e5bd196d2b01ed59c 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Ll]ibrary/ 2 | [Tt]emp/ 3 | [Oo]bj/ 4 | 5 | # Autogenerated VS/MD solution and project files 6 | *.csproj 7 | *.unityproj 8 | *.sln 9 | *.pidb 10 | *.userprefs 11 | .vs 12 | 13 | .DS_Store 14 | *.swp 15 | -------------------------------------------------------------------------------- /Assets/Test/Test 1.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66c47aaf593514853a8fa9c88abef62b 3 | timeCreated: 1433335352 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Test 2.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f8ab06f1330ed41efa1fcf52a9e95e37 3 | timeCreated: 1434199588 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Test 3.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 498bf13264b414565b60599a9b60c467 3 | timeCreated: 1434201961 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Wall 1.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c91d844444069430a947913f23dd7cc9 3 | timeCreated: 1434019721 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Wall 2.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f804c03affd4d436aa0f43861b93108d 3 | timeCreated: 1434197379 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Wall 3.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6dd9527d61b5444bda33d53473dc054d 3 | timeCreated: 1434202482 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Skybox 1.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0a841d79484245b797d4afe5995b26f 3 | timeCreated: 1433339721 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Skybox 2.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26876a91f38bb46f9b9516edf543928b 3 | timeCreated: 1434197327 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Skybox 3.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 78ecff716917e4993857fa8888011254 3 | timeCreated: 1434202484 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Wall 3b.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fdc586d6c137f47d1a5fffa1e8f160f7 3 | timeCreated: 1434203246 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8aa089c96a4f4fb38f0ec5cd651bff7 3 | folderAsset: yes 4 | timeCreated: 1432554689 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/Acknowledgement.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9beda65cbfd0b574a851509ab29359a4 3 | timeCreated: 1451308277 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /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/Kino/Fog.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fba6b0e4a46c4e07a0153904e753df8 3 | folderAsset: yes 4 | timeCreated: 1435838661 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Shaders/Default Wall.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dddcdd0c49f184396b3fe5d5ba46b9ce 3 | timeCreated: 1434029719 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Reaktion.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 487429d9beca24ae78ab8ac96eb73dde 3 | folderAsset: yes 4 | timeCreated: 1432554155 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 809904d3c10dc4cd59cf6b7183552729 3 | folderAsset: yes 4 | timeCreated: 1433508636 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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/Kino/Bloom.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecdb90abc15fe42bca3b67047f7fd9df 3 | folderAsset: yes 4 | timeCreated: 1445666754 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/Kvant/Wall.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a9793755c0ed44be9b84ad9ecc74bd1 3 | folderAsset: yes 4 | timeCreated: 1433330654 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/sIBL Archive.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 18483977e8a6104408cdee1f1e5bda9c 3 | folderAsset: yes 4 | timeCreated: 1451308166 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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/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/Kino/Bloom/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0e7e3e77db40c4cba83bb3a6ab440084 3 | folderAsset: yes 4 | timeCreated: 1445666764 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Bloom/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f44dd1607e93a4131a4003b39c363e93 3 | folderAsset: yes 4 | timeCreated: 1445666764 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Fog/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58aa7694ca3de4e8e9cf8cf893804671 3 | folderAsset: yes 4 | timeCreated: 1435838677 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Fog/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d17a16d39c5864bf89575ff76ad6667e 3 | folderAsset: yes 4 | timeCreated: 1435838681 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9de3ed609a2a84de79ed8481cb785c70 3 | folderAsset: yes 4 | timeCreated: 1433421225 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f7e9dd68ff9f24e3b925b4d435ff9767 3 | folderAsset: yes 4 | timeCreated: 1433330736 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a04b09761850048f2b0b5cf5ec807111 3 | folderAsset: yes 4 | timeCreated: 1433330669 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Reaktion/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 263f8cf5a4c1141e6a79dc1c86d69dc2 3 | folderAsset: yes 4 | timeCreated: 1432554155 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Reaktion/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d874762c14cf4223bd1bcfc86500326 3 | folderAsset: yes 4 | timeCreated: 1432554155 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/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/Reaktion/Editor/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c8c8f5affaaa4616a15e69dda142154 3 | folderAsset: yes 4 | timeCreated: 1432554155 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/Acknowledgement.txt: -------------------------------------------------------------------------------- 1 | The HDR images in this directory are provided from sIBL Archive under the 2 | Creative Commons license (CC BY-NC-SA 3.0 US). Please see the page below for 3 | further details. 4 | 5 | http://www.hdrlabs.com/sibl/archive.html 6 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Test/Test 1.unity 10 | -------------------------------------------------------------------------------- /Assets/Kino/Bloom/Shader/Bloom.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5a711a01011934ebcb58ef5ad52159d6 3 | timeCreated: 1435809878 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Fog/Shader/Fog.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3514cc2676a6c4db294c28459f22c359 3 | timeCreated: 1435838691 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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/Kvant/Wall/Shaders/Debug.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b02210009e584160bf24e085a6f4a6a 3 | timeCreated: 1433330679 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Shaders/Kernel.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7f9e4b36d4474781935eb3ae5ba30d3 3 | timeCreated: 1433330680 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Shaders/Surface.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1ded3f0cc90114d1c9b7431b375d82e2 3 | timeCreated: 1433330679 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Shaders/SimplexNoiseExt3D.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 722313c0db91a314aac4f7e9748d6907 3 | timeCreated: 1451303441 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /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 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /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 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /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", "KvantWall.unitypackage", ExportPackageOptions.Recurse); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Editor/PackageTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75d1346d1b1a24e01ba46ef35e66884e 3 | timeCreated: 1434196838 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/Fog/Editor/FogEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60a60d9e0b29447ed832e2d9aad638b0 3 | timeCreated: 1435838686 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/Wall/WallScroller.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4578a0a68c3f346b5ac9cb1be539e62b 3 | timeCreated: 1434032953 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/Bloom/Editor/BloomEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 036bc30d96c3349ce86bfc8d95667da7 3 | timeCreated: 1435816745 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/Wall/Editor/WallEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d6315d55ce7448a391ad43c21228a20 3 | timeCreated: 1433421232 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/Wall/Scripts/BulkMesh.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbc7a06704aa5471abafff1b6e607ff3 3 | timeCreated: 1433330745 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/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/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/Kvant/Wall/Editor/WallMaterialEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0934c53b725214a3f8011aba28bca735 3 | timeCreated: 1434019705 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/Wall/Editor/WallScrollerEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 696628c7758494e718a5664027b1f817 3 | timeCreated: 1443322211 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/Kino/Fog/Fog.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee4ab9821096c489f84e50f35b7b9644 3 | timeCreated: 1435839407 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _shader: {fileID: 4800000, guid: 3514cc2676a6c4db294c28459f22c359, type: 3} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Kino/Bloom/Bloom.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6363bba448bf64e60a763433f9ddf81b 3 | timeCreated: 1445671165 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _shader: {fileID: 4800000, guid: 5a711a01011934ebcb58ef5ad52159d6, type: 3} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Shaders/Debug.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Kvant/Wall/Debug" 2 | { 3 | Properties 4 | { 5 | _MainTex("-", 2D) = ""{} 6 | } 7 | 8 | CGINCLUDE 9 | 10 | sampler2D _MainTex; 11 | 12 | #include "UnityCG.cginc" 13 | 14 | float4 frag(v2f_img i) : SV_Target 15 | { 16 | float3 c = tex2D(_MainTex, i.uv).xyz; 17 | return float4(c * 0.5 + 0.5, 1); 18 | } 19 | 20 | ENDCG 21 | 22 | SubShader 23 | { 24 | Pass 25 | { 26 | CGPROGRAM 27 | #pragma vertex vert_img 28 | #pragma fragment frag 29 | ENDCG 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Wall.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29cfb89969d804cadbeec71cd66d93f4 3 | timeCreated: 1434030032 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _defaultShape: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 9 | - _defaultMaterial: {fileID: 2100000, guid: dddcdd0c49f184396b3fe5d5ba46b9ce, type: 2} 10 | - _material: {instanceID: 0} 11 | - _kernelShader: {fileID: 4800000, guid: d7f9e4b36d4474781935eb3ae5ba30d3, type: 3} 12 | - _debugShader: {fileID: 4800000, guid: 6b02210009e584160bf24e085a6f4a6a, type: 3} 13 | executionOrder: 0 14 | icon: {instanceID: 0} 15 | userData: 16 | assetBundleName: 17 | assetBundleVariant: 18 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Editor/WallScrollerEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Custom editor for WallScroller 3 | // 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | namespace Kvant 8 | { 9 | [CanEditMultipleObjects] 10 | [CustomEditor(typeof(WallScroller))] 11 | public class WallScrollerEditor : Editor 12 | { 13 | SerializedProperty _yawAngle; 14 | SerializedProperty _speed; 15 | 16 | void OnEnable() 17 | { 18 | _yawAngle = serializedObject.FindProperty("_yawAngle"); 19 | _speed = serializedObject.FindProperty("_speed"); 20 | } 21 | 22 | public override void OnInspectorGUI() 23 | { 24 | serializedObject.Update(); 25 | EditorGUILayout.PropertyField(_yawAngle); 26 | EditorGUILayout.PropertyField(_speed); 27 | serializedObject.ApplyModifiedProperties(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/WallScroller.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Scroller script for Wall 3 | // 4 | using UnityEngine; 5 | using UnityEngine.Serialization; 6 | 7 | namespace Kvant 8 | { 9 | [RequireComponent(typeof(Wall))] 10 | [AddComponentMenu("Kvant/Wall Scroller")] 11 | public class WallScroller : MonoBehaviour 12 | { 13 | [SerializeField, FormerlySerializedAs("yawAngle")] 14 | float _yawAngle; 15 | 16 | public float yawAngle { 17 | get { return _yawAngle; } 18 | set { _yawAngle = value; } 19 | } 20 | 21 | [SerializeField, FormerlySerializedAs("speed")] 22 | float _speed; 23 | 24 | public float speed { 25 | get { return _speed; } 26 | set { _speed = value; } 27 | } 28 | 29 | void Update() 30 | { 31 | var r = _yawAngle * Mathf.Deg2Rad; 32 | var dir = new Vector2(Mathf.Cos(r), Mathf.Sin(r)); 33 | GetComponent().offset += dir * _speed * Time.deltaTime; 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /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/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/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/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: Standard 11 | pixelLightCount: 2 12 | shadows: 2 13 | shadowResolution: 2 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 25 17 | shadowNearPlaneOffset: 2 18 | shadowCascade2Split: .333333343 19 | shadowCascade4Split: {x: .0666666701, y: .199999988, z: .466666639} 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: 1 35 | BlackBerry: 1 36 | GLES Emulation: 4 37 | PS3: 4 38 | PS4: 4 39 | PSM: 4 40 | PSP2: 4 41 | Samsung TV: 1 42 | Standalone: 4 43 | Tizen: 1 44 | WP8: 4 45 | Web: 4 46 | WebGL: 2 47 | Windows Store Apps: 4 48 | XBOX360: 4 49 | XboxOne: 4 50 | iPhone: 1 51 | -------------------------------------------------------------------------------- /Assets/Textures/Concrete AO.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8fd564835bc6474c84c6798e7d7e2b5 3 | timeCreated: 1432645054 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: -1 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/Textures/Concrete Albedo.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c2641f16f0c74dc8bd65cc0f24b03df 3 | timeCreated: 1432645053 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: -1 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/Textures/Concrete Normal.tga.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 912fe0350b83a4934aa3799ef6fced00 3 | timeCreated: 1432645077 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 1 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 1 20 | heightScale: .25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 8 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | spriteMode: 0 41 | spriteExtrude: 1 42 | spriteMeshType: 1 43 | alignment: 0 44 | spritePivot: {x: .5, y: .5} 45 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 46 | spritePixelsToUnits: 100 47 | alphaIsTransparency: 0 48 | textureType: 1 49 | buildTargetSettings: [] 50 | spriteSheet: 51 | sprites: [] 52 | spritePackingTag: 53 | userData: 54 | assetBundleName: 55 | assetBundleVariant: 56 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/NarrowPath_Env.hdr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09f34b2f71b31433998c520abc74b958 3 | timeCreated: 1432562194 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 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: .5, y: .5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | textureType: 3 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | spritePackingTag: 54 | userData: 55 | assetBundleName: 56 | assetBundleVariant: 57 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/waterfall_Env.exr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57c52d9a248cd4c12bc17f27ebe6a167 3 | timeCreated: 1434197303 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: -3 31 | maxTextureSize: 2048 32 | textureSettings: 33 | filterMode: -1 34 | aniso: -1 35 | mipBias: -1 36 | wrapMode: 1 37 | nPOTScale: 1 38 | lightmap: 0 39 | rGBM: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: .5, y: .5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | textureType: 3 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | spritePackingTag: 54 | userData: 55 | assetBundleName: 56 | assetBundleVariant: 57 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/Circus_Backstage_Env.hdr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2b3e7b47330b84378919c8fd00cd749b 3 | timeCreated: 1434204449 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 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: .5, y: .5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | textureType: 3 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | spritePackingTag: 54 | userData: 55 | assetBundleName: 56 | assetBundleVariant: 57 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Kvant/Wall 2 | ========== 3 | 4 | *Wall* is a GPU accelerated object array animator for Unity. 5 | 6 | ![gif](http://38.media.tumblr.com/f7bda429770418d97003ab2d3c7a5ee4/tumblr_npsercnabU1qio469o1_400.gif) 7 | ![gif](http://45.media.tumblr.com/7288b244152ec0caf0223818143e77c4/tumblr_npvzqaXve21qio469o1_400.gif) 8 | 9 | *Wall* is part of the *Kvant* effect suite. Please see the [GitHub 10 | repositories][kvant] for further information about the suite. 11 | 12 | [kvant]: https://github.com/search?q=kvant+user%3Akeijiro&type=Repositories 13 | 14 | System Requirements 15 | ------------------- 16 | 17 | Unity 5.1 or later versions. 18 | 19 | *Kvant* effects require floating-point HDR textures to store animation state. 20 | Most of mobile devices don't fulfill this requirement at the moment. 21 | 22 | License 23 | ------- 24 | 25 | Copyright (C) 2015 Keijiro Takahashi 26 | 27 | Permission is hereby granted, free of charge, to any person obtaining a copy of 28 | this software and associated documentation files (the "Software"), to deal in 29 | the Software without restriction, including without limitation the rights to 30 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 31 | the Software, and to permit persons to whom the Software is furnished to do so, 32 | subject to the following conditions: 33 | 34 | The above copyright notice and this permission notice shall be included in all 35 | copies or substantial portions of the Software. 36 | 37 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 38 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 39 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 40 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 41 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 42 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 43 | -------------------------------------------------------------------------------- /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/Fog/Editor/FogEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // KinoFog - Deferred fog 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(Fog))] 30 | public class FogEditor : Editor 31 | { 32 | SerializedProperty _startDistance; 33 | SerializedProperty _useRadialDistance; 34 | SerializedProperty _fadeToSkybox; 35 | 36 | void OnEnable() 37 | { 38 | _startDistance = serializedObject.FindProperty("_startDistance"); 39 | _useRadialDistance = serializedObject.FindProperty("_useRadialDistance"); 40 | _fadeToSkybox = serializedObject.FindProperty("_fadeToSkybox"); 41 | } 42 | 43 | public override void OnInspectorGUI() 44 | { 45 | serializedObject.Update(); 46 | 47 | EditorGUILayout.PropertyField(_startDistance); 48 | EditorGUILayout.PropertyField(_useRadialDistance); 49 | EditorGUILayout.PropertyField(_fadeToSkybox); 50 | 51 | serializedObject.ApplyModifiedProperties(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /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/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/Kino/Bloom/Editor/BloomEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // KinoBloom - Bloom effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | using UnityEngine; 25 | using UnityEditor; 26 | 27 | namespace Kino 28 | { 29 | [CanEditMultipleObjects] 30 | [CustomEditor(typeof(Bloom))] 31 | public class Bloomditor : Editor 32 | { 33 | SerializedProperty _radius1; 34 | SerializedProperty _radius2; 35 | SerializedProperty _intensity1; 36 | SerializedProperty _intensity2; 37 | SerializedProperty _threshold; 38 | SerializedProperty _temporalFiltering; 39 | 40 | static string _configWarning = 41 | "This effect only works properly with HDR and linear rendering. " + 42 | "It's strongly recommended to enable these options."; 43 | 44 | static GUIContent _textRadius = new GUIContent("Radius"); 45 | static GUIContent _textIntensity = new GUIContent("Intensity"); 46 | 47 | bool CheckConfig() 48 | { 49 | // Check if HDR rendering is enabled. 50 | var cam = ((Bloom)target).GetComponent(); 51 | if (!cam.hdr) return false; 52 | 53 | // check if linear rendering is enabled. 54 | return QualitySettings.activeColorSpace == ColorSpace.Linear; 55 | } 56 | 57 | void OnEnable() 58 | { 59 | _radius1 = serializedObject.FindProperty("_radius1"); 60 | _radius2 = serializedObject.FindProperty("_radius2"); 61 | _intensity1 = serializedObject.FindProperty("_intensity1"); 62 | _intensity2 = serializedObject.FindProperty("_intensity2"); 63 | _threshold = serializedObject.FindProperty("_threshold"); 64 | _temporalFiltering = serializedObject.FindProperty("_temporalFiltering"); 65 | } 66 | 67 | public override void OnInspectorGUI() 68 | { 69 | serializedObject.Update(); 70 | 71 | if (!CheckConfig()) 72 | EditorGUILayout.HelpBox(_configWarning, MessageType.Warning); 73 | 74 | EditorGUILayout.LabelField("Fringe (small bloom)", EditorStyles.boldLabel); 75 | EditorGUILayout.PropertyField(_radius1, _textRadius); 76 | EditorGUILayout.PropertyField(_intensity1, _textIntensity); 77 | 78 | EditorGUILayout.Space(); 79 | 80 | EditorGUILayout.LabelField("Diffusion (large bloom)", EditorStyles.boldLabel); 81 | EditorGUILayout.PropertyField(_radius2, _textRadius); 82 | EditorGUILayout.PropertyField(_intensity2, _textIntensity); 83 | 84 | EditorGUILayout.Space(); 85 | 86 | EditorGUILayout.PropertyField(_threshold); 87 | EditorGUILayout.PropertyField(_temporalFiltering); 88 | 89 | serializedObject.ApplyModifiedProperties(); 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /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/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 * (Mathf.PerlinNoise(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/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/Test/Skybox 2.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 2 10 | m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _DetailNormalMap 35 | second: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | data: 40 | first: 41 | name: _Tex 42 | second: 43 | m_Texture: {fileID: 8900000, guid: 57c52d9a248cd4c12bc17f27ebe6a167, 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: 1 105 | data: 106 | first: 107 | name: _Parallax 108 | second: .0199999996 109 | data: 110 | first: 111 | name: _ZWrite 112 | second: 1 113 | data: 114 | first: 115 | name: _Glossiness 116 | second: .5 117 | data: 118 | first: 119 | name: _BumpScale 120 | second: 1 121 | data: 122 | first: 123 | name: _OcclusionStrength 124 | second: 1 125 | data: 126 | first: 127 | name: _DetailNormalMapScale 128 | second: 1 129 | data: 130 | first: 131 | name: _UVSec 132 | second: 0 133 | data: 134 | first: 135 | name: _Mode 136 | second: 0 137 | data: 138 | first: 139 | name: _Metallic 140 | second: 0 141 | data: 142 | first: 143 | name: _Rotation 144 | second: 0 145 | m_Colors: 146 | data: 147 | first: 148 | name: _EmissionColor 149 | second: {r: 0, g: 0, b: 0, a: 1} 150 | data: 151 | first: 152 | name: _Color 153 | second: {r: 1, g: 1, b: 1, a: 1} 154 | data: 155 | first: 156 | name: _Tint 157 | second: {r: .5, g: .5, b: .5, a: .5} 158 | -------------------------------------------------------------------------------- /Assets/Test/Skybox 3.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 3 10 | m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _DetailNormalMap 35 | second: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | data: 40 | first: 41 | name: _Tex 42 | second: 43 | m_Texture: {fileID: 8900000, guid: 2b3e7b47330b84378919c8fd00cd749b, 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: 1 105 | data: 106 | first: 107 | name: _Parallax 108 | second: .0199999996 109 | data: 110 | first: 111 | name: _ZWrite 112 | second: 1 113 | data: 114 | first: 115 | name: _Glossiness 116 | second: .5 117 | data: 118 | first: 119 | name: _BumpScale 120 | second: 1 121 | data: 122 | first: 123 | name: _OcclusionStrength 124 | second: 1 125 | data: 126 | first: 127 | name: _DetailNormalMapScale 128 | second: 1 129 | data: 130 | first: 131 | name: _UVSec 132 | second: 0 133 | data: 134 | first: 135 | name: _Mode 136 | second: 0 137 | data: 138 | first: 139 | name: _Metallic 140 | second: 0 141 | data: 142 | first: 143 | name: _Rotation 144 | second: 38 145 | m_Colors: 146 | data: 147 | first: 148 | name: _EmissionColor 149 | second: {r: 0, g: 0, b: 0, a: 1} 150 | data: 151 | first: 152 | name: _Color 153 | second: {r: 1, g: 1, b: 1, a: 1} 154 | data: 155 | first: 156 | name: _Tint 157 | second: {r: .5, g: .5, b: .5, a: .5} 158 | -------------------------------------------------------------------------------- /Assets/Test/Skybox 1.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 1 10 | m_Shader: {fileID: 103, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _DetailNormalMap 35 | second: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | data: 40 | first: 41 | name: _Tex 42 | second: 43 | m_Texture: {fileID: 8900000, guid: 09f34b2f71b31433998c520abc74b958, 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: _Parallax 104 | second: .0199999996 105 | data: 106 | first: 107 | name: _ZWrite 108 | second: 1 109 | data: 110 | first: 111 | name: _Glossiness 112 | second: .5 113 | data: 114 | first: 115 | name: _BumpScale 116 | second: 1 117 | data: 118 | first: 119 | name: _OcclusionStrength 120 | second: 1 121 | data: 122 | first: 123 | name: _DetailNormalMapScale 124 | second: 1 125 | data: 126 | first: 127 | name: _UVSec 128 | second: 0 129 | data: 130 | first: 131 | name: _Mode 132 | second: 0 133 | data: 134 | first: 135 | name: _Metallic 136 | second: 0 137 | data: 138 | first: 139 | name: _Exposure 140 | second: 1.25 141 | data: 142 | first: 143 | name: _Rotation 144 | second: 294 145 | m_Colors: 146 | data: 147 | first: 148 | name: _EmissionColor 149 | second: {r: 0, g: 0, b: 0, a: 1} 150 | data: 151 | first: 152 | name: _Color 153 | second: {r: 1, g: 1, b: 1, a: 1} 154 | data: 155 | first: 156 | name: _Tint 157 | second: {r: .5, g: .5, b: .5, a: .5} 158 | -------------------------------------------------------------------------------- /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/Kvant/Wall/Editor/WallMaterialEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Custom material editor for Wall surface shader 3 | // 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | namespace Kvant 8 | { 9 | public class WallMaterialEditor : ShaderGUI 10 | { 11 | MaterialProperty _colorMode; 12 | MaterialProperty _color; 13 | MaterialProperty _color2; 14 | MaterialProperty _metallic; 15 | MaterialProperty _smoothness; 16 | MaterialProperty _albedoMap; 17 | MaterialProperty _normalMap; 18 | MaterialProperty _normalScale; 19 | MaterialProperty _occlusionMap; 20 | MaterialProperty _occlusionStr; 21 | MaterialProperty _randomUV; 22 | 23 | static GUIContent _albedoText = new GUIContent("Albedo"); 24 | static GUIContent _normalMapText = new GUIContent("Normal Map"); 25 | static GUIContent _occlusionText = new GUIContent("Occlusion"); 26 | 27 | bool _initial = true; 28 | 29 | void FindProperties(MaterialProperty[] props) 30 | { 31 | _colorMode = FindProperty("_ColorMode", props); 32 | _color = FindProperty("_Color", props); 33 | _color2 = FindProperty("_Color2", props); 34 | _metallic = FindProperty("_Metallic", props); 35 | _smoothness = FindProperty("_Smoothness", props); 36 | _albedoMap = FindProperty("_MainTex", props); 37 | _normalMap = FindProperty("_NormalMap", props); 38 | _normalScale = FindProperty("_NormalScale", props); 39 | _occlusionMap = FindProperty("_OcclusionMap", props); 40 | _occlusionStr = FindProperty("_OcclusionStr", props); 41 | _randomUV = FindProperty("_RandomUV", props); 42 | } 43 | 44 | public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties) 45 | { 46 | FindProperties(properties); 47 | 48 | if (ShaderPropertiesGUI(materialEditor) || _initial) 49 | foreach (Material m in materialEditor.targets) 50 | SetMaterialKeywords(m); 51 | 52 | _initial = false; 53 | } 54 | 55 | bool ShaderPropertiesGUI(MaterialEditor materialEditor) 56 | { 57 | EditorGUI.BeginChangeCheck(); 58 | 59 | materialEditor.ShaderProperty(_colorMode, "Color Mode"); 60 | 61 | if (_colorMode.floatValue > 0) 62 | { 63 | var rect = EditorGUILayout.GetControlRect(); 64 | rect.x += EditorGUIUtility.labelWidth; 65 | rect.width = (rect.width - EditorGUIUtility.labelWidth) / 2 - 2; 66 | materialEditor.ShaderProperty(rect, _color, ""); 67 | rect.x += rect.width + 4; 68 | materialEditor.ShaderProperty(rect, _color2, ""); 69 | } 70 | else 71 | { 72 | materialEditor.ShaderProperty(_color, " "); 73 | } 74 | 75 | EditorGUILayout.Space(); 76 | 77 | materialEditor.ShaderProperty(_metallic, "Metallic"); 78 | materialEditor.ShaderProperty(_smoothness, "Smoothness"); 79 | 80 | EditorGUILayout.Space(); 81 | 82 | materialEditor.TexturePropertySingleLine(_albedoText, _albedoMap, null); 83 | materialEditor.TexturePropertySingleLine(_normalMapText, _normalMap, _normalMap.textureValue ? _normalScale : null); 84 | materialEditor.TexturePropertySingleLine(_occlusionText, _occlusionMap, _occlusionMap.textureValue ? _occlusionStr : null); 85 | materialEditor.TextureScaleOffsetProperty(_albedoMap); 86 | 87 | EditorGUILayout.Space(); 88 | 89 | materialEditor.ShaderProperty(_randomUV, "Random UV"); 90 | 91 | return EditorGUI.EndChangeCheck(); 92 | } 93 | 94 | static void SetMaterialKeywords(Material material) 95 | { 96 | SetKeyword(material, "_ALBEDOMAP", material.GetTexture("_MainTex")); 97 | SetKeyword(material, "_NORMALMAP", material.GetTexture("_NormalMap")); 98 | SetKeyword(material, "_OCCLUSIONMAP", material.GetTexture("_OcclusionMap")); 99 | } 100 | 101 | static void SetKeyword(Material m, string keyword, bool state) 102 | { 103 | if (state) 104 | m.EnableKeyword(keyword); 105 | else 106 | m.DisableKeyword(keyword); 107 | } 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Shaders/Surface.shader: -------------------------------------------------------------------------------- 1 | // 2 | // Opaque surface shader for Wall 3 | // 4 | // Vertex format: 5 | // position.xyz = vertex position 6 | // texcoord0.xy = uv for texturing 7 | // texcoord1.xy = uv for position/rotation/scale texture 8 | // 9 | // Position kernel outputs: 10 | // .xyz = position 11 | // .w = random value (0-1) 12 | // 13 | // Rotation kernel outputs: 14 | // .xyzw = rotation (quaternion) 15 | // 16 | // Scale kernel outputs: 17 | // .xyz = scale factor 18 | // .w = random value (0-1) 19 | // 20 | Shader "Kvant/Wall/Surface" 21 | { 22 | Properties 23 | { 24 | _PositionTex ("-", 2D) = "black"{} 25 | _RotationTex ("-", 2D) = "red"{} 26 | _ScaleTex ("-", 2D) = "white"{} 27 | 28 | [Enum(Single, 0, Random, 1)] 29 | _ColorMode ("-", Float) = 0 30 | _Color ("-", Color) = (1, 1, 1, 1) 31 | _Color2 ("-", Color) = (0.5, 0.5, 0.5, 1) 32 | 33 | _Metallic ("-", Range(0,1)) = 0.5 34 | _Smoothness ("-", Range(0,1)) = 0.5 35 | 36 | _MainTex ("-", 2D) = "white"{} 37 | _NormalMap ("-", 2D) = "bump"{} 38 | _NormalScale ("-", Range(0,2)) = 1 39 | _OcclusionMap ("-", 2D) = "white"{} 40 | _OcclusionStr ("-", Range(0,1)) = 1 41 | 42 | [Toggle] 43 | _RandomUV ("-", Float) = 0 44 | } 45 | SubShader 46 | { 47 | Tags { "RenderType"="Opaque" } 48 | 49 | CGPROGRAM 50 | 51 | #pragma surface surf Standard vertex:vert nolightmap addshadow 52 | #pragma shader_feature _ALBEDOMAP 53 | #pragma shader_feature _NORMALMAP 54 | #pragma shader_feature _OCCLUSIONMAP 55 | #pragma target 3.0 56 | 57 | sampler2D _PositionTex; 58 | sampler2D _RotationTex; 59 | sampler2D _ScaleTex; 60 | float2 _BufferOffset; 61 | 62 | half _ColorMode; 63 | half4 _Color; 64 | half4 _Color2; 65 | 66 | half _Metallic; 67 | half _Smoothness; 68 | 69 | sampler2D _MainTex; 70 | sampler2D _NormalMap; 71 | half _NormalScale; 72 | sampler2D _OcclusionMap; 73 | half _OcclusionStr; 74 | 75 | half _RandomUV; 76 | 77 | // Quaternion multiplication. 78 | // http://mathworld.wolfram.com/Quaternion.html 79 | float4 qmul(float4 q1, float4 q2) 80 | { 81 | return float4( 82 | q2.xyz * q1.w + q1.xyz * q2.w + cross(q1.xyz, q2.xyz), 83 | q1.w * q2.w - dot(q1.xyz, q2.xyz) 84 | ); 85 | } 86 | 87 | // Rotate a vector with a rotation quaternion. 88 | // http://mathworld.wolfram.com/Quaternion.html 89 | float3 rotate_vector(float3 v, float4 r) 90 | { 91 | float4 r_c = r * float4(-1, -1, -1, 1); 92 | return qmul(r, qmul(float4(v, 0), r_c)).xyz; 93 | } 94 | 95 | struct Input 96 | { 97 | float2 uv_MainTex; 98 | half4 color : COLOR; 99 | }; 100 | 101 | void vert(inout appdata_full v) 102 | { 103 | float4 uv = float4(v.texcoord1.xy + _BufferOffset, 0, 0); 104 | 105 | float4 p = tex2Dlod(_PositionTex, uv); 106 | float4 r = tex2Dlod(_RotationTex, uv); 107 | float4 s = tex2Dlod(_ScaleTex, uv); 108 | 109 | v.vertex.xyz = rotate_vector(v.vertex.xyz * s.xyz, r) + p.xyz; 110 | v.normal = rotate_vector(v.normal, r); 111 | #if _NORMALMAP 112 | v.tangent.xyz = rotate_vector(v.tangent.xyz, r); 113 | #endif 114 | v.color = lerp(_Color, _Color2, p.w * _ColorMode); 115 | v.texcoord.xy += float2(p.w, s.w) * _RandomUV; 116 | } 117 | 118 | void surf(Input IN, inout SurfaceOutputStandard o) 119 | { 120 | #if _ALBEDOMAP 121 | half4 c = tex2D(_MainTex, IN.uv_MainTex); 122 | o.Albedo = IN.color.rgb * c.rgb; 123 | o.Alpha = IN.color.a * c.a; 124 | #else 125 | o.Albedo = IN.color.rgb; 126 | o.Alpha = IN.color.a; 127 | #endif 128 | 129 | #if _NORMALMAP 130 | half4 n = tex2D(_NormalMap, IN.uv_MainTex); 131 | o.Normal = UnpackScaleNormal(n, _NormalScale); 132 | #endif 133 | 134 | #if _OCCLUSIONMAP 135 | half4 occ = tex2D(_OcclusionMap, IN.uv_MainTex); 136 | o.Occlusion = lerp((half4)1, occ, _OcclusionStr); 137 | #endif 138 | 139 | o.Metallic = _Metallic; 140 | o.Smoothness = _Smoothness; 141 | } 142 | 143 | ENDCG 144 | } 145 | CustomEditor "Kvant.WallMaterialEditor" 146 | } 147 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Shaders/Default Wall.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: Default Wall 10 | m_Shader: {fileID: 4800000, guid: 1ded3f0cc90114d1c9b7431b375d82e2, type: 3} 11 | m_ShaderKeywords: _COLORMODE_SINGLE 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _NormalMap 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: _DetailNormalMap 42 | second: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | data: 47 | first: 48 | name: _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 | data: 89 | first: 90 | name: _PositionTex 91 | second: 92 | m_Texture: {fileID: 0} 93 | m_Scale: {x: 1, y: 1} 94 | m_Offset: {x: 0, y: 0} 95 | data: 96 | first: 97 | name: _RotationTex 98 | second: 99 | m_Texture: {fileID: 0} 100 | m_Scale: {x: 1, y: 1} 101 | m_Offset: {x: 0, y: 0} 102 | data: 103 | first: 104 | name: _ScaleTex 105 | second: 106 | m_Texture: {fileID: 0} 107 | m_Scale: {x: 1, y: 1} 108 | m_Offset: {x: 0, y: 0} 109 | m_Floats: 110 | data: 111 | first: 112 | name: _SrcBlend 113 | second: 1 114 | data: 115 | first: 116 | name: _DstBlend 117 | second: 0 118 | data: 119 | first: 120 | name: _Cutoff 121 | second: .5 122 | data: 123 | first: 124 | name: _Smoothness 125 | second: .5 126 | data: 127 | first: 128 | name: _Parallax 129 | second: .0199999996 130 | data: 131 | first: 132 | name: _ZWrite 133 | second: 1 134 | data: 135 | first: 136 | name: _Glossiness 137 | second: .5 138 | data: 139 | first: 140 | name: _BumpScale 141 | second: 1 142 | data: 143 | first: 144 | name: _OcclusionStrength 145 | second: 1 146 | data: 147 | first: 148 | name: _DetailNormalMapScale 149 | second: 1 150 | data: 151 | first: 152 | name: _UVSec 153 | second: 0 154 | data: 155 | first: 156 | name: _Mode 157 | second: 0 158 | data: 159 | first: 160 | name: _Metallic 161 | second: .5 162 | data: 163 | first: 164 | name: _OcclusionStr 165 | second: 1 166 | data: 167 | first: 168 | name: _ColorMode 169 | second: 0 170 | data: 171 | first: 172 | name: _RandomUV 173 | second: 0 174 | data: 175 | first: 176 | name: _NormalScale 177 | second: 1 178 | m_Colors: 179 | data: 180 | first: 181 | name: _EmissionColor 182 | second: {r: 0, g: 0, b: 0, a: 1} 183 | data: 184 | first: 185 | name: _Color 186 | second: {r: .501960814, g: .501960814, b: .501960814, a: 1} 187 | data: 188 | first: 189 | name: _Color2 190 | second: {r: .5, g: .5, b: .5, a: 1} 191 | -------------------------------------------------------------------------------- /Assets/Test/Wall 3b.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: Wall 3b 10 | m_Shader: {fileID: 4800000, guid: 1ded3f0cc90114d1c9b7431b375d82e2, type: 3} 11 | m_ShaderKeywords: COLOR_RANDOM COLOR_SINGLE RANDOM_UV _COLORMODE_COLOR_SINGLE _COLORMODE_RANDOM 12 | _RANDOM_UV 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: 0} 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: _NormalMap 36 | second: 37 | m_Texture: {fileID: 0} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | data: 41 | first: 42 | name: _DetailNormalMap 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: _ParallaxMap 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: _OcclusionMap 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: _EmissionMap 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: _DetailMask 71 | second: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | data: 76 | first: 77 | name: _DetailAlbedoMap 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: _MetallicGlossMap 85 | second: 86 | m_Texture: {fileID: 0} 87 | m_Scale: {x: 1, y: 1} 88 | m_Offset: {x: 0, y: 0} 89 | data: 90 | first: 91 | name: _PositionTex 92 | second: 93 | m_Texture: {fileID: 0} 94 | m_Scale: {x: 1, y: 1} 95 | m_Offset: {x: 0, y: 0} 96 | data: 97 | first: 98 | name: _RotationTex 99 | second: 100 | m_Texture: {fileID: 0} 101 | m_Scale: {x: 1, y: 1} 102 | m_Offset: {x: 0, y: 0} 103 | data: 104 | first: 105 | name: _ScaleTex 106 | second: 107 | m_Texture: {fileID: 0} 108 | m_Scale: {x: 1, y: 1} 109 | m_Offset: {x: 0, y: 0} 110 | m_Floats: 111 | data: 112 | first: 113 | name: _SrcBlend 114 | second: 1 115 | data: 116 | first: 117 | name: _DstBlend 118 | second: 0 119 | data: 120 | first: 121 | name: _Cutoff 122 | second: .5 123 | data: 124 | first: 125 | name: _Smoothness 126 | second: .649999976 127 | data: 128 | first: 129 | name: _Parallax 130 | second: .0199999996 131 | data: 132 | first: 133 | name: _ZWrite 134 | second: 1 135 | data: 136 | first: 137 | name: _Glossiness 138 | second: .5 139 | data: 140 | first: 141 | name: _BumpScale 142 | second: 1 143 | data: 144 | first: 145 | name: _OcclusionStrength 146 | second: 1 147 | data: 148 | first: 149 | name: _DetailNormalMapScale 150 | second: 1 151 | data: 152 | first: 153 | name: _UVSec 154 | second: 0 155 | data: 156 | first: 157 | name: _Mode 158 | second: 0 159 | data: 160 | first: 161 | name: _Metallic 162 | second: .778999984 163 | data: 164 | first: 165 | name: _OcclusionStr 166 | second: .759000003 167 | data: 168 | first: 169 | name: _ColorMode 170 | second: 1 171 | data: 172 | first: 173 | name: _RandomUV 174 | second: 0 175 | data: 176 | first: 177 | name: _NormalScale 178 | second: 1 179 | m_Colors: 180 | data: 181 | first: 182 | name: _EmissionColor 183 | second: {r: 0, g: 0, b: 0, a: 1} 184 | data: 185 | first: 186 | name: _Color 187 | second: {r: 1, g: .5, b: .5, a: 1} 188 | data: 189 | first: 190 | name: _Color2 191 | second: {r: .661764741, g: 0, b: 0, a: 1} 192 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Shaders/Kernel.shader: -------------------------------------------------------------------------------- 1 | // 2 | // GPGPU kernels for Wall 3 | // 4 | // Position kernel outputs: 5 | // .xyz = position 6 | // .w = random value (0-1) 7 | // 8 | // Rotation kernel outputs: 9 | // .xyzw = rotation (quaternion) 10 | // 11 | // Scale kernel outputs: 12 | // .xyz = scale factor 13 | // .w = random value (0-1) 14 | // 15 | Shader "Hidden/Kvant/Wall/Kernel" 16 | { 17 | CGINCLUDE 18 | 19 | #include "UnityCG.cginc" 20 | #include "SimplexNoiseExt3D.cginc" 21 | 22 | #pragma multi_compile POSITION_Z POSITION_XYZ POSITION_RANDOM 23 | #pragma multi_compile ROTATION_AXIS ROTATION_RANDOM 24 | #pragma multi_compile SCALE_UNIFORM SCALE_XYZ 25 | 26 | float2 _ColumnRow; 27 | float2 _Extent; 28 | float2 _UVOffset; 29 | float3 _BaseScale; 30 | float2 _RandomScale; // min, max 31 | float4 _PositionNoise; // x freq, y freq, amp, time 32 | float4 _RotationNoise; // x freq, y freq, amp, time 33 | float4 _ScaleNoise; // x freq, y freq, amp, time 34 | float3 _RotationAxis; 35 | 36 | // PRNG function. 37 | float nrand(float2 uv, float salt) 38 | { 39 | uv += float2(salt, 0); 40 | return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453); 41 | } 42 | 43 | // Snap UV coordinate to column*row grid. 44 | float2 snap_uv(float2 uv) 45 | { 46 | return floor(uv * _ColumnRow) / _ColumnRow; 47 | } 48 | 49 | // Quaternion multiplication. 50 | // http://mathworld.wolfram.com/Quaternion.html 51 | float4 qmul(float4 q1, float4 q2) 52 | { 53 | return float4( 54 | q2.xyz * q1.w + q1.xyz * q2.w + cross(q1.xyz, q2.xyz), 55 | q1.w * q2.w - dot(q1.xyz, q2.xyz) 56 | ); 57 | } 58 | 59 | // Get a random rotation axis in a deterministic fashion. 60 | float3 get_rotation_axis(float2 uv) 61 | { 62 | // Uniformaly distributed points. 63 | // http://mathworld.wolfram.com/SpherePointPicking.html 64 | float u = nrand(uv, 0) * 2 - 1; 65 | float theta = nrand(uv, 1) * UNITY_PI * 2; 66 | float u2 = sqrt(1 - u * u); 67 | return float3(u2 * cos(theta), u2 * sin(theta), u); 68 | } 69 | 70 | // Pass 0: Position kernel 71 | float4 frag_position(v2f_img i) : SV_Target 72 | { 73 | // Offset UV 74 | float2 uv = snap_uv(i.uv + _UVOffset); 75 | 76 | // Base position 77 | float3 origin = float3((i.uv - 0.5) * _Extent, 0); // << Note: use original UV, not ofsetted UV.. 78 | 79 | // Noise coordinate 80 | float3 nc = float3(uv * _PositionNoise.xy, _PositionNoise.w); 81 | 82 | // Displacement 83 | #if POSITION_Z 84 | float3 disp = float3(0, 0, snoise(nc)); 85 | #elif POSITION_XYZ 86 | float3 disp = snoise_grad(nc) * 0.25; 87 | #else // POSITION_RANDOM 88 | float3 disp = get_rotation_axis(uv) * snoise(nc); 89 | #endif 90 | disp *= _PositionNoise.z; 91 | 92 | return float4(origin + disp, nrand(uv, 2)); 93 | } 94 | 95 | // Pass 1: Rotation kernel 96 | float4 frag_rotation(v2f_img i) : SV_Target 97 | { 98 | // Offset UV 99 | float2 uv = snap_uv(i.uv + _UVOffset); 100 | 101 | // Noise coordinate 102 | float3 nc = float3(uv * _RotationNoise.xy, _RotationNoise.w); 103 | 104 | // Angle 105 | float angle = snoise(nc) * _RotationNoise.z; 106 | 107 | // Rotation axis 108 | #if ROTATION_AXIS 109 | float3 axis = _RotationAxis; 110 | #else // ROTATION_RANDOM 111 | float3 axis = get_rotation_axis(uv); 112 | #endif 113 | 114 | return float4(axis * sin(angle), cos(angle)); 115 | } 116 | 117 | // Pass 2: Scale kernel 118 | float4 frag_scale(v2f_img i) : SV_Target 119 | { 120 | // Offset UV 121 | float2 uv = snap_uv(i.uv + _UVOffset); 122 | 123 | // Random scale factor 124 | float vari = lerp(_RandomScale.x, _RandomScale.y, nrand(uv, 3)); 125 | 126 | // Noise coordinate 127 | float3 nc = float3(uv * _ScaleNoise.xy, _ScaleNoise.w); 128 | 129 | // Scale factors for each axis 130 | #if SCALE_UNIFORM 131 | float3 axes = (float3)snoise(nc + float3(417.1, 471.2, 0)); 132 | #else // SCALE_XYZ 133 | float3 axes = snoise_grad(nc) * 0.25; 134 | #endif 135 | axes = max(1.0 - _ScaleNoise.z * (axes + 1) * 0.5, 0); 136 | 137 | return float4(_BaseScale * axes * vari, nrand(uv, 4)); 138 | } 139 | 140 | ENDCG 141 | 142 | SubShader 143 | { 144 | Pass 145 | { 146 | CGPROGRAM 147 | #pragma target 3.0 148 | #pragma vertex vert_img 149 | #pragma fragment frag_position 150 | ENDCG 151 | } 152 | Pass 153 | { 154 | CGPROGRAM 155 | #pragma target 3.0 156 | #pragma vertex vert_img 157 | #pragma fragment frag_rotation 158 | ENDCG 159 | } 160 | Pass 161 | { 162 | CGPROGRAM 163 | #pragma target 3.0 164 | #pragma vertex vert_img 165 | #pragma fragment frag_scale 166 | ENDCG 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /Assets/Test/Wall 1.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: Wall 1 10 | m_Shader: {fileID: 4800000, guid: 1ded3f0cc90114d1c9b7431b375d82e2, type: 3} 11 | m_ShaderKeywords: COLOR_RANDOM COLOR_SINGLE RANDOM_UV _ALBEDOMAP _COLORMODE_COLOR_SINGLE 12 | _COLORMODE_RANDOM _NORMALMAP _OCCLUSIONMAP _RANDOM_UV 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: 0c2641f16f0c74dc8bd65cc0f24b03df, type: 3} 24 | m_Scale: {x: .5, y: .5} 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: _NormalMap 36 | second: 37 | m_Texture: {fileID: 2800000, guid: 912fe0350b83a4934aa3799ef6fced00, type: 3} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | data: 41 | first: 42 | name: _DetailNormalMap 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: _ParallaxMap 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: _OcclusionMap 57 | second: 58 | m_Texture: {fileID: 2800000, guid: c8fd564835bc6474c84c6798e7d7e2b5, type: 3} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | data: 62 | first: 63 | name: _EmissionMap 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: _DetailMask 71 | second: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | data: 76 | first: 77 | name: _DetailAlbedoMap 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: _MetallicGlossMap 85 | second: 86 | m_Texture: {fileID: 0} 87 | m_Scale: {x: 1, y: 1} 88 | m_Offset: {x: 0, y: 0} 89 | data: 90 | first: 91 | name: _PositionTex 92 | second: 93 | m_Texture: {fileID: 0} 94 | m_Scale: {x: 1, y: 1} 95 | m_Offset: {x: 0, y: 0} 96 | data: 97 | first: 98 | name: _RotationTex 99 | second: 100 | m_Texture: {fileID: 0} 101 | m_Scale: {x: 1, y: 1} 102 | m_Offset: {x: 0, y: 0} 103 | data: 104 | first: 105 | name: _ScaleTex 106 | second: 107 | m_Texture: {fileID: 0} 108 | m_Scale: {x: 1, y: 1} 109 | m_Offset: {x: 0, y: 0} 110 | m_Floats: 111 | data: 112 | first: 113 | name: _SrcBlend 114 | second: 1 115 | data: 116 | first: 117 | name: _DstBlend 118 | second: 0 119 | data: 120 | first: 121 | name: _Cutoff 122 | second: .5 123 | data: 124 | first: 125 | name: _Smoothness 126 | second: .720000029 127 | data: 128 | first: 129 | name: _Parallax 130 | second: .0199999996 131 | data: 132 | first: 133 | name: _ZWrite 134 | second: 1 135 | data: 136 | first: 137 | name: _Glossiness 138 | second: .5 139 | data: 140 | first: 141 | name: _BumpScale 142 | second: 1 143 | data: 144 | first: 145 | name: _OcclusionStrength 146 | second: 1 147 | data: 148 | first: 149 | name: _DetailNormalMapScale 150 | second: 1 151 | data: 152 | first: 153 | name: _UVSec 154 | second: 0 155 | data: 156 | first: 157 | name: _Mode 158 | second: 0 159 | data: 160 | first: 161 | name: _Metallic 162 | second: 1 163 | data: 164 | first: 165 | name: _OcclusionStr 166 | second: 1 167 | data: 168 | first: 169 | name: _ColorMode 170 | second: 1 171 | data: 172 | first: 173 | name: _RandomUV 174 | second: 1 175 | data: 176 | first: 177 | name: _NormalScale 178 | second: 1 179 | m_Colors: 180 | data: 181 | first: 182 | name: _EmissionColor 183 | second: {r: 0, g: 0, b: 0, a: 1} 184 | data: 185 | first: 186 | name: _Color 187 | second: {r: 0, g: 0, b: 0, a: 1} 188 | data: 189 | first: 190 | name: _Color2 191 | second: {r: 1, g: 1, b: 1, a: 1} 192 | -------------------------------------------------------------------------------- /Assets/Test/Wall 2.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: Wall 2 10 | m_Shader: {fileID: 4800000, guid: 1ded3f0cc90114d1c9b7431b375d82e2, type: 3} 11 | m_ShaderKeywords: COLOR_RANDOM COLOR_SINGLE RANDOM_UV _ALBEDOMAP _COLORMODE_COLOR_SINGLE 12 | _COLORMODE_RANDOM _NORMALMAP _OCCLUSIONMAP _RANDOM_UV 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: 0c2641f16f0c74dc8bd65cc0f24b03df, type: 3} 24 | m_Scale: {x: .200000003, y: .5} 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: _NormalMap 36 | second: 37 | m_Texture: {fileID: 2800000, guid: 912fe0350b83a4934aa3799ef6fced00, type: 3} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | data: 41 | first: 42 | name: _DetailNormalMap 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: _ParallaxMap 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: _OcclusionMap 57 | second: 58 | m_Texture: {fileID: 2800000, guid: c8fd564835bc6474c84c6798e7d7e2b5, type: 3} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | data: 62 | first: 63 | name: _EmissionMap 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: _DetailMask 71 | second: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | data: 76 | first: 77 | name: _DetailAlbedoMap 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: _MetallicGlossMap 85 | second: 86 | m_Texture: {fileID: 0} 87 | m_Scale: {x: 1, y: 1} 88 | m_Offset: {x: 0, y: 0} 89 | data: 90 | first: 91 | name: _PositionTex 92 | second: 93 | m_Texture: {fileID: 0} 94 | m_Scale: {x: 1, y: 1} 95 | m_Offset: {x: 0, y: 0} 96 | data: 97 | first: 98 | name: _RotationTex 99 | second: 100 | m_Texture: {fileID: 0} 101 | m_Scale: {x: 1, y: 1} 102 | m_Offset: {x: 0, y: 0} 103 | data: 104 | first: 105 | name: _ScaleTex 106 | second: 107 | m_Texture: {fileID: 0} 108 | m_Scale: {x: 1, y: 1} 109 | m_Offset: {x: 0, y: 0} 110 | m_Floats: 111 | data: 112 | first: 113 | name: _SrcBlend 114 | second: 1 115 | data: 116 | first: 117 | name: _DstBlend 118 | second: 0 119 | data: 120 | first: 121 | name: _Cutoff 122 | second: .5 123 | data: 124 | first: 125 | name: _Smoothness 126 | second: .72299999 127 | data: 128 | first: 129 | name: _Parallax 130 | second: .0199999996 131 | data: 132 | first: 133 | name: _ZWrite 134 | second: 1 135 | data: 136 | first: 137 | name: _Glossiness 138 | second: .5 139 | data: 140 | first: 141 | name: _BumpScale 142 | second: 1 143 | data: 144 | first: 145 | name: _OcclusionStrength 146 | second: 1 147 | data: 148 | first: 149 | name: _DetailNormalMapScale 150 | second: 1 151 | data: 152 | first: 153 | name: _UVSec 154 | second: 0 155 | data: 156 | first: 157 | name: _Mode 158 | second: 0 159 | data: 160 | first: 161 | name: _Metallic 162 | second: .757000029 163 | data: 164 | first: 165 | name: _OcclusionStr 166 | second: .759000003 167 | data: 168 | first: 169 | name: _ColorMode 170 | second: 1 171 | data: 172 | first: 173 | name: _RandomUV 174 | second: 1 175 | data: 176 | first: 177 | name: _NormalScale 178 | second: 1 179 | m_Colors: 180 | data: 181 | first: 182 | name: _EmissionColor 183 | second: {r: 0, g: 0, b: 0, a: 1} 184 | data: 185 | first: 186 | name: _Color 187 | second: {r: .735294104, g: .735294104, b: .735294104, a: 1} 188 | data: 189 | first: 190 | name: _Color2 191 | second: {r: .375, g: .046875, b: .046875, a: 1} 192 | -------------------------------------------------------------------------------- /Assets/Test/Wall 3.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: Wall 3 10 | m_Shader: {fileID: 4800000, guid: 1ded3f0cc90114d1c9b7431b375d82e2, type: 3} 11 | m_ShaderKeywords: COLOR_RANDOM COLOR_SINGLE RANDOM_UV _ALBEDOMAP _COLORMODE_COLOR_SINGLE 12 | _COLORMODE_RANDOM _NORMALMAP _OCCLUSIONMAP _RANDOM_UV 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: 0c2641f16f0c74dc8bd65cc0f24b03df, type: 3} 24 | m_Scale: {x: .200000003, y: .5} 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: _NormalMap 36 | second: 37 | m_Texture: {fileID: 2800000, guid: 912fe0350b83a4934aa3799ef6fced00, type: 3} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | data: 41 | first: 42 | name: _DetailNormalMap 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: _ParallaxMap 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: _OcclusionMap 57 | second: 58 | m_Texture: {fileID: 2800000, guid: c8fd564835bc6474c84c6798e7d7e2b5, type: 3} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | data: 62 | first: 63 | name: _EmissionMap 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: _DetailMask 71 | second: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | data: 76 | first: 77 | name: _DetailAlbedoMap 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: _MetallicGlossMap 85 | second: 86 | m_Texture: {fileID: 0} 87 | m_Scale: {x: 1, y: 1} 88 | m_Offset: {x: 0, y: 0} 89 | data: 90 | first: 91 | name: _PositionTex 92 | second: 93 | m_Texture: {fileID: 0} 94 | m_Scale: {x: 1, y: 1} 95 | m_Offset: {x: 0, y: 0} 96 | data: 97 | first: 98 | name: _RotationTex 99 | second: 100 | m_Texture: {fileID: 0} 101 | m_Scale: {x: 1, y: 1} 102 | m_Offset: {x: 0, y: 0} 103 | data: 104 | first: 105 | name: _ScaleTex 106 | second: 107 | m_Texture: {fileID: 0} 108 | m_Scale: {x: 1, y: 1} 109 | m_Offset: {x: 0, y: 0} 110 | m_Floats: 111 | data: 112 | first: 113 | name: _SrcBlend 114 | second: 1 115 | data: 116 | first: 117 | name: _DstBlend 118 | second: 0 119 | data: 120 | first: 121 | name: _Cutoff 122 | second: .5 123 | data: 124 | first: 125 | name: _Smoothness 126 | second: .769999981 127 | data: 128 | first: 129 | name: _Parallax 130 | second: .0199999996 131 | data: 132 | first: 133 | name: _ZWrite 134 | second: 1 135 | data: 136 | first: 137 | name: _Glossiness 138 | second: .5 139 | data: 140 | first: 141 | name: _BumpScale 142 | second: 1 143 | data: 144 | first: 145 | name: _OcclusionStrength 146 | second: 1 147 | data: 148 | first: 149 | name: _DetailNormalMapScale 150 | second: 1 151 | data: 152 | first: 153 | name: _UVSec 154 | second: 0 155 | data: 156 | first: 157 | name: _Mode 158 | second: 0 159 | data: 160 | first: 161 | name: _Metallic 162 | second: .889999986 163 | data: 164 | first: 165 | name: _OcclusionStr 166 | second: .759000003 167 | data: 168 | first: 169 | name: _ColorMode 170 | second: 1 171 | data: 172 | first: 173 | name: _RandomUV 174 | second: 1 175 | data: 176 | first: 177 | name: _NormalScale 178 | second: 1 179 | m_Colors: 180 | data: 181 | first: 182 | name: _EmissionColor 183 | second: {r: 0, g: 0, b: 0, a: 1} 184 | data: 185 | first: 186 | name: _Color 187 | second: {r: .845588207, g: .845588207, b: .845588207, a: 1} 188 | data: 189 | first: 190 | name: _Color2 191 | second: {r: .0340614058, g: .0341307595, b: .0441176295, a: 1} 192 | -------------------------------------------------------------------------------- /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/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/Kino/Fog/Shader/Fog.shader: -------------------------------------------------------------------------------- 1 | // 2 | // KinoFog - Deferred fog 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/Fog" 24 | { 25 | Properties 26 | { 27 | _MainTex ("-", 2D) = "" {} 28 | _FogColor ("-", Color) = (0, 0, 0, 0) 29 | _SkyTint ("-", Color) = (.5, .5, .5, .5) 30 | [Gamma] _SkyExposure ("-", Range(0, 8)) = 1.0 31 | [NoScaleOffset] _SkyCubemap ("-", Cube) = "" {} 32 | } 33 | CGINCLUDE 34 | 35 | #include "UnityCG.cginc" 36 | 37 | #pragma multi_compile FOG_LINEAR FOG_EXP FOG_EXP2 38 | #pragma multi_compile _ RADIAL_DIST 39 | #pragma multi_compile _ USE_SKYBOX 40 | 41 | sampler2D _MainTex; 42 | float4 _MainTex_TexelSize; 43 | 44 | sampler2D_float _CameraDepthTexture; 45 | 46 | float _DistanceOffset; 47 | float _Density; 48 | float _LinearGrad; 49 | float _LinearOffs; 50 | 51 | // Fog/skybox information 52 | half4 _FogColor; 53 | samplerCUBE _SkyCubemap; 54 | half4 _SkyCubemap_HDR; 55 | half4 _SkyTint; 56 | half _SkyExposure; 57 | float _SkyRotation; 58 | 59 | struct v2f 60 | { 61 | float4 pos : SV_POSITION; 62 | float2 uv : TEXCOORD0; 63 | float2 uv_depth : TEXCOORD1; 64 | float3 ray : TEXCOORD2; 65 | }; 66 | 67 | float3 RotateAroundYAxis(float3 v, float deg) 68 | { 69 | float alpha = deg * UNITY_PI / 180.0; 70 | float sina, cosa; 71 | sincos(alpha, sina, cosa); 72 | float2x2 m = float2x2(cosa, -sina, sina, cosa); 73 | return float3(mul(m, v.xz), v.y).xzy; 74 | } 75 | 76 | v2f vert(appdata_full v) 77 | { 78 | v2f o; 79 | 80 | o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 81 | o.uv = v.texcoord.xy; 82 | o.uv_depth = v.texcoord.xy; 83 | o.ray = RotateAroundYAxis(v.texcoord1.xyz, -_SkyRotation); 84 | 85 | #if UNITY_UV_STARTS_AT_TOP 86 | if (_MainTex_TexelSize.y < 0.0) o.uv.y = 1.0 - o.uv.y; 87 | #endif 88 | 89 | return o; 90 | } 91 | 92 | // Applies one of standard fog formulas, given fog coordinate (i.e. distance) 93 | half ComputeFogFactor(float coord) 94 | { 95 | float fog = 0.0; 96 | #if FOG_LINEAR 97 | // factor = (end-z)/(end-start) = z * (-1/(end-start)) + (end/(end-start)) 98 | fog = coord * _LinearGrad + _LinearOffs; 99 | #elif FOG_EXP 100 | // factor = exp(-density*z) 101 | fog = _Density * coord; 102 | fog = exp2(-fog); 103 | #else // FOG_EXP2 104 | // factor = exp(-(density*z)^2) 105 | fog = _Density * coord; 106 | fog = exp2(-fog * fog); 107 | #endif 108 | return saturate(fog); 109 | } 110 | 111 | // Distance-based fog 112 | float ComputeDistance(float3 ray, float depth) 113 | { 114 | float dist; 115 | #if RADIAL_DIST 116 | dist = length(ray * depth); 117 | #else 118 | dist = depth * _ProjectionParams.z; 119 | #endif 120 | // Built-in fog starts at near plane, so match that by 121 | // subtracting the near value. Not a perfect approximation 122 | // if near plane is very large, but good enough. 123 | dist -= _ProjectionParams.y; 124 | return dist; 125 | } 126 | 127 | half4 frag(v2f i) : SV_Target 128 | { 129 | half4 sceneColor = tex2D(_MainTex, i.uv); 130 | 131 | // Reconstruct world space position & direction towards this screen pixel. 132 | float zsample = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv_depth); 133 | float depth = Linear01Depth(zsample * (zsample < 1.0)); 134 | 135 | // Compute fog amount. 136 | float g = ComputeDistance(i.ray, depth) - _DistanceOffset; 137 | half fog = ComputeFogFactor(max(0.0, g)); 138 | 139 | #if USE_SKYBOX 140 | // Look up the skybox color. 141 | half3 skyColor = DecodeHDR(texCUBE(_SkyCubemap, i.ray), _SkyCubemap_HDR); 142 | skyColor *= _SkyTint.rgb * _SkyExposure * unity_ColorSpaceDouble; 143 | // Lerp between source color to skybox color with fog amount. 144 | return lerp(half4(skyColor, 1), sceneColor, fog); 145 | #else 146 | // Lerp between source color to fog color with the fog amount. 147 | return lerp(_FogColor, sceneColor, fog); 148 | #endif 149 | } 150 | 151 | ENDCG 152 | SubShader 153 | { 154 | ZTest Always Cull Off ZWrite Off 155 | Pass 156 | { 157 | CGPROGRAM 158 | #pragma vertex vert 159 | #pragma fragment frag 160 | ENDCG 161 | } 162 | } 163 | Fallback off 164 | } 165 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Shaders/SimplexNoiseExt3D.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 | float snoise(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 | // Mix final noise value 108 | float4 m = max(0.6 - float4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0); 109 | m = m * m; 110 | m = m * m; 111 | 112 | float4 px = float4(dot(x0, g0), dot(x1, g1), dot(x2, g2), dot(x3, g3)); 113 | return 42.0 * dot(m, px); 114 | } 115 | 116 | float3 snoise_grad(float3 v) 117 | { 118 | const float2 C = float2(1.0 / 6.0, 1.0 / 3.0); 119 | 120 | // First corner 121 | float3 i = floor(v + dot(v, C.yyy)); 122 | float3 x0 = v - i + dot(i, C.xxx); 123 | 124 | // Other corners 125 | float3 g = step(x0.yzx, x0.xyz); 126 | float3 l = 1.0 - g; 127 | float3 i1 = min(g.xyz, l.zxy); 128 | float3 i2 = max(g.xyz, l.zxy); 129 | 130 | // x1 = x0 - i1 + 1.0 * C.xxx; 131 | // x2 = x0 - i2 + 2.0 * C.xxx; 132 | // x3 = x0 - 1.0 + 3.0 * C.xxx; 133 | float3 x1 = x0 - i1 + C.xxx; 134 | float3 x2 = x0 - i2 + C.yyy; 135 | float3 x3 = x0 - 0.5; 136 | 137 | // Permutations 138 | i = mod289(i); // Avoid truncation effects in permutation 139 | float4 p = 140 | permute(permute(permute(i.z + float4(0.0, i1.z, i2.z, 1.0)) 141 | + i.y + float4(0.0, i1.y, i2.y, 1.0)) 142 | + i.x + float4(0.0, i1.x, i2.x, 1.0)); 143 | 144 | // Gradients: 7x7 points over a square, mapped onto an octahedron. 145 | // The ring size 17*17 = 289 is close to a multiple of 49 (49*6 = 294) 146 | float4 j = p - 49.0 * floor(p / 49.0); // mod(p,7*7) 147 | 148 | float4 x_ = floor(j / 7.0); 149 | float4 y_ = floor(j - 7.0 * x_); // mod(j,N) 150 | 151 | float4 x = (x_ * 2.0 + 0.5) / 7.0 - 1.0; 152 | float4 y = (y_ * 2.0 + 0.5) / 7.0 - 1.0; 153 | 154 | float4 h = 1.0 - abs(x) - abs(y); 155 | 156 | float4 b0 = float4(x.xy, y.xy); 157 | float4 b1 = float4(x.zw, y.zw); 158 | 159 | //float4 s0 = float4(lessThan(b0, 0.0)) * 2.0 - 1.0; 160 | //float4 s1 = float4(lessThan(b1, 0.0)) * 2.0 - 1.0; 161 | float4 s0 = floor(b0) * 2.0 + 1.0; 162 | float4 s1 = floor(b1) * 2.0 + 1.0; 163 | float4 sh = -step(h, 0.0); 164 | 165 | float4 a0 = b0.xzyw + s0.xzyw * sh.xxyy; 166 | float4 a1 = b1.xzyw + s1.xzyw * sh.zzww; 167 | 168 | float3 g0 = float3(a0.xy, h.x); 169 | float3 g1 = float3(a0.zw, h.y); 170 | float3 g2 = float3(a1.xy, h.z); 171 | float3 g3 = float3(a1.zw, h.w); 172 | 173 | // Normalise gradients 174 | float4 norm = taylorInvSqrt(float4(dot(g0, g0), dot(g1, g1), dot(g2, g2), dot(g3, g3))); 175 | g0 *= norm.x; 176 | g1 *= norm.y; 177 | g2 *= norm.z; 178 | g3 *= norm.w; 179 | 180 | // Compute gradient of noise function at P 181 | float4 m = max(0.6 - float4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0); 182 | float4 m2 = m * m; 183 | float4 m3 = m2 * m; 184 | float4 m4 = m2 * m2; 185 | float3 grad = 186 | -6.0 * m3.x * x0 * dot(x0, g0) + m4.x * g0 + 187 | -6.0 * m3.y * x1 * dot(x1, g1) + m4.y * g1 + 188 | -6.0 * m3.z * x2 * dot(x2, g2) + m4.z * g2 + 189 | -6.0 * m3.w * x3 * dot(x3, g3) + m4.w * g3; 190 | return 42.0 * grad; 191 | } 192 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Editor/WallEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Custom editor class for Wall 3 | // 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | namespace Kvant 8 | { 9 | [CustomEditor(typeof(Wall)), CanEditMultipleObjects] 10 | public class WallEditor : Editor 11 | { 12 | SerializedProperty _columns; 13 | SerializedProperty _rows; 14 | SerializedProperty _extent; 15 | SerializedProperty _offset; 16 | 17 | SerializedProperty _positionNoiseMode; 18 | SerializedProperty _positionNoiseAmplitude; 19 | SerializedProperty _positionNoiseFrequency; 20 | SerializedProperty _positionNoiseSpeed; 21 | 22 | SerializedProperty _rotationNoiseMode; 23 | SerializedProperty _rotationNoiseAmplitude; 24 | SerializedProperty _rotationNoiseFrequency; 25 | SerializedProperty _rotationNoiseSpeed; 26 | 27 | SerializedProperty _scaleNoiseMode; 28 | SerializedProperty _scaleNoiseAmplitude; 29 | SerializedProperty _scaleNoiseFrequency; 30 | SerializedProperty _scaleNoiseSpeed; 31 | 32 | SerializedProperty _shapes; 33 | SerializedProperty _baseScale; 34 | SerializedProperty _scaleRandomness; 35 | SerializedProperty _material; 36 | SerializedProperty _castShadows; 37 | SerializedProperty _receiveShadows; 38 | 39 | SerializedProperty _debug; 40 | 41 | static GUIContent _textPositionNoise = new GUIContent("Noise To Position"); 42 | static GUIContent _textRotationNoise = new GUIContent("Noise To Rotation"); 43 | static GUIContent _textScaleNoise = new GUIContent("Noise To Scale"); 44 | static GUIContent _textAmplitude = new GUIContent("Amplitude"); 45 | static GUIContent _textFrequency = new GUIContent("Frequency"); 46 | static GUIContent _textSpeed = new GUIContent("Speed"); 47 | 48 | void OnEnable() 49 | { 50 | _columns = serializedObject.FindProperty("_columns"); 51 | _rows = serializedObject.FindProperty("_rows"); 52 | _extent = serializedObject.FindProperty("_extent"); 53 | _offset = serializedObject.FindProperty("_offset"); 54 | 55 | _positionNoiseMode = serializedObject.FindProperty("_positionNoiseMode"); 56 | _positionNoiseAmplitude = serializedObject.FindProperty("_positionNoiseAmplitude"); 57 | _positionNoiseFrequency = serializedObject.FindProperty("_positionNoiseFrequency"); 58 | _positionNoiseSpeed = serializedObject.FindProperty("_positionNoiseSpeed"); 59 | 60 | _rotationNoiseMode = serializedObject.FindProperty("_rotationNoiseMode"); 61 | _rotationNoiseAmplitude = serializedObject.FindProperty("_rotationNoiseAmplitude"); 62 | _rotationNoiseFrequency = serializedObject.FindProperty("_rotationNoiseFrequency"); 63 | _rotationNoiseSpeed = serializedObject.FindProperty("_rotationNoiseSpeed"); 64 | 65 | _scaleNoiseMode = serializedObject.FindProperty("_scaleNoiseMode"); 66 | _scaleNoiseAmplitude = serializedObject.FindProperty("_scaleNoiseAmplitude"); 67 | _scaleNoiseFrequency = serializedObject.FindProperty("_scaleNoiseFrequency"); 68 | _scaleNoiseSpeed = serializedObject.FindProperty("_scaleNoiseSpeed"); 69 | 70 | _shapes = serializedObject.FindProperty("_shapes"); 71 | _baseScale = serializedObject.FindProperty("_baseScale"); 72 | _scaleRandomness = serializedObject.FindProperty("_scaleRandomness"); 73 | _material = serializedObject.FindProperty("_material"); 74 | _castShadows = serializedObject.FindProperty("_castShadows"); 75 | _receiveShadows = serializedObject.FindProperty("_receiveShadows"); 76 | 77 | _debug = serializedObject.FindProperty("_debug"); 78 | } 79 | 80 | public override void OnInspectorGUI() 81 | { 82 | var targetWall = target as Wall; 83 | 84 | serializedObject.Update(); 85 | 86 | EditorGUI.BeginChangeCheck(); 87 | 88 | EditorGUILayout.PropertyField(_columns); 89 | EditorGUILayout.PropertyField(_rows); 90 | 91 | if (EditorGUI.EndChangeCheck()) 92 | targetWall.NotifyConfigChange(); 93 | 94 | EditorGUILayout.PropertyField(_extent); 95 | EditorGUILayout.PropertyField(_offset); 96 | 97 | EditorGUILayout.Space(); 98 | 99 | EditorGUILayout.PropertyField(_positionNoiseMode, _textPositionNoise); 100 | if (_positionNoiseMode.hasMultipleDifferentValues || _positionNoiseMode.enumValueIndex > 0) 101 | { 102 | EditorGUI.indentLevel++; 103 | EditorGUILayout.PropertyField(_positionNoiseAmplitude, _textAmplitude); 104 | EditorGUILayout.PropertyField(_positionNoiseFrequency, _textFrequency); 105 | EditorGUILayout.PropertyField(_positionNoiseSpeed, _textSpeed); 106 | EditorGUI.indentLevel--; 107 | } 108 | 109 | EditorGUILayout.PropertyField(_rotationNoiseMode, _textRotationNoise); 110 | if (_rotationNoiseMode.hasMultipleDifferentValues || _rotationNoiseMode.enumValueIndex > 0) 111 | { 112 | EditorGUI.indentLevel++; 113 | EditorGUILayout.PropertyField(_rotationNoiseAmplitude, _textAmplitude); 114 | EditorGUILayout.PropertyField(_rotationNoiseFrequency, _textFrequency); 115 | EditorGUILayout.PropertyField(_rotationNoiseSpeed, _textSpeed); 116 | EditorGUI.indentLevel--; 117 | } 118 | 119 | EditorGUILayout.PropertyField(_scaleNoiseMode, _textScaleNoise); 120 | if (_scaleNoiseMode.hasMultipleDifferentValues || _scaleNoiseMode.enumValueIndex > 0) 121 | { 122 | EditorGUI.indentLevel++; 123 | EditorGUILayout.PropertyField(_scaleNoiseAmplitude, _textAmplitude); 124 | EditorGUILayout.PropertyField(_scaleNoiseFrequency, _textFrequency); 125 | EditorGUILayout.PropertyField(_scaleNoiseSpeed, _textSpeed); 126 | EditorGUI.indentLevel--; 127 | } 128 | 129 | EditorGUILayout.Space(); 130 | 131 | EditorGUI.BeginChangeCheck(); 132 | 133 | EditorGUILayout.PropertyField(_shapes, true); 134 | 135 | if (EditorGUI.EndChangeCheck()) 136 | targetWall.NotifyConfigChange(); 137 | 138 | EditorGUILayout.PropertyField(_baseScale); 139 | EditorGUILayout.PropertyField(_scaleRandomness); 140 | 141 | EditorGUILayout.PropertyField(_material); 142 | EditorGUILayout.PropertyField(_castShadows); 143 | EditorGUILayout.PropertyField(_receiveShadows); 144 | 145 | EditorGUILayout.Space(); 146 | 147 | EditorGUILayout.PropertyField(_debug); 148 | 149 | serializedObject.ApplyModifiedProperties(); 150 | } 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/Kino/Fog/Fog.cs: -------------------------------------------------------------------------------- 1 | // 2 | // KinoFog - Deferred fog 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/Fog")] 30 | public class Fog : MonoBehaviour 31 | { 32 | #region Public Properties 33 | 34 | // Start distance 35 | [SerializeField] 36 | float _startDistance = 1; 37 | 38 | public float startDistance { 39 | get { return _startDistance; } 40 | set { _startDistance = value; } 41 | } 42 | 43 | // Use radial distance 44 | [SerializeField] 45 | bool _useRadialDistance; 46 | 47 | public bool useRadialDistance { 48 | get { return _useRadialDistance; } 49 | set { _useRadialDistance = value; } 50 | } 51 | 52 | // Fade-to-skybox flag 53 | [SerializeField] 54 | bool _fadeToSkybox; 55 | 56 | public bool fadeToSkybox { 57 | get { return _fadeToSkybox; } 58 | set { _fadeToSkybox = value; } 59 | } 60 | 61 | #endregion 62 | 63 | #region Private Properties 64 | 65 | [SerializeField] Shader _shader; 66 | 67 | Material _material; 68 | 69 | #endregion 70 | 71 | #region MonoBehaviour Functions 72 | 73 | void OnEnable() 74 | { 75 | GetComponent().depthTextureMode |= DepthTextureMode.Depth; 76 | } 77 | 78 | [ImageEffectOpaque] 79 | void OnRenderImage(RenderTexture source, RenderTexture destination) 80 | { 81 | if (_material == null) 82 | { 83 | _material = new Material(_shader); 84 | _material.hideFlags = HideFlags.DontSave; 85 | } 86 | 87 | _startDistance = Mathf.Max(_startDistance, 0.0f); 88 | _material.SetFloat("_DistanceOffset", _startDistance); 89 | 90 | var mode = RenderSettings.fogMode; 91 | if (mode == FogMode.Linear) 92 | { 93 | var start = RenderSettings.fogStartDistance; 94 | var end = RenderSettings.fogEndDistance; 95 | var invDiff = 1.0f / Mathf.Max(end - start, 1.0e-6f); 96 | _material.SetFloat("_LinearGrad", -invDiff); 97 | _material.SetFloat("_LinearOffs", end * invDiff); 98 | _material.DisableKeyword("FOG_EXP"); 99 | _material.DisableKeyword("FOG_EXP2"); 100 | } 101 | else if (mode == FogMode.Exponential) 102 | { 103 | const float coeff = 1.4426950408f; // 1/ln(2) 104 | var density = RenderSettings.fogDensity; 105 | _material.SetFloat("_Density", coeff * density); 106 | _material.EnableKeyword("FOG_EXP"); 107 | _material.DisableKeyword("FOG_EXP2"); 108 | } 109 | else // FogMode.ExponentialSquared 110 | { 111 | const float coeff = 1.2011224087f; // 1/sqrt(ln(2)) 112 | var density = RenderSettings.fogDensity; 113 | _material.SetFloat("_Density", coeff * density); 114 | _material.DisableKeyword("FOG_EXP"); 115 | _material.EnableKeyword("FOG_EXP2"); 116 | } 117 | 118 | if (_useRadialDistance) 119 | _material.EnableKeyword("RADIAL_DIST"); 120 | else 121 | _material.DisableKeyword("RADIAL_DIST"); 122 | 123 | if (_fadeToSkybox) 124 | { 125 | _material.EnableKeyword("USE_SKYBOX"); 126 | // Transfer the skybox parameters. 127 | var skybox = RenderSettings.skybox; 128 | _material.SetTexture("_SkyCubemap", skybox.GetTexture("_Tex")); 129 | _material.SetColor("_SkyTint", skybox.GetColor("_Tint")); 130 | _material.SetFloat("_SkyExposure", skybox.GetFloat("_Exposure")); 131 | _material.SetFloat("_SkyRotation", skybox.GetFloat("_Rotation")); 132 | } 133 | else 134 | { 135 | _material.DisableKeyword("USE_SKYBOX"); 136 | _material.SetColor("_FogColor", RenderSettings.fogColor); 137 | } 138 | 139 | // Calculate vectors towards frustum corners. 140 | var cam = GetComponent(); 141 | var camtr = cam.transform; 142 | var camNear = cam.nearClipPlane; 143 | var camFar = cam.farClipPlane; 144 | 145 | var tanHalfFov = Mathf.Tan(cam.fieldOfView * Mathf.Deg2Rad / 2); 146 | var toRight = camtr.right * camNear * tanHalfFov * cam.aspect; 147 | var toTop = camtr.up * camNear * tanHalfFov; 148 | 149 | var v_tl = camtr.forward * camNear - toRight + toTop; 150 | var v_tr = camtr.forward * camNear + toRight + toTop; 151 | var v_br = camtr.forward * camNear + toRight - toTop; 152 | var v_bl = camtr.forward * camNear - toRight - toTop; 153 | 154 | var v_s = v_tl.magnitude * camFar / camNear; 155 | 156 | // Draw screen quad. 157 | RenderTexture.active = destination; 158 | 159 | _material.SetTexture("_MainTex", source); 160 | _material.SetPass(0); 161 | 162 | GL.PushMatrix(); 163 | GL.LoadOrtho(); 164 | GL.Begin(GL.QUADS); 165 | 166 | GL.MultiTexCoord2(0, 0, 0); 167 | GL.MultiTexCoord(1, v_bl.normalized * v_s); 168 | GL.Vertex3(0, 0, 0.1f); 169 | 170 | GL.MultiTexCoord2(0, 1, 0); 171 | GL.MultiTexCoord(1, v_br.normalized * v_s); 172 | GL.Vertex3(1, 0, 0.1f); 173 | 174 | GL.MultiTexCoord2(0, 1, 1); 175 | GL.MultiTexCoord(1, v_tr.normalized * v_s); 176 | GL.Vertex3(1, 1, 0.1f); 177 | 178 | GL.MultiTexCoord2(0, 0, 1); 179 | GL.MultiTexCoord(1, v_tl.normalized * v_s); 180 | GL.Vertex3(0, 1, 0.1f); 181 | 182 | GL.End(); 183 | GL.PopMatrix(); 184 | } 185 | 186 | #endregion 187 | } 188 | } 189 | -------------------------------------------------------------------------------- /Assets/Kino/Bloom/Shader/Bloom.shader: -------------------------------------------------------------------------------- 1 | // 2 | // KinoBloom - Bloom effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | Shader "Hidden/Kino/Bloom" 25 | { 26 | Properties 27 | { 28 | _MainTex("-", 2D) = "" {} 29 | _AccTex("-", 2D) = "" {} 30 | _Blur1Tex("-", 2D) = "" {} 31 | _Blur2Tex("-", 2D) = "" {} 32 | } 33 | 34 | CGINCLUDE 35 | 36 | #include "UnityCG.cginc" 37 | 38 | sampler2D _MainTex; 39 | float2 _MainTex_TexelSize; 40 | 41 | sampler2D _AccTex; 42 | sampler2D _Blur1Tex; 43 | sampler2D _Blur2Tex; 44 | 45 | float _Threshold; 46 | float _TempFilter; 47 | float _Intensity1; 48 | float _Intensity2; 49 | 50 | // Quarter downsampler 51 | half4 frag_downsample(v2f_img i) : SV_Target 52 | { 53 | float4 d = _MainTex_TexelSize.xyxy * float4(1, 1, -1, -1); 54 | half4 s; 55 | s = tex2D(_MainTex, i.uv + d.xy); 56 | s += tex2D(_MainTex, i.uv + d.xw); 57 | s += tex2D(_MainTex, i.uv + d.zy); 58 | s += tex2D(_MainTex, i.uv + d.zw); 59 | return s * 0.25; 60 | } 61 | 62 | // Thresholding filter 63 | half4 frag_threshold(v2f_img i) : SV_Target 64 | { 65 | half4 cs = tex2D(_MainTex, i.uv); 66 | half lm = Luminance(cs.rgb); 67 | return cs * smoothstep(_Threshold, _Threshold * 1.5, lm); 68 | } 69 | 70 | // Thresholding filter with temporal filtering 71 | half4 frag_threshold_temp(v2f_img i) : SV_Target 72 | { 73 | half4 co = frag_threshold(i); 74 | half4 cp = tex2D(_AccTex, i.uv); 75 | return lerp(co, cp, _TempFilter); 76 | } 77 | 78 | // 9-tap Gaussian filter with linear sampling 79 | // http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/ 80 | half4 gaussian_filter(float2 uv, float2 stride) 81 | { 82 | half4 s = tex2D(_MainTex, uv) * 0.227027027; 83 | 84 | float2 d1 = stride * 1.3846153846; 85 | s += tex2D(_MainTex, uv + d1) * 0.3162162162; 86 | s += tex2D(_MainTex, uv - d1) * 0.3162162162; 87 | 88 | float2 d2 = stride * 3.2307692308; 89 | s += tex2D(_MainTex, uv + d2) * 0.0702702703; 90 | s += tex2D(_MainTex, uv - d2) * 0.0702702703; 91 | 92 | return s; 93 | } 94 | 95 | half4 frag_gaussian_blur_h(v2f_img i) : SV_Target 96 | { 97 | return gaussian_filter(i.uv, float2(_MainTex_TexelSize.x, 0)); 98 | } 99 | 100 | half4 frag_gaussian_blur_v(v2f_img i) : SV_Target 101 | { 102 | return gaussian_filter(i.uv, float2(0, _MainTex_TexelSize.y)); 103 | } 104 | 105 | // 13-tap box filter with linear sampling 106 | half4 box_filter(float2 uv, float2 stride) 107 | { 108 | half4 s = tex2D(_MainTex, uv) / 2; 109 | 110 | float2 d1 = stride * 1.5; 111 | s += tex2D(_MainTex, uv + d1); 112 | s += tex2D(_MainTex, uv - d1); 113 | 114 | float2 d2 = stride * 3.5; 115 | s += tex2D(_MainTex, uv + d2); 116 | s += tex2D(_MainTex, uv - d2); 117 | 118 | float2 d3 = stride * 5.5; 119 | s += tex2D(_MainTex, uv + d3); 120 | s += tex2D(_MainTex, uv - d3); 121 | 122 | return s * 2 / 13; 123 | } 124 | 125 | half4 frag_box_blur_h(v2f_img i) : SV_Target 126 | { 127 | return box_filter(i.uv, float2(_MainTex_TexelSize.x, 0)); 128 | } 129 | 130 | half4 frag_box_blur_v(v2f_img i) : SV_Target 131 | { 132 | return box_filter(i.uv, float2(0, _MainTex_TexelSize.y)); 133 | } 134 | 135 | // Composite function 136 | half4 frag_composite(v2f_img i) : SV_Target 137 | { 138 | half4 cs = tex2D(_MainTex, i.uv); 139 | half3 c1 = LinearToGammaSpace(cs.rgb); 140 | half3 c2 = LinearToGammaSpace(tex2D(_Blur1Tex, i.uv).rgb); 141 | half3 c3 = LinearToGammaSpace(tex2D(_Blur2Tex, i.uv).rgb); 142 | half3 co = c1 + c2 * _Intensity1 + c3 * _Intensity2; 143 | return half4(GammaToLinearSpace(co), cs.a); 144 | } 145 | 146 | ENDCG 147 | SubShader 148 | { 149 | Pass 150 | { 151 | ZTest Always Cull Off ZWrite Off 152 | CGPROGRAM 153 | #pragma vertex vert_img 154 | #pragma fragment frag_downsample 155 | #pragma target 3.0 156 | ENDCG 157 | } 158 | Pass 159 | { 160 | ZTest Always Cull Off ZWrite Off 161 | CGPROGRAM 162 | #pragma vertex vert_img 163 | #pragma fragment frag_threshold 164 | #pragma target 3.0 165 | ENDCG 166 | } 167 | Pass 168 | { 169 | ZTest Always Cull Off ZWrite Off 170 | CGPROGRAM 171 | #pragma vertex vert_img 172 | #pragma fragment frag_threshold_temp 173 | #pragma target 3.0 174 | ENDCG 175 | } 176 | Pass 177 | { 178 | ZTest Always Cull Off ZWrite Off 179 | CGPROGRAM 180 | #pragma vertex vert_img 181 | #pragma fragment frag_gaussian_blur_h 182 | #pragma target 3.0 183 | ENDCG 184 | } 185 | Pass 186 | { 187 | ZTest Always Cull Off ZWrite Off 188 | CGPROGRAM 189 | #pragma vertex vert_img 190 | #pragma fragment frag_gaussian_blur_v 191 | #pragma target 3.0 192 | ENDCG 193 | } 194 | Pass 195 | { 196 | ZTest Always Cull Off ZWrite Off 197 | CGPROGRAM 198 | #pragma vertex vert_img 199 | #pragma fragment frag_box_blur_h 200 | #pragma target 3.0 201 | ENDCG 202 | } 203 | Pass 204 | { 205 | ZTest Always Cull Off ZWrite Off 206 | CGPROGRAM 207 | #pragma vertex vert_img 208 | #pragma fragment frag_box_blur_v 209 | #pragma target 3.0 210 | ENDCG 211 | } 212 | Pass 213 | { 214 | ZTest Always Cull Off ZWrite Off 215 | CGPROGRAM 216 | #pragma vertex vert_img 217 | #pragma fragment frag_composite 218 | #pragma target 3.0 219 | ENDCG 220 | } 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /Assets/Kvant/Wall/Scripts/BulkMesh.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Bulk mesh handler 3 | // 4 | using UnityEngine; 5 | 6 | namespace Kvant 7 | { 8 | public partial class Wall 9 | { 10 | [System.Serializable] 11 | class BulkMesh 12 | { 13 | #region Public Properties 14 | 15 | Mesh _mesh; 16 | public Mesh mesh { get { return _mesh; } } 17 | 18 | #endregion 19 | 20 | #region Public Methods 21 | 22 | public BulkMesh(Mesh[] shapes, int columns) 23 | { 24 | CombineMeshes(shapes, columns); 25 | } 26 | 27 | public void Rebuild(Mesh[] shapes, int columns) 28 | { 29 | Release(); 30 | CombineMeshes(shapes, columns); 31 | } 32 | 33 | public void Release() 34 | { 35 | if (_mesh) DestroyImmediate(_mesh); 36 | } 37 | 38 | #endregion 39 | 40 | #region Private Methods 41 | 42 | // Cache structure which stores shape information 43 | struct ShapeCacheData 44 | { 45 | Vector3[] vertices; 46 | Vector3[] normals; 47 | Vector4[] tangents; 48 | Vector2[] uv; 49 | int[] indices; 50 | 51 | public ShapeCacheData(Mesh mesh) 52 | { 53 | if (mesh) 54 | { 55 | vertices = mesh.vertices; 56 | normals = mesh.normals; 57 | tangents = mesh.tangents; 58 | uv = mesh.uv; 59 | indices = mesh.GetIndices(0); 60 | } 61 | else 62 | { 63 | // An empty mesh was given; replaces with a two-sided quad. 64 | vertices = new Vector3[] { 65 | new Vector3(-1, +1, 0), new Vector3(+1, +1, 0), 66 | new Vector3(-1, -1, 0), new Vector3(+1, -1, 0), 67 | new Vector3(+1, +1, 0), new Vector3(-1, +1, 0), 68 | new Vector3(+1, -1, 0), new Vector3(-1, -1, 0) 69 | }; 70 | normals = new Vector3[] { 71 | Vector3.forward, Vector3.forward, 72 | Vector3.forward, Vector3.forward, 73 | -Vector3.forward, -Vector3.forward, 74 | -Vector3.forward, -Vector3.forward, 75 | }; 76 | tangents = new Vector4[] { 77 | new Vector4( 1, 0, 0, 1), new Vector4( 1, 0, 0, 1), 78 | new Vector4( 1, 0, 0, 1), new Vector4( 1, 0, 0, 1), 79 | new Vector4(-1, 0, 0, 1), new Vector4(-1, 0, 0, 1), 80 | new Vector4(-1, 0, 0, 1), new Vector4(-1, 0, 0, 1) 81 | }; 82 | uv = new Vector2[] { 83 | new Vector2(0, 1), new Vector2(1, 1), 84 | new Vector2(0, 0), new Vector2(1, 0), 85 | new Vector2(1, 1), new Vector2(0, 1), 86 | new Vector2(1, 0), new Vector2(0, 0) 87 | }; 88 | indices = new int[] {0, 1, 2, 3, 2, 1, 4, 5, 6, 7, 6, 5}; 89 | } 90 | } 91 | 92 | public int VertexCount { get { return vertices.Length; } } 93 | public int IndexCount { get { return indices.Length; } } 94 | 95 | public void CopyVerticesTo(Vector3[] destination, int position) 96 | { 97 | System.Array.Copy(vertices, 0, destination, position, vertices.Length); 98 | } 99 | 100 | public void CopyNormalsTo(Vector3[] destination, int position) 101 | { 102 | System.Array.Copy(normals, 0, destination, position, normals.Length); 103 | } 104 | 105 | public void CopyTangentsTo(Vector4[] destination, int position) 106 | { 107 | System.Array.Copy(tangents, 0, destination, position, tangents.Length); 108 | } 109 | 110 | public void CopyUVTo(Vector2[] destination, int position) 111 | { 112 | System.Array.Copy(uv, 0, destination, position, uv.Length); 113 | } 114 | 115 | public void CopyIndicesTo(int[] destination, int position, int offset) 116 | { 117 | for (var i = 0; i < indices.Length; i++) 118 | destination[position + i] = offset + indices[i]; 119 | } 120 | } 121 | 122 | // Mesh combiner function 123 | void CombineMeshes(Mesh[] shapes, int copyCount) 124 | { 125 | ShapeCacheData[] cache; 126 | 127 | if (shapes == null || shapes.Length == 0) 128 | { 129 | // An empty shape was given; use the default shape. 130 | cache = new ShapeCacheData[1]; 131 | cache[0] = new ShapeCacheData(null); 132 | } 133 | else 134 | { 135 | // Copy given meshes into a shape cache. 136 | cache = new ShapeCacheData[shapes.Length]; 137 | for (var i = 0; i < shapes.Length; i++) 138 | cache[i] = new ShapeCacheData(shapes[i]); 139 | } 140 | 141 | // Count the number of vertices and indices in the shape cache. 142 | var vc_shapes = 0; 143 | var ic_shapes = 0; 144 | foreach (var s in cache) { 145 | vc_shapes += s.VertexCount; 146 | ic_shapes += s.IndexCount; 147 | } 148 | 149 | // If there is nothing, break. 150 | if (vc_shapes == 0) return; 151 | 152 | // Determine the number of vertices/indicies. 153 | var vc = 0; 154 | var ic = 0; 155 | for (var i = 0; i < copyCount; i++) 156 | { 157 | var s = cache[i % cache.Length]; 158 | if (vc + s.VertexCount > 65535) break; 159 | vc += s.VertexCount; 160 | ic += s.IndexCount; 161 | } 162 | 163 | // Create vertex arrays. 164 | var vertices = new Vector3[vc]; 165 | var normals = new Vector3[vc]; 166 | var tangents = new Vector4[vc]; 167 | var uv = new Vector2[vc]; 168 | var uv2 = new Vector2[vc]; 169 | var indicies = new int[ic]; 170 | 171 | for (int v_i = 0, i_i = 0, e_i = 0; v_i < vc; e_i++) 172 | { 173 | var s = cache[e_i % cache.Length]; 174 | 175 | s.CopyVerticesTo(vertices, v_i); 176 | s.CopyNormalsTo (normals, v_i); 177 | s.CopyTangentsTo(tangents, v_i); 178 | s.CopyUVTo (uv, v_i); 179 | 180 | s.CopyIndicesTo(indicies, i_i, v_i); 181 | 182 | var coord = new Vector2((float)e_i / copyCount, 0); 183 | for (var i = 0; i < s.VertexCount; i++) uv2[v_i + i] = coord; 184 | 185 | v_i += s.VertexCount; 186 | i_i += s.IndexCount; 187 | } 188 | 189 | // Create a mesh object. 190 | _mesh = new Mesh(); 191 | 192 | _mesh.vertices = vertices; 193 | _mesh.normals = normals; 194 | _mesh.tangents = tangents; 195 | _mesh.uv = uv; 196 | _mesh.uv2 = uv2; 197 | 198 | _mesh.SetIndices(indicies, MeshTopology.Triangles, 0); 199 | _mesh.Optimize(); 200 | 201 | // This only for temporary use. Don't save. 202 | _mesh.hideFlags = HideFlags.DontSave; 203 | 204 | // Avoid being culled. 205 | _mesh.bounds = new Bounds(Vector3.zero, Vector3.one * 1000); 206 | } 207 | 208 | #endregion 209 | } 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /Assets/Kino/Bloom/Bloom.cs: -------------------------------------------------------------------------------- 1 | // 2 | // KinoBloom - Bloom effect 3 | // 4 | // Copyright (C) 2015 Keijiro Takahashi 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | // 24 | using UnityEngine; 25 | 26 | namespace Kino 27 | { 28 | [ExecuteInEditMode] 29 | [RequireComponent(typeof(Camera))] 30 | [AddComponentMenu("Kino Image Effects/Bloom")] 31 | public class Bloom : MonoBehaviour 32 | { 33 | #region Public Properties 34 | 35 | // Bloom radius 36 | [SerializeField, Range(1, 10)] 37 | float _radius1 = 1.0f; 38 | 39 | public float radius1 { 40 | get { return _radius1; } 41 | set { _radius1 = value; } 42 | } 43 | 44 | [SerializeField, Range(1, 10)] 45 | float _radius2 = 4.0f; 46 | 47 | public float radius2 { 48 | get { return _radius2; } 49 | set { _radius2 = value; } 50 | } 51 | 52 | // Bloom intensity 53 | [SerializeField, Range(0, 1.0f)] 54 | float _intensity1 = 0.2f; 55 | 56 | public float intensity1 { 57 | get { return _intensity1; } 58 | set { _intensity1 = value; } 59 | } 60 | 61 | [SerializeField, Range(0, 1.0f)] 62 | float _intensity2 = 0.2f; 63 | 64 | public float intensity2 { 65 | get { return _intensity2; } 66 | set { _intensity2 = value; } 67 | } 68 | 69 | // Threshold 70 | [SerializeField, Range(0, 2)] 71 | float _threshold = 0.5f; 72 | 73 | public float threshold { 74 | get { return _threshold; } 75 | set { _threshold = value; } 76 | } 77 | 78 | // Temporal filtering 79 | [SerializeField, Range(0, 1.0f)] 80 | float _temporalFiltering = 0.0f; 81 | 82 | public float temporalFiltering { 83 | get { return _temporalFiltering; } 84 | set { _temporalFiltering = value; } 85 | } 86 | 87 | #endregion 88 | 89 | #region Private Properties 90 | 91 | [SerializeField] Shader _shader; 92 | Material _material; 93 | RenderTexture _accBuffer; 94 | 95 | #endregion 96 | 97 | #region MonoBehaviour Functions 98 | 99 | RenderTexture GetTempBuffer(int width, int height) 100 | { 101 | return RenderTexture.GetTemporary(width, height, 0, RenderTextureFormat.DefaultHDR); 102 | } 103 | 104 | void ReleaseTempBuffer(RenderTexture rt) 105 | { 106 | RenderTexture.ReleaseTemporary(rt); 107 | } 108 | 109 | void OnRenderImage(RenderTexture source, RenderTexture destination) 110 | { 111 | // Set up the material object. 112 | if (_material == null) 113 | { 114 | _material = new Material(_shader); 115 | _material.hideFlags = HideFlags.DontSave; 116 | } 117 | 118 | // Common options 119 | _material.SetFloat("_Intensity1", _intensity1); 120 | _material.SetFloat("_Intensity2", _intensity2); 121 | _material.SetFloat("_Threshold", _threshold); 122 | _material.SetFloat("_TempFilter", 1.0f - Mathf.Exp(_temporalFiltering * -4)); 123 | 124 | // Calculate the size of the blur buffers. 125 | var blur1Height = (int)(720 / _radius1); 126 | var blur2Height = (int)(256 / _radius2); 127 | var blur1Width = blur1Height * source.width / source.height; 128 | var blur2Width = blur2Height * source.width / source.height; 129 | 130 | // Blur image buffers 131 | RenderTexture rt1 = null, rt2 = null; 132 | 133 | // Small bloom 134 | if (_intensity1 > 0.0f) 135 | { 136 | var rt = source; 137 | 138 | // Shrink the source image with the quater downsampler 139 | while (rt.height > blur1Height * 4) 140 | { 141 | var rt_next = GetTempBuffer(rt.width / 4, rt.height / 4); 142 | Graphics.Blit(rt, rt_next, _material, 0); 143 | if (rt != source) ReleaseTempBuffer(rt); 144 | rt = rt_next; 145 | } 146 | 147 | // Allocate the blur buffer. 148 | rt1 = GetTempBuffer(blur1Width, blur1Height); 149 | 150 | // Shrink the source image and apply the threshold. 151 | Graphics.Blit(rt, rt1, _material, 1); 152 | if (rt != source) ReleaseTempBuffer(rt); 153 | 154 | // Apply the separable Gaussian filter. 155 | var rtb = GetTempBuffer(blur1Width, blur1Height); 156 | for (var i = 0; i < 2; i++) 157 | { 158 | Graphics.Blit(rt1, rtb, _material, 3); 159 | Graphics.Blit(rtb, rt1, _material, 4); 160 | } 161 | ReleaseTempBuffer(rtb); 162 | } 163 | 164 | // Large bloom 165 | if (_intensity2 > 0.0f) 166 | { 167 | var rt = source; 168 | 169 | // Shrink the source image with the quater downsampler 170 | while (rt.height > blur2Height * 4) 171 | { 172 | var rt_next = GetTempBuffer(rt.width / 4, rt.height / 4); 173 | Graphics.Blit(rt, rt_next, _material, 0); 174 | if (rt != source) ReleaseTempBuffer(rt); 175 | rt = rt_next; 176 | } 177 | 178 | // Allocate the blur buffer. 179 | rt2 = GetTempBuffer(blur2Width, blur2Height); 180 | 181 | // Shrink + thresholding + temporal filtering 182 | if (_accBuffer && _temporalFiltering > 0.0f) 183 | { 184 | _material.SetTexture("_AccTex", _accBuffer); 185 | Graphics.Blit(rt, rt2, _material, 2); 186 | } 187 | else 188 | { 189 | Graphics.Blit(rt, rt2, _material, 1); 190 | } 191 | if (rt != source) ReleaseTempBuffer(rt); 192 | 193 | // Update the accmulation buffer. 194 | if (_accBuffer) 195 | { 196 | ReleaseTempBuffer(_accBuffer); 197 | _accBuffer = null; 198 | } 199 | if (_temporalFiltering > 0.0f) 200 | { 201 | _accBuffer = GetTempBuffer(blur2Width, blur2Height); 202 | Graphics.Blit(rt2, _accBuffer); 203 | } 204 | 205 | // Apply the separable box filter repeatedly. 206 | var rtb = GetTempBuffer(blur2Width, blur2Height); 207 | for (var i = 0; i < 4; i++) 208 | { 209 | Graphics.Blit(rt2, rtb, _material, 5); 210 | Graphics.Blit(rtb, rt2, _material, 6); 211 | } 212 | ReleaseTempBuffer(rtb); 213 | } 214 | 215 | // Compositing 216 | _material.SetTexture("_Blur1Tex", rt1 ? rt1 : source); 217 | _material.SetTexture("_Blur2Tex", rt2 ? rt2 : source); 218 | Graphics.Blit(source, destination, _material, 7); 219 | 220 | // Release the blur buffers. 221 | ReleaseTempBuffer(rt1); 222 | ReleaseTempBuffer(rt2); 223 | } 224 | 225 | #endregion 226 | } 227 | } 228 | -------------------------------------------------------------------------------- /Assets/Test/Test 2.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: 1 18 | m_FogColor: {r: .5, g: .5, b: .5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: .0299999993 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: 26876a91f38bb46f9b9516edf543928b, 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: 8900000, guid: 7ceb5b7a522b14e06b93951c7e218981, type: 3} 39 | m_Sun: {fileID: 0} 40 | --- !u!157 &4 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 &5 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 &495395942 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: 495395944} 96 | - 108: {fileID: 495395943} 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 &495395943 105 | Light: 106 | m_ObjectHideFlags: 0 107 | m_PrefabParentObject: {fileID: 0} 108 | m_PrefabInternal: {fileID: 0} 109 | m_GameObject: {fileID: 495395942} 110 | m_Enabled: 1 111 | serializedVersion: 6 112 | m_Type: 1 113 | m_Color: {r: 1, g: .956862748, b: .839215696, a: 1} 114 | m_Intensity: .529999971 115 | m_Range: 10 116 | m_SpotAngle: 30 117 | m_CookieSize: 10 118 | m_Shadows: 119 | m_Type: 0 120 | m_Resolution: -1 121 | m_Strength: 1 122 | m_Bias: .0500000007 123 | m_NormalBias: .400000006 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 &495395944 137 | Transform: 138 | m_ObjectHideFlags: 0 139 | m_PrefabParentObject: {fileID: 0} 140 | m_PrefabInternal: {fileID: 0} 141 | m_GameObject: {fileID: 495395942} 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: 0 148 | --- !u!1 &826320310 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: 826320315} 156 | - 20: {fileID: 826320314} 157 | - 92: {fileID: 826320313} 158 | - 124: {fileID: 826320312} 159 | - 81: {fileID: 826320311} 160 | - 114: {fileID: 826320316} 161 | - 114: {fileID: 826320318} 162 | - 114: {fileID: 826320317} 163 | - 114: {fileID: 826320319} 164 | m_Layer: 0 165 | m_Name: Main Camera 166 | m_TagString: MainCamera 167 | m_Icon: {fileID: 0} 168 | m_NavMeshLayer: 0 169 | m_StaticEditorFlags: 0 170 | m_IsActive: 1 171 | --- !u!81 &826320311 172 | AudioListener: 173 | m_ObjectHideFlags: 0 174 | m_PrefabParentObject: {fileID: 0} 175 | m_PrefabInternal: {fileID: 0} 176 | m_GameObject: {fileID: 826320310} 177 | m_Enabled: 1 178 | --- !u!124 &826320312 179 | Behaviour: 180 | m_ObjectHideFlags: 0 181 | m_PrefabParentObject: {fileID: 0} 182 | m_PrefabInternal: {fileID: 0} 183 | m_GameObject: {fileID: 826320310} 184 | m_Enabled: 1 185 | --- !u!92 &826320313 186 | Behaviour: 187 | m_ObjectHideFlags: 0 188 | m_PrefabParentObject: {fileID: 0} 189 | m_PrefabInternal: {fileID: 0} 190 | m_GameObject: {fileID: 826320310} 191 | m_Enabled: 1 192 | --- !u!20 &826320314 193 | Camera: 194 | m_ObjectHideFlags: 0 195 | m_PrefabParentObject: {fileID: 0} 196 | m_PrefabInternal: {fileID: 0} 197 | m_GameObject: {fileID: 826320310} 198 | m_Enabled: 1 199 | serializedVersion: 2 200 | m_ClearFlags: 1 201 | m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} 202 | m_NormalizedViewPortRect: 203 | serializedVersion: 2 204 | x: 0 205 | y: 0 206 | width: 1 207 | height: 1 208 | near clip plane: .300000012 209 | far clip plane: 1000 210 | field of view: 40 211 | orthographic: 0 212 | orthographic size: 5 213 | m_Depth: -1 214 | m_CullingMask: 215 | serializedVersion: 2 216 | m_Bits: 4294967295 217 | m_RenderingPath: 3 218 | m_TargetTexture: {fileID: 0} 219 | m_TargetDisplay: 0 220 | m_TargetEye: 3 221 | m_HDR: 1 222 | m_OcclusionCulling: 0 223 | m_StereoConvergence: 10 224 | m_StereoSeparation: .0219999999 225 | m_StereoMirrorMode: 0 226 | --- !u!4 &826320315 227 | Transform: 228 | m_ObjectHideFlags: 0 229 | m_PrefabParentObject: {fileID: 0} 230 | m_PrefabInternal: {fileID: 0} 231 | m_GameObject: {fileID: 826320310} 232 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 233 | m_LocalPosition: {x: 0, y: 0, z: -15} 234 | m_LocalScale: {x: 1, y: 1, z: 1} 235 | m_Children: [] 236 | m_Father: {fileID: 1174392234} 237 | m_RootOrder: 0 238 | --- !u!114 &826320316 239 | MonoBehaviour: 240 | m_ObjectHideFlags: 0 241 | m_PrefabParentObject: {fileID: 0} 242 | m_PrefabInternal: {fileID: 0} 243 | m_GameObject: {fileID: 826320310} 244 | m_Enabled: 1 245 | m_EditorHideFlags: 0 246 | m_Script: {fileID: 11500000, guid: 2f6a516d891854931acf7fb785c812ec, type: 3} 247 | m_Name: 248 | m_EditorClassIdentifier: 249 | _intensity: 1.5 250 | _sampleRadius: 1.29999995 251 | _rangeCheck: 1 252 | _fallOffDistance: 200 253 | _sampleCount: 1 254 | _shader: {fileID: 4800000, guid: c928e16c12e994a70928a9181450d18c, type: 3} 255 | --- !u!114 &826320317 256 | MonoBehaviour: 257 | m_ObjectHideFlags: 0 258 | m_PrefabParentObject: {fileID: 0} 259 | m_PrefabInternal: {fileID: 0} 260 | m_GameObject: {fileID: 826320310} 261 | m_Enabled: 1 262 | m_EditorHideFlags: 0 263 | m_Script: {fileID: 11500000, guid: 6363bba448bf64e60a763433f9ddf81b, type: 3} 264 | m_Name: 265 | m_EditorClassIdentifier: 266 | _radius1: 2 267 | _radius2: 4 268 | _intensity1: .200000003 269 | _intensity2: .200000003 270 | _threshold: .300000012 271 | _temporalFiltering: 0 272 | _shader: {fileID: 4800000, guid: 5a711a01011934ebcb58ef5ad52159d6, type: 3} 273 | --- !u!114 &826320318 274 | MonoBehaviour: 275 | m_ObjectHideFlags: 0 276 | m_PrefabParentObject: {fileID: 0} 277 | m_PrefabInternal: {fileID: 0} 278 | m_GameObject: {fileID: 826320310} 279 | m_Enabled: 1 280 | m_EditorHideFlags: 0 281 | m_Script: {fileID: 11500000, guid: ee4ab9821096c489f84e50f35b7b9644, type: 3} 282 | m_Name: 283 | m_EditorClassIdentifier: 284 | _startDistance: 8 285 | _useRadialDistance: 1 286 | _fadeToSkybox: 1 287 | _shader: {fileID: 4800000, guid: 3514cc2676a6c4db294c28459f22c359, type: 3} 288 | --- !u!114 &826320319 289 | MonoBehaviour: 290 | m_ObjectHideFlags: 0 291 | m_PrefabParentObject: {fileID: 0} 292 | m_PrefabInternal: {fileID: 0} 293 | m_GameObject: {fileID: 826320310} 294 | m_Enabled: 1 295 | m_EditorHideFlags: 0 296 | m_Script: {fileID: 11500000, guid: 6fc18a55c333d51489e5ee49b3cbff50, type: 3} 297 | m_Name: 298 | m_EditorClassIdentifier: 299 | _falloff: .5 300 | _shader: {fileID: 4800000, guid: 89a223cbeee1935419811f8736c0a9b3, type: 3} 301 | --- !u!1 &1174392233 302 | GameObject: 303 | m_ObjectHideFlags: 0 304 | m_PrefabParentObject: {fileID: 0} 305 | m_PrefabInternal: {fileID: 0} 306 | serializedVersion: 4 307 | m_Component: 308 | - 4: {fileID: 1174392234} 309 | m_Layer: 0 310 | m_Name: Pivot 311 | m_TagString: Untagged 312 | m_Icon: {fileID: 0} 313 | m_NavMeshLayer: 0 314 | m_StaticEditorFlags: 0 315 | m_IsActive: 1 316 | --- !u!4 &1174392234 317 | Transform: 318 | m_ObjectHideFlags: 0 319 | m_PrefabParentObject: {fileID: 0} 320 | m_PrefabInternal: {fileID: 0} 321 | m_GameObject: {fileID: 1174392233} 322 | m_LocalRotation: {x: 0, y: .578569531, z: 0, w: -.815633059} 323 | m_LocalPosition: {x: 0, y: 0, z: 0} 324 | m_LocalScale: {x: 1, y: 1, z: 1} 325 | m_Children: 326 | - {fileID: 826320315} 327 | - {fileID: 1986347844} 328 | m_Father: {fileID: 0} 329 | m_RootOrder: 1 330 | --- !u!1 &1986347842 331 | GameObject: 332 | m_ObjectHideFlags: 0 333 | m_PrefabParentObject: {fileID: 0} 334 | m_PrefabInternal: {fileID: 0} 335 | serializedVersion: 4 336 | m_Component: 337 | - 4: {fileID: 1986347844} 338 | - 114: {fileID: 1986347843} 339 | - 114: {fileID: 1986347845} 340 | m_Layer: 0 341 | m_Name: Wall 342 | m_TagString: Untagged 343 | m_Icon: {fileID: 0} 344 | m_NavMeshLayer: 0 345 | m_StaticEditorFlags: 0 346 | m_IsActive: 1 347 | --- !u!114 &1986347843 348 | MonoBehaviour: 349 | m_ObjectHideFlags: 0 350 | m_PrefabParentObject: {fileID: 0} 351 | m_PrefabInternal: {fileID: 0} 352 | m_GameObject: {fileID: 1986347842} 353 | m_Enabled: 1 354 | m_EditorHideFlags: 0 355 | m_Script: {fileID: 11500000, guid: 29cfb89969d804cadbeec71cd66d93f4, type: 3} 356 | m_Name: 357 | m_EditorClassIdentifier: 358 | _columns: 200 359 | _rows: 40 360 | _extent: {x: 128, y: 65} 361 | _offset: {x: 0, y: 0} 362 | _positionNoiseMode: 1 363 | _positionNoiseAmplitude: 4 364 | _positionNoiseFrequency: .0500000007 365 | _positionNoiseSpeed: .379999995 366 | _rotationNoiseMode: 4 367 | _rotationNoiseAmplitude: 45 368 | _rotationNoiseFrequency: .100000001 369 | _rotationNoiseSpeed: .330000013 370 | _scaleNoiseMode: 1 371 | _scaleNoiseAmplitude: .600000024 372 | _scaleNoiseFrequency: .150000006 373 | _scaleNoiseSpeed: .400000006 374 | _shapes: [] 375 | _baseScale: {x: 1, y: 5.5999999, z: 1} 376 | _scaleRandomness: .5 377 | _material: {fileID: 2100000, guid: f804c03affd4d436aa0f43861b93108d, type: 2} 378 | _castShadows: 0 379 | _receiveShadows: 0 380 | _debug: 0 381 | _defaultShape: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 382 | _defaultMaterial: {fileID: 2100000, guid: dddcdd0c49f184396b3fe5d5ba46b9ce, type: 2} 383 | _kernelShader: {fileID: 4800000, guid: d7f9e4b36d4474781935eb3ae5ba30d3, type: 3} 384 | _debugShader: {fileID: 4800000, guid: 6b02210009e584160bf24e085a6f4a6a, type: 3} 385 | --- !u!4 &1986347844 386 | Transform: 387 | m_ObjectHideFlags: 0 388 | m_PrefabParentObject: {fileID: 0} 389 | m_PrefabInternal: {fileID: 0} 390 | m_GameObject: {fileID: 1986347842} 391 | m_LocalRotation: {x: .132652491, y: .432026446, z: -.0644125938, w: .889723301} 392 | m_LocalPosition: {x: -25.7999992, y: 11.6000004, z: 41.9000015} 393 | m_LocalScale: {x: 1, y: 1, z: 1} 394 | m_Children: [] 395 | m_Father: {fileID: 1174392234} 396 | m_RootOrder: 1 397 | --- !u!114 &1986347845 398 | MonoBehaviour: 399 | m_ObjectHideFlags: 0 400 | m_PrefabParentObject: {fileID: 0} 401 | m_PrefabInternal: {fileID: 0} 402 | m_GameObject: {fileID: 1986347842} 403 | m_Enabled: 1 404 | m_EditorHideFlags: 0 405 | m_Script: {fileID: 11500000, guid: 4578a0a68c3f346b5ac9cb1be539e62b, type: 3} 406 | m_Name: 407 | m_EditorClassIdentifier: 408 | _yawAngle: 0 409 | _speed: 10 410 | --------------------------------------------------------------------------------