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/CameraLit.shader | 146 ++++++++++----------- 1 file changed, 73 insertions(+), 73 deletions(-) (limited to 'Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader') diff --git a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader index 6ca491b3..f9dd2196 100644 --- a/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader +++ b/Assets/ThirdParty/UMotion/UMotionEditor/Shaders/CameraLit.shader @@ -1,73 +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 +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 -- cgit v1.1-26-g67d0