Skip to content

Instantly share code, notes, and snippets.

using UnityEngine;
public class Gameboy : MonoBehaviour
{
private RenderTexture _downscaledRenderTexture;
private void OnEnable()
{
var camera = GetComponent<Camera>();
int height = 144;
Shader "Identity"
{
...
SubShader
{
...
Pass
{
...
float4 frag (v2f i) : SV_Target
using UnityEngine;
public class Gameboy : MonoBehaviour
{
public Material identityMaterial;
private RenderTexture _downscaledRenderTexture;
private void OnEnable()
{
Shader "Gameboy"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Darkest ("Darkest", color) = (0.0588235, 0.21961, 0.0588235)
_Dark ("Dark", color) = (0.188235, 0.38431, 0.188235)
_Ligt ("Light", color) = (0.545098, 0.6745098, 0.0588235)
_Ligtest ("Lightest", color) = (0.607843, 0.7372549, 0.0588235)
}
Shader "Gameboy"
{
Properties
{
...
}
SubShader
{
...
Shader "Gameboy"
{
...
sampler2D _MainTex;
float4 _Darkest, _Dark, _Ligt, _Ligtest;
float4 frag (v2f i) : SV_Target
{
float4 originalColor = tex2D(_MainTex, i.uv);
Shader "Gameboy"
{
...
sampler2D _MainTex;
float4 _Darkest, _Dark, _Ligt, _Ligtest;
float4 frag (v2f i) : SV_Target
{
float4 originalColor = tex2D(_MainTex, i.uv);
Shader "Gameboy"
{
...
sampler2D _MainTex;
float4 _Darkest, _Dark, _Ligt, _Ligtest;
float4 frag (v2f i) : SV_Target
{
float4 originalColor = tex2D(_MainTex, i.uv);
Shader "Gameboy"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Darkest ("Darkest", color) = (0.0588235, 0.21961, 0.0588235)
_Dark ("Dark", color) = (0.188235, 0.38431, 0.188235)
_Ligt ("Light", color) = (0.545098, 0.6745098, 0.0588235)
_Ligtest ("Lightest", color) = (0.607843, 0.7372549, 0.0588235)
}
using UnityEngine;
public class Gameboy : MonoBehaviour
{
public Material gameboyMaterial;
public Material identityMaterial;
private RenderTexture _downscaledRenderTexture;
private void OnEnable()