Advertisement
Guest User

Untitled

a guest
Jan 30th, 2021
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. public class StarFieldEffect : MonoBehaviour
  4. {
  5.     public Shader s;
  6.     private Material m;
  7.     private Camera c;
  8.  
  9.     void Awake()
  10.     {
  11.         c = GetComponent<Camera>();
  12.         c.depthTextureMode = DepthTextureMode.Depth;
  13.         m = new Material(s);
  14.     }
  15.  
  16.     void OnRenderImage(RenderTexture source, RenderTexture destination)
  17.     {
  18.         Graphics.Blit(source, destination, m);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement