ColorMask与Blend
来源:互联网 发布:gcp网络培训官网 编辑:程序博客网 时间:2024/05/29 09:33
Shader "N/T" { Properties { _Color ("Texture to blend", Color) = (1,1,1,1) } SubShader { Tags { "Queue" = "Transparent" } ColorMask R Pass { Blend DstColor one CGPROGRAM #include "UnityCG.cginc" //#pragma exclude_renderers gles #pragma vertex vert#pragma fragment fragfloat4 _Color;float4 vert( appdata_base v ) : POSITION {return mul( UNITY_MATRIX_MVP, v.vertex );}float4 frag(float4 pos:POSITION):COLOR{return _Color;}ENDCG } } Fallback Off}
_Colr为(1,1,1,1)时,ColorMask R情况下,最终颜色计算方式
(1,0,0) * (bgColor.r,bgColor.g,bgColr.b) + (bgColor.r,bgColor.g,bgColr.b) * (1,1,1)
最终颜色 = frag计算结果 * 帧缓冲中已有颜色 + 帧缓冲中已有颜色*1
注意一点在ColorMaskR 条件下 frag计算结果由(1,1,1)变为(1,0,0)
0 0
- ColorMask与Blend
- ColorMask
- Shader ColorMask
- Blend基础-项目与层次
- BLEND
- 微软Expression Blend基础教程系列 - Blend基础-项目与层次
- Unity ColorMask 对应值
- Blend基础-控件与用户控件
- 微软Expression Blend基础教程系列 - Blend基础-控件与用户控件
- depth test与blend(深度测试与混合)
- depth test与blend(深度测试与混合)
- 课时70 Fragment shader - Alpha 与 blend 运算
- 混合 blend
- blend初探
- OpenGL Blend
- blend快捷键
- 看看blend
- blend基础
- 金融时间序列分析:1. 基础知识
- 【Android - 进阶】之事件分发机制
- 装饰者 设计模式
- 如何解决PHP里大量数据循环时内存耗尽的问题
- scala 模式匹配
- ColorMask与Blend
- 数据结构与算法(C语言版)__递归
- Spring3企业应用开发实战笔记-->MySQL安装
- 求hack or 证明(【JZOJ 4923】 【NOIP2017提高组模拟12.17】巧克力狂欢)
- java 基础
- linux上安装运行Jmeter
- filestream 用法
- 关闭toast权限后自定义解决方式
- Leetcode 473. Matchsticks to Square 卖火柴的小女孩画框框 解题报告