Shader 进度条/技能CD特效

游客

标题:Shader 进度条/技能CD特效
正文:
用了几天弄明白了这个简单的进度条，不容易。主要是利用了三角函数反正切函数特性，在夹角范围内的值透明度设为0，不在范围内值设成1.对于shader 编辑器，可以用forge 以及amplify.贴上测试代码：// Made with Amplify Shader Editor// Available at the Unity Asset Store - http://u3d.as/y3X Shader &quot;Unlit/MT&quot;{ Properties { _MainTex (&quot;Sprite Texture&quot;, 2D) = &quot;white&quot; {} _Color (&quot;Tint&quot;, Color) = (1,1,1,1) _angle(&quot;angle&quot;, Float) = 360 _StencilComp (&quot;Stencil Comparison&quot;, Float) = 8 _Stencil (&quot;Stencil ID&quot;, Float) = 0 _StencilOp (&quot;Stencil Operation&quot;, Float) = 0 _StencilWriteMask (&quot;Stencil Write Mask&quot;, Float) = 255 _StencilReadMask (&quot;Stencil Read Mask&quot;, Float) = 255 _ColorMask (&quot;Color Mask&quot;, Float) = 15 [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip (&quot;Use Alpha Clip&quot;, Float) = 0 } SubShader { Tags { &quot;Queue&quot;=&quot;Transparent&quot; &quot;IgnoreProjector&quot;=&quot;True&quot; &quot;RenderType&quot;=&quot;Tra
[<<][[1]][2][3][>>]

查看评论(0)
发表评论

首页