# NGUI-Optimize **Repository Path**: daao/NGUI-Optimize ## Basic Information - **Project Name**: NGUI-Optimize - **Description**: No description available - **Primary Language**: C# - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2015-05-19 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 暂时使用NGUI3.5.7版本 NGUI的一些优化案例 oschina : https://github.com/daaoling/NGUI-Optimize.git github : https://git.oschina.net/daao/NGUI-Optimize.git 目录 NGUI-Optimize /Assets /CullBlack : 去除黑色背景 /MaskNGUI : [Shader]对NGUI的UISprite和UITexture进行裁剪 http://www.unitymanual.com/thread-38987-1-1.html http://nickithansen.dk/masking-and-clipping-textures-using-shaders-in-ngui/ [Shader]NGUI与灰化 http://www.unitymanual.com/thread-39773-1-1.html /OptimizeNGUI :参考 http://www.xiaobao1993.com/853.html 1.ctrl + a 选中 Alpha1. 按 ctrl + c 复制。 2.ctrl + a 选中 红通道。ctrl + v 粘贴将其覆盖。绿,蓝通道执行同样的操作。 3.删除Alpha 1 透明通道保存. 需要改进 => 1.缺少 panel clip shader 2.流程脚本化 http://stackoverflow.com/questions/18328800/github-updates-were-rejected-because-the-remote-contains-work-that-you-do-not-h http://www.tasharen.com/forum/index.php?topic=5612.0 http://forum.unity3d.com/threads/does-unity-always-use-double-memory-for-texture-in-runtime.198270/ http://www.tasharen.com/forum/index.php?topic=8229.msg38810#msg38810 CullBlack 核心代码: sampler2D _MainTex; fixed4 frag(v2f IN) : SV_Target { fixed4 col = tex2D(_MainTex, IN.texcoord); //黑色像素透明度为0 if(col.r >= 0 && col.r <= 0.07 && col.g >= 0 && col.g <= 0.07 && col.b >= 0 && col.b <= 0.07 ) { col.a = 0; } return col; }