namespace UnityEngine.Rendering.PostProcessing
{
///
/// The base abstract class for all effect renderer types. If you're writing your own effect you
/// should rather use .
///
///
public abstract class PostProcessEffectRenderer
{
///
/// This member is set to true when is
/// called by the user to reset temporal effects and other history-based effects.
///
protected bool m_ResetHistory = true;
///
/// Called when the renderer is created and its associated settings have been set.
///
///
public virtual void Init()
{
}
///
/// Override this method if your renderer needs access to any of the buffers defined in
/// .
///
/// The currently set depth texture modes
///
public virtual DepthTextureMode GetCameraFlags()
{
return DepthTextureMode.None;
}
///
/// Resets the history state for this renderer. This is automatically called when
/// is called by the user.
///
public virtual void ResetHistory()
{
m_ResetHistory = true;
}
///
/// Override this method to release any resource allocated by your renderer.
///
public virtual void Release()
{
ResetHistory();
}
///
/// The render method called by when the effect is rendered.
///
/// A context object
public abstract void Render(PostProcessRenderContext context);
internal abstract void SetSettings(PostProcessEffectSettings settings);
}
///
/// The base abstract class for all effect renderer types.
///
/// The associated type of settings for this renderer
public abstract class PostProcessEffectRenderer : PostProcessEffectRenderer
where T : PostProcessEffectSettings
{
///
/// The current state of the effect settings associated with this renderer.
///
public T settings { get; internal set; }
internal override void SetSettings(PostProcessEffectSettings settings)
{
this.settings = (T)settings;
}
}
}