Unity3d Ugui Shader Draw a ring

Source: Internet
Author: User

Shader"Unlit/newunlitshader"{Properties {_maintex ("Texture", 2D) =" White"{} _color ("Tint", Color) = (1,1,1,1) _stencilcomp ("stencil Comparison", Float) =8_stencil ("stencil ID", Float) =0_stencilop ("stencil Operation", Float) =0_stencilwritemask ("stencil Write Mask", Float) =255_stencilreadmask ("stencil Read Mask", Float) =255_colormask ("Color Mask", Float) = the_width ("_width", Float) =0} subshader {Tags {"Queue"="Transparent"            "Ignoreprojector"="True"            "Rendertype"="Transparent"            "Previewtype"="Plane"} cull off Lighting off fog{Mode Off} Blend srcalpha Oneminussrcalpha Stencil {Ref[_stencil] comp[_stencilcomp] Pass[_stencilop] Readma            Sk[_stencilreadmask] Writemask[_stencilwritemask]} Colormask[_colormask] Pass { Cgprogram#pragmaVertex vert#pragmaFragment Frag#include"Unitycg.cginc"            structAppData {float4 vertex:position;            FLOAT2 uv:texcoord0;            }; structv2f {float2 uv:texcoord0;            FLOAT4 vertex:sv_position;            };            Sampler2d _maintex;            FLOAT4 _maintex_st; float_width;            FLOAT4 _color;                v2f Vert (AppData v) {v2f o; O.vertex=Unityobjecttoclippos (V.vertex); O.uv=Transform_tex (V.UV, _maintex); returno; } fixed4 Frag (v2f i): sv_target {floatD = Distance (I.UV,FLOAT2 (0.5,0.5)); if(D <0.5-2/_width)                {Discard; }                if(D >0.5) {discard; } fixed4 Col=tex2d (_maintex, I.UV); returncol*_color; } ENDCG} }}

Unity3d Ugui Shader Draw a ring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.