Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- [ExecuteInEditMode]
- public class CameraScript : MonoBehaviour {
- public Material mat;
- void Start()
- {
- GetComponent<Camera>().depthTextureMode = DepthTextureMode.Depth;
- }
- void OnRenderImage(RenderTexture source, RenderTexture destination)
- {
- Graphics.Blit(source, destination, mat);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement