码迷,mamicode.com
首页 > 其他好文 > 详细

解决灰色shader与mask冲突的方案

时间:2016-01-15 06:20:03      阅读:525      评论:0      收藏:0      [点我收藏+]

标签:

 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行是解决的方案

解决灰色shader与mask冲突的方案

标签:

原文地址:http://www.cnblogs.com/MrZivChu/p/maskAndShader.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!