Folder clean up;
Added Emissive;
This commit is contained in:
36
Runtime/UTS Renderer/UTSOutlinePass.cs
Normal file
36
Runtime/UTS Renderer/UTSOutlinePass.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering.HighDefinition;
|
||||
|
||||
namespace Misaki.HdrpToon
|
||||
{
|
||||
[HideInInspector]
|
||||
internal class UTSOutlinePass : DrawRenderersCustomPass
|
||||
{
|
||||
protected override void Execute(CustomPassContext ctx)
|
||||
{
|
||||
var utsRenderer = ctx.hdCamera.volumeStack.GetComponent<UTSRenderer>();
|
||||
if (utsRenderer == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!utsRenderer.enableOutline.value || !utsRenderer.state.value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Shader.SetGlobalFloat("_Outline_MaxWidth", utsRenderer.outlineMaxWidth.value * 0.01f);
|
||||
|
||||
var renderConfig = HDUtils.GetRendererConfiguration(false, false);
|
||||
var result = new UnityEngine.Rendering.RendererUtils.RendererListDesc(UtsShaderPassName.outlinePassId, ctx.cullingResults, ctx.hdCamera.camera)
|
||||
{
|
||||
rendererConfiguration = renderConfig,
|
||||
renderQueueRange = GetRenderQueueRange(RenderQueueType.All),
|
||||
excludeObjectMotionVectors = false,
|
||||
};
|
||||
|
||||
CoreUtils.DrawRendererList(ctx.renderContext, ctx.cmd, ctx.renderContext.CreateRendererList(result));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user