123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
- Shader "Hidden/MotionBlur" {
- Properties {
- _MainTex ("Base (RGB)", 2D) = "white" {}
- _AccumOrig("AccumOrig", Float) = 0.65
- }
- SubShader {
- ZTest Always Cull Off ZWrite Off
- Fog { Mode off }
- Pass {
- Blend SrcAlpha OneMinusSrcAlpha
- ColorMask RGB
- BindChannels {
- Bind "vertex", vertex
- Bind "texcoord", texcoord
- }
-
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #pragma fragmentoption ARB_precision_hint_fastest
-
- #include "UnityCG.cginc"
-
- struct appdata_t {
- float4 vertex : POSITION;
- float2 texcoord : TEXCOORD;
- };
-
- struct v2f {
- float4 vertex : POSITION;
- float2 texcoord : TEXCOORD;
- };
-
- float4 _MainTex_ST;
- float _AccumOrig;
-
- v2f vert (appdata_t v)
- {
- v2f o;
- o.vertex = UnityObjectToClipPos(v.vertex);
- o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
- return o;
- }
-
- sampler2D _MainTex;
-
- half4 frag (v2f i) : COLOR
- {
- return half4(tex2D(_MainTex, i.texcoord).rgb, _AccumOrig );
- }
- ENDCG
- }
- Pass {
- Blend One Zero
- ColorMask A
-
- BindChannels {
- Bind "vertex", vertex
- Bind "texcoord", texcoord
- }
-
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- #pragma fragmentoption ARB_precision_hint_fastest
-
- #include "UnityCG.cginc"
-
- struct appdata_t {
- float4 vertex : POSITION;
- float2 texcoord : TEXCOORD;
- };
-
- struct v2f {
- float4 vertex : POSITION;
- float2 texcoord : TEXCOORD;
- };
-
- float4 _MainTex_ST;
-
- v2f vert (appdata_t v)
- {
- v2f o;
- o.vertex = UnityObjectToClipPos(v.vertex);
- o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
- return o;
- }
-
- sampler2D _MainTex;
-
- half4 frag (v2f i) : COLOR
- {
- return tex2D(_MainTex, i.texcoord);
- }
- ENDCG
- }
-
- }
- SubShader {
- ZTest Always Cull Off ZWrite Off
- Fog { Mode off }
- Pass {
- Blend SrcAlpha OneMinusSrcAlpha
- ColorMask RGB
- SetTexture [_MainTex] {
- ConstantColor (0,0,0,[_AccumOrig])
- Combine texture, constant
- }
- }
- Pass {
- Blend One Zero
- ColorMask A
- SetTexture [_MainTex] {
- Combine texture
- }
- }
- }
- Fallback off
- }
|