VignetteModel.cs
2.39 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
using System;
namespace UnityEngine.PostProcessing
{
[Serializable]
public class VignetteModel : PostProcessingModel
{
public enum Mode
{
Classic,
Masked
}
[Serializable]
public struct Settings
{
[Tooltip("Use the \"Classic\" mode for parametric controls. Use \"Round\" to get a perfectly round vignette no matter what the aspect ratio is. Use the \"Masked\" mode to use your own texture mask.")]
public Mode mode;
[ColorUsage(false)]
[Tooltip("Vignette color. Use the alpha channel for transparency.")]
public Color color;
[Tooltip("Sets the vignette center point (screen center is [0.5,0.5]).")]
public Vector2 center;
[Range(0f, 1f), Tooltip("Amount of vignetting on screen.")]
public float intensity;
[Range(0.01f, 1f), Tooltip("Smoothness of the vignette borders.")]
public float smoothness;
[Range(0f, 1f), Tooltip("Lower values will make a square-ish vignette.")]
public float roundness;
[Tooltip("A black and white mask to use as a vignette.")]
public Texture mask;
[Range(0f, 1f), Tooltip("Mask opacity.")]
public float opacity;
[Tooltip("Should the vignette be perfectly round or be dependent on the current aspect ratio?")]
public bool rounded;
public static Settings defaultSettings
{
get
{
return new Settings
{
mode = Mode.Classic,
color = new Color(0f, 0f, 0f, 1f),
center = new Vector2(0.5f, 0.5f),
intensity = 0.45f,
smoothness = 0.2f,
roundness = 1f,
mask = null,
opacity = 1f,
rounded = false
};
}
}
}
[SerializeField]
Settings m_Settings = Settings.defaultSettings;
public Settings settings
{
get { return m_Settings; }
set { m_Settings = value; }
}
public override void Reset()
{
m_Settings = Settings.defaultSettings;
}
}
}