-
Notifications
You must be signed in to change notification settings - Fork 876
Expand file tree
/
Copy pathPostProcessEffectRenderer.cs
More file actions
82 lines (72 loc) · 2.93 KB
/
Copy pathPostProcessEffectRenderer.cs
File metadata and controls
82 lines (72 loc) · 2.93 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
#pragma warning disable CS0618 // Type or member is obsolete
namespace UnityEngine.Rendering.PostProcessing
{
/// <summary>
/// The base abstract class for all effect renderer types. If you're writing your own effect you
/// should rather use <see cref="PostProcessEffectRenderer{T}"/>.
/// </summary>
/// <seealso cref="PostProcessEffectRenderer{T}"/>
public abstract class PostProcessEffectRenderer
{
/// <summary>
/// This member is set to <c>true</c> when <see cref="PostProcessLayer.ResetHistory"/> is
/// called by the user to reset temporal effects and other history-based effects.
/// </summary>
protected bool m_ResetHistory = true;
/// <summary>
/// Called when the renderer is created and its associated settings have been set.
/// </summary>
/// <seealso cref="PostProcessEffectRenderer{T}.settings"/>
public virtual void Init()
{
}
/// <summary>
/// Override this method if your renderer needs access to any of the buffers defined in
/// <see cref="DepthTextureMode"/>.
/// </summary>
/// <returns>The currently set depth texture modes</returns>
/// <seealso cref="DepthTextureMode"/>
public virtual DepthTextureMode GetCameraFlags()
{
return DepthTextureMode.None;
}
/// <summary>
/// Resets the history state for this renderer. This is automatically called when
/// <see cref="PostProcessLayer.ResetHistory"/> is called by the user.
/// </summary>
public virtual void ResetHistory()
{
m_ResetHistory = true;
}
/// <summary>
/// Override this method to release any resource allocated by your renderer.
/// </summary>
public virtual void Release()
{
ResetHistory();
}
/// <summary>
/// The render method called by <see cref="PostProcessLayer"/> when the effect is rendered.
/// </summary>
/// <param name="context">A context object</param>
public abstract void Render(PostProcessRenderContext context);
internal abstract void SetSettings(PostProcessEffectSettings settings);
}
/// <summary>
/// The base abstract class for all effect renderer types.
/// </summary>
/// <typeparam name="T">The associated type of settings for this renderer</typeparam>
public abstract class PostProcessEffectRenderer<T> : PostProcessEffectRenderer
where T : PostProcessEffectSettings
{
/// <summary>
/// The current state of the effect settings associated with this renderer.
/// </summary>
public T settings { get; internal set; }
internal override void SetSettings(PostProcessEffectSettings settings)
{
this.settings = (T)settings;
}
}
}
#pragma warning restore CS0618 // Type or member is obsolete