SHARE
TWEET

Generic Unity camera image effect script

a guest Dec 17th, 2016 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. [ExecuteInEditMode]
  5. public class CamPost : MonoBehaviour
  6. {
  7.     [SerializeField] private Shader shader;
  8.     private Material material;
  9.  
  10.     void OnEnable()
  11.     {
  12.         material = new Material(shader);
  13.     }
  14.  
  15.     void OnRenderImage(RenderTexture source, RenderTexture destination)
  16.     {
  17.         Graphics.Blit(source, destination, material);
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top