Skip to content

Instantly share code, notes, and snippets.

@KumoKairo
Last active December 25, 2017 16:55
Show Gist options
  • Save KumoKairo/e1b71c8c21f3b41698a5db01fc92b215 to your computer and use it in GitHub Desktop.
Save KumoKairo/e1b71c8c21f3b41698a5db01fc92b215 to your computer and use it in GitHub Desktop.
using UnityEngine;
public class Gameboy : MonoBehaviour
{
private RenderTexture _downscaledRenderTexture;
private void OnEnable()
{
var camera = GetComponent<Camera>();
int height = 144;
int width = Mathf.RoundToInt(camera.aspect * height);
_downscaledRenderTexture = new RenderTexture(width, height, 16);
_downscaledRenderTexture.filterMode = FilterMode.Point;
}
private void OnDisable()
{
Destroy(_downscaledRenderTexture);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment