Added UtsEvaluateAngelRing;

Added UTSTonemapping;
This commit is contained in:
Misaki
2025-01-30 22:54:43 +09:00
parent d8b12a0ca9
commit 181a53a3b2
17 changed files with 246 additions and 159 deletions

View File

@@ -0,0 +1,48 @@
using System;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
[Serializable, VolumeComponentMenu("Post-processing/UTS Tonemapping")]
public sealed class UTSTonemapping : CustomPostProcessVolumeComponent, IPostProcessComponent
{
[Tooltip("Controls the intensity of the effect.")]
public BoolParameter state = new BoolParameter(true, BoolParameter.DisplayType.EnumPopup);
private Material _material;
public bool IsActive() => _material != null && state.value;
// Do not forget to add this post process in the Custom Post Process Orders list (Project Settings > Graphics > HDRP Global Settings).
public override CustomPostProcessInjectionPoint injectionPoint => CustomPostProcessInjectionPoint.AfterPostProcess;
const string Shader_Name = "Hidden/Shader/UTSTonemapping";
public override void Setup()
{
if (Shader.Find(Shader_Name) != null)
{
_material = CoreUtils.CreateEngineMaterial(Shader_Name);
}
else
{
Debug.LogError($"Unable to find shader '{Shader_Name}'. Post Process Volume UTSToonmapping is unable to load. To fix this, please edit the 'kShaderName' constant in UTSToonmapping.cs or change the name of your custom post process shader.");
}
}
public override void Render(CommandBuffer cmd, HDCamera camera, RTHandle source, RTHandle destination)
{
if (_material == null || !state.value)
{
return;
}
_material.SetTexture("_MainTex", source);
HDUtils.DrawFullScreen(cmd, _material, destination, shaderPassId: 0);
}
public override void Cleanup()
{
CoreUtils.Destroy(_material);
}
}