Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: lzt120 on March 26, 2015, 12:06:46 AM

Title: Modify of shader and scrollview donot clip
Post by: lzt120 on March 26, 2015, 12:06:46 AM
I modify the shader of "Unlit/Transparent Colored" as below list but this lead to that scroll-view does not clip any more when I am dragging. How can I fixed this ?
 
  1. //_GreyColor("GreyColor", Color) = (0.299, 0.587, 0.114,1)
  2. if (i.color.r < 0.001)  
  3. {  
  4.     col = tex2D(_MainTex, i.texcoord);  
  5.     float grey = dot(col.rgb, float3(_GreyColor.r,_GreyColor.g,_GreyColor.b));  
  6.     col.rgb = float3(grey, grey, grey);  
  7.                                
  8. }  
  9. else
  10. {
  11.     col = tex2D(_MainTex, i.texcoord) * i.color;  
  12. }  
Title: Re: Modify of shader and scrollview donot clip
Post by: ArenMook on March 27, 2015, 10:53:40 PM
Unlit/Transparent Colored shader doesn't do clipping. Clipping happens in the numbered versions of this shader such as Unlit - Transparent Colored 1.