daily pastebin goal
74%
SHARE
TWEET

Demo 37 - Camera script

tonynogo Jul 6th, 2017 1,117 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [ExecuteInEditMode]
  2. public class PostRenderer : MonoBehaviour
  3. {
  4.     public Material _material;
  5.  
  6.     void Awake()
  7.     {
  8.         _material = new Material(Shader.Find("Custom/PostRenderNoise"));
  9.         _material.SetTexture("_SecondaryTex", Resources.Load("Textures/Hatch") as Texture);
  10.     }
  11.  
  12.     public void OnRenderImage(RenderTexture source, RenderTexture destination)
  13.     {
  14.         _material.SetFloat("_OffsetX", Random.Range(0f, 1.1f));
  15.         _material.SetFloat("_OffsetY", Random.Range(0, 1.1f));
  16.         Graphics.Blit(source, destination, _material);
  17.     }
  18. }
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
 
Top