Advertisement
Guest User

SimpleBlit.cs

a guest
Aug 7th, 2020
761
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1.      
  2. using System.Collections;
  3. using UnityEngine;
  4.  
  5. [ExecuteInEditMode]
  6. public class SimpleBlit: MonoBehaviour
  7. {
  8.     [SerializeField]
  9.     private Material material;
  10.    
  11.     public void Start()
  12.     {
  13.         Camera.main.depthTextureMode = DepthTextureMode.DepthNormals;// depthnormals are needed for outline effect
  14.     }
  15.  
  16.     // Postprocess the image
  17.     void OnRenderImage(RenderTexture source, RenderTexture destination)
  18.     {      
  19.         Graphics.Blit(source, destination, material);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement