light_world.lua/lib/shaders/postshaders/pixellate.glsl
Tim Anema 7fe549a01a optimizations to say the least
-cut out complicated light angle calulations and instead put in a arc
stencil
-stenciled the range of each light to optimize the shader drawing
-refactors postshaders to user proper love variables
-minimized amount of canvases
-added better functionality to my canvas util
-refactored blurring to be in one place
2014-12-19 22:54:29 -05:00

11 lines
306 B
GLSL

const float pixel_w = 2.0;
const float pixel_h = 2.0;
vec4 effect(vec4 vcolor, Image texture, vec2 uv, vec2 pixel_coords)
{
float dx = pixel_w*(1.0/love_ScreenSize.x);
float dy = pixel_h*(1.0/love_ScreenSize.y);
vec2 coord = vec2(dx*floor(uv.x/dx), dy*floor(uv.y/dy));
return Texel(texture, coord);
}