28 lines
882 B
C#
28 lines
882 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.Rendering;
|
|
using UnityEngine.Rendering.Universal;
|
|
|
|
|
|
/**
|
|
* https://www.febucci.com/2022/05/custom-post-processing-in-urp/
|
|
*/
|
|
|
|
namespace Shaders
|
|
{
|
|
[Serializable,
|
|
VolumeComponentMenuForRenderPipeline("Custom/"+nameof(CustomEffectComponent), typeof(UniversalRenderPipeline))]
|
|
public class CustomEffectComponent : VolumeComponent, IPostProcessComponent
|
|
{
|
|
// For example, an intensity parameter that goes from 0 to 1
|
|
public ClampedFloatParameter intensity =
|
|
new ClampedFloatParameter(value: 1, min: 0, max: 1, overrideState: true);
|
|
|
|
// Other 'Parameter' variables you might have
|
|
|
|
public bool IsActive() => intensity.value > 0;
|
|
|
|
// I have no idea what this does yet but I'll update the post once I find an usage
|
|
public bool IsTileCompatible() => true;
|
|
}
|
|
} |