Skip to content

Instantly share code, notes, and snippets.

@kolen
kolen / dither.glsl
Created July 30, 2019 21:53
Simple dithering shader for godot engine
// Based on http://devlog-martinsh.blogspot.com/2011/03/glsl-dithering.html
shader_type canvas_item;
uniform float scale = 1.0;
float find_closest(int x, int y, float c0)
{
mat4 dither = mat4(vec4( 1.0, 33.0, 9.0, 41.0),
vec4(49.0, 17.0, 57.0, 25.0),