HollywoodFlareBlur.shader 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. Shader "Hidden/HollywoodFlareBlurShader" {
  3. Properties {
  4. _MainTex ("Base (RGB)", 2D) = "" {}
  5. _NonBlurredTex ("Base (RGB)", 2D) = "" {}
  6. }
  7. CGINCLUDE
  8. #include "UnityCG.cginc"
  9. struct v2f {
  10. float4 pos : POSITION;
  11. float2 uv : TEXCOORD0;
  12. };
  13. float4 offsets;
  14. float4 tintColor;
  15. // ok, _NonBlurredTex and _MainTex are switched ...
  16. sampler2D _MainTex;
  17. sampler2D _NonBlurredTex;
  18. v2f vert (appdata_img v) {
  19. v2f o;
  20. o.pos = UnityObjectToClipPos(v.vertex);
  21. o.uv = v.texcoord.xy;
  22. return o;
  23. }
  24. half4 frag (v2f i) : COLOR {
  25. half4 color = tex2D (_MainTex, i.uv);
  26. half4 colorNb = tex2D (_NonBlurredTex, i.uv);
  27. return (color) * tintColor * 0.5 + colorNb * normalize(tintColor) * 0.5; // - saturate(colorNb - color);
  28. }
  29. ENDCG
  30. Subshader {
  31. Pass {
  32. ZTest Always Cull Off ZWrite Off
  33. Fog { Mode off }
  34. CGPROGRAM
  35. #pragma fragmentoption ARB_precision_hint_fastest
  36. #pragma vertex vert
  37. #pragma fragment frag
  38. ENDCG
  39. }
  40. }
  41. Fallback off
  42. } // shader