MotionBlur.shader
2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Shader "Hidden/Post FX/Motion Blur"
{
CGINCLUDE
#pragma target 3.0
ENDCG
SubShader
{
Cull Off ZWrite Off ZTest Always
// (0) Velocity texture setup
Pass
{
CGPROGRAM
#include "MotionBlur.cginc"
#pragma vertex VertDefault
#pragma fragment FragVelocitySetup
ENDCG
}
// (1) TileMax filter (2 pixel width with normalization)
Pass
{
CGPROGRAM
#include "MotionBlur.cginc"
#pragma vertex VertDefault
#pragma fragment FragTileMax1
ENDCG
}
// (2) TileMax filter (2 pixel width)
Pass
{
CGPROGRAM
#include "MotionBlur.cginc"
#pragma vertex VertDefault
#pragma fragment FragTileMax2
ENDCG
}
// (3) TileMax filter (variable width)
Pass
{
CGPROGRAM
#include "MotionBlur.cginc"
#pragma vertex VertDefault
#pragma fragment FragTileMaxV
ENDCG
}
// (4) NeighborMax filter
Pass
{
CGPROGRAM
#include "MotionBlur.cginc"
#pragma vertex VertDefault
#pragma fragment FragNeighborMax
ENDCG
}
// (5) Reconstruction filter
Pass
{
CGPROGRAM
#include "MotionBlur.cginc"
#pragma vertex VertMultitex
#pragma fragment FragReconstruction
ENDCG
}
// (6) Frame compression
Pass
{
CGPROGRAM
#pragma multi_compile __ UNITY_COLORSPACE_GAMMA
#include "MotionBlur.cginc"
#pragma vertex VertFrameCompress
#pragma fragment FragFrameCompress
ENDCG
}
// (7) Frame blending
Pass
{
CGPROGRAM
#pragma multi_compile __ UNITY_COLORSPACE_GAMMA
#include "MotionBlur.cginc"
#pragma vertex VertMultitex
#pragma fragment FragFrameBlending
ENDCG
}
// (8) Frame blending (without chroma subsampling)
Pass
{
CGPROGRAM
#include "MotionBlur.cginc"
#pragma vertex VertMultitex
#pragma fragment FragFrameBlendingRaw
ENDCG
}
}
}