Author Topic: Modify of shader and scrollview donot clip  (Read 1472 times)

lzt120

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 68
    • View Profile
Modify of shader and scrollview donot clip
« 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. }  

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Modify of shader and scrollview donot clip
« Reply #1 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.