49 lines
1.3 KiB
C#
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;
|
|
}
|
|
} |