namespace UnityEngine.Rendering.PostProcessing
{
///
/// The post-processing stack is entirely built around the use of
/// and as such requires the use of to properly deal with
/// the deferred nature of .
/// This wrapper abstracts the creation and destruction of
/// and to make the process easier.
///
///
public sealed class PropertySheet
{
///
/// The actual to fill.
///
public MaterialPropertyBlock properties { get; private set; }
internal Material material { get; private set; }
internal PropertySheet(Material material)
{
this.material = material;
properties = new MaterialPropertyBlock();
}
///
/// Clears all keywords set on the source material.
///
public void ClearKeywords()
{
material.shaderKeywords = null;
}
///
/// Enableds a given keyword on the source material.
///
/// The keyword to enable
public void EnableKeyword(string keyword)
{
material.EnableKeyword(keyword);
}
///
/// Disables a given keyword on the source material.
///
/// The keyword to disable
public void DisableKeyword(string keyword)
{
material.DisableKeyword(keyword);
}
internal void Release()
{
RuntimeUtilities.Destroy(material);
material = null;
}
}
}