Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class SimpleBlitScript : MonoBehaviour {
- public bool newPlease = false;
- RenderTexture releasePlease = null;
- public void Update()
- {
- if (newPlease)
- {
- var t = RenderTexture.GetTemporary(480, 270, 0, RenderTextureFormat.ARGBHalf);
- t.filterMode = FilterMode.Point;
- releasePlease.Release();
- newPlease = false;
- }
- }
- private void OnRenderImage(RenderTexture source, RenderTexture destination)
- {
- Graphics.Blit(source, destination);
- if (destination.format != RenderTextureFormat.ARGBHalf) { releasePlease = destination; newPlease = true; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement