当前位置:网站首页>UGUI源码解析——StencilMaterial
UGUI源码解析——StencilMaterial
2022-07-23 00:16:00 【Hello Bug.】
一:前言
StencilMaterial是一个静态类,负责管理模板材质,维护了一个MatEntry类型的列表,主要作用就是提供一个新的材质
对材质设置的参数,实际上是设置给Shader的(UI-Default.shader)
二:源码解析
——Add
添加一个材质
创建一个MatEntry,用指定的baseMat以及其他参数赋值给MatEntry并创建了customMat(实际上赋值的是customMat的shader参数)
设置材质时会开启UNITY_UI_ALPHACLIP,这也解释了为什么将Mask对象上Graphic对应的Alpha值设置为0,所有子对象都显示不出来了,在UI-Default.shader中有以下操作:透明度过小会被裁剪
——Remove
从MatEntry列表中移除一个已存在的材质
——ClearAll
移除MatEntry列表中的全部材质
边栏推荐
- Geely Xingrui: from product technology empowerment to cultural confidence
- What is the value of the new meta universe layout "primitive Cube" of "crazy diners"?
- Storage of Graphs~
- Ali II: why do MySQL indexes use b+ trees instead of jump tables?
- SQL Server 数据库设计--SELECT语句
- 50道经典计算机网络面试题,你答得上几个?(上)
- Network synchronous IO model - IO multiplexing
- Family fraud is prevalent, and Sogou number builds a security firewall
- PostgreSQL 与 Navicat:数据库行业的中坚力量
- Talking about -- network security architecture design (III)
猜你喜欢

User defined type details: structure, enumeration, union

DOM系列之禁止选中文字和禁止右键菜单

【云原生】风云暗涌的时代,DBA们的利刃出鞘了

Pagoda installation hyperf

Extend the maximum memory limit of canvas and the principle of browser rendering from a bug
![[zero based BLDC series] brushless DC motor control principle based on Hall sensor](/img/72/9595080e437a716be035187dadc8cc.png)
[zero based BLDC series] brushless DC motor control principle based on Hall sensor

发现了一个好用到爆的数据分析利器

SIP账号的作用-告诉你什么是SIP线路

Detailed explanation of common ADB operation commands of "suggestions collection"

OSI七层模型有哪七层?每一层分别有啥作用,这篇文章讲的明明白白!
随机推荐
Arduino框架下合宙ESP32C3 +1.8“TFT液晶屏通过TFT_eSPI库驱动显示
启牛开户安全性高吗?说万3的佣金靠谱吗?
wireshark抓包工具基本使用
In depth explanation of CAS is necessary for interview practice
[openvx] VX for basic use of objects_ node
What are the seven layers of OSI's seven layer model? What is the role of each layer? This article is clear!
基于JSP实现OA办公系统
生成13位条形码Ean-13码规则:第十三位数字是前十二位数字经过计算得到的校验码。
There was an accident caused by MySQL misoperation, and "high availability" couldn't stand it
白盒测试的概念及测试方法
go语言中的结构体和组合思想入门示例
OSI七层模型有哪七层?每一层分别有啥作用,这篇文章讲的明明白白!
实现 FinClip 微信授权登录的三种方案
如何防范各类联属欺诈?
牛客刷题系列之初阶版(自守数,返回小于 N 的质数个数,第一个只出现一次的字符)
[unity project practice] FSM finite state machine
Svg+canvas canvas track JS special effect
【云原生】风云暗涌的时代,DBA们的利刃出鞘了
Nanoid? Better than UUID
[openvx] VX for basic use of objects_ context
