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