AVProMovieCapture_MotionBlur_Add.shader 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. Shader "Hidden/AVProMovieCapture/MotionBlur-Add"
  3. {
  4. Properties
  5. {
  6. _MainTex ("Base (RGB)", 2D) = "white" {}
  7. }
  8. SubShader
  9. {
  10. Pass
  11. {
  12. ZTest Always Cull Off ZWrite Off
  13. Lighting Off
  14. Fog { Mode off }
  15. Blend One One
  16. CGPROGRAM
  17. #pragma exclude_renderers flash xbox360 ps3 gles
  18. #pragma vertex vert
  19. #pragma fragment frag
  20. //#pragma target 3.0
  21. //#pragma fragmentoption ARB_precision_hint_fastest
  22. #include "UnityCG.cginc"
  23. uniform sampler2D _MainTex;
  24. uniform float4 _MainTex_TexelSize;
  25. uniform float _Weight;
  26. struct appdata
  27. {
  28. float4 vertex : POSITION;
  29. half2 texcoord : TEXCOORD0;
  30. };
  31. struct v2f
  32. {
  33. float4 pos : SV_POSITION;
  34. half2 uv : TEXCOORD0;
  35. };
  36. v2f vert(appdata v)
  37. {
  38. v2f o;
  39. o.pos = UnityObjectToClipPos(v.vertex);
  40. o.uv = v.texcoord;
  41. // Note: this flip is not needed because motion blur never target anti-aliased rendertextures
  42. /*#if UNITY_UV_STARTS_AT_TOP
  43. if (_MainTex_TexelSize.y < 0)
  44. {
  45. o.uv.y = 1.0 - o.uv.y;
  46. }
  47. #endif*/
  48. return o;
  49. }
  50. fixed4 frag (v2f i) : COLOR
  51. {
  52. float4 col = tex2D(_MainTex, i.uv) * _Weight;
  53. return col;
  54. }
  55. ENDCG
  56. }
  57. }
  58. Fallback off
  59. }