标签:
1 Shader "Custom/Opaque" 2 { 3 Properties 4 { 5 [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 6 _Color ("Tint", Color) = (1,1,1,1) 7 8 // required for UI.Mask 9 _StencilComp ("Stencil Comparison", Float) = 8 10 _Stencil ("Stencil ID", Float) = 0 11 _StencilOp ("Stencil Operation", Float) = 0 12 _StencilWriteMask ("Stencil Write Mask", Float) = 255 13 _StencilReadMask ("Stencil Read Mask", Float) = 255 14 _ColorMask ("Color Mask", Float) = 15 15 } 16 SubShader 17 { 18 Tags 19 { 20 // ... 21 } 22 23 // required for UI.Mask 24 Stencil 25 { 26 Ref [_Stencil] 27 Comp [_StencilComp] 28 Pass [_StencilOp] 29 ReadMask [_StencilReadMask] 30 WriteMask [_StencilWriteMask] 31 } 32 ColorMask [_ColorMask] 33 34 Pass 35 { 36 // ... 37 } 38 } 39 }
9~14行以及24~32行是解决的方案
标签:
原文地址:http://www.cnblogs.com/MrZivChu/p/maskAndShader.html