BuiltinDebugViewsModel.cs
3.65 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
124
125
126
127
128
129
130
131
132
133
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class BuiltinDebugViewsModel : PostProcessingModel
{
[Serializable]
public struct DepthSettings
{
[Range(0f, 1f), Tooltip("Scales the camera far plane before displaying the depth map.")]
public float scale;
public static DepthSettings defaultSettings
{
get
{
return new DepthSettings
{
scale = 1f
};
}
}
}
[Serializable]
public struct MotionVectorsSettings
{
[Range(0f, 1f), Tooltip("Opacity of the source render.")]
public float sourceOpacity;
[Range(0f, 1f), Tooltip("Opacity of the per-pixel motion vector colors.")]
public float motionImageOpacity;
[Min(0f), Tooltip("Because motion vectors are mainly very small vectors, you can use this setting to make them more visible.")]
public float motionImageAmplitude;
[Range(0f, 1f), Tooltip("Opacity for the motion vector arrows.")]
public float motionVectorsOpacity;
[Range(8, 64), Tooltip("The arrow density on screen.")]
public int motionVectorsResolution;
[Min(0f), Tooltip("Tweaks the arrows length.")]
public float motionVectorsAmplitude;
public static MotionVectorsSettings defaultSettings
{
get
{
return new MotionVectorsSettings
{
sourceOpacity = 1f,
motionImageOpacity = 0f,
motionImageAmplitude = 16f,
motionVectorsOpacity = 1f,
motionVectorsResolution = 24,
motionVectorsAmplitude = 64f
};
}
}
}
public enum Mode
{
None,
Depth,
Normals,
MotionVectors,
AmbientOcclusion,
EyeAdaptation,
FocusPlane,
PreGradingLog,
LogLut,
UserLut
}
[Serializable]
public struct Settings
{
public Mode mode;
public DepthSettings depth;
public MotionVectorsSettings motionVectors;
public static Settings defaultSettings
{
get
{
return new Settings
{
mode = Mode.None,
depth = DepthSettings.defaultSettings,
motionVectors = MotionVectorsSettings.defaultSettings
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public bool willInterrupt
{
get
{
return !IsModeActive(Mode.None)
&& !IsModeActive(Mode.EyeAdaptation)
&& !IsModeActive(Mode.PreGradingLog)
&& !IsModeActive(Mode.LogLut)
&& !IsModeActive(Mode.UserLut);
}
}
public override void Reset()
{
settings = Settings.defaultSettings;
}
public bool IsModeActive(Mode mode)
{
return m_Settings.mode == mode;
}
}
}