Advertisement
tonynogo

Demo 50 - Camera script

Jul 6th, 2017
8,994
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. [ExecuteInEditMode]
  4. public class CameraScript : MonoBehaviour {
  5.  
  6.         public Material mat;
  7.  
  8.         void Start()
  9.         {
  10.             GetComponent<Camera>().depthTextureMode = DepthTextureMode.Depth;
  11.         }
  12.  
  13.         void OnRenderImage(RenderTexture source, RenderTexture destination)
  14.         {
  15.             Graphics.Blit(source, destination, mat);
  16.         }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement