diff options
Diffstat (limited to 'Assets/ThirdParty/UMotion/UMotionEditor/Shaders')
14 files changed, 450 insertions, 0 deletions
diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader new file mode 100644 index 00000000..6ca491b3 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader @@ -0,0 +1,73 @@ +Shader "UMotion Editor/Camera Lit" +{ + Properties + { + _Color("Main Color (RGB)", color) = (1, 1, 1, 1) + _WireColor("Wire Color (RGB) Trans (A)", color) = (0, 0, 0, 1) + _WireSize("Wire Size", Range(0, 4)) = 0.9 + } + + SubShader + { + Tags { "RenderType" = "Opaque" "IgnoreProjector"="True" } + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 3.0 + + #include "UnityCG.cginc" + + fixed4 _Color; + fixed4 _WireColor; + half _WireSize; + + struct vInput + { + float4 vertex : POSITION; + half4 texcoord : TEXCOORD0; + float3 normal : NORMAL; + }; + + struct vOutput + { + float4 pos : SV_POSITION; + fixed3 wirecoord : TEXCOORD1; + float3 lambert : TEXCOORD2; + }; + + vOutput vert(vInput i) + { + vOutput o; + + o.pos = UnityObjectToClipPos(i.vertex); + + o.wirecoord = fixed3(floor(i.texcoord.x), frac(i.texcoord.x) * 10, i.texcoord.y); + + float3 viewDir = normalize(WorldSpaceViewDir(i.vertex)); + float3 worldNormal = normalize(UnityObjectToWorldNormal(i.normal)); + o.lambert = saturate(dot(viewDir, worldNormal)); + + return o; + } + + fixed4 frag(vOutput i) : SV_Target + { + fixed4 outColor; + outColor.rgb = i.lambert * _Color; + outColor.a = 1.0; + + half3 width = abs(ddx(i.wirecoord.xyz)) + abs(ddy(i.wirecoord.xyz)); + half3 smoothed = smoothstep(half3(0, 0, 0), width * _WireSize, i.wirecoord.xyz); + half wireAlpha = min(min(smoothed.x, smoothed.y), smoothed.z); + + return lerp(lerp(outColor, _WireColor, _WireColor.a), outColor, wireAlpha); + } + + ENDCG + } //Pass + } //SubShader +} //Shader diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader.meta b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader.meta new file mode 100644 index 00000000..5b976339 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 48874f7fa809410459fad9f55010f4bb +timeCreated: 1473450613 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlit.shader b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlit.shader new file mode 100644 index 00000000..dc4654a9 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlit.shader @@ -0,0 +1,41 @@ +Shader "UMotion Editor/Color Unlit" +{ + Properties + { + // Color property for material inspector, default to white + _Color ("Main Color", Color) = (1,1,1,1) + } + SubShader + { + Tags { "RenderType"="Opaque" "IgnoreProjector"="True" } + LOD 100 + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + // vertex shader + // this time instead of using "appdata" struct, just spell inputs manually, + // and instead of returning v2f struct, also just return a single output + // float4 clip position + float4 vert (float4 vertex : POSITION) : SV_POSITION + { + return UnityObjectToClipPos(vertex); + } + + // color from the material + fixed4 _Color; + + // pixel shader, no inputs needed + fixed4 frag () : SV_Target + { + return _Color; // just return it + } + ENDCG + } + } +}
\ No newline at end of file diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlit.shader.meta b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlit.shader.meta new file mode 100644 index 00000000..31d413b3 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlit.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 1d54d617e69b06a4085e3437d19a8ec1 +timeCreated: 1473578258 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlitTransparent.shader b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlitTransparent.shader new file mode 100644 index 00000000..536f40bc --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlitTransparent.shader @@ -0,0 +1,43 @@ +Shader "UMotion Editor/Color Unlit Transparent" +{ + Properties + { + // Color property for material inspector, default to white + _Color ("Main Color", Color) = (1,1,1,1) + } + SubShader + { + Tags { "RenderType"="Transparent" "IgnoreProjector"="True" } + LOD 100 + ZWrite Off + Blend SrcAlpha OneMinusSrcAlpha + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + // vertex shader + // this time instead of using "appdata" struct, just spell inputs manually, + // and instead of returning v2f struct, also just return a single output + // float4 clip position + float4 vert (float4 vertex : POSITION) : SV_POSITION + { + return UnityObjectToClipPos(vertex); + } + + // color from the material + fixed4 _Color; + + // pixel shader, no inputs needed + fixed4 frag () : SV_Target + { + return _Color; // just return it + } + ENDCG + } + } +}
\ No newline at end of file diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlitTransparent.shader.meta b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlitTransparent.shader.meta new file mode 100644 index 00000000..9916f066 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/ColorUnlitTransparent.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: ffd3c4e17a9e1d54ba9f7ca169a4b98f +timeCreated: 1503310892 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader new file mode 100644 index 00000000..9e0fb815 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader @@ -0,0 +1,70 @@ +Shader "UMotion Editor/Unlit Dashed Line" +{ + Properties + { + _Color("Line Color (RGB) Trans (A)", color) = (0, 0, 0, 1) + _Thickness("Line Thikness", Range(0, 4)) = 0.9 + _DashFrequency("Dash Frequency", Range(0, 150)) = 100 + } + + SubShader + { + Tags {"Queue"="Transparent" "RenderType"="Transparent" "IgnoreProjector"="True" "DisableBatching"="True" } + LOD 100 + + ZWrite Off + Blend SrcAlpha OneMinusSrcAlpha + Cull Off + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 3.0 + + #include "UnityCG.cginc" + + fixed4 _Color; + half _Thickness; + half _DashFrequency; + + struct vInput + { + float4 vertex : POSITION; + half4 texcoord : TEXCOORD0; + }; + + struct vOutput + { + float4 pos : SV_POSITION; + float2 uv : TEXCOORD0; + }; + + vOutput vert(vInput i) + { + vOutput o; + + o.pos = UnityObjectToClipPos(i.vertex); + + o.uv = i.texcoord.xy; + o.uv.x *= length(float3(unity_ObjectToWorld[0].z, unity_ObjectToWorld[1].z, unity_ObjectToWorld[2].z)); + + return o; + } + + fixed4 frag(vOutput i) : SV_Target + { + half2 mass = half2(sin(i.uv.x * _DashFrequency), i.uv.y); + + half2 width = abs(ddx(mass)) + abs(ddy(mass)); + half2 smoothed = smoothstep(half2(0, 0), width * _Thickness, mass.xy); + half alpha = max(smoothed.x, smoothed.y); + + return fixed4(_Color.x, _Color.y, _Color.z, 1 - alpha); + } + + ENDCG + } //Pass + } //SubShader +} //Shader diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader.meta b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader.meta new file mode 100644 index 00000000..7cad2d08 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: d57a3d80d6b9c334692747b789c7d8d7 +timeCreated: 1436426827 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitLine.shader b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitLine.shader new file mode 100644 index 00000000..6c789116 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitLine.shader @@ -0,0 +1,63 @@ +Shader "UMotion Editor/Unlit Line" +{ + Properties + { + _Color("Line Color (RGB) Trans (A)", color) = (0, 0, 0, 1) + _Thickness("Line Thikness", Range(0, 4)) = 0.9 + } + + SubShader + { + Tags {"Queue"="Transparent" "RenderType"="Transparent" "IgnoreProjector"="True" } + LOD 100 + + ZWrite Off + Blend SrcAlpha OneMinusSrcAlpha + Cull Off + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 3.0 + + #include "UnityCG.cginc" + + fixed4 _Color; + half _Thickness; + + struct vInput + { + float4 vertex : POSITION; + half4 texcoord : TEXCOORD0; + }; + + struct vOutput + { + float4 pos : SV_POSITION; + float uv_y : TEXCOORD0; + }; + + vOutput vert(vInput i) + { + vOutput o; + + o.pos = UnityObjectToClipPos(i.vertex); + o.uv_y = i.texcoord.y; + + return o; + } + + fixed4 frag(vOutput i) : SV_Target + { + half width = abs(ddx(i.uv_y)) + abs(ddy(i.uv_y)); + half alpha = smoothstep(0, width * _Thickness, i.uv_y); + + return fixed4(_Color.x, _Color.y, _Color.z, 1 - alpha); + } + + ENDCG + } //Pass + } //SubShader +} //Shader diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitLine.shader.meta b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitLine.shader.meta new file mode 100644 index 00000000..6e3b8a0c --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitLine.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: b514aec5044c41141ac3b62eca518b25 +timeCreated: 1436426827 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/VertexColorUnlit.shader b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/VertexColorUnlit.shader new file mode 100644 index 00000000..6be5ffb1 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/VertexColorUnlit.shader @@ -0,0 +1,32 @@ +// Source: http://wiki.unity3d.com/index.php/VertexColorUnlit +Shader "UMotion Editor/Vertex Color Unlit" +{ + Properties + { + _MainTex ("Texture", 2D) = "white" {} + } + + Category + { + Tags { "RenderType"="Opaque" "IgnoreProjector"="True" } + Lighting Off + + BindChannels + { + Bind "Color", color + Bind "Vertex", vertex + Bind "TexCoord", texcoord + } + + SubShader + { + Pass + { + SetTexture [_MainTex] + { + Combine texture * primary DOUBLE + } + } + } + } +}
\ No newline at end of file diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/VertexColorUnlit.shader.meta b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/VertexColorUnlit.shader.meta new file mode 100644 index 00000000..71e0854c --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/VertexColorUnlit.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 7bb4c2b089bb2f841bb905642a28daad +timeCreated: 1473539026 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/WiresOnly.shader b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/WiresOnly.shader new file mode 100644 index 00000000..cd0db9b9 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/WiresOnly.shader @@ -0,0 +1,65 @@ +Shader "UMotion Editor/Wires Only" +{ + Properties + { + _Color("Main Color (RGB)", color) = (1, 1, 1, 1) + _Size("Wire Size", Range(0, 4)) = 0.9 + } + + SubShader + { + Tags {"Queue"="Transparent" "RenderType"="Transparent" "IgnoreProjector"="True" } + LOD 100 + + ZWrite Off + Blend SrcAlpha OneMinusSrcAlpha + Cull Off + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + #pragma target 3.0 + + #include "UnityCG.cginc" + + fixed4 _Color; + half _Size; + + struct vInput + { + float4 vertex : POSITION; + half4 texcoord : TEXCOORD0; + }; + + struct vOutput + { + float4 pos : SV_POSITION; + fixed3 wirecoord : TEXCOORD1; + }; + + vOutput vert(vInput i) + { + vOutput o; + + o.pos = UnityObjectToClipPos(i.vertex); + + o.wirecoord = fixed3(floor(i.texcoord.x), frac(i.texcoord.x) * 10, i.texcoord.y); + + return o; + } + + fixed4 frag(vOutput i) : SV_Target + { + half3 width = abs(ddx(i.wirecoord.xyz)) + abs(ddy(i.wirecoord.xyz)); + half3 smoothed = smoothstep(half3(0, 0, 0), width * _Size, i.wirecoord.xyz); + half wireAlpha = min(min(smoothed.x, smoothed.y), smoothed.z); + + return fixed4(_Color.xyz, 1 - wireAlpha); + } + + ENDCG + } //Pass + } //SubShader +} //Shader diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/WiresOnly.shader.meta b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/WiresOnly.shader.meta new file mode 100644 index 00000000..403ce1a1 --- /dev/null +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/WiresOnly.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: a326767bf949111429490e01d3a59d11 +timeCreated: 1521051594 +licenseType: Store +ShaderImporter: + defaultTextures: [] + userData: + assetBundleName: + assetBundleVariant: |