├── .gitattributes ├── .gitignore ├── .gitmodules ├── Assets ├── Kino.meta ├── Kino │ ├── Vision.meta │ └── Vision │ │ ├── Editor.meta │ │ ├── Editor │ │ ├── VisionEditor.cs │ │ └── VisionEditor.cs.meta │ │ ├── Shader.meta │ │ ├── Shader │ │ ├── Common.cginc │ │ ├── Common.cginc.meta │ │ ├── Depth.cginc │ │ ├── Depth.cginc.meta │ │ ├── MotionVectors.cginc │ │ ├── MotionVectors.cginc.meta │ │ ├── Normals.cginc │ │ ├── Normals.cginc.meta │ │ ├── Vision.shader │ │ └── Vision.shader.meta │ │ ├── Vision.cs │ │ └── Vision.cs.meta ├── ParticleMotionVector.meta ├── ParticleMotionVector │ ├── Editor.meta │ ├── Editor │ │ ├── StandardOpaqueInspector.cs │ │ └── StandardOpaqueInspector.cs.meta │ ├── Shaders.meta │ └── Shaders │ │ ├── Common.cginc │ │ ├── Common.cginc.meta │ │ ├── Motion.cginc │ │ ├── Motion.cginc.meta │ │ ├── StandardOpaque.shader │ │ ├── StandardOpaque.shader.meta │ │ ├── Surface.cginc │ │ └── Surface.cginc.meta ├── Submodules.meta ├── Submodules │ └── PostProcessing.meta ├── Test.meta ├── Test │ ├── Models.meta │ ├── Models │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── prop_asteroid_01_mat.mat │ │ │ ├── prop_asteroid_01_mat.mat.meta │ │ │ ├── prop_asteroid_02_mat.mat │ │ │ ├── prop_asteroid_02_mat.mat.meta │ │ │ ├── prop_asteroid_03_mat.mat │ │ │ └── prop_asteroid_03_mat.mat.meta │ │ ├── prop_asteroid_01.FBX │ │ ├── prop_asteroid_01.FBX.meta │ │ ├── prop_asteroid_02.FBX │ │ ├── prop_asteroid_02.FBX.meta │ │ ├── prop_asteroid_03.FBX │ │ └── prop_asteroid_03.FBX.meta │ ├── PostFx.asset │ ├── PostFx.asset.meta │ ├── Skybox.mat │ ├── Skybox.mat.meta │ ├── Test.unity │ ├── Test.unity.meta │ ├── Textures.meta │ └── Textures │ │ ├── prop_asteroid_01_dff.tif │ │ ├── prop_asteroid_01_dff.tif.meta │ │ ├── prop_asteroid_01_nrm.tif │ │ ├── prop_asteroid_01_nrm.tif.meta │ │ ├── prop_asteroid_02_dff.tif │ │ ├── prop_asteroid_02_dff.tif.meta │ │ ├── prop_asteroid_02_nrm.tif │ │ ├── prop_asteroid_02_nrm.tif.meta │ │ ├── prop_asteroid_03_dff.tif │ │ ├── prop_asteroid_03_dff.tif.meta │ │ ├── prop_asteroid_03_nrm.tif │ │ └── prop_asteroid_03_nrm.tif.meta ├── sIBL Archive.meta └── sIBL Archive │ ├── Acknowledgement.txt │ ├── Acknowledgement.txt.meta │ ├── fin4_Env.hdr │ └── fin4_Env.hdr.meta ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset ├── UnityAdsSettings.asset.meta └── UnityConnectSettings.asset └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | 3 | /[Ll]ibrary/ 4 | /[Tt]emp/ 5 | /[Oo]bj/ 6 | /[Bb]uild/ 7 | /[Bb]uilds/ 8 | 9 | # Autogenerated VS/MD solution and project files 10 | ExportedObj/ 11 | *.csproj 12 | *.unityproj 13 | *.sln 14 | *.suo 15 | *.tmp 16 | *.user 17 | *.userprefs 18 | *.pidb 19 | *.booproj 20 | *.svd 21 | 22 | # Unity3D generated meta files 23 | *.pidb.meta 24 | 25 | # Unity3D Generated File On Crash Reports 26 | sysinfo.txt 27 | 28 | # Builds 29 | *.apk 30 | *.unitypackage 31 | 32 | # Windows image file caches 33 | Thumbs.db 34 | ehthumbs.db 35 | 36 | # Folder config file 37 | Desktop.ini 38 | 39 | # Recycle Bin used on file shares 40 | $RECYCLE.BIN/ 41 | 42 | # Windows Installer files 43 | *.cab 44 | *.msi 45 | *.msm 46 | *.msp 47 | 48 | # Windows shortcuts 49 | *.lnk 50 | 51 | # ========================= 52 | # Operating System Files 53 | # ========================= 54 | 55 | # OSX 56 | # ========================= 57 | 58 | .DS_Store 59 | .AppleDouble 60 | .LSOverride 61 | 62 | # Thumbnails 63 | ._* 64 | 65 | # Files that might appear in the root of a volume 66 | .DocumentRevisions-V100 67 | .fseventsd 68 | .Spotlight-V100 69 | .TemporaryItems 70 | .Trashes 71 | .VolumeIcon.icns 72 | 73 | # Directories potentially created on remote AFP share 74 | .AppleDB 75 | .AppleDesktop 76 | Network Trash Folder 77 | Temporary Items 78 | .apdisk 79 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "Assets/Submodules/PostProcessing"] 2 | path = Assets/Submodules/PostProcessing 3 | url = https://github.com/keijiro/PostProcessing 4 | branch = v2 5 | -------------------------------------------------------------------------------- /Assets/Kino.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96d6f0c23b5b349a39907f19574573ef 3 | folderAsset: yes 4 | timeCreated: 1435811145 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vision.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73e4e59414c2afa4a992dc60b7af5377 3 | folderAsset: yes 4 | timeCreated: 1464483257 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa6f18e3d69176d42b2bbfe3522c18b9 3 | folderAsset: yes 4 | timeCreated: 1464425295 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Editor/VisionEditor.cs: -------------------------------------------------------------------------------- 1 | // KinoVision - Frame visualization utility 2 | // https://github.com/keijiro/KinoVision 3 | 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | namespace Kino 8 | { 9 | [CustomEditor(typeof(Vision))] 10 | public sealed class VisionEditor : Editor 11 | { 12 | // Common 13 | SerializedProperty _source; 14 | SerializedProperty _blendRatio; 15 | SerializedProperty _useDepthNormals; 16 | 17 | static GUIContent _textUseDepthNormals = new GUIContent("Use Depth Normals"); 18 | 19 | // Depth 20 | SerializedProperty _depthRepeat; 21 | 22 | static GUIContent _textRepeat = new GUIContent("Repeat"); 23 | 24 | // Normals 25 | SerializedProperty _validateNormals; 26 | 27 | static GUIContent _textCheckValidity = new GUIContent("Check Validity"); 28 | 29 | // Motion vectors 30 | SerializedProperty _motionOverlayAmplitude; 31 | SerializedProperty _motionVectorsAmplitude; 32 | SerializedProperty _motionVectorsResolution; 33 | 34 | static GUIContent _textOverlayAmplitude = new GUIContent("Overlay Amplitude"); 35 | static GUIContent _textArrowsAmplitude = new GUIContent("Arrows Amplitude"); 36 | static GUIContent _textArrowsResolution = new GUIContent("Arrows Resolution"); 37 | 38 | void OnEnable() 39 | { 40 | // Common 41 | _source = serializedObject.FindProperty("_source"); 42 | _blendRatio = serializedObject.FindProperty("_blendRatio"); 43 | _useDepthNormals = serializedObject.FindProperty("_useDepthNormals"); 44 | 45 | // Depth 46 | _depthRepeat = serializedObject.FindProperty("_depthRepeat"); 47 | 48 | // Normals 49 | _validateNormals = serializedObject.FindProperty("_validateNormals"); 50 | 51 | // Motion vectors 52 | _motionOverlayAmplitude = serializedObject.FindProperty("_motionOverlayAmplitude"); 53 | _motionVectorsAmplitude = serializedObject.FindProperty("_motionVectorsAmplitude"); 54 | _motionVectorsResolution = serializedObject.FindProperty("_motionVectorsResolution"); 55 | } 56 | 57 | public override void OnInspectorGUI() 58 | { 59 | serializedObject.Update(); 60 | 61 | EditorGUILayout.PropertyField(_source); 62 | 63 | var source = (Vision.Source)_source.enumValueIndex; 64 | 65 | if (source == Vision.Source.Depth) 66 | { 67 | // Depth 68 | EditorGUILayout.PropertyField(_depthRepeat, _textRepeat); 69 | EditorGUILayout.PropertyField(_useDepthNormals, _textUseDepthNormals); 70 | } 71 | 72 | if (source == Vision.Source.Normals) 73 | { 74 | // Normals 75 | EditorGUILayout.PropertyField(_useDepthNormals, _textUseDepthNormals); 76 | EditorGUI.BeginDisabledGroup(_useDepthNormals.boolValue); 77 | EditorGUILayout.PropertyField(_validateNormals, _textCheckValidity); 78 | EditorGUI.EndDisabledGroup(); 79 | } 80 | 81 | if (source == Vision.Source.MotionVectors) 82 | { 83 | // Motion vectors 84 | EditorGUILayout.PropertyField(_motionOverlayAmplitude, _textOverlayAmplitude); 85 | EditorGUILayout.PropertyField(_motionVectorsAmplitude, _textArrowsAmplitude); 86 | EditorGUILayout.PropertyField(_motionVectorsResolution, _textArrowsResolution); 87 | } 88 | 89 | EditorGUILayout.PropertyField(_blendRatio); 90 | 91 | serializedObject.ApplyModifiedProperties(); 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Editor/VisionEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3dfb7b26a8f9def40a0492dce32db32a 3 | timeCreated: 1464425308 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b1955e5ee5302de4f96cfc7826375b9d 3 | folderAsset: yes 4 | timeCreated: 1464351708 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader/Common.cginc: -------------------------------------------------------------------------------- 1 | // KinoVision - Frame visualization utility 2 | // https://github.com/keijiro/KinoVision 3 | 4 | #include "UnityCG.cginc" 5 | 6 | sampler2D _MainTex; 7 | float4 _MainTex_TexelSize; 8 | float4 _MainTex_ST; 9 | 10 | // Common vertex shader 11 | 12 | struct CommonAttributes 13 | { 14 | float4 position : POSITION; 15 | float2 uv : TEXCOORD; 16 | }; 17 | 18 | struct CommonVaryings 19 | { 20 | float4 position : SV_POSITION; 21 | half2 uv0 : TEXCOORD0; // Screen space UV (supports stereo rendering) 22 | half2 uv1 : TEXCOORD1; // Alternative UV (supports v-flip case) 23 | }; 24 | 25 | CommonVaryings CommonVertex(CommonAttributes input) 26 | { 27 | float2 uv1 = input.uv; 28 | 29 | #if UNITY_UV_STARTS_AT_TOP 30 | if (_MainTex_TexelSize.y < 0) uv1.y = 1 - uv1.y; 31 | #endif 32 | 33 | CommonVaryings o; 34 | o.position = UnityObjectToClipPos(input.position); 35 | o.uv0 = UnityStereoScreenSpaceUVAdjust(input.uv, _MainTex_ST); 36 | o.uv1 = UnityStereoScreenSpaceUVAdjust(uv1, _MainTex_ST); 37 | return o; 38 | } 39 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader/Common.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b1bf50d0d092ce43bd609638f19aa66 3 | timeCreated: 1472190701 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader/Depth.cginc: -------------------------------------------------------------------------------- 1 | // KinoVision - Frame visualization utility 2 | // https://github.com/keijiro/KinoVision 3 | 4 | #include "Common.cginc" 5 | 6 | half _Blend; 7 | half _Repeat; 8 | 9 | sampler2D_float _CameraDepthTexture; 10 | sampler2D _CameraDepthNormalsTexture; 11 | 12 | float LinearizeDepth(float z) 13 | { 14 | float isOrtho = unity_OrthoParams.w; 15 | float isPers = 1 - unity_OrthoParams.w; 16 | z *= _ZBufferParams.x; 17 | return (1 - isOrtho * z) / (isPers * z + _ZBufferParams.y); 18 | } 19 | 20 | half4 DepthFragment(CommonVaryings input) : SV_Target 21 | { 22 | half4 src = tex2D(_MainTex, input.uv0); 23 | 24 | #ifdef USE_CAMERA_DEPTH 25 | float depth = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, input.uv1); 26 | depth = LinearizeDepth(depth); 27 | #else // USE_CAMERA_DEPTH_NORMALS 28 | float4 cdn = tex2D(_CameraDepthNormalsTexture, input.uv1); 29 | float depth = DecodeFloatRG(cdn.zw); 30 | #endif 31 | 32 | float dr = frac(depth * _Repeat); 33 | float d1 = 1 - dr; 34 | float d2 = 1 / (1 + dr * 100); 35 | half3 rgb = half3(d1, d2, d2); 36 | 37 | #if !UNITY_COLORSPACE_GAMMA 38 | rgb = GammaToLinearSpace(rgb); 39 | #endif 40 | 41 | rgb = lerp(src.rgb, rgb, _Blend); 42 | 43 | return half4(rgb, src.a); 44 | } 45 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader/Depth.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eebbdfbe14dd0464ca05a31ac81bbd1b 3 | timeCreated: 1469430001 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader/MotionVectors.cginc: -------------------------------------------------------------------------------- 1 | // KinoVision - Frame visualization utility 2 | // https://github.com/keijiro/KinoVision 3 | 4 | #include "Common.cginc" 5 | 6 | half _Blend; 7 | half _Amplitude; 8 | int _ColumnCount; 9 | int _RowCount; 10 | 11 | sampler2D_half _CameraMotionVectorsTexture; 12 | 13 | // Convert a motion vector into RGBA color. 14 | half4 VectorToColor(float2 mv) 15 | { 16 | half phi = atan2(mv.x, mv.y); 17 | half hue = (phi / UNITY_PI + 1) * 0.5; 18 | 19 | half r = abs(hue * 6 - 3) - 1; 20 | half g = 2 - abs(hue * 6 - 2); 21 | half b = 2 - abs(hue * 6 - 4); 22 | half a = length(mv); 23 | 24 | return saturate(half4(r, g, b, a)); 25 | } 26 | 27 | // Motion vectors overlay shader 28 | half4 OverlayFragment(CommonVaryings input) : SV_Target 29 | { 30 | half4 src = tex2D(_MainTex, input.uv0); 31 | 32 | half2 mv = tex2D(_CameraMotionVectorsTexture, input.uv1).rg * _Amplitude; 33 | half4 mc = VectorToColor(mv); 34 | 35 | half3 rgb = mc.rgb; 36 | #if !UNITY_COLORSPACE_GAMMA 37 | rgb = GammaToLinearSpace(rgb); 38 | #endif 39 | 40 | half src_ratio = saturate(2 - _Blend * 2); 41 | half mc_ratio = saturate(_Blend * 2); 42 | rgb = lerp(src.rgb * src_ratio, rgb, mc.a * mc_ratio); 43 | 44 | return half4(rgb, src.a); 45 | } 46 | 47 | // Motion vector arrow shader 48 | struct ArrowVaryings 49 | { 50 | float4 position : SV_POSITION; 51 | float2 scoord : TEXCOORD; 52 | half4 color : COLOR; 53 | }; 54 | 55 | ArrowVaryings ArrowVertex(uint vertex_id : SV_VertexID) 56 | { 57 | // Screen aspect ratio 58 | float aspect = _ScreenParams.x * (_ScreenParams.w - 1); 59 | float inv_aspect = _ScreenParams.y * (_ScreenParams.z - 1); 60 | 61 | // Vertex IDs 62 | uint arrow_id = vertex_id / 6; 63 | uint point_id = vertex_id - arrow_id * 6; 64 | 65 | // Column/Row number of the arrow 66 | uint row = arrow_id / _ColumnCount; 67 | uint col = arrow_id - row * _ColumnCount; 68 | 69 | // Texture coordinate of the reference point 70 | float2 uv = float2((col + 0.5) / _ColumnCount, (row + 0.5) / _RowCount); 71 | 72 | // Retrieve the motion vector. 73 | half2 mv = tex2Dlod(_CameraMotionVectorsTexture, float4(uv, 0, 0)).rg * _Amplitude; 74 | 75 | // Arrow color 76 | half4 color = VectorToColor(mv); 77 | 78 | // Arrow vertex position parameter (0=origin, 1=head) 79 | float arrow_l = point_id > 0; 80 | 81 | // Rotation matrix for the arrow head 82 | float2 head_dir = normalize(mv * float2(aspect, 1)); 83 | float2x2 head_rot = float2x2(head_dir.y, head_dir.x, -head_dir.x, head_dir.y); 84 | 85 | // Offset for arrow head vertices 86 | float head_x = point_id == 3 ? -1 : (point_id == 5 ? 1 : 0); 87 | head_x *= arrow_l * 0.3 * saturate(length(mv) * _RowCount); 88 | 89 | float2 head_offs = float2(head_x, -abs(head_x)); 90 | head_offs = mul(head_rot, head_offs) * float2(inv_aspect, 1); 91 | 92 | // Vertex position in the clip space 93 | float2 vp = mv * arrow_l + head_offs * 2 / _RowCount + uv * 2 - 1; 94 | 95 | // Convert to the screen coordinates. 96 | float2 scoord = (vp + 1) * 0.5 * _ScreenParams.xy; 97 | 98 | // Snap to a pixel-perfect position. 99 | scoord = round(scoord); 100 | 101 | // Bring back to the clip space. 102 | vp = (scoord + 0.5) * (_ScreenParams.zw - 1) * 2 - 1; 103 | vp.y *= _ProjectionParams.x; 104 | 105 | // Color tweaks 106 | color.rgb = GammaToLinearSpace(lerp(color.rgb, 1, 0.5)); 107 | color.a = _Blend; 108 | 109 | // Output 110 | ArrowVaryings o; 111 | o.position = float4(vp, 0, 1); 112 | o.scoord = scoord; 113 | o.color = color; 114 | return o; 115 | } 116 | 117 | half4 ArrowFragment(ArrowVaryings input) : SV_Target 118 | { 119 | // Pseudo anti-aliasing 120 | float aa = length(frac(input.scoord) - 0.5) / 0.707; 121 | aa *= (aa * (aa * 0.305306011 + 0.682171111) + 0.012522878); // gamma 122 | return half4(input.color.rgb, input.color.a * aa); 123 | } 124 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader/MotionVectors.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2246bf0aa22a89c40b4626c29b0ec051 3 | timeCreated: 1469519947 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader/Normals.cginc: -------------------------------------------------------------------------------- 1 | // KinoVision - Frame visualization utility 2 | // https://github.com/keijiro/KinoVision 3 | 4 | #include "Common.cginc" 5 | 6 | half _Blend; 7 | half _Validate; 8 | 9 | sampler2D _CameraGBufferTexture2; 10 | sampler2D _CameraDepthNormalsTexture; 11 | 12 | half4 NormalsFragment(CommonVaryings input) : SV_Target 13 | { 14 | half4 src = tex2D(_MainTex, input.uv0); 15 | 16 | #ifdef USE_CAMERA_DEPTH_NORMALS 17 | float4 cdn = tex2D(_CameraDepthNormalsTexture, input.uv1); 18 | float3 n = DecodeViewNormalStereo(cdn); 19 | float isZero = (dot(n, 1) == 0); 20 | #else // USE_GBUFFER 21 | float3 n = tex2D(_CameraGBufferTexture2, input.uv1).xyz; 22 | float isZero = (dot(n, 1) == 0); 23 | n = mul((float3x3)unity_WorldToCamera, n * 2 - 1); 24 | n.z = -n.z; 25 | #endif 26 | 27 | float l = length(n); 28 | float invalid = max((float)(l < 0.99), (float)(l > 1.01)) - isZero; 29 | 30 | n = (n + 1) * 0.5; 31 | #if !UNITY_COLORSPACE_GAMMA 32 | n = GammaToLinearSpace(n); 33 | #endif 34 | 35 | half3 rgb = lerp(n, half3(1, 0, 0), invalid * _Validate); 36 | rgb = lerp(src.rgb, rgb, _Blend); 37 | 38 | return half4(rgb, src.a); 39 | } 40 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader/Normals.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e25302734900fa42a55e69d42e867f7 3 | timeCreated: 1469432923 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader/Vision.shader: -------------------------------------------------------------------------------- 1 | // KinoVision - Frame visualization utility 2 | // https://github.com/keijiro/KinoVision 3 | 4 | Shader "Hidden/Kino/Vision" 5 | { 6 | Properties 7 | { 8 | _MainTex("", 2D) = ""{} 9 | } 10 | Subshader 11 | { 12 | // Depth with camera depth texture 13 | Pass 14 | { 15 | ZTest Always Cull Off ZWrite Off 16 | CGPROGRAM 17 | #define USE_CAMERA_DEPTH 18 | #include "Depth.cginc" 19 | #pragma multi_compile _ UNITY_COLORSPACE_GAMMA 20 | #pragma vertex CommonVertex 21 | #pragma fragment DepthFragment 22 | #pragma target 3.0 23 | ENDCG 24 | } 25 | // Depth with camera depth normals texture 26 | Pass 27 | { 28 | ZTest Always Cull Off ZWrite Off 29 | CGPROGRAM 30 | #define USE_CAMERA_DEPTH_NORMALS 31 | #include "Depth.cginc" 32 | #pragma multi_compile _ UNITY_COLORSPACE_GAMMA 33 | #pragma vertex CommonVertex 34 | #pragma fragment DepthFragment 35 | #pragma target 3.0 36 | ENDCG 37 | } 38 | // Depth with camera depth normals texture 39 | Pass 40 | { 41 | ZTest Always Cull Off ZWrite Off 42 | CGPROGRAM 43 | #define USE_CAMERA_DEPTH_NORMALS 44 | #include "Normals.cginc" 45 | #pragma multi_compile _ UNITY_COLORSPACE_GAMMA 46 | #pragma vertex CommonVertex 47 | #pragma fragment NormalsFragment 48 | #pragma target 3.0 49 | ENDCG 50 | } 51 | // Depth with G buffer 52 | Pass 53 | { 54 | ZTest Always Cull Off ZWrite Off 55 | CGPROGRAM 56 | #define USE_GBUFFER 57 | #include "Normals.cginc" 58 | #pragma multi_compile _ UNITY_COLORSPACE_GAMMA 59 | #pragma vertex CommonVertex 60 | #pragma fragment NormalsFragment 61 | #pragma target 3.0 62 | ENDCG 63 | } 64 | // Motion vectors overlay 65 | Pass 66 | { 67 | ZTest Always Cull Off ZWrite Off 68 | CGPROGRAM 69 | #include "MotionVectors.cginc" 70 | #pragma multi_compile _ UNITY_COLORSPACE_GAMMA 71 | #pragma vertex CommonVertex 72 | #pragma fragment OverlayFragment 73 | #pragma target 3.0 74 | ENDCG 75 | } 76 | // Motion vector arrows 77 | Pass 78 | { 79 | Blend SrcAlpha OneMinusSrcAlpha 80 | ZTest Always Cull Off ZWrite Off 81 | CGPROGRAM 82 | #include "MotionVectors.cginc" 83 | #pragma multi_compile _ UNITY_COLORSPACE_GAMMA 84 | #pragma vertex ArrowVertex 85 | #pragma fragment ArrowFragment 86 | #pragma target 3.0 87 | ENDCG 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Shader/Vision.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f104e85b3463c2748a02d2f07582fa63 3 | timeCreated: 1464498944 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Vision.cs: -------------------------------------------------------------------------------- 1 | // KinoVision - Frame visualization utility 2 | // https://github.com/keijiro/KinoVision 3 | 4 | using UnityEngine; 5 | 6 | namespace Kino 7 | { 8 | [ExecuteInEditMode] 9 | [RequireComponent(typeof(Camera))] 10 | [AddComponentMenu("Kino Image Effects/Vision")] 11 | public sealed class Vision : MonoBehaviour 12 | { 13 | #region Common properties 14 | 15 | public enum Source { Depth, Normals, MotionVectors } 16 | 17 | [SerializeField] 18 | Source _source; 19 | 20 | [SerializeField, Range(0, 1)] 21 | float _blendRatio = 0.5f; 22 | 23 | [SerializeField] 24 | bool _useDepthNormals; 25 | 26 | #endregion 27 | 28 | #region Properties for depth 29 | 30 | [SerializeField] 31 | float _depthRepeat = 1; 32 | 33 | #endregion 34 | 35 | #region Properties for normals 36 | 37 | [SerializeField] 38 | bool _validateNormals = false; 39 | 40 | #endregion 41 | 42 | #region Properties for motion vectors 43 | 44 | [SerializeField] 45 | float _motionOverlayAmplitude = 10; 46 | 47 | [SerializeField, Range(0, 10)] 48 | float _motionVectorsAmplitude = 1; 49 | 50 | [SerializeField, Range(8, 64)] 51 | int _motionVectorsResolution = 16; 52 | 53 | #endregion 54 | 55 | #region Private members 56 | 57 | [SerializeField] Shader _shader; 58 | Material _material; 59 | 60 | // Check if the G-buffer is available. 61 | bool IsGBufferAvailable { 62 | get { 63 | var actualPath = GetComponent().actualRenderingPath; 64 | return actualPath == RenderingPath.DeferredShading; 65 | } 66 | } 67 | 68 | #endregion 69 | 70 | #region MonoBehaviour functions 71 | 72 | void OnDestroy() 73 | { 74 | if (_material != null) 75 | if (Application.isPlaying) 76 | Destroy(_material); 77 | else 78 | DestroyImmediate(_material); 79 | } 80 | 81 | void Update() 82 | { 83 | var camera = GetComponent(); 84 | 85 | // Update depth texture mode. 86 | if (_source == Source.Depth) 87 | if (_useDepthNormals) 88 | camera.depthTextureMode |= DepthTextureMode.DepthNormals; 89 | else 90 | camera.depthTextureMode |= DepthTextureMode.Depth; 91 | 92 | if (_source == Source.Normals) 93 | if (_useDepthNormals || !IsGBufferAvailable) 94 | camera.depthTextureMode |= DepthTextureMode.DepthNormals; 95 | 96 | if (_source == Source.MotionVectors) 97 | camera.depthTextureMode |= 98 | DepthTextureMode.Depth | DepthTextureMode.MotionVectors; 99 | } 100 | 101 | void OnRenderImage(RenderTexture source, RenderTexture destination) 102 | { 103 | // Lazy initialization of the material. 104 | if (_material == null) 105 | { 106 | _material = new Material(_shader); 107 | _material.hideFlags = HideFlags.DontSave; 108 | } 109 | 110 | if (_source == Source.Depth) 111 | { 112 | // Depth 113 | _material.SetFloat("_Blend", _blendRatio); 114 | _material.SetFloat("_Repeat", _depthRepeat); 115 | var pass = _useDepthNormals ? 1 : 0; 116 | Graphics.Blit(source, destination, _material, pass); 117 | } 118 | else if (_source == Source.Normals) 119 | { 120 | // Normals 121 | _material.SetFloat("_Blend", _blendRatio); 122 | _material.SetFloat("_Validate", _validateNormals ? 1 : 0); 123 | var pass = (!_useDepthNormals && IsGBufferAvailable) ? 3 : 2; 124 | Graphics.Blit(source, destination, _material, pass); 125 | } 126 | else if (_source == Source.MotionVectors) 127 | { 128 | // Motion vectors (overlay) 129 | _material.SetFloat("_Blend", _blendRatio); 130 | _material.SetFloat("_Amplitude", _motionOverlayAmplitude); 131 | Graphics.Blit(source, destination, _material, 4); 132 | 133 | // Motion vectors (arrays) 134 | var rows = _motionVectorsResolution; 135 | var cols = rows * source.width / source.height; 136 | _material.SetInt("_ColumnCount", cols); 137 | _material.SetInt("_RowCount", rows); 138 | _material.SetFloat("_Amplitude", _motionVectorsAmplitude); 139 | _material.SetPass(5); 140 | Graphics.DrawProcedural(MeshTopology.Lines, cols * rows * 6, 1); 141 | } 142 | } 143 | 144 | #endregion 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /Assets/Kino/Vision/Vision.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3a1e83ab3c6c9d7468fff9be485a1390 3 | timeCreated: 1469520261 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: 8 | - _shader: {fileID: 4800000, guid: f104e85b3463c2748a02d2f07582fa63, type: 3} 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a4a4a9b4e9cdf94ab086cebff5139c8 3 | folderAsset: yes 4 | timeCreated: 1505296659 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00247c58d8a6f164aa5d1821d2bfb59a 3 | folderAsset: yes 4 | timeCreated: 1505982973 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Editor/StandardOpaqueInspector.cs: -------------------------------------------------------------------------------- 1 | // ParticleMotionVector - Example implementation of motion vector writer for 2 | // mesh particle systems | https://github.com/keijiro/ParticleMotionVector 3 | 4 | using UnityEngine; 5 | using UnityEditor; 6 | 7 | namespace ParticleMotionVector 8 | { 9 | class StandardOpaqueGUI : ShaderGUI 10 | { 11 | static class Styles 12 | { 13 | public static readonly GUIContent albedo = new GUIContent("Albedo"); 14 | public static readonly GUIContent normalMap = new GUIContent("Normal Map"); 15 | } 16 | 17 | public override void OnGUI(MaterialEditor editor, MaterialProperty[] props) 18 | { 19 | var texture = FindProperty("_MainTex", props); 20 | var option = FindProperty("_Color", props); 21 | editor.TexturePropertySingleLine(Styles.albedo, texture, option); 22 | 23 | EditorGUILayout.Space(); 24 | 25 | editor.ShaderProperty(FindProperty("_Glossiness", props), "Smoothness"); 26 | editor.ShaderProperty(FindProperty("_Metallic", props), "Metallic"); 27 | 28 | EditorGUILayout.Space(); 29 | 30 | texture = FindProperty("_BumpMap", props); 31 | option = texture != null ? FindProperty("_BumpScale", props) : null; 32 | editor.TexturePropertySingleLine(Styles.normalMap, texture, option); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Editor/StandardOpaqueInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afe7ab541afbe9144a0034736de67899 3 | timeCreated: 1505982983 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/ParticleMotionVector/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f855ffc3d7d3bca4ca7829df87b3cb0a 3 | folderAsset: yes 4 | timeCreated: 1505982959 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Shaders/Common.cginc: -------------------------------------------------------------------------------- 1 | // ParticleMotionVector - Example implementation of motion vector writer for 2 | // mesh particle systems | https://github.com/keijiro/ParticleMotionVector 3 | 4 | #include "UnityCG.cginc" 5 | 6 | struct CustomAttributes 7 | { 8 | float4 position : POSITION; 9 | float4 texcoord0 : TEXCOORD0; // uv.xy, center.xy 10 | float4 texcoord1 : TEXCOORD1; // center.z, velocity.xyz 11 | float4 texcoord2 : TEXCOORD2; // rotation.xyz, rotationspeed.x 12 | float2 texcoord3 : TEXCOORD3; // rotationspeed.yz 13 | }; 14 | 15 | float3 GetCenter(CustomAttributes input) 16 | { 17 | return float3(input.texcoord0.zw, input.texcoord1.x); 18 | } 19 | 20 | float3 GetVelocity(CustomAttributes input) 21 | { 22 | return input.texcoord1.yzw; 23 | } 24 | 25 | float3 GetRotation(CustomAttributes input) 26 | { 27 | return input.texcoord2.xyz; 28 | } 29 | 30 | float3 GetRotationSpeed(CustomAttributes input) 31 | { 32 | return float3(input.texcoord2.w, input.texcoord3.xy); 33 | } 34 | 35 | float3x3 Euler3x3(float3 v) 36 | { 37 | float sx, cx; 38 | float sy, cy; 39 | float sz, cz; 40 | 41 | sincos(v.x, sx, cx); 42 | sincos(v.y, sy, cy); 43 | sincos(v.z, sz, cz); 44 | 45 | float3 row1 = float3(sx*sy*sz + cy*cz, sx*sy*cz - cy*sz, cx*sy); 46 | float3 row3 = float3(sx*cy*sz - sy*cz, sx*cy*cz + sy*sz, cx*cy); 47 | float3 row2 = float3(cx*sz, cx*cz, -sx); 48 | 49 | return float3x3(row1, row2, row3); 50 | } 51 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Shaders/Common.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8dfa41b1a4f989a40b0d96b3c1dc88a9 3 | timeCreated: 1505291162 4 | licenseType: Pro 5 | ShaderImporter: 6 | externalObjects: {} 7 | defaultTextures: [] 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Shaders/Motion.cginc: -------------------------------------------------------------------------------- 1 | // ParticleMotionVector - Example implementation of motion vector writer for 2 | // mesh particle systems | https://github.com/keijiro/ParticleMotionVector 3 | 4 | #include "Common.cginc" 5 | 6 | float4x4 _NonJitteredVP; 7 | float4x4 _PreviousVP; 8 | 9 | struct Varyings 10 | { 11 | float4 vertex : SV_POSITION; 12 | float4 transfer0 : TEXCOORD0; 13 | float4 transfer1 : TEXCOORD1; 14 | }; 15 | 16 | float3 CalculatePreviousPosition(CustomAttributes input) 17 | { 18 | float dt = unity_DeltaTime.x; 19 | 20 | // Current rotation 21 | float3 r1 = GetRotation(input); 22 | 23 | // Inverse current rotation matrix 24 | float3x3 imr1 = transpose(Euler3x3(r1)); 25 | 26 | // Previous rotation matrix 27 | float3x3 mr0 = Euler3x3(r1 - GetRotationSpeed(input) * dt); 28 | 29 | // Current center position 30 | float3 p1 = GetCenter(input); 31 | 32 | // Previous center position 33 | float3 p0 = p1 - mul(imr1, GetVelocity(input)) * dt; 34 | 35 | // Take back to the origin, apply the inverse rotation, then reapply the 36 | // previous rotation and position. 37 | return mul(mr0, mul(imr1, input.position.xyz - p1)) + p0; 38 | } 39 | 40 | Varyings Vertex(CustomAttributes input) 41 | { 42 | float4 vp0 = float4(CalculatePreviousPosition(input), 1); 43 | float4 vp1 = input.position; 44 | 45 | Varyings o; 46 | o.vertex = UnityObjectToClipPos(vp1); 47 | o.transfer0 = mul(_PreviousVP, vp0); 48 | o.transfer1 = mul(_NonJitteredVP, vp1); 49 | return o; 50 | } 51 | 52 | half4 Fragment(Varyings input) : SV_Target 53 | { 54 | float3 hp0 = input.transfer0.xyz / input.transfer0.w; 55 | float3 hp1 = input.transfer1.xyz / input.transfer1.w; 56 | 57 | float2 vp0 = (hp0.xy + 1) / 2; 58 | float2 vp1 = (hp1.xy + 1) / 2; 59 | 60 | #if UNITY_UV_STARTS_AT_TOP 61 | vp0.y = 1 - vp0.y; 62 | vp1.y = 1 - vp1.y; 63 | #endif 64 | 65 | return half4(vp1 - vp0, 0, 1); 66 | } 67 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Shaders/Motion.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48d78b75f36a5de43b586176fa9d6054 3 | timeCreated: 1478836031 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Shaders/StandardOpaque.shader: -------------------------------------------------------------------------------- 1 | // ParticleMotionVector - Example implementation of motion vector writer for 2 | // mesh particle systems | https://github.com/keijiro/ParticleMotionVector 3 | 4 | Shader "Particles/Standard Opaque with Motion Vectors" 5 | { 6 | Properties 7 | { 8 | _MainTex("Albedo (RGB)", 2D) = "white" {} 9 | _Color("Color", Color) = (1,1,1,1) 10 | 11 | [Gamma] _Metallic("Metallic", Range(0, 1)) = 0 12 | _Glossiness("Smoothness", Range(0, 1)) = 0.5 13 | 14 | _BumpMap("Normal Map", 2D) = "bump" {} 15 | _BumpScale("Scale", Float) = 1 16 | } 17 | SubShader 18 | { 19 | Tags { "RenderType"="Opaque" } 20 | 21 | Pass 22 | { 23 | Tags { "LightMode" = "MotionVectors" } 24 | ZWrite Off 25 | 26 | CGPROGRAM 27 | #pragma vertex Vertex 28 | #pragma fragment Fragment 29 | #pragma target 3.5 30 | #include "Motion.cginc" 31 | ENDCG 32 | } 33 | 34 | CGPROGRAM 35 | #pragma surface surf Standard fullforwardshadows addshadow nolightmap 36 | #pragma target 3.5 37 | #include "Surface.cginc" 38 | ENDCG 39 | } 40 | 41 | FallBack "Diffuse" 42 | CustomEditor "ParticleMotionVector.StandardOpaqueGUI" 43 | } 44 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Shaders/StandardOpaque.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e2c60d973d8f864893448b991b44a4d 3 | timeCreated: 1478835436 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Shaders/Surface.cginc: -------------------------------------------------------------------------------- 1 | // ParticleMotionVector - Example implementation of motion vector writer for 2 | // mesh particle systems | https://github.com/keijiro/ParticleMotionVector 3 | 4 | #include "Common.cginc" 5 | 6 | struct Input 7 | { 8 | float2 uv_MainTex; 9 | float4 color : COLOR; 10 | }; 11 | 12 | sampler2D _MainTex; 13 | sampler2D _BumpMap; 14 | 15 | fixed4 _Color; 16 | half _Metallic; 17 | half _Glossiness; 18 | half _BumpScale; 19 | 20 | void surf(Input IN, inout SurfaceOutputStandard o) 21 | { 22 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 23 | o.Albedo = IN.color.rgb * c.rgb; 24 | o.Metallic = _Metallic; 25 | o.Smoothness = _Glossiness; 26 | o.Normal = UnpackScaleNormal(tex2D(_BumpMap, IN.uv_MainTex), _BumpScale); 27 | o.Alpha = c.a; 28 | } 29 | -------------------------------------------------------------------------------- /Assets/ParticleMotionVector/Shaders/Surface.cginc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e54ca7f07c6dbd54e8a31bc4c900f51f 3 | timeCreated: 1478835635 4 | licenseType: Pro 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Submodules.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 41208894f0b530a41ac26b5af49ad054 3 | folderAsset: yes 4 | timeCreated: 1505298237 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Submodules/PostProcessing.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 52dbc6f76756b11468f0352c4b09fb8b 3 | folderAsset: yes 4 | timeCreated: 1505298237 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 810c414971c456a4fa1bd5d38f672993 3 | folderAsset: yes 4 | timeCreated: 1505296630 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Models.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f38d8841241ac844bb7dda393826ded9 3 | folderAsset: yes 4 | timeCreated: 1505809144 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Models/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e339edc8e4470194291bdfaebf20828b 3 | folderAsset: yes 4 | timeCreated: 1505809164 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Models/Materials/prop_asteroid_01_mat.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Models/Materials/prop_asteroid_01_mat.mat -------------------------------------------------------------------------------- /Assets/Test/Models/Materials/prop_asteroid_01_mat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26942a1db988594448ad62b0b27d0c00 3 | timeCreated: 1505809164 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Models/Materials/prop_asteroid_02_mat.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Models/Materials/prop_asteroid_02_mat.mat -------------------------------------------------------------------------------- /Assets/Test/Models/Materials/prop_asteroid_02_mat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9d1ba88ec33a0d43a670f3ad4619088 3 | timeCreated: 1505809164 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Models/Materials/prop_asteroid_03_mat.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Models/Materials/prop_asteroid_03_mat.mat -------------------------------------------------------------------------------- /Assets/Test/Models/Materials/prop_asteroid_03_mat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aca64b6496164d74db5bb0a1c4eeb62e 3 | timeCreated: 1505809164 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Models/prop_asteroid_01.FBX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Models/prop_asteroid_01.FBX -------------------------------------------------------------------------------- /Assets/Test/Models/prop_asteroid_01.FBX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: baedbbad82997f445a8cb4da210404e0 3 | ModelImporter: 4 | serializedVersion: 18 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2300000: //RootNode 9 | 3300000: //RootNode 10 | 4300000: Group1 11 | 4300002: prop_asteroid_01 12 | 9500000: //RootNode 13 | materials: 14 | importMaterials: 1 15 | materialName: 1 16 | materialSearch: 1 17 | animations: 18 | legacyGenerateAnimations: 4 19 | bakeSimulation: 0 20 | optimizeGameObjects: 0 21 | motionNodeName: 22 | animationImportErrors: 23 | animationImportWarnings: 24 | animationRetargetingWarnings: 25 | animationDoRetargetingWarnings: 0 26 | animationCompression: 1 27 | animationRotationError: .5 28 | animationPositionError: .5 29 | animationScaleError: .5 30 | animationWrapMode: 0 31 | extraExposedTransformPaths: [] 32 | clipAnimations: [] 33 | isReadable: 1 34 | meshes: 35 | lODScreenPercentages: [] 36 | globalScale: .00999999978 37 | meshCompression: 0 38 | addColliders: 0 39 | importBlendShapes: 1 40 | swapUVChannels: 0 41 | generateSecondaryUV: 0 42 | useFileUnits: 1 43 | optimizeMeshForGPU: 1 44 | keepQuads: 0 45 | weldVertices: 1 46 | secondaryUVAngleDistortion: 8 47 | secondaryUVAreaDistortion: 15.000001 48 | secondaryUVHardAngle: 88 49 | secondaryUVPackMargin: 4 50 | useFileScale: 0 51 | tangentSpace: 52 | normalSmoothAngle: 60 53 | splitTangentsAcrossUV: 1 54 | normalImportMode: 0 55 | tangentImportMode: 1 56 | importAnimation: 0 57 | copyAvatar: 0 58 | humanDescription: 59 | human: [] 60 | skeleton: [] 61 | armTwist: .5 62 | foreArmTwist: .5 63 | upperLegTwist: .5 64 | legTwist: .5 65 | armStretch: .0500000007 66 | legStretch: .0500000007 67 | feetSpacing: 0 68 | rootMotionBoneName: 69 | lastHumanDescriptionAvatarSource: {instanceID: 0} 70 | animationType: 0 71 | additionalBone: 0 72 | userData: 73 | assetBundleName: 74 | assetBundleVariant: 75 | -------------------------------------------------------------------------------- /Assets/Test/Models/prop_asteroid_02.FBX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Models/prop_asteroid_02.FBX -------------------------------------------------------------------------------- /Assets/Test/Models/prop_asteroid_02.FBX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9afa958d6d8235941b9badb42aae4370 3 | ModelImporter: 4 | serializedVersion: 18 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2300000: //RootNode 9 | 3300000: //RootNode 10 | 4300000: Asteroid_02 11 | 4300002: prop_asteroid_02 12 | 9500000: //RootNode 13 | materials: 14 | importMaterials: 1 15 | materialName: 1 16 | materialSearch: 1 17 | animations: 18 | legacyGenerateAnimations: 4 19 | bakeSimulation: 0 20 | optimizeGameObjects: 0 21 | motionNodeName: 22 | animationImportErrors: 23 | animationImportWarnings: 24 | animationRetargetingWarnings: 25 | animationDoRetargetingWarnings: 0 26 | animationCompression: 1 27 | animationRotationError: .5 28 | animationPositionError: .5 29 | animationScaleError: .5 30 | animationWrapMode: 0 31 | extraExposedTransformPaths: [] 32 | clipAnimations: [] 33 | isReadable: 1 34 | meshes: 35 | lODScreenPercentages: [] 36 | globalScale: .00999999978 37 | meshCompression: 0 38 | addColliders: 0 39 | importBlendShapes: 1 40 | swapUVChannels: 0 41 | generateSecondaryUV: 0 42 | useFileUnits: 1 43 | optimizeMeshForGPU: 1 44 | keepQuads: 0 45 | weldVertices: 1 46 | secondaryUVAngleDistortion: 8 47 | secondaryUVAreaDistortion: 15.000001 48 | secondaryUVHardAngle: 88 49 | secondaryUVPackMargin: 4 50 | useFileScale: 0 51 | tangentSpace: 52 | normalSmoothAngle: 60 53 | splitTangentsAcrossUV: 1 54 | normalImportMode: 0 55 | tangentImportMode: 1 56 | importAnimation: 0 57 | copyAvatar: 0 58 | humanDescription: 59 | human: [] 60 | skeleton: [] 61 | armTwist: .5 62 | foreArmTwist: .5 63 | upperLegTwist: .5 64 | legTwist: .5 65 | armStretch: .0500000007 66 | legStretch: .0500000007 67 | feetSpacing: 0 68 | rootMotionBoneName: 69 | lastHumanDescriptionAvatarSource: {instanceID: 0} 70 | animationType: 0 71 | additionalBone: 0 72 | userData: 73 | assetBundleName: 74 | assetBundleVariant: 75 | -------------------------------------------------------------------------------- /Assets/Test/Models/prop_asteroid_03.FBX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Models/prop_asteroid_03.FBX -------------------------------------------------------------------------------- /Assets/Test/Models/prop_asteroid_03.FBX.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2768a9a4c8d289840918dcb879705893 3 | ModelImporter: 4 | serializedVersion: 18 5 | fileIDToRecycleName: 6 | 100000: //RootNode 7 | 400000: //RootNode 8 | 2300000: //RootNode 9 | 3300000: //RootNode 10 | 4300000: Asteroid_03 11 | 4300002: prop_asteroid_03 12 | 9500000: //RootNode 13 | materials: 14 | importMaterials: 1 15 | materialName: 1 16 | materialSearch: 1 17 | animations: 18 | legacyGenerateAnimations: 4 19 | bakeSimulation: 0 20 | optimizeGameObjects: 0 21 | motionNodeName: 22 | animationImportErrors: 23 | animationImportWarnings: 24 | animationRetargetingWarnings: 25 | animationDoRetargetingWarnings: 0 26 | animationCompression: 1 27 | animationRotationError: .5 28 | animationPositionError: .5 29 | animationScaleError: .5 30 | animationWrapMode: 0 31 | extraExposedTransformPaths: [] 32 | clipAnimations: [] 33 | isReadable: 1 34 | meshes: 35 | lODScreenPercentages: [] 36 | globalScale: .00999999978 37 | meshCompression: 0 38 | addColliders: 0 39 | importBlendShapes: 1 40 | swapUVChannels: 0 41 | generateSecondaryUV: 0 42 | useFileUnits: 1 43 | optimizeMeshForGPU: 1 44 | keepQuads: 0 45 | weldVertices: 1 46 | secondaryUVAngleDistortion: 8 47 | secondaryUVAreaDistortion: 15.000001 48 | secondaryUVHardAngle: 88 49 | secondaryUVPackMargin: 4 50 | useFileScale: 0 51 | tangentSpace: 52 | normalSmoothAngle: 60 53 | splitTangentsAcrossUV: 1 54 | normalImportMode: 0 55 | tangentImportMode: 1 56 | importAnimation: 0 57 | copyAvatar: 0 58 | humanDescription: 59 | human: [] 60 | skeleton: [] 61 | armTwist: .5 62 | foreArmTwist: .5 63 | upperLegTwist: .5 64 | legTwist: .5 65 | armStretch: .0500000007 66 | legStretch: .0500000007 67 | feetSpacing: 0 68 | rootMotionBoneName: 69 | lastHumanDescriptionAvatarSource: {instanceID: 0} 70 | animationType: 0 71 | additionalBone: 0 72 | userData: 73 | assetBundleName: 74 | assetBundleVariant: 75 | -------------------------------------------------------------------------------- /Assets/Test/PostFx.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/PostFx.asset -------------------------------------------------------------------------------- /Assets/Test/PostFx.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d9541d54403cb846b5dcf40ef24ba66 3 | timeCreated: 1505292995 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 11400000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Test/Skybox.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Skybox.mat -------------------------------------------------------------------------------- /Assets/Test/Skybox.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 980e6f4c0f67890438073631cc57c436 3 | timeCreated: 1505296202 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | mainObjectFileID: 2100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Test.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Test.unity -------------------------------------------------------------------------------- /Assets/Test/Test.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61e77589273a1994cbba02cfe449a0c8 3 | timeCreated: 1478841121 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Test/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c16fe86ee4fd0b4418a3f9538ccaf9d3 3 | folderAsset: yes 4 | timeCreated: 1505809156 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_01_dff.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Textures/prop_asteroid_01_dff.tif -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_01_dff.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae6a7f967521769458b0913fa39caaf4 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 512 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_01_nrm.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Textures/prop_asteroid_01_nrm.tif -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_01_nrm.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6db5bbdfe0e9894798706814cd6b336 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 1 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 1 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 512 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_02_dff.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Textures/prop_asteroid_02_dff.tif -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_02_dff.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba157ba55f72c424a9e88f3c029997c4 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 512 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_02_nrm.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Textures/prop_asteroid_02_nrm.tif -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_02_nrm.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6d9b42ac01f24bf4d98923573f103575 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 1 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 1 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 512 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_03_dff.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Textures/prop_asteroid_03_dff.tif -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_03_dff.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 836be25be3e1e8c41ae5545bc8a9a4d7 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 512 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_03_nrm.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/Test/Textures/prop_asteroid_03_nrm.tif -------------------------------------------------------------------------------- /Assets/Test/Textures/prop_asteroid_03_nrm.tif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7eae0d2701845a54aa570b07c55dab44 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 1 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 1 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 512 29 | textureSettings: 30 | filterMode: -1 31 | aniso: -1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: 1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/sIBL Archive.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a96824f9803d243a38d56bc8eafbf755 3 | folderAsset: yes 4 | timeCreated: 1436690172 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/Acknowledgement.txt: -------------------------------------------------------------------------------- 1 | The HDR images in this directory are provided from sIBL Archive under the 2 | Creative Commons license (CC BY-NC-SA 3.0 US). Please see the page below for 3 | further details. 4 | 5 | http://www.hdrlabs.com/sibl/archive.html 6 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/Acknowledgement.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 60bb4480dbb174616bc9731e372b3406 3 | timeCreated: 1436690642 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/sIBL Archive/fin4_Env.hdr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/Assets/sIBL Archive/fin4_Env.hdr -------------------------------------------------------------------------------- /Assets/sIBL Archive/fin4_Env.hdr.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d335d3dbbc6fbde43be13eb54c0d48cf 3 | timeCreated: 1505807521 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: 7 | 8900000: generatedCubemap 8 | serializedVersion: 4 9 | mipmaps: 10 | mipMapMode: 0 11 | enableMipMap: 1 12 | sRGBTexture: 1 13 | linearTexture: 0 14 | fadeOut: 0 15 | borderMipMap: 0 16 | mipMapsPreserveCoverage: 0 17 | alphaTestReferenceValue: 0.5 18 | mipMapFadeDistanceStart: 1 19 | mipMapFadeDistanceEnd: 3 20 | bumpmap: 21 | convertToNormalMap: 0 22 | externalNormalMap: 0 23 | heightScale: 0.25 24 | normalMapFilter: 0 25 | isReadable: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -1 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 49 | spritePixelsToUnits: 100 50 | alphaUsage: 1 51 | alphaIsTransparency: 0 52 | spriteTessellationDetail: -1 53 | textureType: 0 54 | textureShape: 2 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - buildTarget: DefaultTexturePlatform 60 | maxTextureSize: 2048 61 | textureFormat: -1 62 | textureCompression: 1 63 | compressionQuality: 50 64 | crunchedCompression: 0 65 | allowsAlphaSplitting: 0 66 | overridden: 0 67 | - buildTarget: Standalone 68 | maxTextureSize: 2048 69 | textureFormat: -1 70 | textureCompression: 1 71 | compressionQuality: 50 72 | crunchedCompression: 0 73 | allowsAlphaSplitting: 0 74 | overridden: 0 75 | spriteSheet: 76 | serializedVersion: 2 77 | sprites: [] 78 | outline: [] 79 | physicsShape: [] 80 | spritePackingTag: 81 | userData: 82 | assetBundleName: 83 | assetBundleVariant: 84 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2017.1.1f1 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/UnityAdsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00000000000000008100000000000000 3 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keijiro/ParticleMotionVector/5b5a42409e99de921730e86c5e8908601017d599/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ParticleMotionVector 2 | ==================== 3 | 4 | This is an example that shows how to support rendering motion vectors within 5 | the standard particle system of Unity. 6 | 7 | Particles/Standard Opaque with Motion Vectors 8 | --------------------------------------------- 9 | 10 | ![inspector](https://i.imgur.com/oxBt0mp.png) 11 | 12 | This shader only supports rendering mesh particles without transparency. It may 13 | not sound very useful for particle effects in a general sense, but actually 14 | useful in some specific cases, like when rendering many small moving objects 15 | (asteroids, confetti, etc.) by using a particle system. 16 | 17 | ![movec](https://i.imgur.com/tFs7Rnjm.png) 18 | ![gif](https://i.imgur.com/2dSeftZ.gif) 19 | 20 | When using this shader, "Simulation Space" in the main module and "Render 21 | Alignment" in the renderer module have to be set to "World". This is needed to 22 | calculate rotations correctly in the motion vector writer. 23 | 24 | ![inspector](https://i.imgur.com/QxZIZrE.png) 25 | 26 | Also the custom vertex streams have to be set up in the following order: 27 | 28 | - UV (TEXCOORD0.xy) 29 | - Center (TEXCOORD0.zw|x) 30 | - Velocity (TEXCOORD1.yzw) 31 | - Rotation3D (TEXCOORD2.xyz) 32 | - RotationSpeed3D (TEXCOORD2.w|xy) 33 | 34 | ![vertex streams](https://i.imgur.com/BuKy5i7.png) 35 | 36 | System requirements 37 | ------------------- 38 | 39 | - Unity 2017.1 or later 40 | 41 | Current limitations 42 | ------------------- 43 | 44 | In the current implementation, change of the particle size is ignored in the 45 | calculation of motion vectors. This may introduce artifacts when animating the 46 | particle size with using the "Size over Lifetime" module or the "Size by Speed" 47 | module. 48 | 49 | How about transparency? 50 | ----------------------- 51 | 52 | I haven't tried transparency with motion vectors because I think it works only 53 | if someone tweaks it very carefully (and I have no time to invest in it). I 54 | won't recommend it, but you can try it anyway. 55 | 56 | License 57 | ------- 58 | 59 | Copyright (c) 2017 Unity Technologies 60 | 61 | This repository is to be treated as an example content of Unity; you can use 62 | the code freely in your projects. Also see the [FAQ] about example contents. 63 | 64 | [FAQ]: https://unity3d.com/unity/faq#faq-37863 65 | --------------------------------------------------------------------------------