Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using UnityEngine;
- using UnityEngine.Rendering.PostProcessing;
- [Serializable]
- [PostProcess(typeof(PostProcessHighlightRenderer), PostProcessEvent.BeforeTransparent, "Harryh___h/Highlight")]
- public sealed class PostProcessHighlight : PostProcessEffectSettings
- {
- public FloatParameter scale = new FloatParameter { value = 100 };
- public FloatParameter shine = new FloatParameter { value = 0.4f };
- public FloatParameter shadow = new FloatParameter { value = 0.1f };
- public IntParameter rotations = new IntParameter { value = 30 };
- public FloatParameter depthThreshold = new FloatParameter { value = 0.1f };
- }
- public sealed class PostProcessHighlightRenderer : PostProcessEffectRenderer<PostProcessHighlight>
- {
- public override void Render(PostProcessRenderContext context)
- {
- var sheet = context.propertySheets.Get(Shader.Find("Hidden/Harryh___h/Highlight"));
- sheet.properties.SetFloat("_Scale", settings.scale);
- sheet.properties.SetFloat("_Shine", settings.shine);
- sheet.properties.SetFloat("_Shadow", settings.shadow);
- sheet.properties.SetFloat("_Rotations", settings.rotations);
- sheet.properties.SetFloat("_DepthThreshold", settings.depthThreshold);
- context.command.BlitFullscreenTriangle(context.source, context.destination, sheet, 0);
- }
- }
Add Comment
Please, Sign In to add comment