experiments with fresnel and shadergraph
[WindSway-HDRP.git] / Library / PackageCache / com.unity.postprocessing@2.1.6 / PostProcessing / Runtime / PostProcessEffectRenderer.cs
blob9a5b293bea85c741d39e56e1df271f2582742e58
1 namespace UnityEngine.Rendering.PostProcessing
3 /// <summary>
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}"/>.
6 /// </summary>
7 /// <seealso cref="PostProcessEffectRenderer{T}"/>
8 public abstract class PostProcessEffectRenderer
10 /// <summary>
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.
13 /// </summary>
14 protected bool m_ResetHistory = true;
16 /// <summary>
17 /// Called when the renderer is created and its associated settings have been set.
18 /// </summary>
19 /// <seealso cref="PostProcessEffectRenderer{T}.settings"/>
20 public virtual void Init()
24 /// <summary>
25 /// Override this method if your renderer needs access to any of the buffers defined in
26 /// <see cref="DepthTextureMode"/>.
27 /// </summary>
28 /// <returns>The currently set depth texture modes</returns>
29 /// <seealso cref="DepthTextureMode"/>
30 public virtual DepthTextureMode GetCameraFlags()
32 return DepthTextureMode.None;
35 /// <summary>
36 /// Resets the history state for this renderer. This is automatically called when
37 /// <see cref="PostProcessLayer.ResetHistory"/> is called by the user.
38 /// </summary>
39 public virtual void ResetHistory()
41 m_ResetHistory = true;
44 /// <summary>
45 /// Override this method to release any resource allocated by your renderer.
46 /// </summary>
47 public virtual void Release()
49 ResetHistory();
52 /// <summary>
53 /// The render method called by <see cref="PostProcessLayer"/> when the effect is rendered.
54 /// </summary>
55 /// <param name="context">A context object</param>
56 public abstract void Render(PostProcessRenderContext context);
58 internal abstract void SetSettings(PostProcessEffectSettings settings);
61 /// <summary>
62 /// The base abstract class for all effect renderer types.
63 /// </summary>
64 /// <typeparam name="T">The associated type of settings for this renderer</typeparam>
65 public abstract class PostProcessEffectRenderer<T> : PostProcessEffectRenderer
66 where T : PostProcessEffectSettings
68 /// <summary>
69 /// The current state of the effect settings associated with this renderer.
70 /// </summary>
71 public T settings { get; internal set; }
73 internal override void SetSettings(PostProcessEffectSettings settings)
75 this.settings = (T)settings;