init
This commit is contained in:
commit
341a877b4a
2338 changed files with 1346408 additions and 0 deletions
21
Assets/Materials/PostProcessing/Greyscale.cs
Normal file
21
Assets/Materials/PostProcessing/Greyscale.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.PostProcessing;
|
||||
|
||||
[Serializable]
|
||||
[PostProcess(typeof(GrayscaleRenderer), PostProcessEvent.AfterStack, "Custom/Grayscale")]
|
||||
public sealed class Grayscale : PostProcessEffectSettings
|
||||
{
|
||||
[Range(0, 1), Tooltip("Grayscale effect intensity")]
|
||||
public FloatParameter blend = new FloatParameter { value = .5f };
|
||||
}
|
||||
|
||||
public sealed class GrayscaleRenderer : PostProcessEffectRenderer<Grayscale>
|
||||
{
|
||||
public override void Render(PostProcessRenderContext context)
|
||||
{
|
||||
var sheet = context.propertySheets.Get(Shader.Find("Hidden/Custom/Grayscale"));
|
||||
sheet.properties.SetFloat("_Blend", settings.blend);
|
||||
context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue