Advertisement
Guest User

Untitled

a guest
May 25th, 2019
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. //RadialBlur
  2. #ifdef RADIALBLUR_ON
  3. current_step += direction * _ds * dstf; //ds is blur range/distance (0,1)
  4. #else
  5.  
  6. #endif
  7.  
  8. //Vignette
  9. float OuterVig = 1.0; // Position for the Outer vignette
  10. float InnerVig = 0.05; // Position for the inner Vignette Ring
  11. float4 color = tex2D(_CGrabPass, uv);
  12. float2 center = float2(0.5,.5); // Center of Screen
  13. float dist = distance(center,uv )*1.414213; // Distance between center and the current Uv. Multiplyed by 1.414213 to fit in the range of 0.0 to 1.0
  14. float vig = clamp((OuterVig-dist) / (OuterVig-InnerVig),0.0,1.0); // Generate the Vignette with Clamp which go from outer Viggnet ring to inner vignette ring with smooth steps
  15. color *= vig; // Multiply the Vignette with the texture color
  16.  
  17.  
  18. }
  19.  
  20. total /= amount;
  21. float vig = total;
  22. float gray = total.g * 0.6 + total.r * 0.3 + total.b * 0.1;
  23. float3(gray, gray, gray);
  24. #ifdef GRAYSCALE_ON
  25. total = lerp(total, gray.xxx, dstf * _gsvalue);
  26. #endif
  27. return float4( total, 1.0 );
  28. }
  29.  
  30.  
  31. }
  32. ENDCG
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement