├── ProjectSettings ├── ProjectVersion.txt ├── NetworkManager.asset ├── TimeManager.asset ├── EditorBuildSettings.asset ├── AudioManager.asset ├── EditorSettings.asset ├── TagManager.asset ├── DynamicsManager.asset ├── Physics2DSettings.asset ├── GraphicsSettings.asset ├── NavMeshAreas.asset ├── QualitySettings.asset ├── InputManager.asset └── ProjectSettings.asset ├── KvantStream.unitypackage ├── Assets ├── Kvant.meta ├── Kvant │ ├── Stream.meta │ └── Stream │ │ ├── Editor.meta │ │ ├── Shaders.meta │ │ ├── Shaders │ │ ├── Kernel.shader.meta │ │ ├── Line.shader.meta │ │ ├── ClassicNoise3D.cginc.meta │ │ ├── Debug.shader.meta │ │ ├── Debug.shader │ │ ├── Line.shader │ │ ├── Kernel.shader │ │ └── ClassicNoise3D.cginc │ │ ├── Editor │ │ ├── StreamEditor.cs.meta │ │ └── StreamEditor.cs │ │ ├── Stream.cs.meta │ │ └── Stream.cs ├── Test.unity.meta ├── Skybox.mat.meta ├── Editor.meta ├── Reaktion.meta ├── Shaders.meta ├── 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 ├── Shaders │ ├── ImageEffects.meta │ └── ImageEffects │ │ ├── Bloom_V2.meta │ │ └── Bloom_V2 │ │ ├── Editor.meta │ │ ├── VideoBloom.shader.meta │ │ ├── PostEffectsBase.cs.meta │ │ ├── Editor │ │ ├── VideoBloomEditor.cs.meta │ │ └── VideoBloomEditor.cs │ │ ├── VideoBloom.cs.meta │ │ ├── VideoBloom.shader │ │ ├── PostEffectsBase.cs │ │ └── VideoBloom.cs ├── Editor │ ├── PackageTool.cs │ └── PackageTool.cs.meta ├── Skybox.mat └── Test.unity ├── .gitignore ├── .gitattributes └── README.md /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.1.0p1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /KvantStream.unitypackage: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/KvantStream/HEAD/KvantStream.unitypackage -------------------------------------------------------------------------------- /Assets/Kvant.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8be732b80b8b445e5bd196d2b01ed59c 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b33584f0d78e94bfbbc4a53a1ef0aa1a 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 14852505b14744e2a928900f948f2ef1 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b855adf524c894e159dd8a425e1ec8aa 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Shaders/Kernel.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6afe8e4e613e44e00bcbd80b0615a8de 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Shaders/Line.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 456607e7d289e480eb05f5bc12ad0fe6 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Shaders/ClassicNoise3D.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ba1abd1cb44c47b68fbb577c6c4ba3e 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | -------------------------------------------------------------------------------- /.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 | 12 | .DS_Store 13 | *.swp 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /Assets/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 75c8abdb729514f3088ebceac71bcdec 3 | timeCreated: 1432036172 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Skybox.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c38eff46e3bbf4f06a4ea1a68a682a00 3 | timeCreated: 1432036193 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/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ab8bd8bbc587406086ba52494ca5238 3 | folderAsset: yes 4 | timeCreated: 1434638976 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Editor/StreamEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13e7c1b527aaf482c90b896428f5f3f4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/Reaktion.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 487429d9beca24ae78ab8ac96eb73dde 3 | folderAsset: yes 4 | timeCreated: 1432036098 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db5759608f86240768c36ccd7c9fa2b4 3 | folderAsset: yes 4 | timeCreated: 1431955054 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: 1432036098 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: 1432036098 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /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.unity 10 | -------------------------------------------------------------------------------- /Assets/Reaktion/Editor/Utility.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c8c8f5affaaa4616a15e69dda142154 3 | folderAsset: yes 4 | timeCreated: 1432036098 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/ImageEffects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecf03591a02f943e1a1b92e69c62ac19 3 | folderAsset: yes 4 | timeCreated: 1431955054 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/ImageEffects/Bloom_V2.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8423e9098e8634577adae16ef4cd3173 3 | folderAsset: yes 4 | timeCreated: 1431954257 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Shaders/Debug.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d079a8b94e4546bd8b1c43b825a8305 3 | timeCreated: 1432038195 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/ImageEffects/Bloom_V2/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 828ed72cae1f2104cad9b893763115f2 3 | folderAsset: yes 4 | timeCreated: 1431954257 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Shaders/ImageEffects/Bloom_V2/VideoBloom.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4da5120001c1945e99d8db7be2c8c652 3 | timeCreated: 1423298687 4 | licenseType: Store 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 | -------------------------------------------------------------------------------- /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", "KvantStream.unitypackage", ExportPackageOptions.Recurse); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/Editor/PackageTool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b44e5e8d72880411b83660c48c0b1038 3 | timeCreated: 1434638981 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/Shaders/ImageEffects/Bloom_V2/PostEffectsBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b608e8d5cf204125a256e8c6edf225b 3 | timeCreated: 1423298361 4 | licenseType: Store 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/Shaders/ImageEffects/Bloom_V2/Editor/VideoBloomEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feb575ac495c04c6081b79dd8549ad3b 3 | timeCreated: 1423298362 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Shaders/ImageEffects/Bloom_V2/VideoBloom.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffd37938bd1d34558a64a40ff7419815 3 | timeCreated: 1423299358 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - videoBloomShader: {fileID: 4800000, guid: 4da5120001c1945e99d8db7be2c8c652, 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 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Stream.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c8daf798f0664336a4e8b9d914d7502 3 | timeCreated: 1432042411 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _kernelShader: {fileID: 4800000, guid: 6afe8e4e613e44e00bcbd80b0615a8de, type: 3} 9 | - _lineShader: {fileID: 4800000, guid: 456607e7d289e480eb05f5bc12ad0fe6, type: 3} 10 | - _debugShader: {fileID: 4800000, guid: 6d079a8b94e4546bd8b1c43b825a8305, type: 3} 11 | executionOrder: 0 12 | icon: {instanceID: 0} 13 | userData: 14 | assetBundleName: 15 | assetBundleVariant: 16 | -------------------------------------------------------------------------------- /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/Stream/Shaders/Debug.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Kvant/Stream/Debug Blit" 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 | -------------------------------------------------------------------------------- /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: Fantastic 11 | pixelLightCount: 4 12 | shadows: 2 13 | shadowResolution: 2 14 | shadowProjection: 1 15 | shadowCascades: 4 16 | shadowDistance: 150 17 | shadowCascade2Split: .333333343 18 | shadowCascade4Split: {x: .0666666701, y: .199999988, z: .466666639} 19 | blendWeights: 4 20 | textureQuality: 0 21 | anisotropicTextures: 2 22 | antiAliasing: 0 23 | softParticles: 1 24 | softVegetation: 1 25 | realtimeReflectionProbes: 1 26 | billboardsFaceCameraPosition: 1 27 | vSyncCount: 1 28 | lodBias: 2 29 | maximumLODLevel: 0 30 | particleRaycastBudget: 4096 31 | excludedTargetPlatforms: [] 32 | m_PerPlatformDefaultQuality: 33 | Android: 2 34 | BlackBerry: 2 35 | GLES Emulation: 5 36 | PS3: 5 37 | PS4: 5 38 | PSM: 5 39 | PSP2: 5 40 | Samsung TV: 2 41 | Standalone: 5 42 | Tizen: 2 43 | WP8: 5 44 | Web: 5 45 | WebGL: 3 46 | Windows Store Apps: 5 47 | XBOX360: 5 48 | XboxOne: 5 49 | iPhone: 2 50 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | KvantStream 2 | =========== 3 | 4 | A simple GPU particle system for Unity 5 | 6 | ![sample](http://keijiro.github.io/KvantStream/sample.gif) 7 | 8 | System Requirements 9 | ------------------- 10 | 11 | Unity 5.1 or later versions. 12 | 13 | Compatibility 14 | ------------- 15 | 16 | KvantStream needs a 4-component floating-point texture format. Basically, it 17 | means it runs only on desktop/laptop-class GPUs. 18 | 19 | License 20 | ------- 21 | 22 | Copyright (C) 2015 Keijiro Takahashi 23 | 24 | Permission is hereby granted, free of charge, to any person obtaining a copy of 25 | this software and associated documentation files (the "Software"), to deal in 26 | the Software without restriction, including without limitation the rights to 27 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 28 | the Software, and to permit persons to whom the Software is furnished to do so, 29 | subject to the following conditions: 30 | 31 | The above copyright notice and this permission notice shall be included in all 32 | copies or substantial portions of the Software. 33 | 34 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 36 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 37 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 38 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 39 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 40 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Shaders/Line.shader: -------------------------------------------------------------------------------- 1 | // 2 | // Line shader for Stream 3 | // 4 | // Vertex format: 5 | // position.x = texture switch (0/1) 6 | // texcoord.xy = uv for ParticleTex 7 | // 8 | Shader "Hidden/Kvant/Stream/Line" 9 | { 10 | Properties 11 | { 12 | _ParticleTex1 ("-", 2D) = ""{} 13 | _ParticleTex2 ("-", 2D) = ""{} 14 | [HDR] _Color ("-", Color) = (1, 1, 1, 1) 15 | _Tail ("-", Float) = 1 16 | } 17 | 18 | CGINCLUDE 19 | 20 | #pragma multi_compile_fog 21 | 22 | #include "UnityCG.cginc" 23 | 24 | struct appdata 25 | { 26 | float4 position : POSITION; 27 | float2 texcoord : TEXCOORD0; 28 | }; 29 | 30 | struct v2f 31 | { 32 | float4 position : SV_POSITION; 33 | half4 color : COLOR; 34 | UNITY_FOG_COORDS(0) 35 | }; 36 | 37 | sampler2D _ParticleTex1; 38 | float4 _ParticleTex1_TexelSize; 39 | 40 | sampler2D _ParticleTex2; 41 | float4 _ParticleTex2_TexelSize; 42 | 43 | half4 _Color; 44 | half _Tail; 45 | 46 | v2f vert(appdata v) 47 | { 48 | v2f o; 49 | 50 | float2 uv = v.texcoord.xy + _ParticleTex1_TexelSize.xy / 2; 51 | 52 | float4 p1 = tex2Dlod(_ParticleTex1, float4(uv, 0, 0)); 53 | float4 p2 = tex2Dlod(_ParticleTex2, float4(uv, 0, 0)); 54 | float sw = v.position.x; 55 | 56 | if (p1.w < 0) 57 | { 58 | o.position = mul(UNITY_MATRIX_MVP, float4(p2.xyz, 1)); 59 | } 60 | else 61 | { 62 | float3 p = lerp(p2.xyz, p1.xyz, (1.0 - sw) * _Tail); 63 | o.position = mul(UNITY_MATRIX_MVP, float4(p, 1)); 64 | } 65 | 66 | o.color = _Color; 67 | o.color.a *= sw; 68 | 69 | UNITY_TRANSFER_FOG(o, o.position); 70 | 71 | return o; 72 | } 73 | 74 | half4 frag(v2f i) : SV_Target 75 | { 76 | fixed4 c = i.color; 77 | UNITY_APPLY_FOG(i.fogCoord, c); 78 | return c; 79 | } 80 | 81 | ENDCG 82 | 83 | SubShader 84 | { 85 | Tags { "RenderType"="Transparent" "Queue"="Transparent" } 86 | Pass 87 | { 88 | Blend SrcAlpha OneMinusSrcAlpha 89 | CGPROGRAM 90 | #pragma target 3.0 91 | #pragma vertex vert 92 | #pragma fragment frag 93 | ENDCG 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /Assets/Shaders/ImageEffects/Bloom_V2/Editor/VideoBloomEditor.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | [CustomEditor (typeof(VideoBloom))] 6 | class VideoBloomEditor : Editor 7 | { 8 | SerializedProperty tweakMode; 9 | SerializedProperty Threshold; 10 | SerializedProperty MasterAmount; 11 | SerializedProperty MediumAmount; 12 | SerializedProperty LargeAmount; 13 | SerializedProperty Tint; 14 | SerializedProperty KernelSize; 15 | SerializedProperty MediumKernelScale; 16 | SerializedProperty LargeKernelScale; 17 | SerializedProperty BlendMode; 18 | SerializedProperty HighQuality; 19 | 20 | 21 | 22 | SerializedObject serObj; 23 | 24 | void OnEnable () 25 | { 26 | serObj = new SerializedObject (target); 27 | 28 | tweakMode = serObj.FindProperty("tweakMode"); 29 | Threshold = serObj.FindProperty("Threshold"); 30 | MasterAmount = serObj.FindProperty("MasterAmount"); 31 | MediumAmount = serObj.FindProperty("MediumAmount"); 32 | LargeAmount = serObj.FindProperty("LargeAmount"); 33 | Tint = serObj.FindProperty("Tint"); 34 | KernelSize = serObj.FindProperty("KernelSize"); 35 | MediumKernelScale = serObj.FindProperty("MediumKernelScale"); 36 | LargeKernelScale = serObj.FindProperty("LargeKernelScale"); 37 | BlendMode = serObj.FindProperty("BlendMode"); 38 | HighQuality = serObj.FindProperty("HighQuality"); 39 | } 40 | 41 | 42 | public override void OnInspectorGUI () 43 | { 44 | serObj.Update(); 45 | 46 | EditorGUILayout.LabelField("Bloom for bright screen pixels", EditorStyles.miniLabel); 47 | 48 | EditorGUILayout.Separator (); 49 | 50 | EditorGUILayout.PropertyField (tweakMode, new GUIContent("Mode")); 51 | 52 | EditorGUILayout.Separator (); 53 | 54 | Threshold.floatValue = EditorGUILayout.Slider ("Threshold", Threshold.floatValue, 0.0f, 4.0f); 55 | MasterAmount.floatValue = EditorGUILayout.Slider ("Intensity", MasterAmount.floatValue, 0.0f, 5.0f); 56 | EditorGUILayout.PropertyField (BlendMode, new GUIContent("Blend Mode")); 57 | KernelSize.floatValue = EditorGUILayout.Slider ("Kernel Size", KernelSize.floatValue, 10.0f, 100.0f); 58 | EditorGUILayout.PropertyField(Tint, new GUIContent("Tint")); 59 | 60 | if (tweakMode.intValue == 1) 61 | { 62 | EditorGUILayout.Separator (); 63 | EditorGUILayout.Separator (); 64 | MediumAmount.floatValue = EditorGUILayout.Slider ("Medium Amount", MediumAmount.floatValue, 0.0f, 5.0f); 65 | LargeAmount.floatValue = EditorGUILayout.Slider ("Large Amount", LargeAmount.floatValue, 0.0f, 100.0f); 66 | EditorGUILayout.Separator (); 67 | MediumKernelScale.floatValue = EditorGUILayout.Slider ("Medium Kernel Scale", MediumKernelScale.floatValue, 1.0f, 20.0f); 68 | LargeKernelScale.floatValue = EditorGUILayout.Slider ("Large Kernel Scale", LargeKernelScale.floatValue, 3.0f, 20.0f); 69 | EditorGUILayout.Separator (); 70 | EditorGUILayout.PropertyField (HighQuality, new GUIContent("High Quality")); 71 | } 72 | 73 | EditorGUILayout.Separator (); 74 | 75 | 76 | serObj.ApplyModifiedProperties(); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /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/Kvant/Stream/Shaders/Kernel.shader: -------------------------------------------------------------------------------- 1 | // 2 | // GPGPU kernels for Stream 3 | // 4 | // Texture format: 5 | // .xyz = particle position 6 | // .w = particle life 7 | // 8 | Shader "Hidden/Kvant/Stream/Kernel" 9 | { 10 | Properties 11 | { 12 | _MainTex ("-", 2D) = ""{} 13 | _EmitterPos ("-", Vector) = (0, 0, 20, 0) 14 | _EmitterSize ("-", Vector) = (40, 40, 40, 0) 15 | _Direction ("-", Vector) = (0, 0, -1, 0.2) 16 | _SpeedParams ("-", Vector) = (5, 10, 0, 0) 17 | _NoiseParams ("-", Vector) = (0.2, 0.1, 1) // (frequency, amplitude, animation) 18 | _Config ("-", Vector) = (1, 2, 0, 0) // (throttle, life, random seed, dT) 19 | } 20 | 21 | CGINCLUDE 22 | 23 | #pragma multi_compile NOISE_OFF NOISE_ON 24 | 25 | #include "UnityCG.cginc" 26 | #include "ClassicNoise3D.cginc" 27 | 28 | sampler2D _MainTex; 29 | 30 | float3 _EmitterPos; 31 | float3 _EmitterSize; 32 | float4 _Direction; 33 | float2 _SpeedParams; 34 | float4 _NoiseParams; 35 | float4 _Config; 36 | 37 | // PRNG function. 38 | float nrand(float2 uv, float salt) 39 | { 40 | uv += float2(salt, _Config.z); 41 | return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453); 42 | } 43 | 44 | // Get a new particle. 45 | float4 new_particle(float2 uv) 46 | { 47 | float t = _Time.x; 48 | 49 | // Random position. 50 | float3 p = float3(nrand(uv, t + 1), nrand(uv, t + 2), nrand(uv, t + 3)); 51 | p = (p - (float3)0.5) * _EmitterSize + _EmitterPos; 52 | 53 | // Life duration. 54 | float l = _Config.y * (0.5 + nrand(uv, t + 0)); 55 | 56 | // Throttling: discard particle emission by adding offset. 57 | float4 offs = float4(1e8, 1e8, 1e8, -1e8) * (uv.x > _Config.x); 58 | 59 | return float4(p, l) + offs; 60 | } 61 | 62 | // Position dependant velocity field. 63 | float3 get_velocity(float3 p, float2 uv) 64 | { 65 | // Random vector. 66 | float3 v = float3(nrand(uv, 4), nrand(uv, 5), nrand(uv, 6)); 67 | v = (v - (float3)0.5) * 2; 68 | 69 | // Apply the spread parameter. 70 | v = lerp(_Direction.xyz, v, _Direction.w); 71 | 72 | // Apply the speed parameter. 73 | v = normalize(v) * lerp(_SpeedParams.x, _SpeedParams.y, nrand(uv, 7)); 74 | 75 | #ifdef NOISE_ON 76 | // Add noise vector. 77 | p = (p + _Time.y * _NoiseParams.z) * _NoiseParams.x; 78 | float nx = cnoise(p + float3(138.2, 0, 0)); 79 | float ny = cnoise(p + float3(0, 138.2, 0)); 80 | float nz = cnoise(p + float3(0, 0, 138.2)); 81 | v += float3(nx, ny, nz) * _NoiseParams.y; 82 | #endif 83 | return v; 84 | } 85 | 86 | // Pass 0: Initialization 87 | float4 frag_init(v2f_img i) : SV_Target 88 | { 89 | return new_particle(i.uv); 90 | } 91 | 92 | // Pass 1: Update 93 | float4 frag_update(v2f_img i) : SV_Target 94 | { 95 | float4 p = tex2D(_MainTex, i.uv); 96 | if (p.w > 0) 97 | { 98 | float dt = _Config.w; 99 | p.xyz += get_velocity(p.xyz, i.uv) * dt; // position 100 | p.w -= dt; // life 101 | return p; 102 | } 103 | else 104 | { 105 | return new_particle(i.uv); 106 | } 107 | } 108 | 109 | ENDCG 110 | 111 | SubShader 112 | { 113 | // Pass 0: Initialization 114 | Pass 115 | { 116 | CGPROGRAM 117 | #pragma target 3.0 118 | #pragma vertex vert_img 119 | #pragma fragment frag_init 120 | ENDCG 121 | } 122 | // Pass 1: Update 123 | Pass 124 | { 125 | CGPROGRAM 126 | #pragma target 3.0 127 | #pragma vertex vert_img 128 | #pragma fragment frag_update 129 | ENDCG 130 | } 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /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/Skybox.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Skybox 10 | m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 5 13 | m_CustomRenderQueue: -1 14 | stringTagMap: {} 15 | m_SavedProperties: 16 | serializedVersion: 2 17 | m_TexEnvs: 18 | data: 19 | first: 20 | name: _MainTex 21 | second: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | data: 26 | first: 27 | name: _BumpMap 28 | second: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | data: 33 | first: 34 | name: _DetailNormalMap 35 | second: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | data: 40 | first: 41 | name: _ParallaxMap 42 | second: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | data: 47 | first: 48 | name: _OcclusionMap 49 | second: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | data: 54 | first: 55 | name: _EmissionMap 56 | second: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | data: 61 | first: 62 | name: _DetailMask 63 | second: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | data: 68 | first: 69 | name: _DetailAlbedoMap 70 | second: 71 | m_Texture: {fileID: 0} 72 | m_Scale: {x: 1, y: 1} 73 | m_Offset: {x: 0, y: 0} 74 | data: 75 | first: 76 | name: _MetallicGlossMap 77 | second: 78 | m_Texture: {fileID: 0} 79 | m_Scale: {x: 1, y: 1} 80 | m_Offset: {x: 0, y: 0} 81 | m_Floats: 82 | data: 83 | first: 84 | name: _SrcBlend 85 | second: 1 86 | data: 87 | first: 88 | name: _DstBlend 89 | second: 0 90 | data: 91 | first: 92 | name: _Cutoff 93 | second: .5 94 | data: 95 | first: 96 | name: _Exposure 97 | second: 1 98 | data: 99 | first: 100 | name: _SunSize 101 | second: .0199999996 102 | data: 103 | first: 104 | name: _AtmosphereThickness 105 | second: .209999993 106 | data: 107 | first: 108 | name: _Parallax 109 | second: .0199999996 110 | data: 111 | first: 112 | name: _ZWrite 113 | second: 1 114 | data: 115 | first: 116 | name: _Glossiness 117 | second: .5 118 | data: 119 | first: 120 | name: _BumpScale 121 | second: 1 122 | data: 123 | first: 124 | name: _OcclusionStrength 125 | second: 1 126 | data: 127 | first: 128 | name: _DetailNormalMapScale 129 | second: 1 130 | data: 131 | first: 132 | name: _UVSec 133 | second: 0 134 | data: 135 | first: 136 | name: _Mode 137 | second: 0 138 | data: 139 | first: 140 | name: _Metallic 141 | second: 0 142 | m_Colors: 143 | data: 144 | first: 145 | name: _EmissionColor 146 | second: {r: 0, g: 0, b: 0, a: 1} 147 | data: 148 | first: 149 | name: _Color 150 | second: {r: 1, g: 1, b: 1, a: 1} 151 | data: 152 | first: 153 | name: _SkyTint 154 | second: {r: .5, g: .5, b: .5, a: 1} 155 | data: 156 | first: 157 | name: _GroundColor 158 | second: {r: 0, g: 0, b: 0, a: 1} 159 | -------------------------------------------------------------------------------- /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/Shaders/ImageEffects/Bloom_V2/VideoBloom.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/VideoBloom" 2 | { 3 | Properties 4 | { 5 | _MainTex ("_MainTex (RGB)", 2D) = "black" 6 | _MediumBloom ("-", 2D) = "" {} 7 | _LargeBloom ("-", 2D) = "black" {} 8 | } 9 | 10 | CGINCLUDE 11 | 12 | #include "UnityCG.cginc" 13 | 14 | sampler2D _MainTex; 15 | sampler2D _MediumBloom; 16 | sampler2D _LargeBloom; 17 | uniform half4 _MainTex_TexelSize; 18 | uniform half4 _Param0; 19 | uniform half4 _Param1; 20 | uniform half _Param2; 21 | 22 | struct v_blurCoords 23 | { 24 | float4 pos : SV_POSITION; 25 | half2 uv0 : TEXCOORD0; 26 | half2 uv1 : TEXCOORD1; 27 | half2 uv2 : TEXCOORD2; 28 | half2 uv3 : TEXCOORD3; 29 | half2 uv4 : TEXCOORD4; 30 | }; 31 | 32 | struct v2f 33 | { 34 | float4 pos : SV_POSITION; 35 | float2 uv : TEXCOORD0; 36 | }; 37 | 38 | uniform float4 _MainTex_ST; 39 | 40 | v_blurCoords vertBlur(appdata_img v) 41 | { 42 | v_blurCoords o; 43 | o.pos = mul (UNITY_MATRIX_MVP, v.vertex); 44 | o.uv0 = v.texcoord; 45 | o.uv1 = v.texcoord + _MainTex_TexelSize.xy * _Param0.xy; 46 | o.uv2 = v.texcoord - _MainTex_TexelSize.xy * _Param0.xy; 47 | o.uv3 = v.texcoord + _MainTex_TexelSize.xy * _Param0.zw; 48 | o.uv4 = v.texcoord - _MainTex_TexelSize.xy * _Param0.zw; 49 | return o; 50 | } 51 | 52 | half4 fragBlurIter(v_blurCoords i) : COLOR 53 | { 54 | half4 color = half4(0.182h, 0.182h, 0.182h, 0.182h) * tex2D (_MainTex, i.uv0); 55 | color += half4(0.2045h, 0.2045h, 0.2045h, 0.2045h) * (tex2D (_MainTex, i.uv1) + tex2D (_MainTex, i.uv2) + tex2D (_MainTex, i.uv3) + tex2D (_MainTex, i.uv4)); 56 | return color; 57 | } 58 | 59 | half4 fragBlurLerpIter(v_blurCoords i) : COLOR 60 | { 61 | half4 src0 = tex2D (_MainTex, i.uv0); 62 | half4 color = half4(0.182h, 0.182h, 0.182h, 0.182h) * src0; 63 | color += half4(0.2045h, 0.2045h, 0.2045h, 0.2045h) * (tex2D (_MainTex, i.uv1) + tex2D (_MainTex, i.uv2) + tex2D (_MainTex, i.uv3) + tex2D (_MainTex, i.uv4)); 64 | return lerp(src0, color, _Param2); 65 | } 66 | 67 | v2f vert(appdata_img v) 68 | { 69 | v2f o; 70 | o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 71 | o.uv = v.texcoord.xy; 72 | return o; 73 | } 74 | 75 | half4 fragThresh(v2f i) : SV_Target 76 | { 77 | half4 color = tex2D(_MainTex, i.uv); 78 | half luma = dot(color, half4(0.3h, 0.59h, 0.11h, 0.0h)); 79 | return luma < _Param2 ? half4(0.0h, 0.0h, 0.0h, 0.0h):color; 80 | } 81 | 82 | half4 fragAdd(v2f i) : SV_Target 83 | { 84 | half4 color = tex2D(_MainTex, i.uv); 85 | half4 bloom = tex2D(_MediumBloom, i.uv) * _Param1 * _Param0.x; 86 | bloom += tex2D(_LargeBloom, i.uv) * _Param1 * _Param0.y; 87 | return color + bloom; 88 | } 89 | 90 | half4 fragScreen(v2f i) : SV_Target 91 | { 92 | half4 color = tex2D(_MainTex, i.uv); 93 | half4 bloom = tex2D(_MediumBloom, i.uv) * _Param1 * _Param0.x; 94 | bloom += tex2D(_LargeBloom, i.uv) * _Param1 * _Param0.y; 95 | half4 mr = color + bloom - color * bloom; 96 | return max(color, mr); 97 | } 98 | 99 | ENDCG 100 | 101 | SubShader 102 | { 103 | 104 | ZTest Always Cull Off ZWrite Off Fog { Mode Off } Lighting Off Blend Off 105 | 106 | // 0 107 | Pass 108 | { 109 | 110 | CGPROGRAM 111 | #pragma vertex vertBlur 112 | #pragma fragment fragBlurIter 113 | #pragma fragmentoption ARB_precision_hint_fastest 114 | ENDCG 115 | 116 | } 117 | 118 | // 1 119 | Pass 120 | { 121 | 122 | CGPROGRAM 123 | #pragma vertex vertBlur 124 | #pragma fragment fragBlurLerpIter 125 | #pragma fragmentoption ARB_precision_hint_fastest 126 | ENDCG 127 | 128 | } 129 | 130 | // 2 131 | Pass 132 | { 133 | 134 | CGPROGRAM 135 | #pragma vertex vert 136 | #pragma fragment fragThresh 137 | #pragma fragmentoption ARB_precision_hint_fastest 138 | ENDCG 139 | 140 | } 141 | 142 | // 3 143 | Pass 144 | { 145 | 146 | CGPROGRAM 147 | #pragma vertex vert 148 | #pragma fragment fragAdd 149 | #pragma fragmentoption ARB_precision_hint_fastest 150 | ENDCG 151 | 152 | } 153 | 154 | // 4 155 | Pass 156 | { 157 | 158 | CGPROGRAM 159 | #pragma vertex vert 160 | #pragma fragment fragScreen 161 | #pragma fragmentoption ARB_precision_hint_fastest 162 | ENDCG 163 | 164 | } 165 | } 166 | 167 | FallBack Off 168 | } 169 | 170 | -------------------------------------------------------------------------------- /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/Shaders/ImageEffects/Bloom_V2/PostEffectsBase.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | [ExecuteInEditMode] 5 | [RequireComponent (typeof(Camera))] 6 | public class PostEffectsBase : MonoBehaviour { 7 | protected bool supportHDRTextures = true; 8 | protected bool supportDX11 = false; 9 | protected bool isSupported = true; 10 | 11 | 12 | protected Material CheckShaderAndCreateMaterial ( Shader s, Material m2Create) { 13 | if (!s) { 14 | Debug.Log("Missing shader in " + ToString ()); 15 | enabled = false; 16 | return null; 17 | } 18 | 19 | if (s.isSupported && m2Create && m2Create.shader == s) 20 | return m2Create; 21 | 22 | if (!s.isSupported) { 23 | NotSupported (); 24 | Debug.Log("The shader " + s.ToString() + " on effect "+ToString()+" is not supported on this platform!"); 25 | return null; 26 | } 27 | else { 28 | m2Create = new Material (s); 29 | m2Create.hideFlags = HideFlags.DontSave; 30 | if (m2Create) 31 | return m2Create; 32 | else return null; 33 | } 34 | } 35 | 36 | 37 | protected Material CreateMaterial ( Shader s, Material m2Create) { 38 | if (!s) { 39 | Debug.Log ("Missing shader in " + ToString ()); 40 | return null; 41 | } 42 | 43 | if (m2Create && (m2Create.shader == s) && (s.isSupported)) 44 | return m2Create; 45 | 46 | if (!s.isSupported) { 47 | return null; 48 | } 49 | else { 50 | m2Create = new Material (s); 51 | m2Create.hideFlags = HideFlags.DontSave; 52 | if (m2Create) 53 | return m2Create; 54 | else return null; 55 | } 56 | } 57 | 58 | void OnEnable () { 59 | isSupported = true; 60 | } 61 | 62 | protected bool CheckSupport () { 63 | return CheckSupport (false); 64 | } 65 | 66 | 67 | public virtual bool CheckResources () { 68 | Debug.LogWarning ("CheckResources () for " + ToString() + " should be overwritten."); 69 | return isSupported; 70 | } 71 | 72 | 73 | protected void Start () { 74 | CheckResources (); 75 | } 76 | 77 | protected bool CheckSupport ( bool needDepth) { 78 | isSupported = true; 79 | supportHDRTextures = SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf); 80 | supportDX11 = SystemInfo.graphicsShaderLevel >= 50 && SystemInfo.supportsComputeShaders; 81 | 82 | if (!SystemInfo.supportsImageEffects || !SystemInfo.supportsRenderTextures) { 83 | NotSupported (); 84 | return false; 85 | } 86 | 87 | if (needDepth && !SystemInfo.SupportsRenderTextureFormat (RenderTextureFormat.Depth)) { 88 | NotSupported (); 89 | return false; 90 | } 91 | 92 | if (needDepth) 93 | GetComponent().depthTextureMode |= DepthTextureMode.Depth; 94 | 95 | return true; 96 | } 97 | 98 | protected bool CheckSupport ( bool needDepth, bool needHdr) { 99 | if (!CheckSupport(needDepth)) 100 | return false; 101 | 102 | if (needHdr && !supportHDRTextures) { 103 | NotSupported (); 104 | return false; 105 | } 106 | 107 | return true; 108 | } 109 | 110 | 111 | public bool Dx11Support () { 112 | return supportDX11; 113 | } 114 | 115 | 116 | protected void ReportAutoDisable () { 117 | Debug.LogWarning ("The image effect " + ToString() + " has been disabled as it's not supported on the current platform."); 118 | } 119 | 120 | // deprecated but needed for old effects to survive upgrading 121 | bool CheckShader ( Shader s) { 122 | Debug.Log("The shader " + s.ToString () + " on effect "+ ToString () + " is not part of the Unity 3.2+ effects suite anymore. For best performance and quality, please ensure you are using the latest Standard Assets Image Effects (Pro only) package."); 123 | if (!s.isSupported) { 124 | NotSupported (); 125 | return false; 126 | } 127 | else { 128 | return false; 129 | } 130 | } 131 | 132 | 133 | protected void NotSupported () { 134 | enabled = false; 135 | isSupported = false; 136 | return; 137 | } 138 | 139 | 140 | protected void DrawBorder ( RenderTexture dest, Material material ) { 141 | float x1; 142 | float x2; 143 | float y1; 144 | float y2; 145 | 146 | RenderTexture.active = dest; 147 | bool invertY = true; // source.texelSize.y < 0.0ff; 148 | // Set up the simple Matrix 149 | GL.PushMatrix(); 150 | GL.LoadOrtho(); 151 | 152 | for (int i = 0; i < material.passCount; i++) 153 | { 154 | material.SetPass(i); 155 | 156 | float y1_; float y2_; 157 | if (invertY) 158 | { 159 | y1_ = 1.0f; y2_ = 0.0f; 160 | } 161 | else 162 | { 163 | y1_ = 0.0f; y2_ = 1.0f; 164 | } 165 | 166 | // left 167 | x1 = 0.0f; 168 | x2 = 0.0f + 1.0f/(dest.width*1.0f); 169 | y1 = 0.0f; 170 | y2 = 1.0f; 171 | GL.Begin(GL.QUADS); 172 | 173 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 174 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 175 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 176 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 177 | 178 | // right 179 | x1 = 1.0f - 1.0f/(dest.width*1.0f); 180 | x2 = 1.0f; 181 | y1 = 0.0f; 182 | y2 = 1.0f; 183 | 184 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 185 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 186 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 187 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 188 | 189 | // top 190 | x1 = 0.0f; 191 | x2 = 1.0f; 192 | y1 = 0.0f; 193 | y2 = 0.0f + 1.0f/(dest.height*1.0f); 194 | 195 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 196 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 197 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 198 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 199 | 200 | // bottom 201 | x1 = 0.0f; 202 | x2 = 1.0f; 203 | y1 = 1.0f - 1.0f/(dest.height*1.0f); 204 | y2 = 1.0f; 205 | 206 | GL.TexCoord2(0.0f, y1_); GL.Vertex3(x1, y1, 0.1f); 207 | GL.TexCoord2(1.0f, y1_); GL.Vertex3(x2, y1, 0.1f); 208 | GL.TexCoord2(1.0f, y2_); GL.Vertex3(x2, y2, 0.1f); 209 | GL.TexCoord2(0.0f, y2_); GL.Vertex3(x1, y2, 0.1f); 210 | 211 | GL.End(); 212 | } 213 | 214 | GL.PopMatrix(); 215 | } 216 | } 217 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Editor/StreamEditor.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Custom editor class for Stream 3 | // 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | namespace Kvant 8 | { 9 | [CustomEditor(typeof(Stream)), CanEditMultipleObjects] 10 | public class StreamEditor : Editor 11 | { 12 | SerializedProperty _maxParticles; 13 | SerializedProperty _emitterPosition; 14 | SerializedProperty _emitterSize; 15 | SerializedProperty _throttle; 16 | 17 | SerializedProperty _direction; 18 | SerializedProperty _minSpeed; 19 | SerializedProperty _maxSpeed; 20 | SerializedProperty _spread; 21 | 22 | SerializedProperty _noiseAmplitude; 23 | SerializedProperty _noiseFrequency; 24 | SerializedProperty _noiseSpeed; 25 | 26 | SerializedProperty _color; 27 | SerializedProperty _tail; 28 | SerializedProperty _randomSeed; 29 | SerializedProperty _debug; 30 | 31 | static GUIContent _textCenter = new GUIContent("Center"); 32 | static GUIContent _textSize = new GUIContent("Size"); 33 | static GUIContent _textSpeed = new GUIContent("Speed"); 34 | static GUIContent _textAmplitude = new GUIContent("Amplitude"); 35 | static GUIContent _textFrequency = new GUIContent("Frequency"); 36 | 37 | void OnEnable() 38 | { 39 | _maxParticles = serializedObject.FindProperty("_maxParticles"); 40 | _emitterPosition = serializedObject.FindProperty("_emitterPosition"); 41 | _emitterSize = serializedObject.FindProperty("_emitterSize"); 42 | _throttle = serializedObject.FindProperty("_throttle"); 43 | 44 | _direction = serializedObject.FindProperty("_direction"); 45 | _minSpeed = serializedObject.FindProperty("_minSpeed"); 46 | _maxSpeed = serializedObject.FindProperty("_maxSpeed"); 47 | _spread = serializedObject.FindProperty("_spread"); 48 | 49 | _noiseAmplitude = serializedObject.FindProperty("_noiseAmplitude"); 50 | _noiseFrequency = serializedObject.FindProperty("_noiseFrequency"); 51 | _noiseSpeed = serializedObject.FindProperty("_noiseSpeed"); 52 | 53 | _color = serializedObject.FindProperty("_color"); 54 | _tail = serializedObject.FindProperty("_tail"); 55 | _randomSeed = serializedObject.FindProperty("_randomSeed"); 56 | _debug = serializedObject.FindProperty("_debug"); 57 | } 58 | 59 | public override void OnInspectorGUI() 60 | { 61 | var targetStream = target as Stream; 62 | 63 | serializedObject.Update(); 64 | 65 | EditorGUI.BeginChangeCheck(); 66 | 67 | EditorGUILayout.PropertyField(_maxParticles); 68 | if (!_maxParticles.hasMultipleDifferentValues) 69 | EditorGUILayout.LabelField(" ", "Allocated: " + targetStream.maxParticles, EditorStyles.miniLabel); 70 | 71 | if (EditorGUI.EndChangeCheck()) 72 | targetStream.NotifyConfigChange(); 73 | 74 | EditorGUILayout.LabelField("Emitter", EditorStyles.boldLabel); 75 | EditorGUILayout.PropertyField(_emitterPosition, _textCenter); 76 | EditorGUILayout.PropertyField(_emitterSize, _textSize); 77 | EditorGUILayout.PropertyField(_throttle); 78 | 79 | EditorGUILayout.Space(); 80 | 81 | EditorGUILayout.LabelField("Velocity", EditorStyles.boldLabel); 82 | EditorGUILayout.PropertyField(_direction); 83 | MinMaxSlider(_textSpeed, _minSpeed, _maxSpeed, 0.0f, 50.0f); 84 | EditorGUILayout.PropertyField(_spread); 85 | 86 | EditorGUILayout.Space(); 87 | 88 | EditorGUILayout.LabelField("Turbulent Noise", EditorStyles.boldLabel); 89 | EditorGUILayout.Slider(_noiseAmplitude, 0.0f, 50.0f, _textAmplitude); 90 | EditorGUILayout.Slider(_noiseFrequency, 0.01f, 1.0f, _textFrequency); 91 | EditorGUILayout.Slider(_noiseSpeed, 0.0f, 10.0f, _textSpeed); 92 | 93 | EditorGUILayout.Space(); 94 | 95 | EditorGUILayout.PropertyField(_color); 96 | EditorGUILayout.Slider(_tail, 0.0f, 20.0f); 97 | EditorGUILayout.PropertyField(_randomSeed); 98 | EditorGUILayout.PropertyField(_debug); 99 | 100 | serializedObject.ApplyModifiedProperties(); 101 | } 102 | 103 | void MinMaxSlider(GUIContent label, SerializedProperty propMin, SerializedProperty propMax, float minLimit, float maxLimit) 104 | { 105 | var min = propMin.floatValue; 106 | var max = propMax.floatValue; 107 | 108 | EditorGUI.BeginChangeCheck(); 109 | 110 | // Min-max slider. 111 | EditorGUILayout.MinMaxSlider(label, ref min, ref max, minLimit, maxLimit); 112 | 113 | var prevIndent = EditorGUI.indentLevel; 114 | EditorGUI.indentLevel = 0; 115 | 116 | // Float value boxes. 117 | var rect = EditorGUILayout.GetControlRect(); 118 | rect.x += EditorGUIUtility.labelWidth; 119 | rect.width = (rect.width - EditorGUIUtility.labelWidth) / 2 - 2; 120 | 121 | if (EditorGUIUtility.wideMode) 122 | { 123 | EditorGUIUtility.labelWidth = 28; 124 | min = Mathf.Clamp(EditorGUI.FloatField(rect, "min", min), minLimit, max); 125 | rect.x += rect.width + 4; 126 | max = Mathf.Clamp(EditorGUI.FloatField(rect, "max", max), min, maxLimit); 127 | EditorGUIUtility.labelWidth = 0; 128 | } 129 | else 130 | { 131 | min = Mathf.Clamp(EditorGUI.FloatField(rect, min), minLimit, max); 132 | rect.x += rect.width + 4; 133 | max = Mathf.Clamp(EditorGUI.FloatField(rect, max), min, maxLimit); 134 | } 135 | 136 | EditorGUI.indentLevel = prevIndent; 137 | 138 | if (EditorGUI.EndChangeCheck()) { 139 | propMin.floatValue = min; 140 | propMax.floatValue = max; 141 | } 142 | } 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Shaders/ClassicNoise3D.cginc: -------------------------------------------------------------------------------- 1 | // An HLSL variant of the Gustavson's webgl-noise shader. 2 | // Translated by Keijiro Takahashi 3 | // For further information, see the original notice below. 4 | 5 | // 6 | // GLSL textureless classic 3D noise "cnoise", 7 | // with an RSL-style periodic variant "pnoise". 8 | // Author: Stefan Gustavson (stefan.gustavson@liu.se) 9 | // Version: 2011-10-11 10 | // 11 | // Many thanks to Ian McEwan of Ashima Arts for the 12 | // ideas for permutation and gradient selection. 13 | // 14 | // Copyright (c) 2011 Stefan Gustavson. All rights reserved. 15 | // Distributed under the MIT license. See LICENSE file. 16 | // https://github.com/ashima/webgl-noise 17 | // 18 | 19 | float3 mod(float3 x, float3 y) 20 | { 21 | return x - y * floor(x / y); 22 | } 23 | 24 | float3 mod289(float3 x) 25 | { 26 | return x - floor(x / 289.0) * 289.0; 27 | } 28 | 29 | float4 mod289(float4 x) 30 | { 31 | return x - floor(x / 289.0) * 289.0; 32 | } 33 | 34 | float4 permute(float4 x) 35 | { 36 | return mod289(((x*34.0)+1.0)*x); 37 | } 38 | 39 | float4 taylorInvSqrt(float4 r) 40 | { 41 | return (float4)1.79284291400159 - r * 0.85373472095314; 42 | } 43 | 44 | float3 fade(float3 t) { 45 | return t*t*t*(t*(t*6.0-15.0)+10.0); 46 | } 47 | 48 | // Classic Perlin noise 49 | float cnoise(float3 P) 50 | { 51 | float3 Pi0 = floor(P); // Integer part for indexing 52 | float3 Pi1 = Pi0 + (float3)1.0; // Integer part + 1 53 | Pi0 = mod289(Pi0); 54 | Pi1 = mod289(Pi1); 55 | float3 Pf0 = frac(P); // Fractional part for interpolation 56 | float3 Pf1 = Pf0 - (float3)1.0; // Fractional part - 1.0 57 | float4 ix = float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); 58 | float4 iy = float4(Pi0.y, Pi0.y, Pi1.y, Pi1.y); 59 | float4 iz0 = (float4)Pi0.z; 60 | float4 iz1 = (float4)Pi1.z; 61 | 62 | float4 ixy = permute(permute(ix) + iy); 63 | float4 ixy0 = permute(ixy + iz0); 64 | float4 ixy1 = permute(ixy + iz1); 65 | 66 | float4 gx0 = ixy0 / 7.0; 67 | float4 gy0 = frac(floor(gx0) / 7.0) - 0.5; 68 | gx0 = frac(gx0); 69 | float4 gz0 = (float4)0.5 - abs(gx0) - abs(gy0); 70 | float4 sz0 = step(gz0, (float4)0.0); 71 | gx0 -= sz0 * (step((float4)0.0, gx0) - 0.5); 72 | gy0 -= sz0 * (step((float4)0.0, gy0) - 0.5); 73 | 74 | float4 gx1 = ixy1 / 7.0; 75 | float4 gy1 = frac(floor(gx1) / 7.0) - 0.5; 76 | gx1 = frac(gx1); 77 | float4 gz1 = (float4)0.5 - abs(gx1) - abs(gy1); 78 | float4 sz1 = step(gz1, (float4)0.0); 79 | gx1 -= sz1 * (step((float4)0.0, gx1) - 0.5); 80 | gy1 -= sz1 * (step((float4)0.0, gy1) - 0.5); 81 | 82 | float3 g000 = float3(gx0.x,gy0.x,gz0.x); 83 | float3 g100 = float3(gx0.y,gy0.y,gz0.y); 84 | float3 g010 = float3(gx0.z,gy0.z,gz0.z); 85 | float3 g110 = float3(gx0.w,gy0.w,gz0.w); 86 | float3 g001 = float3(gx1.x,gy1.x,gz1.x); 87 | float3 g101 = float3(gx1.y,gy1.y,gz1.y); 88 | float3 g011 = float3(gx1.z,gy1.z,gz1.z); 89 | float3 g111 = float3(gx1.w,gy1.w,gz1.w); 90 | 91 | float4 norm0 = taylorInvSqrt(float4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); 92 | g000 *= norm0.x; 93 | g010 *= norm0.y; 94 | g100 *= norm0.z; 95 | g110 *= norm0.w; 96 | 97 | float4 norm1 = taylorInvSqrt(float4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); 98 | g001 *= norm1.x; 99 | g011 *= norm1.y; 100 | g101 *= norm1.z; 101 | g111 *= norm1.w; 102 | 103 | float n000 = dot(g000, Pf0); 104 | float n100 = dot(g100, float3(Pf1.x, Pf0.y, Pf0.z)); 105 | float n010 = dot(g010, float3(Pf0.x, Pf1.y, Pf0.z)); 106 | float n110 = dot(g110, float3(Pf1.x, Pf1.y, Pf0.z)); 107 | float n001 = dot(g001, float3(Pf0.x, Pf0.y, Pf1.z)); 108 | float n101 = dot(g101, float3(Pf1.x, Pf0.y, Pf1.z)); 109 | float n011 = dot(g011, float3(Pf0.x, Pf1.y, Pf1.z)); 110 | float n111 = dot(g111, Pf1); 111 | 112 | float3 fade_xyz = fade(Pf0); 113 | float4 n_z = lerp(float4(n000, n100, n010, n110), float4(n001, n101, n011, n111), fade_xyz.z); 114 | float2 n_yz = lerp(n_z.xy, n_z.zw, fade_xyz.y); 115 | float n_xyz = lerp(n_yz.x, n_yz.y, fade_xyz.x); 116 | return 2.2 * n_xyz; 117 | } 118 | 119 | // Classic Perlin noise, periodic variant 120 | float pnoise(float3 P, float3 rep) 121 | { 122 | float3 Pi0 = mod(floor(P), rep); // Integer part, modulo period 123 | float3 Pi1 = mod(Pi0 + (float3)1.0, rep); // Integer part + 1, mod period 124 | Pi0 = mod289(Pi0); 125 | Pi1 = mod289(Pi1); 126 | float3 Pf0 = frac(P); // Fractional part for interpolation 127 | float3 Pf1 = Pf0 - (float3)1.0; // Fractional part - 1.0 128 | float4 ix = float4(Pi0.x, Pi1.x, Pi0.x, Pi1.x); 129 | float4 iy = float4(Pi0.y, Pi0.y, Pi1.y, Pi1.y); 130 | float4 iz0 = (float4)Pi0.z; 131 | float4 iz1 = (float4)Pi1.z; 132 | 133 | float4 ixy = permute(permute(ix) + iy); 134 | float4 ixy0 = permute(ixy + iz0); 135 | float4 ixy1 = permute(ixy + iz1); 136 | 137 | float4 gx0 = ixy0 / 7.0; 138 | float4 gy0 = frac(floor(gx0) / 7.0) - 0.5; 139 | gx0 = frac(gx0); 140 | float4 gz0 = (float4)0.5 - abs(gx0) - abs(gy0); 141 | float4 sz0 = step(gz0, (float4)0.0); 142 | gx0 -= sz0 * (step((float4)0.0, gx0) - 0.5); 143 | gy0 -= sz0 * (step((float4)0.0, gy0) - 0.5); 144 | 145 | float4 gx1 = ixy1 / 7.0; 146 | float4 gy1 = frac(floor(gx1) / 7.0) - 0.5; 147 | gx1 = frac(gx1); 148 | float4 gz1 = (float4)0.5 - abs(gx1) - abs(gy1); 149 | float4 sz1 = step(gz1, (float4)0.0); 150 | gx1 -= sz1 * (step((float4)0.0, gx1) - 0.5); 151 | gy1 -= sz1 * (step((float4)0.0, gy1) - 0.5); 152 | 153 | float3 g000 = float3(gx0.x,gy0.x,gz0.x); 154 | float3 g100 = float3(gx0.y,gy0.y,gz0.y); 155 | float3 g010 = float3(gx0.z,gy0.z,gz0.z); 156 | float3 g110 = float3(gx0.w,gy0.w,gz0.w); 157 | float3 g001 = float3(gx1.x,gy1.x,gz1.x); 158 | float3 g101 = float3(gx1.y,gy1.y,gz1.y); 159 | float3 g011 = float3(gx1.z,gy1.z,gz1.z); 160 | float3 g111 = float3(gx1.w,gy1.w,gz1.w); 161 | 162 | float4 norm0 = taylorInvSqrt(float4(dot(g000, g000), dot(g010, g010), dot(g100, g100), dot(g110, g110))); 163 | g000 *= norm0.x; 164 | g010 *= norm0.y; 165 | g100 *= norm0.z; 166 | g110 *= norm0.w; 167 | float4 norm1 = taylorInvSqrt(float4(dot(g001, g001), dot(g011, g011), dot(g101, g101), dot(g111, g111))); 168 | g001 *= norm1.x; 169 | g011 *= norm1.y; 170 | g101 *= norm1.z; 171 | g111 *= norm1.w; 172 | 173 | float n000 = dot(g000, Pf0); 174 | float n100 = dot(g100, float3(Pf1.x, Pf0.y, Pf0.z)); 175 | float n010 = dot(g010, float3(Pf0.x, Pf1.y, Pf0.z)); 176 | float n110 = dot(g110, float3(Pf1.x, Pf1.y, Pf0.z)); 177 | float n001 = dot(g001, float3(Pf0.x, Pf0.y, Pf1.z)); 178 | float n101 = dot(g101, float3(Pf1.x, Pf0.y, Pf1.z)); 179 | float n011 = dot(g011, float3(Pf0.x, Pf1.y, Pf1.z)); 180 | float n111 = dot(g111, Pf1); 181 | 182 | float3 fade_xyz = fade(Pf0); 183 | float4 n_z = lerp(float4(n000, n100, n010, n110), float4(n001, n101, n011, n111), fade_xyz.z); 184 | float2 n_yz = lerp(n_z.xy, n_z.zw, fade_xyz.y); 185 | float n_xyz = lerp(n_yz.x, n_yz.y, fade_xyz.x); 186 | return 2.2 * n_xyz; 187 | } 188 | -------------------------------------------------------------------------------- /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/Shaders/ImageEffects/Bloom_V2/VideoBloom.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | 4 | [ExecuteInEditMode] 5 | [AddComponentMenu("Image Effects/Other/VideoBloom")] 6 | [RequireComponent(typeof(Camera))] 7 | 8 | public class VideoBloom : PostEffectsBase 9 | { 10 | public enum TweakMode 11 | { 12 | Basic = 0, 13 | Advanced = 1 14 | } 15 | 16 | public enum BlendingMode 17 | { 18 | Add = 0, 19 | Screen = 1, 20 | } 21 | 22 | public TweakMode tweakMode = TweakMode.Basic; 23 | [Range(0.0f, 4.0f)] 24 | public float Threshold = 0.75f; 25 | [Range(0.0f, 5.0f)] 26 | public float MasterAmount = 0.5f; 27 | [Range(0.0f, 5.0f)] 28 | public float MediumAmount = 1.0f; 29 | [Range(0.0f, 100.0f)] 30 | public float LargeAmount = 0.0f; 31 | public Color Tint = new Color(1.0f, 1.0f, 1.0f, 1.0f); 32 | [Range(10.0f, 100.0f)] 33 | public float KernelSize = 50.0f; 34 | [Range(1.0f, 20.0f)] 35 | public float MediumKernelScale = 1.0f; 36 | [Range(3.0f, 20.0f)] 37 | public float LargeKernelScale = 3.0f; 38 | public BlendingMode BlendMode = BlendingMode.Add; 39 | public bool HighQuality = true; 40 | 41 | public Shader videoBloomShader; 42 | private Material videoBloomMaterial; 43 | 44 | public override bool CheckResources () 45 | { 46 | CheckSupport (false, true); 47 | 48 | videoBloomMaterial = CheckShaderAndCreateMaterial (videoBloomShader, videoBloomMaterial); 49 | 50 | if (!isSupported) 51 | ReportAutoDisable (); 52 | 53 | return isSupported; 54 | } 55 | 56 | 57 | float videoBlurGetMaxScaleFor(float radius) 58 | { 59 | double x = (double)radius; 60 | double sc = x < 10.0 ? (0.1*x * 1.468417):(x < 36.3287 ? (0.127368 * x + 0.194737):(0.8*(float)Math.Sqrt(x))); 61 | return sc <= 0.0 ? 0.0f:(float)sc; 62 | } 63 | 64 | void BloomBlit(RenderTexture source, RenderTexture blur1, RenderTexture blur2, float radius1, float radius2) 65 | { 66 | const float kd0 = (4.0f/3.0f); 67 | const float kd1 = (1.0f/3.0f); 68 | float maxScale = videoBlurGetMaxScaleFor(radius1); 69 | int blurIteration1 = (int)maxScale; 70 | float lerp1 = (maxScale - (float)blurIteration1); 71 | maxScale = videoBlurGetMaxScaleFor(radius2); 72 | int blurIteration2 = (int)maxScale; 73 | float dUV = 1.0f; 74 | int rtW = source.width; 75 | int rtH = source.height; 76 | float s0 = blurIteration1 != 0 ? 1.0f:-1.0f; 77 | Vector4 v; 78 | int i; 79 | 80 | if (radius1 == 0.0f) 81 | { 82 | Graphics.Blit(source, blur1); 83 | return; 84 | } 85 | 86 | RenderTexture rt = RenderTexture.GetTemporary(rtW, rtH, 0, RenderTextureFormat.ARGBHalf); 87 | rt.filterMode = FilterMode.Bilinear; 88 | rt.wrapMode = TextureWrapMode.Clamp; 89 | Graphics.Blit(source, rt); 90 | 91 | for (i = 0; i < blurIteration1; i++) 92 | { 93 | s0 = (i % 2 != 0 ? -1.0f:1.0f); 94 | v = new Vector4(s0 * dUV * kd0, dUV * kd1, s0 * dUV * kd1, -dUV * kd0); 95 | videoBloomMaterial.SetVector("_Param0", v); 96 | RenderTexture rt2 = RenderTexture.GetTemporary(rtW, rtH, 0, RenderTextureFormat.ARGBHalf); 97 | rt2.filterMode = FilterMode.Bilinear; 98 | rt2.wrapMode = TextureWrapMode.Clamp; 99 | videoBloomMaterial.SetTexture("_MainTex", rt); 100 | Graphics.Blit (rt, rt2, videoBloomMaterial, 0); 101 | RenderTexture.ReleaseTemporary(rt); 102 | rt = rt2; 103 | dUV = dUV * 1.414213562373095f; 104 | } 105 | 106 | v = new Vector4(-s0 * dUV * kd0, dUV * kd1, -s0 * dUV * kd1, -dUV * kd0); 107 | videoBloomMaterial.SetVector("_Param0", v); 108 | videoBloomMaterial.SetFloat("_Param2", lerp1); 109 | videoBloomMaterial.SetTexture("_MainTex", rt); 110 | Graphics.Blit (rt, blur1, videoBloomMaterial, 1); 111 | 112 | if (blur2 != null) 113 | { 114 | for ( ; i < blurIteration2; i++) 115 | { 116 | s0 = (i % 2 != 0 ? -1.0f:1.0f); 117 | v = new Vector4(s0 * dUV * kd0, dUV * kd1, s0 * dUV * kd1, -dUV * kd0); 118 | videoBloomMaterial.SetVector("_Param0", v); 119 | RenderTexture rt2 = RenderTexture.GetTemporary(rtW, rtH, 0, RenderTextureFormat.ARGBHalf); 120 | rt2.filterMode = FilterMode.Bilinear; 121 | rt2.wrapMode = TextureWrapMode.Clamp; 122 | videoBloomMaterial.SetTexture("_MainTex", rt); 123 | Graphics.Blit (rt, rt2, videoBloomMaterial, 0); 124 | RenderTexture.ReleaseTemporary(rt); 125 | rt = rt2; 126 | dUV = dUV * 1.414213562373095f; 127 | } 128 | 129 | v = new Vector4(-s0 * dUV * kd0, dUV * kd1, -s0 * dUV * kd1, -dUV * kd0); 130 | videoBloomMaterial.SetVector("_Param0", v); 131 | videoBloomMaterial.SetFloat("_Param2", (maxScale - (float)blurIteration2)); 132 | videoBloomMaterial.SetTexture("_MainTex", rt); 133 | Graphics.Blit (rt, blur2, videoBloomMaterial, 1); 134 | } 135 | 136 | RenderTexture.ReleaseTemporary(rt); 137 | 138 | } 139 | 140 | //[ImageEffectOpaque] 141 | void OnRenderImage (RenderTexture source, RenderTexture destination) 142 | { 143 | 144 | if ((MediumAmount == 0.0f && LargeAmount == 0.0f) || MasterAmount == 0.0f || !CheckResources( )) 145 | { 146 | Graphics.Blit(source, destination); 147 | return; 148 | } 149 | float coe = HighQuality == true ? 1.0f:0.25f; 150 | int rtW = (int)(coe * (float)source.width); 151 | int rtH = (int)(coe * (float)source.height); 152 | Vector4 weight = new Vector4(0.5f * MasterAmount*MediumAmount, 0.5f * MasterAmount*LargeAmount, 0.0f, 0.0f); 153 | Vector4 tint = new Vector4(Tint.r, Tint.g, Tint.b, 1.0f); 154 | float radius1 = KernelSize * MediumKernelScale * coe; 155 | float radius2 = KernelSize * LargeKernelScale * coe; 156 | 157 | RenderTexture tmp1 = RenderTexture.GetTemporary(rtW, rtH, 0, RenderTextureFormat.ARGBHalf); 158 | RenderTexture tmp2 = RenderTexture.GetTemporary(rtW, rtH, 0, RenderTextureFormat.ARGBHalf); 159 | RenderTexture tmp3 = null; 160 | tmp1.filterMode = FilterMode.Bilinear; 161 | tmp1.wrapMode = TextureWrapMode.Clamp; 162 | tmp2.filterMode = FilterMode.Bilinear; 163 | tmp2.wrapMode = TextureWrapMode.Clamp; 164 | 165 | if (HighQuality == true) 166 | { 167 | videoBloomMaterial.SetFloat("_Param2", Threshold); 168 | Graphics.Blit(source, tmp1, videoBloomMaterial, 2); 169 | } 170 | else 171 | { 172 | tmp3 = RenderTexture.GetTemporary(2 * rtW, 2 * rtH, 0, RenderTextureFormat.ARGBHalf); 173 | tmp3.filterMode = FilterMode.Bilinear; 174 | tmp3.wrapMode = TextureWrapMode.Clamp; 175 | Graphics.Blit(source, tmp3); 176 | videoBloomMaterial.SetFloat("_Param2", Threshold); 177 | Graphics.Blit(tmp3, tmp1, videoBloomMaterial, 2); 178 | RenderTexture.ReleaseTemporary(tmp3); 179 | tmp3 = null; 180 | } 181 | 182 | if (LargeAmount != 0.0f) 183 | { 184 | tmp3 = RenderTexture.GetTemporary(rtW, rtH, 0, RenderTextureFormat.ARGBHalf); 185 | tmp3.filterMode = FilterMode.Bilinear; 186 | tmp3.wrapMode = TextureWrapMode.Clamp; 187 | } 188 | 189 | BloomBlit(tmp1, tmp2, tmp3, radius1, radius2 >= radius1 ? radius2:radius1); 190 | 191 | videoBloomMaterial.SetTexture("_MainTex", source); 192 | videoBloomMaterial.SetTexture("_MediumBloom", tmp2); 193 | videoBloomMaterial.SetTexture("_LargeBloom", tmp3); 194 | videoBloomMaterial.SetVector("_Param0", weight); 195 | videoBloomMaterial.SetVector("_Param1", tint); 196 | Graphics.Blit(source, destination, videoBloomMaterial, BlendMode == BlendingMode.Screen ? 4:3); 197 | 198 | RenderTexture.ReleaseTemporary(tmp1); 199 | RenderTexture.ReleaseTemporary(tmp2); 200 | if (tmp3 != null) 201 | RenderTexture.ReleaseTemporary(tmp3); 202 | 203 | } 204 | 205 | } 206 | -------------------------------------------------------------------------------- /Assets/Kvant/Stream/Stream.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Stream - line particle system 3 | // 4 | using UnityEngine; 5 | 6 | namespace Kvant 7 | { 8 | [ExecuteInEditMode, AddComponentMenu("Kvant/Stream")] 9 | public class Stream : MonoBehaviour 10 | { 11 | #region Parameters Exposed To Editor 12 | 13 | [SerializeField] 14 | int _maxParticles = 32768; 15 | 16 | [SerializeField] 17 | Vector3 _emitterPosition = Vector3.forward * 20; 18 | 19 | [SerializeField] 20 | Vector3 _emitterSize = Vector3.one * 40; 21 | 22 | [SerializeField, Range(0, 1)] 23 | float _throttle = 1.0f; 24 | 25 | [SerializeField] 26 | Vector3 _direction = -Vector3.forward; 27 | 28 | [SerializeField] 29 | float _minSpeed = 5.0f; 30 | 31 | [SerializeField] 32 | float _maxSpeed = 10.0f; 33 | 34 | [SerializeField, Range(0, 1)] 35 | float _spread = 0.2f; 36 | 37 | [SerializeField] 38 | float _noiseAmplitude = 0.1f; 39 | 40 | [SerializeField] 41 | float _noiseFrequency = 0.2f; 42 | 43 | [SerializeField] 44 | float _noiseSpeed = 1.0f; 45 | 46 | [SerializeField, ColorUsage(true, true, 0, 8, 0.125f, 3)] 47 | Color _color = Color.white; 48 | 49 | [SerializeField] 50 | float _tail = 1.0f; 51 | 52 | [SerializeField] 53 | int _randomSeed = 0; 54 | 55 | [SerializeField] 56 | bool _debug; 57 | 58 | #endregion 59 | 60 | #region Public Properties 61 | 62 | public int maxParticles { 63 | // Returns the actual number of particles. 64 | get { return BufferWidth * BufferHeight; } 65 | } 66 | 67 | public float throttle { 68 | get { return _throttle; } 69 | set { _throttle = value; } 70 | } 71 | 72 | public Vector3 emitterPosition { 73 | get { return _emitterPosition; } 74 | set { _emitterPosition = value; } 75 | } 76 | 77 | public Vector3 emitterSize { 78 | get { return _emitterSize; } 79 | set { _emitterSize = value; } 80 | } 81 | 82 | public Vector3 direction { 83 | get { return _direction; } 84 | set { _direction = value; } 85 | } 86 | 87 | public float minSpeed { 88 | get { return _minSpeed; } 89 | set { _minSpeed = value; } 90 | } 91 | 92 | public float maxSpeed { 93 | get { return _maxSpeed; } 94 | set { _maxSpeed = value; } 95 | } 96 | 97 | public float spread { 98 | get { return _spread; } 99 | set { _spread = value; } 100 | } 101 | 102 | public float noiseAmplitude { 103 | get { return _noiseAmplitude; } 104 | set { _noiseAmplitude = value; } 105 | } 106 | 107 | public float noiseFrequency { 108 | get { return _noiseFrequency; } 109 | set { _noiseFrequency = value; } 110 | } 111 | 112 | public float noiseSpeed { 113 | get { return _noiseSpeed; } 114 | set { _noiseSpeed = value; } 115 | } 116 | 117 | public Color color { 118 | get { return _color; } 119 | set { _color = value; } 120 | } 121 | 122 | public float tail { 123 | get { return _tail; } 124 | set { _tail = value; } 125 | } 126 | 127 | #endregion 128 | 129 | #region Shader And Materials 130 | 131 | [SerializeField] Shader _kernelShader; 132 | [SerializeField] Shader _lineShader; 133 | [SerializeField] Shader _debugShader; 134 | 135 | Material _kernelMaterial; 136 | Material _lineMaterial; 137 | Material _debugMaterial; 138 | 139 | #endregion 140 | 141 | #region Private Variables And Objects 142 | 143 | RenderTexture _particleBuffer1; 144 | RenderTexture _particleBuffer2; 145 | Mesh _mesh; 146 | bool _needsReset = true; 147 | 148 | #endregion 149 | 150 | #region Private Properties 151 | 152 | int BufferWidth { get { return 256; } } 153 | 154 | int BufferHeight { 155 | get { 156 | return Mathf.Clamp(_maxParticles / BufferWidth + 1, 1, 127); 157 | } 158 | } 159 | 160 | static float deltaTime { 161 | get { 162 | return Application.isPlaying && Time.frameCount > 1 ? Time.deltaTime : 1.0f / 10; 163 | } 164 | } 165 | 166 | #endregion 167 | 168 | #region Resource Management 169 | 170 | public void NotifyConfigChange() 171 | { 172 | _needsReset = true; 173 | } 174 | 175 | Material CreateMaterial(Shader shader) 176 | { 177 | var material = new Material(shader); 178 | material.hideFlags = HideFlags.DontSave; 179 | return material; 180 | } 181 | 182 | RenderTexture CreateBuffer() 183 | { 184 | var buffer = new RenderTexture(BufferWidth, BufferHeight, 0, RenderTextureFormat.ARGBFloat); 185 | buffer.hideFlags = HideFlags.DontSave; 186 | buffer.filterMode = FilterMode.Point; 187 | buffer.wrapMode = TextureWrapMode.Repeat; 188 | return buffer; 189 | } 190 | 191 | Mesh CreateMesh() 192 | { 193 | var Nx = BufferWidth; 194 | var Ny = BufferHeight; 195 | 196 | // Create vertex arrays. 197 | var VA = new Vector3[Nx * Ny * 2]; 198 | var TA = new Vector2[Nx * Ny * 2]; 199 | 200 | var Ai = 0; 201 | for (var x = 0; x < Nx; x++) 202 | { 203 | for (var y = 0; y < Ny; y++) 204 | { 205 | VA[Ai + 0] = new Vector3(1, 0, 0); 206 | VA[Ai + 1] = new Vector3(0, 0, 0); 207 | 208 | var u = (float)x / Nx; 209 | var v = (float)y / Ny; 210 | TA[Ai] = TA[Ai + 1] = new Vector2(u, v); 211 | 212 | Ai += 2; 213 | } 214 | } 215 | 216 | // Index array. 217 | var IA = new int[VA.Length]; 218 | for (Ai = 0; Ai < VA.Length; Ai++) IA[Ai] = Ai; 219 | 220 | // Create a mesh object. 221 | var mesh = new Mesh(); 222 | mesh.hideFlags = HideFlags.DontSave; 223 | mesh.vertices = VA; 224 | mesh.uv = TA; 225 | mesh.SetIndices(IA, MeshTopology.Lines, 0); 226 | mesh.Optimize(); 227 | 228 | // Avoid being culled. 229 | mesh.bounds = new Bounds(Vector3.zero, Vector3.one * 1000); 230 | 231 | return mesh; 232 | } 233 | 234 | void UpdateKernelShader() 235 | { 236 | var m = _kernelMaterial; 237 | 238 | m.SetVector("_EmitterPos", _emitterPosition); 239 | m.SetVector("_EmitterSize", _emitterSize); 240 | 241 | var dir = new Vector4(_direction.x, _direction.y, _direction.z, _spread); 242 | m.SetVector("_Direction", dir); 243 | 244 | m.SetVector("_SpeedParams", new Vector2(_minSpeed, _maxSpeed)); 245 | 246 | if (_noiseAmplitude > 0) 247 | { 248 | var np = new Vector3(_noiseFrequency, _noiseAmplitude, _noiseSpeed); 249 | m.SetVector("_NoiseParams", np); 250 | m.EnableKeyword("NOISE_ON"); 251 | } 252 | else 253 | { 254 | m.DisableKeyword("NOISE_ON"); 255 | } 256 | 257 | var life = 2.0f; 258 | m.SetVector("_Config", new Vector4(_throttle, life, _randomSeed, deltaTime)); 259 | } 260 | 261 | void ResetResources() 262 | { 263 | // Mesh object. 264 | if (_mesh == null) _mesh = CreateMesh(); 265 | 266 | // Particle buffers. 267 | if (_particleBuffer1) DestroyImmediate(_particleBuffer1); 268 | if (_particleBuffer2) DestroyImmediate(_particleBuffer2); 269 | 270 | _particleBuffer1 = CreateBuffer(); 271 | _particleBuffer2 = CreateBuffer(); 272 | 273 | // Shader materials. 274 | if (!_kernelMaterial) _kernelMaterial = CreateMaterial(_kernelShader); 275 | if (!_lineMaterial) _lineMaterial = CreateMaterial(_lineShader); 276 | if (!_debugMaterial) _debugMaterial = CreateMaterial(_debugShader); 277 | 278 | // Warming up. 279 | UpdateKernelShader(); 280 | InitializeAndPrewarmBuffers(); 281 | 282 | _needsReset = false; 283 | } 284 | 285 | void InitializeAndPrewarmBuffers() 286 | { 287 | // Initialization. 288 | Graphics.Blit(null, _particleBuffer2, _kernelMaterial, 0); 289 | 290 | // Execute the kernel shader repeatedly. 291 | for (var i = 0; i < 8; i++) { 292 | Graphics.Blit(_particleBuffer2, _particleBuffer1, _kernelMaterial, 1); 293 | Graphics.Blit(_particleBuffer1, _particleBuffer2, _kernelMaterial, 1); 294 | } 295 | } 296 | 297 | #endregion 298 | 299 | #region MonoBehaviour Functions 300 | 301 | void Reset() 302 | { 303 | _needsReset = true; 304 | } 305 | 306 | void OnDestroy() 307 | { 308 | if (_mesh) DestroyImmediate(_mesh); 309 | if (_particleBuffer1) DestroyImmediate(_particleBuffer1); 310 | if (_particleBuffer2) DestroyImmediate(_particleBuffer2); 311 | if (_kernelMaterial) DestroyImmediate(_kernelMaterial); 312 | if (_lineMaterial) DestroyImmediate(_lineMaterial); 313 | if (_debugMaterial) DestroyImmediate(_debugMaterial); 314 | } 315 | 316 | void Update() 317 | { 318 | if (_needsReset) ResetResources(); 319 | 320 | UpdateKernelShader(); 321 | 322 | if (Application.isPlaying) 323 | { 324 | // Swap the particle buffers. 325 | var temp = _particleBuffer1; 326 | _particleBuffer1 = _particleBuffer2; 327 | _particleBuffer2 = temp; 328 | 329 | // Execute the kernel shader. 330 | Graphics.Blit(_particleBuffer1, _particleBuffer2, _kernelMaterial, 1); 331 | } 332 | else 333 | { 334 | InitializeAndPrewarmBuffers(); 335 | } 336 | 337 | // Draw particles. 338 | _lineMaterial.SetTexture("_ParticleTex1", _particleBuffer1); 339 | _lineMaterial.SetTexture("_ParticleTex2", _particleBuffer2); 340 | _lineMaterial.SetColor("_Color", _color); 341 | _lineMaterial.SetFloat("_Tail", _tail / deltaTime / 60); 342 | Graphics.DrawMesh(_mesh, transform.position, transform.rotation, _lineMaterial, gameObject.layer); 343 | } 344 | 345 | void OnGUI() 346 | { 347 | if (_debug && Event.current.type.Equals(EventType.Repaint)) 348 | { 349 | if (_debugMaterial && _particleBuffer2) 350 | { 351 | var rect = new Rect(0, 0, 256, 64); 352 | Graphics.DrawTexture(rect, _particleBuffer2, _debugMaterial); 353 | } 354 | } 355 | } 356 | 357 | void OnDrawGizmosSelected() 358 | { 359 | Gizmos.color = Color.yellow; 360 | Gizmos.matrix = transform.localToWorldMatrix; 361 | Gizmos.DrawWireCube(_emitterPosition, _emitterSize); 362 | } 363 | 364 | #endregion 365 | } 366 | } 367 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | AndroidProfiler: 0 8 | defaultScreenOrientation: 4 9 | targetDevice: 2 10 | targetResolution: 0 11 | accelerometerFrequency: 60 12 | companyName: DefaultCompany 13 | productName: KvantStream 14 | defaultCursor: {fileID: 0} 15 | cursorHotspot: {x: 0, y: 0} 16 | m_ShowUnitySplashScreen: 1 17 | defaultScreenWidth: 1024 18 | defaultScreenHeight: 768 19 | defaultScreenWidthWeb: 960 20 | defaultScreenHeightWeb: 600 21 | m_RenderingPath: 1 22 | m_MobileRenderingPath: 1 23 | m_ActiveColorSpace: 1 24 | m_MTRendering: 1 25 | m_MobileMTRendering: 0 26 | m_Stereoscopic3D: 0 27 | iosShowActivityIndicatorOnLoading: -1 28 | androidShowActivityIndicatorOnLoading: -1 29 | iosAppInBackgroundBehavior: 0 30 | displayResolutionDialog: 1 31 | allowedAutorotateToPortrait: 1 32 | allowedAutorotateToPortraitUpsideDown: 1 33 | allowedAutorotateToLandscapeRight: 1 34 | allowedAutorotateToLandscapeLeft: 1 35 | useOSAutorotation: 1 36 | use32BitDisplayBuffer: 1 37 | disableDepthAndStencilBuffers: 0 38 | defaultIsFullScreen: 1 39 | defaultIsNativeResolution: 1 40 | runInBackground: 0 41 | captureSingleScreen: 0 42 | Override IPod Music: 0 43 | Prepare IOS For Recording: 0 44 | submitAnalytics: 1 45 | usePlayerLog: 1 46 | bakeCollisionMeshes: 0 47 | forceSingleInstance: 0 48 | resizableWindow: 0 49 | useMacAppStoreValidation: 0 50 | gpuSkinning: 0 51 | xboxPIXTextureCapture: 0 52 | xboxEnableAvatar: 0 53 | xboxEnableKinect: 0 54 | xboxEnableKinectAutoTracking: 0 55 | xboxEnableFitness: 0 56 | visibleInBackground: 0 57 | macFullscreenMode: 2 58 | d3d9FullscreenMode: 1 59 | d3d11FullscreenMode: 1 60 | xboxSpeechDB: 0 61 | xboxEnableHeadOrientation: 0 62 | xboxEnableGuest: 0 63 | xboxOneResolution: 0 64 | ps3SplashScreen: {fileID: 0} 65 | videoMemoryForVertexBuffers: 0 66 | psp2PowerMode: 0 67 | psp2AcquireBGM: 1 68 | m_SupportedAspectRatios: 69 | 4:3: 1 70 | 5:4: 1 71 | 16:10: 1 72 | 16:9: 1 73 | Others: 1 74 | bundleIdentifier: com.Company.ProductName 75 | bundleVersion: 1.0 76 | preloadedAssets: [] 77 | metroEnableIndependentInputSource: 0 78 | metroEnableLowLatencyPresentationAPI: 0 79 | xboxOneDisableKinectGpuReservation: 0 80 | virtualRealitySupported: 0 81 | productGUID: 1591ba6fb3c5744dfb01067de7d4450d 82 | AndroidBundleVersionCode: 1 83 | AndroidMinSdkVersion: 9 84 | AndroidPreferredInstallLocation: 1 85 | aotOptions: 86 | apiCompatibilityLevel: 2 87 | iPhoneStrippingLevel: 0 88 | iPhoneScriptCallOptimization: 0 89 | ForceInternetPermission: 0 90 | ForceSDCardPermission: 0 91 | CreateWallpaper: 0 92 | APKExpansionFiles: 0 93 | preloadShaders: 0 94 | StripUnusedMeshComponents: 0 95 | iPhoneSdkVersion: 988 96 | iPhoneTargetOSVersion: 22 97 | uIPrerenderedIcon: 0 98 | uIRequiresPersistentWiFi: 0 99 | uIStatusBarHidden: 1 100 | uIExitOnSuspend: 0 101 | uIStatusBarStyle: 0 102 | iPhoneSplashScreen: {fileID: 0} 103 | iPhoneHighResSplashScreen: {fileID: 0} 104 | iPhoneTallHighResSplashScreen: {fileID: 0} 105 | iPhone47inSplashScreen: {fileID: 0} 106 | iPhone55inPortraitSplashScreen: {fileID: 0} 107 | iPhone55inLandscapeSplashScreen: {fileID: 0} 108 | iPadPortraitSplashScreen: {fileID: 0} 109 | iPadHighResPortraitSplashScreen: {fileID: 0} 110 | iPadLandscapeSplashScreen: {fileID: 0} 111 | iPadHighResLandscapeSplashScreen: {fileID: 0} 112 | iOSLaunchScreenType: 0 113 | iOSLaunchScreenPortrait: {fileID: 0} 114 | iOSLaunchScreenLandscape: {fileID: 0} 115 | iOSLaunchScreenBackgroundColor: 116 | serializedVersion: 2 117 | rgba: 0 118 | iOSLaunchScreenFillPct: 100 119 | iOSLaunchScreenSize: 100 120 | iOSLaunchScreenCustomXibPath: 121 | AndroidTargetDevice: 0 122 | AndroidSplashScreenScale: 0 123 | androidSplashScreen: {fileID: 0} 124 | AndroidKeystoreName: 125 | AndroidKeyaliasName: 126 | AndroidTVCompatibility: 1 127 | AndroidIsGame: 1 128 | androidEnableBanner: 1 129 | m_AndroidBanners: 130 | - width: 320 131 | height: 180 132 | banner: {fileID: 0} 133 | androidGamepadSupportLevel: 0 134 | resolutionDialogBanner: {fileID: 0} 135 | m_BuildTargetIcons: 136 | - m_BuildTarget: 137 | m_Icons: 138 | - m_Icon: {fileID: 0} 139 | m_Size: 128 140 | m_BuildTargetBatching: [] 141 | m_BuildTargetGraphicsAPIs: [] 142 | webPlayerTemplate: APPLICATION:Default 143 | m_TemplateCustomTags: {} 144 | actionOnDotNetUnhandledException: 1 145 | enableInternalProfiler: 0 146 | logObjCUncaughtExceptions: 1 147 | enableCrashReportAPI: 0 148 | locationUsageDescription: 149 | XboxTitleId: 150 | XboxImageXexPath: 151 | XboxSpaPath: 152 | XboxGenerateSpa: 0 153 | XboxDeployKinectResources: 0 154 | XboxSplashScreen: {fileID: 0} 155 | xboxEnableSpeech: 0 156 | xboxAdditionalTitleMemorySize: 0 157 | xboxDeployKinectHeadOrientation: 0 158 | xboxDeployKinectHeadPosition: 0 159 | ps3TitleConfigPath: 160 | ps3DLCConfigPath: 161 | ps3ThumbnailPath: 162 | ps3BackgroundPath: 163 | ps3SoundPath: 164 | ps3NPAgeRating: 12 165 | ps3TrophyCommId: 166 | ps3NpCommunicationPassphrase: 167 | ps3TrophyPackagePath: 168 | ps3BootCheckMaxSaveGameSizeKB: 128 169 | ps3TrophyCommSig: 170 | ps3SaveGameSlots: 1 171 | ps3TrialMode: 0 172 | ps3VideoMemoryForAudio: 0 173 | ps3EnableVerboseMemoryStats: 0 174 | ps3UseSPUForUmbra: 0 175 | ps3EnableMoveSupport: 1 176 | ps3DisableDolbyEncoding: 0 177 | ps4NPAgeRating: 12 178 | ps4NPTitleSecret: 179 | ps4NPTrophyPackPath: 180 | ps4ParentalLevel: 1 181 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 182 | ps4Category: 0 183 | ps4MasterVersion: 01.00 184 | ps4AppVersion: 01.00 185 | ps4AppType: 0 186 | ps4ParamSfxPath: 187 | ps4VideoOutPixelFormat: 0 188 | ps4VideoOutResolution: 4 189 | ps4PronunciationXMLPath: 190 | ps4PronunciationSIGPath: 191 | ps4BackgroundImagePath: 192 | ps4StartupImagePath: 193 | ps4SaveDataImagePath: 194 | ps4BGMPath: 195 | ps4ShareFilePath: 196 | ps4NPtitleDatPath: 197 | ps4RemotePlayKeyAssignment: -1 198 | ps4EnterButtonAssignment: 1 199 | ps4ApplicationParam1: 0 200 | ps4ApplicationParam2: 0 201 | ps4ApplicationParam3: 0 202 | ps4ApplicationParam4: 0 203 | ps4GarlicHeapSize: 2048 204 | ps4Passcode: RhRXdCdG5nG5azdNMK66MuCV6GXi5xr8 205 | ps4pnSessions: 1 206 | ps4pnPresence: 1 207 | ps4pnFriends: 1 208 | ps4pnGameCustomData: 1 209 | playerPrefsSupport: 0 210 | monoEnv: 211 | psp2Splashimage: {fileID: 0} 212 | psp2NPTrophyPackPath: 213 | psp2NPSupportGBMorGJP: 0 214 | psp2NPAgeRating: 12 215 | psp2NPTitleDatPath: 216 | psp2NPCommsID: 217 | psp2NPCommunicationsID: 218 | psp2NPCommsPassphrase: 219 | psp2NPCommsSig: 220 | psp2ParamSfxPath: 221 | psp2ManualPath: 222 | psp2LiveAreaGatePath: 223 | psp2LiveAreaBackroundPath: 224 | psp2LiveAreaPath: 225 | psp2LiveAreaTrialPath: 226 | psp2PatchChangeInfoPath: 227 | psp2PatchOriginalPackage: 228 | psp2PackagePassword: 4P2R391UXaLHbavJvFZGfO47XWS2qVOw 229 | psp2KeystoneFile: 230 | psp2MemoryExpansionMode: 0 231 | psp2DRMType: 0 232 | psp2StorageType: 0 233 | psp2MediaCapacity: 0 234 | psp2DLCConfigPath: 235 | psp2ThumbnailPath: 236 | psp2BackgroundPath: 237 | psp2SoundPath: 238 | psp2TrophyCommId: 239 | psp2TrophyPackagePath: 240 | psp2PackagedResourcesPath: 241 | psp2SaveDataQuota: 10240 242 | psp2ParentalLevel: 1 243 | psp2ShortTitle: Not Set 244 | psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF 245 | psp2Category: 0 246 | psp2MasterVersion: 01.00 247 | psp2AppVersion: 01.00 248 | psp2TVBootMode: 0 249 | psp2EnterButtonAssignment: 2 250 | psp2TVDisableEmu: 0 251 | psp2AllowTwitterDialog: 1 252 | psp2Upgradable: 0 253 | psp2HealthWarning: 0 254 | psp2UseLibLocation: 0 255 | psp2InfoBarOnStartup: 0 256 | psp2InfoBarColor: 0 257 | psmSplashimage: {fileID: 0} 258 | spritePackerPolicy: 259 | scriptingDefineSymbols: {} 260 | metroPackageName: KvantStream 261 | metroPackageLogo: 262 | metroPackageLogo140: 263 | metroPackageLogo180: 264 | metroPackageLogo240: 265 | metroPackageVersion: 266 | metroCertificatePath: 267 | metroCertificatePassword: 268 | metroCertificateSubject: 269 | metroCertificateIssuer: 270 | metroCertificateNotAfter: 0000000000000000 271 | metroApplicationDescription: KvantStream 272 | metroStoreTileLogo80: 273 | metroStoreTileLogo: 274 | metroStoreTileLogo140: 275 | metroStoreTileLogo180: 276 | metroStoreTileWideLogo80: 277 | metroStoreTileWideLogo: 278 | metroStoreTileWideLogo140: 279 | metroStoreTileWideLogo180: 280 | metroStoreTileSmallLogo80: 281 | metroStoreTileSmallLogo: 282 | metroStoreTileSmallLogo140: 283 | metroStoreTileSmallLogo180: 284 | metroStoreSmallTile80: 285 | metroStoreSmallTile: 286 | metroStoreSmallTile140: 287 | metroStoreSmallTile180: 288 | metroStoreLargeTile80: 289 | metroStoreLargeTile: 290 | metroStoreLargeTile140: 291 | metroStoreLargeTile180: 292 | metroStoreSplashScreenImage: 293 | metroStoreSplashScreenImage140: 294 | metroStoreSplashScreenImage180: 295 | metroPhoneAppIcon: 296 | metroPhoneAppIcon140: 297 | metroPhoneAppIcon240: 298 | metroPhoneSmallTile: 299 | metroPhoneSmallTile140: 300 | metroPhoneSmallTile240: 301 | metroPhoneMediumTile: 302 | metroPhoneMediumTile140: 303 | metroPhoneMediumTile240: 304 | metroPhoneWideTile: 305 | metroPhoneWideTile140: 306 | metroPhoneWideTile240: 307 | metroPhoneSplashScreenImage: 308 | metroPhoneSplashScreenImage140: 309 | metroPhoneSplashScreenImage240: 310 | metroTileShortName: 311 | metroCommandLineArgsFile: 312 | metroTileShowName: 0 313 | metroMediumTileShowName: 0 314 | metroLargeTileShowName: 0 315 | metroWideTileShowName: 0 316 | metroDefaultTileSize: 1 317 | metroTileForegroundText: 1 318 | metroTileBackgroundColor: {r: 0, g: 0, b: 0, a: 1} 319 | metroSplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1} 320 | metroSplashScreenUseBackgroundColor: 0 321 | platformCapabilities: {} 322 | metroFTAName: 323 | metroFTAFileTypes: [] 324 | metroProtocolName: 325 | metroCompilationOverrides: 1 326 | blackberryDeviceAddress: 327 | blackberryDevicePassword: 328 | blackberryTokenPath: 329 | blackberryTokenExires: 330 | blackberryTokenAuthor: 331 | blackberryTokenAuthorId: 332 | blackberryCskPassword: 333 | blackberrySaveLogPath: 334 | blackberrySharedPermissions: 0 335 | blackberryCameraPermissions: 0 336 | blackberryGPSPermissions: 0 337 | blackberryDeviceIDPermissions: 0 338 | blackberryMicrophonePermissions: 0 339 | blackberryGamepadSupport: 0 340 | blackberryBuildId: 0 341 | blackberryLandscapeSplashScreen: {fileID: 0} 342 | blackberryPortraitSplashScreen: {fileID: 0} 343 | blackberrySquareSplashScreen: {fileID: 0} 344 | tizenProductDescription: 345 | tizenProductURL: 346 | tizenSigningProfileName: 347 | tizenGPSPermissions: 0 348 | tizenMicrophonePermissions: 0 349 | stvDeviceAddress: 350 | stvProductDescription: 351 | stvProductAuthor: 352 | stvProductAuthorEmail: 353 | stvProductLink: 354 | stvProductCategory: 0 355 | XboxOneProductId: 356 | XboxOneUpdateKey: 357 | XboxOneSandboxId: 358 | XboxOneContentId: 359 | XboxOneTitleId: 360 | XboxOneSCId: 361 | XboxOneGameOsOverridePath: 362 | XboxOnePackagingOverridePath: 363 | XboxOneAppManifestOverridePath: 364 | XboxOnePackageEncryption: 0 365 | XboxOnePackageUpdateGranularity: 2 366 | XboxOneDescription: 367 | XboxOneIsContentPackage: 0 368 | XboxOneEnableGPUVariability: 0 369 | XboxOneSockets: {} 370 | XboxOneSplashScreen: {fileID: 0} 371 | XboxOneAllowedProductIds: [] 372 | XboxOnePersistentLocalStorageSize: 0 373 | intPropertyNames: 374 | - WebGL::ScriptingBackend 375 | - WebGL::audioCompressionFormat 376 | - WebGL::exceptionSupport 377 | - WebGL::memorySize 378 | - iOS::Architecture 379 | - iOS::ScriptingBackend 380 | WebGL::ScriptingBackend: 1 381 | WebGL::audioCompressionFormat: 4 382 | WebGL::exceptionSupport: 1 383 | WebGL::memorySize: 256 384 | iOS::Architecture: 2 385 | iOS::ScriptingBackend: 1 386 | boolPropertyNames: 387 | - WebGL::analyzeBuildSize 388 | - WebGL::dataCaching 389 | - WebGL::useEmbeddedResources 390 | - XboxOne::enus 391 | WebGL::analyzeBuildSize: 0 392 | WebGL::dataCaching: 0 393 | WebGL::useEmbeddedResources: 0 394 | XboxOne::enus: 1 395 | stringPropertyNames: 396 | - WebGL::emscriptenArgs 397 | - WebGL::template 398 | WebGL::emscriptenArgs: 399 | WebGL::template: APPLICATION:Default 400 | firstStreamedSceneWithResources: 0 401 | cloudProjectId: 402 | projectId: 403 | projectName: 404 | organizationId: 405 | cloudEnabled: 0 406 | -------------------------------------------------------------------------------- /Assets/Test.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: .0627451017, g: .0941176564, b: .145098045, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: .0599999987 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: c38eff46e3bbf4f06a4ea1a68a682a00, type: 2} 29 | m_HaloStrength: .5 30 | m_FlareStrength: 1 31 | m_FlareFadeSpeed: 3 32 | m_HaloTexture: {fileID: 0} 33 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 34 | m_DefaultReflectionMode: 0 35 | m_DefaultReflectionResolution: 128 36 | m_ReflectionBounces: 1 37 | m_ReflectionIntensity: 1 38 | m_CustomReflection: {fileID: 0} 39 | m_Sun: {fileID: 0} 40 | --- !u!127 &3 41 | LevelGameManager: 42 | m_ObjectHideFlags: 0 43 | --- !u!157 &4 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 5 47 | m_GIWorkflowMode: 0 48 | m_LightmapsMode: 1 49 | m_GISettings: 50 | serializedVersion: 2 51 | m_BounceScale: 1 52 | m_IndirectOutputScale: 1 53 | m_AlbedoBoost: 1 54 | m_TemporalCoherenceThreshold: 1 55 | m_EnvironmentLightingMode: 0 56 | m_EnableBakedLightmaps: 1 57 | m_EnableRealtimeLightmaps: 1 58 | m_LightmapEditorSettings: 59 | serializedVersion: 3 60 | m_Resolution: 2 61 | m_BakeResolution: 40 62 | m_TextureWidth: 1024 63 | m_TextureHeight: 1024 64 | m_AOMaxDistance: 1 65 | m_Padding: 2 66 | m_CompAOExponent: 0 67 | m_LightmapParameters: {fileID: 0} 68 | m_TextureCompression: 1 69 | m_FinalGather: 0 70 | m_FinalGatherRayCount: 1024 71 | m_LightmapSnapshot: {fileID: 0} 72 | m_RuntimeCPUUsage: 25 73 | --- !u!196 &5 74 | NavMeshSettings: 75 | serializedVersion: 2 76 | m_ObjectHideFlags: 0 77 | m_BuildSettings: 78 | serializedVersion: 2 79 | agentRadius: .5 80 | agentHeight: 2 81 | agentSlope: 45 82 | agentClimb: .400000006 83 | ledgeDropHeight: 0 84 | maxJumpAcrossDistance: 0 85 | accuratePlacement: 0 86 | minRegionArea: 2 87 | cellSize: .166666672 88 | manualCellSize: 0 89 | m_NavMeshData: {fileID: 0} 90 | --- !u!1 &326565777 91 | GameObject: 92 | m_ObjectHideFlags: 0 93 | m_PrefabParentObject: {fileID: 0} 94 | m_PrefabInternal: {fileID: 0} 95 | serializedVersion: 4 96 | m_Component: 97 | - 4: {fileID: 326565778} 98 | - 114: {fileID: 326565779} 99 | m_Layer: 0 100 | m_Name: Camera Pivot 101 | m_TagString: Untagged 102 | m_Icon: {fileID: 0} 103 | m_NavMeshLayer: 0 104 | m_StaticEditorFlags: 0 105 | m_IsActive: 1 106 | --- !u!4 &326565778 107 | Transform: 108 | m_ObjectHideFlags: 0 109 | m_PrefabParentObject: {fileID: 0} 110 | m_PrefabInternal: {fileID: 0} 111 | m_GameObject: {fileID: 326565777} 112 | m_LocalRotation: {x: 0, y: .104528472, z: 0, w: .994521916} 113 | m_LocalPosition: {x: 0, y: 0, z: 0} 114 | m_LocalScale: {x: 1, y: 1, z: 1} 115 | m_Children: 116 | - {fileID: 2010005518} 117 | m_Father: {fileID: 0} 118 | m_RootOrder: 2 119 | --- !u!114 &326565779 120 | MonoBehaviour: 121 | m_ObjectHideFlags: 0 122 | m_PrefabParentObject: {fileID: 0} 123 | m_PrefabInternal: {fileID: 0} 124 | m_GameObject: {fileID: 326565777} 125 | m_Enabled: 1 126 | m_EditorHideFlags: 0 127 | m_Script: {fileID: 11500000, guid: f91a6fa75d39940268b68c6204273e22, type: 3} 128 | m_Name: 129 | m_EditorClassIdentifier: 130 | position: 131 | mode: 0 132 | velocity: 1 133 | arbitraryVector: {x: 0, y: 1, z: 0} 134 | randomness: 0 135 | rotation: 136 | mode: 2 137 | velocity: 30 138 | arbitraryVector: {x: 0, y: 1, z: 0} 139 | randomness: 0 140 | useLocalCoordinate: 1 141 | --- !u!1 &1113537728 142 | GameObject: 143 | m_ObjectHideFlags: 0 144 | m_PrefabParentObject: {fileID: 0} 145 | m_PrefabInternal: {fileID: 0} 146 | serializedVersion: 4 147 | m_Component: 148 | - 4: {fileID: 1113537730} 149 | - 108: {fileID: 1113537729} 150 | m_Layer: 0 151 | m_Name: Directional Light 152 | m_TagString: Untagged 153 | m_Icon: {fileID: 0} 154 | m_NavMeshLayer: 0 155 | m_StaticEditorFlags: 0 156 | m_IsActive: 1 157 | --- !u!108 &1113537729 158 | Light: 159 | m_ObjectHideFlags: 0 160 | m_PrefabParentObject: {fileID: 0} 161 | m_PrefabInternal: {fileID: 0} 162 | m_GameObject: {fileID: 1113537728} 163 | m_Enabled: 1 164 | serializedVersion: 6 165 | m_Type: 1 166 | m_Color: {r: 1, g: 1, b: 1, a: 1} 167 | m_Intensity: .300000012 168 | m_Range: 10 169 | m_SpotAngle: 30 170 | m_CookieSize: 10 171 | m_Shadows: 172 | m_Type: 2 173 | m_Resolution: -1 174 | m_Strength: 1 175 | m_Bias: .0500000007 176 | m_NormalBias: .400000006 177 | m_Cookie: {fileID: 0} 178 | m_DrawHalo: 0 179 | m_Flare: {fileID: 0} 180 | m_RenderMode: 0 181 | m_CullingMask: 182 | serializedVersion: 2 183 | m_Bits: 4294967295 184 | m_Lightmapping: 4 185 | m_BounceIntensity: 1 186 | m_ShadowRadius: 0 187 | m_ShadowAngle: 0 188 | m_AreaSize: {x: 1, y: 1} 189 | --- !u!4 &1113537730 190 | Transform: 191 | m_ObjectHideFlags: 0 192 | m_PrefabParentObject: {fileID: 0} 193 | m_PrefabInternal: {fileID: 0} 194 | m_GameObject: {fileID: 1113537728} 195 | m_LocalRotation: {x: -3.59673868e-09, y: .999756277, z: -.0220766235, w: -1.6288098e-07} 196 | m_LocalPosition: {x: 0, y: 3, z: 0} 197 | m_LocalScale: {x: 1, y: 1, z: 1} 198 | m_Children: [] 199 | m_Father: {fileID: 0} 200 | m_RootOrder: 0 201 | --- !u!1 &1600744608 202 | GameObject: 203 | m_ObjectHideFlags: 0 204 | m_PrefabParentObject: {fileID: 0} 205 | m_PrefabInternal: {fileID: 0} 206 | serializedVersion: 4 207 | m_Component: 208 | - 4: {fileID: 1600744610} 209 | - 114: {fileID: 1600744609} 210 | m_Layer: 0 211 | m_Name: Stream 212 | m_TagString: Untagged 213 | m_Icon: {fileID: 0} 214 | m_NavMeshLayer: 0 215 | m_StaticEditorFlags: 0 216 | m_IsActive: 1 217 | --- !u!114 &1600744609 218 | MonoBehaviour: 219 | m_ObjectHideFlags: 0 220 | m_PrefabParentObject: {fileID: 0} 221 | m_PrefabInternal: {fileID: 0} 222 | m_GameObject: {fileID: 1600744608} 223 | m_Enabled: 1 224 | m_EditorHideFlags: 0 225 | m_Script: {fileID: 11500000, guid: 9c8daf798f0664336a4e8b9d914d7502, type: 3} 226 | m_Name: 227 | m_EditorClassIdentifier: 228 | _maxParticles: 32768 229 | _emitterPosition: {x: 0, y: 0, z: 20} 230 | _emitterSize: {x: 50, y: 50, z: 50} 231 | _throttle: 1 232 | _direction: {x: -0, y: -0, z: -1} 233 | _minSpeed: 13.02139 234 | _maxSpeed: 26.3101616 235 | _spread: .0309999995 236 | _noiseAmplitude: 11 237 | _noiseFrequency: .104000002 238 | _noiseSpeed: 2.42000008 239 | _color: {r: 1.52358079, g: 1.97518885, b: 2.09299994, a: 1} 240 | _tail: 1 241 | _randomSeed: 0 242 | _debug: 0 243 | _kernelShader: {fileID: 4800000, guid: 6afe8e4e613e44e00bcbd80b0615a8de, type: 3} 244 | _lineShader: {fileID: 4800000, guid: 456607e7d289e480eb05f5bc12ad0fe6, type: 3} 245 | _debugShader: {fileID: 4800000, guid: 6d079a8b94e4546bd8b1c43b825a8305, type: 3} 246 | --- !u!4 &1600744610 247 | Transform: 248 | m_ObjectHideFlags: 0 249 | m_PrefabParentObject: {fileID: 0} 250 | m_PrefabInternal: {fileID: 0} 251 | m_GameObject: {fileID: 1600744608} 252 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 253 | m_LocalPosition: {x: 0, y: 0, z: 0} 254 | m_LocalScale: {x: 1, y: 1, z: 1} 255 | m_Children: [] 256 | m_Father: {fileID: 0} 257 | m_RootOrder: 1 258 | --- !u!1 &1656229776 259 | GameObject: 260 | m_ObjectHideFlags: 0 261 | m_PrefabParentObject: {fileID: 0} 262 | m_PrefabInternal: {fileID: 0} 263 | serializedVersion: 4 264 | m_Component: 265 | - 4: {fileID: 1656229780} 266 | - 33: {fileID: 1656229779} 267 | - 135: {fileID: 1656229778} 268 | - 23: {fileID: 1656229777} 269 | m_Layer: 0 270 | m_Name: Sphere 271 | m_TagString: Untagged 272 | m_Icon: {fileID: 0} 273 | m_NavMeshLayer: 0 274 | m_StaticEditorFlags: 0 275 | m_IsActive: 1 276 | --- !u!23 &1656229777 277 | MeshRenderer: 278 | m_ObjectHideFlags: 0 279 | m_PrefabParentObject: {fileID: 0} 280 | m_PrefabInternal: {fileID: 0} 281 | m_GameObject: {fileID: 1656229776} 282 | m_Enabled: 1 283 | m_CastShadows: 1 284 | m_ReceiveShadows: 1 285 | m_Materials: 286 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 287 | m_SubsetIndices: 288 | m_StaticBatchRoot: {fileID: 0} 289 | m_UseLightProbes: 1 290 | m_ReflectionProbeUsage: 1 291 | m_ProbeAnchor: {fileID: 0} 292 | m_ScaleInLightmap: 1 293 | m_PreserveUVs: 1 294 | m_ImportantGI: 0 295 | m_AutoUVMaxDistance: .5 296 | m_AutoUVMaxAngle: 89 297 | m_LightmapParameters: {fileID: 0} 298 | m_SortingLayerID: 0 299 | m_SortingOrder: 0 300 | --- !u!135 &1656229778 301 | SphereCollider: 302 | m_ObjectHideFlags: 0 303 | m_PrefabParentObject: {fileID: 0} 304 | m_PrefabInternal: {fileID: 0} 305 | m_GameObject: {fileID: 1656229776} 306 | m_Material: {fileID: 0} 307 | m_IsTrigger: 0 308 | m_Enabled: 1 309 | serializedVersion: 2 310 | m_Radius: .5 311 | m_Center: {x: 0, y: 0, z: 0} 312 | --- !u!33 &1656229779 313 | MeshFilter: 314 | m_ObjectHideFlags: 0 315 | m_PrefabParentObject: {fileID: 0} 316 | m_PrefabInternal: {fileID: 0} 317 | m_GameObject: {fileID: 1656229776} 318 | m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0} 319 | --- !u!4 &1656229780 320 | Transform: 321 | m_ObjectHideFlags: 0 322 | m_PrefabParentObject: {fileID: 0} 323 | m_PrefabInternal: {fileID: 0} 324 | m_GameObject: {fileID: 1656229776} 325 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 326 | m_LocalPosition: {x: 0, y: 0, z: 0} 327 | m_LocalScale: {x: 1, y: 1, z: 1} 328 | m_Children: [] 329 | m_Father: {fileID: 0} 330 | m_RootOrder: 3 331 | --- !u!1 &2010005513 332 | GameObject: 333 | m_ObjectHideFlags: 0 334 | m_PrefabParentObject: {fileID: 0} 335 | m_PrefabInternal: {fileID: 0} 336 | serializedVersion: 4 337 | m_Component: 338 | - 4: {fileID: 2010005518} 339 | - 20: {fileID: 2010005517} 340 | - 92: {fileID: 2010005516} 341 | - 124: {fileID: 2010005515} 342 | - 81: {fileID: 2010005514} 343 | - 114: {fileID: 2010005519} 344 | - 114: {fileID: 2010005520} 345 | m_Layer: 0 346 | m_Name: Main Camera 347 | m_TagString: MainCamera 348 | m_Icon: {fileID: 0} 349 | m_NavMeshLayer: 0 350 | m_StaticEditorFlags: 0 351 | m_IsActive: 1 352 | --- !u!81 &2010005514 353 | AudioListener: 354 | m_ObjectHideFlags: 0 355 | m_PrefabParentObject: {fileID: 0} 356 | m_PrefabInternal: {fileID: 0} 357 | m_GameObject: {fileID: 2010005513} 358 | m_Enabled: 1 359 | --- !u!124 &2010005515 360 | Behaviour: 361 | m_ObjectHideFlags: 0 362 | m_PrefabParentObject: {fileID: 0} 363 | m_PrefabInternal: {fileID: 0} 364 | m_GameObject: {fileID: 2010005513} 365 | m_Enabled: 1 366 | --- !u!92 &2010005516 367 | Behaviour: 368 | m_ObjectHideFlags: 0 369 | m_PrefabParentObject: {fileID: 0} 370 | m_PrefabInternal: {fileID: 0} 371 | m_GameObject: {fileID: 2010005513} 372 | m_Enabled: 1 373 | --- !u!20 &2010005517 374 | Camera: 375 | m_ObjectHideFlags: 0 376 | m_PrefabParentObject: {fileID: 0} 377 | m_PrefabInternal: {fileID: 0} 378 | m_GameObject: {fileID: 2010005513} 379 | m_Enabled: 1 380 | serializedVersion: 2 381 | m_ClearFlags: 1 382 | m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438} 383 | m_NormalizedViewPortRect: 384 | serializedVersion: 2 385 | x: 0 386 | y: 0 387 | width: 1 388 | height: 1 389 | near clip plane: .100000001 390 | far clip plane: 300 391 | field of view: 50 392 | orthographic: 0 393 | orthographic size: 5 394 | m_Depth: -1 395 | m_CullingMask: 396 | serializedVersion: 2 397 | m_Bits: 4294967295 398 | m_RenderingPath: -1 399 | m_TargetTexture: {fileID: 0} 400 | m_TargetDisplay: 0 401 | m_HDR: 1 402 | m_OcclusionCulling: 0 403 | m_StereoConvergence: 10 404 | m_StereoSeparation: .0219999999 405 | m_StereoMirrorMode: 0 406 | --- !u!4 &2010005518 407 | Transform: 408 | m_ObjectHideFlags: 0 409 | m_PrefabParentObject: {fileID: 0} 410 | m_PrefabInternal: {fileID: 0} 411 | m_GameObject: {fileID: 2010005513} 412 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 413 | m_LocalPosition: {x: 0, y: 0, z: -5} 414 | m_LocalScale: {x: 1, y: 1, z: 1} 415 | m_Children: [] 416 | m_Father: {fileID: 326565778} 417 | m_RootOrder: 0 418 | --- !u!114 &2010005519 419 | MonoBehaviour: 420 | m_ObjectHideFlags: 0 421 | m_PrefabParentObject: {fileID: 0} 422 | m_PrefabInternal: {fileID: 0} 423 | m_GameObject: {fileID: 2010005513} 424 | m_Enabled: 1 425 | m_EditorHideFlags: 0 426 | m_Script: {fileID: 11500000, guid: d637268abbbb5428e991dd9ec93136f2, type: 3} 427 | m_Name: 428 | m_EditorClassIdentifier: 429 | positionFrequency: .200000003 430 | rotationFrequency: .200000003 431 | positionAmount: .300000012 432 | rotationAmount: 30 433 | positionComponents: {x: 1, y: 1, z: 1} 434 | rotationComponents: {x: 1, y: 1, z: 1} 435 | positionOctave: 3 436 | rotationOctave: 3 437 | --- !u!114 &2010005520 438 | MonoBehaviour: 439 | m_ObjectHideFlags: 0 440 | m_PrefabParentObject: {fileID: 0} 441 | m_PrefabInternal: {fileID: 0} 442 | m_GameObject: {fileID: 2010005513} 443 | m_Enabled: 1 444 | m_EditorHideFlags: 0 445 | m_Script: {fileID: 11500000, guid: ffd37938bd1d34558a64a40ff7419815, type: 3} 446 | m_Name: 447 | m_EditorClassIdentifier: 448 | tweakMode: 1 449 | Threshold: .300000012 450 | MasterAmount: 2 451 | MediumAmount: .200000003 452 | LargeAmount: .400000006 453 | Tint: {r: 1, g: 1, b: 1, a: 1} 454 | KernelSize: 25 455 | MediumKernelScale: 1 456 | LargeKernelScale: 5 457 | BlendMode: 0 458 | HighQuality: 1 459 | videoBloomShader: {fileID: 4800000, guid: 4da5120001c1945e99d8db7be2c8c652, type: 3} 460 | --------------------------------------------------------------------------------