This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
project-undercover/Project Undercover/Assets/Scripts/Glow/GlowComposite.cs

23 lines
468 B
C#
Raw Normal View History

2017-10-03 04:15:13 -05:00
using UnityEngine;
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
public class GlowComposite : MonoBehaviour
{
[Range (0, 10)]
public float Intensity = 2;
private Material _compositeMat;
void OnEnable()
{
_compositeMat = new Material(Shader.Find("Hidden/GlowComposite"));
}
void OnRenderImage(RenderTexture src, RenderTexture dst)
{
_compositeMat.SetFloat("_Intensity", Intensity);
Graphics.Blit(src, dst, _compositeMat, 0);
}
}