12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- Shader "Hidden/AVProMovieCapture/MotionBlur-Div"
- {
- Properties
- {
- _MainTex ("Base (RGB)", 2D) = "white" {}
- }
- SubShader
- {
- Pass
- {
- ZTest Always Cull Off ZWrite Off
- Lighting Off
- Fog { Mode off }
-
- CGPROGRAM
- #pragma exclude_renderers flash xbox360 ps3 gles
- #pragma vertex vert
- #pragma fragment frag
- //#pragma target 3.0
- //#pragma fragmentoption ARB_precision_hint_fastest
- #include "UnityCG.cginc"
-
- uniform float _NumSamples;
- uniform sampler2D _MainTex;
- uniform float4 _MainTex_TexelSize;
- struct appdata
- {
- float4 vertex : POSITION;
- half2 texcoord : TEXCOORD0;
- };
- struct v2f
- {
- float4 pos : SV_POSITION;
- half2 uv : TEXCOORD0;
- };
- v2f vert(appdata v)
- {
- v2f o;
- o.pos = UnityObjectToClipPos(v.vertex);
- o.uv = v.texcoord;
- // Note: this flip is not needed because motion blur never target anti-aliased rendertextures
- /*#if UNITY_UV_STARTS_AT_TOP
- if (_MainTex_TexelSize.y < 0)
- {
- o.uv.y = 1.0 - o.uv.y;
- }
- #endif*/
- return o;
- }
- fixed4 frag (v2f i) : COLOR
- {
- float4 col = tex2D(_MainTex, i.uv);
- return col / _NumSamples;
- }
- ENDCG
- }
- }
- Fallback off
- }
|