-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAmplifyOcclusionBase.cs
143 lines (109 loc) · 3.53 KB
/
AmplifyOcclusionBase.cs
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
134
135
136
137
138
139
140
141
142
143
using System;
using UnityEngine;
[AddComponentMenu("")]
public class AmplifyOcclusionBase : MonoBehaviour
{
public enum ApplicationMethod
{
PostEffect,
Deferred,
Debug
}
public enum PerPixelNormalSource
{
None,
Camera,
GBuffer,
GBufferOctaEncoded
}
public enum SampleCountLevel
{
Low,
Medium,
High,
VeryHigh
}
[Header("Ambient Occlusion")]
public ApplicationMethod ApplyMethod;
[Tooltip("Number of samples per pass.")]
public SampleCountLevel SampleCount = SampleCountLevel.Medium;
public PerPixelNormalSource PerPixelNormals = PerPixelNormalSource.Camera;
[Tooltip("Final applied intensity of the occlusion effect.")]
[Range(0f, 1f)]
public float Intensity = 1f;
public Color Tint = Color.black;
[Tooltip("Radius spread of the occlusion.")]
[Range(0f, 32f)]
public float Radius = 2f;
[NonSerialized]
[Tooltip("Max sampling range in pixels.")]
[Range(32f, 1024f)]
public int PixelRadiusLimit = 512;
[NonSerialized]
[Tooltip("Occlusion contribution amount on relation to radius.")]
[Range(0f, 2f)]
public float RadiusIntensity = 1f;
[Tooltip("Power exponent attenuation of the occlusion.")]
[Range(0f, 16f)]
public float PowerExponent = 1.8f;
[Tooltip("Controls the initial occlusion contribution offset.")]
[Range(0f, 0.99f)]
public float Bias = 0.05f;
[Tooltip("Controls the thickness occlusion contribution.")]
[Range(0f, 1f)]
public float Thickness = 1f;
[Tooltip("Compute the Occlusion and Blur at half of the resolution.")]
public bool Downsample = true;
[Header("Distance Fade")]
[Tooltip("Control parameters at faraway.")]
public bool FadeEnabled;
[Tooltip("Distance in Unity unities that start to fade.")]
public float FadeStart = 100f;
[Tooltip("Length distance to performe the transition.")]
public float FadeLength = 50f;
[Tooltip("Final Intensity parameter.")]
[Range(0f, 1f)]
public float FadeToIntensity;
public Color FadeToTint = Color.black;
[Tooltip("Final Radius parameter.")]
[Range(0f, 32f)]
public float FadeToRadius = 2f;
[Tooltip("Final PowerExponent parameter.")]
[Range(0f, 16f)]
public float FadeToPowerExponent = 1.8f;
[Tooltip("Final Thickness parameter.")]
[Range(0f, 1f)]
public float FadeToThickness = 1f;
[Header("Bilateral Blur")]
public bool BlurEnabled = true;
[Tooltip("Radius in screen pixels.")]
[Range(1f, 4f)]
public int BlurRadius = 3;
[Tooltip("Number of times that the Blur will repeat.")]
[Range(1f, 4f)]
public int BlurPasses = 1;
[Tooltip("0 - Blured, 1 - Sharpened.")]
[Range(0f, 20f)]
public float BlurSharpness = 10f;
[Header("Temporal Filter")]
[Tooltip("Accumulates the effect over the time.")]
public bool FilterEnabled = true;
[Tooltip("Controls the accumulation decayment. 0 - Faster update, more flicker. 1 - Slow update (ghosting on moving objects), less flicker.")]
[Range(0f, 1f)]
public float FilterBlending = 0.5f;
[Tooltip("Controls the discard sensibility based on the motion of the scene and objects. 0 - Discard less, reuse more (more ghost effect). 1 - Discard more, reuse less (less ghost effect).")]
[Range(0f, 1f)]
public float FilterResponse = 0.5f;
[NonSerialized]
[Tooltip("Enables directional variations.")]
public bool TemporalDirections = true;
[NonSerialized]
[Tooltip("Enables offset variations.")]
public bool TemporalOffsets = true;
[NonSerialized]
[Tooltip("Reduces ghosting effect near the objects's edges while moving.")]
public bool TemporalDilation;
[NonSerialized]
[Tooltip("Uses the object movement information for calc new areas of occlusion.")]
public bool UseMotionVectors = true;
}