From fc6de82e75310b4c007d80753a5f58e6692f4855 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 13 Oct 2020 10:33:05 +0800 Subject: +misc --- .../UMotionEditor/Shaders/UnlitDashedLine.shader | 140 ++++++++++----------- 1 file changed, 70 insertions(+), 70 deletions(-) (limited to 'Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader') diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader index 9e0fb815..37798944 100644 --- a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/UnlitDashedLine.shader @@ -1,70 +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 +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 -- cgit v1.1-26-g67d0