Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class SimpleBlitScript : MonoBehaviour {
  6.  
  7. public bool newPlease = false;
  8. RenderTexture releasePlease = null;
  9.  
  10. public void Update()
  11. {
  12. if (newPlease)
  13. {
  14. var t = RenderTexture.GetTemporary(480, 270, 0, RenderTextureFormat.ARGBHalf);
  15. t.filterMode = FilterMode.Point;
  16. releasePlease.Release();
  17. newPlease = false;
  18. }
  19. }
  20.  
  21. private void OnRenderImage(RenderTexture source, RenderTexture destination)
  22. {
  23. Graphics.Blit(source, destination);
  24.  
  25. if (destination.format != RenderTextureFormat.ARGBHalf) { releasePlease = destination; newPlease = true; }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement