Files
Cielonos/Assets/Shaders/ScriptablePostProcessor/PostProcessing/ScriptablePostProcessorVolume.cs
SoulliesOfficial ef7b479712 initial
2025-11-25 08:19:33 -05:00

49 lines
1.3 KiB
C#

using System;
using Echovoid.Runtime.Behavior.Rendering;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
namespace SLSFramework.Rendering.PostProcessing
{
public enum CustomPostProcessInjectionPoint
{
AfterTransparent,
BeforePostProcess,
AfterPostProcess
}
public abstract class ScriptablePostProcessorVolume : VolumeComponent, IPostProcessComponent, IDisposable
{
public virtual CustomPostProcessInjectionPoint InjectionPoint =>
CustomPostProcessInjectionPoint.AfterPostProcess;
public virtual int OrderInInjectionPoint => 0;
protected Material material;
protected abstract string GetShaderName();
public virtual void Setup()
{
material = InternalShaderHelpers.GenerateTransientMaterial(GetShaderName());
}
public abstract void Render(CommandBuffer cmd, ref RenderingData renderingData, RTHandle source, RTHandle destination);
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
public virtual void Dispose(bool disposing)
{
CoreUtils.Destroy(material);
}
public abstract bool IsActive();
public bool IsTileCompatible() => false;
}
}