Skip to content

Instantly share code, notes, and snippets.

@nothke
Created February 14, 2017 09:13
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save nothke/e68576aeca5ca6279343f8cd1e0d42ca to your computer and use it in GitHub Desktop.
Save nothke/e68576aeca5ca6279343f8cd1e0d42ca to your computer and use it in GitHub Desktop.
//PIXELBOY BY @WTFMIG EAT A BUTT WORLD BAHAHAHAHA POOP MY PANTS
// - edited by @Nothke to use screen height for #LOWREZJAM
using UnityEngine;
using System.Collections;
[ExecuteInEditMode]
[AddComponentMenu("Image Effects/PixelBoy")]
public class PixelBoy : MonoBehaviour
{
public int h = 64;
int w;
protected void Start()
{
if (!SystemInfo.supportsImageEffects)
{
enabled = false;
return;
}
}
void Update()
{
float ratio = ((float)Camera.main.pixelWidth) / (float)Camera.main.pixelHeight;
w = Mathf.RoundToInt(h * ratio);
}
void OnRenderImage(RenderTexture source, RenderTexture destination)
{
source.filterMode = FilterMode.Point;
RenderTexture buffer = RenderTexture.GetTemporary(w, h, -1);
buffer.filterMode = FilterMode.Point;
Graphics.Blit(source, buffer);
Graphics.Blit(buffer, destination);
RenderTexture.ReleaseTemporary(buffer);
}
}
@SorenSaket
Copy link

xd

@nithindavis
Copy link

how do i use this effect in godot engine? any clues ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment