AVProMovieCapture_MotionBlur_Add.shader 1.2 KB

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