1 namespace UnityEngine
.Rendering
.PostProcessing
4 /// The base abstract class for all effect renderer types. If you're writing your own effect you
5 /// should rather use <see cref="PostProcessEffectRenderer{T}"/>.
7 /// <seealso cref="PostProcessEffectRenderer{T}"/>
8 public abstract class PostProcessEffectRenderer
11 /// This member is set to <c>true</c> when <see cref="PostProcessLayer.ResetHistory"/> is
12 /// called by the user to reset temporal effects and other history-based effects.
14 protected bool m_ResetHistory
= true;
17 /// Called when the renderer is created and its associated settings have been set.
19 /// <seealso cref="PostProcessEffectRenderer{T}.settings"/>
20 public virtual void Init()
25 /// Override this method if your renderer needs access to any of the buffers defined in
26 /// <see cref="DepthTextureMode"/>.
28 /// <returns>The currently set depth texture modes</returns>
29 /// <seealso cref="DepthTextureMode"/>
30 public virtual DepthTextureMode
GetCameraFlags()
32 return DepthTextureMode
.None
;
36 /// Resets the history state for this renderer. This is automatically called when
37 /// <see cref="PostProcessLayer.ResetHistory"/> is called by the user.
39 public virtual void ResetHistory()
41 m_ResetHistory
= true;
45 /// Override this method to release any resource allocated by your renderer.
47 public virtual void Release()
53 /// The render method called by <see cref="PostProcessLayer"/> when the effect is rendered.
55 /// <param name="context">A context object</param>
56 public abstract void Render(PostProcessRenderContext context
);
58 internal abstract void SetSettings(PostProcessEffectSettings settings
);
62 /// The base abstract class for all effect renderer types.
64 /// <typeparam name="T">The associated type of settings for this renderer</typeparam>
65 public abstract class PostProcessEffectRenderer
<T
> : PostProcessEffectRenderer
66 where T
: PostProcessEffectSettings
69 /// The current state of the effect settings associated with this renderer.
71 public T settings { get; internal set; }
73 internal override void SetSettings(PostProcessEffectSettings settings
)
75 this.settings
= (T
)settings
;