当前位置: 代码迷 >> 综合 >> unity让shader支持UGUI Mask
  详细解决方案

unity让shader支持UGUI Mask

热度:47   发布时间:2023-12-10 15:49:15.0

shader支持UGUI MASK需要添加

Shader "XXXXX"
{
Properties
{
...//MASK SUPPORT ADD
_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) = 15
//END}SubShader
{Tags {
   ...}//MASK SUPPORT ADD
Stencil
{Ref [_Stencil]Comp [_StencilComp]Pass [_StencilOp] ReadMask [_StencilReadMask]WriteMask [_StencilWriteMask]
}
ColorMask [_ColorMask]
//END...

原文地址
http://answers.unity3d.com/questions/980924/ui-mask-with-shader.html

  相关解决方案