light_world.lua/lib/shaders/tilt_shift.glsl
Tim Anema 45be0c56fa refactoring,
taking out unused variables and redundant code, also took out debug variables. also moved the shaders in to the lib folder
for better portablility of the library
2014-09-29 10:03:34 -04:00

12 lines
472 B
GLSL

extern Image imgBuffer;
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords){
vec4 pixel = Texel(texture, texture_coords);
vec4 pixelBuffer = Texel(imgBuffer, texture_coords);
if(texture_coords.y > 0.5) {
return vec4(pixel.rgb * (texture_coords.y - 0.5) * 2.0 + pixelBuffer.rgb * (1.0 - texture_coords.y) * 2.0, 1.0);
} else {
return vec4(pixel.rgb * (0.5 - texture_coords.y) * 2.0 + pixelBuffer.rgb * texture_coords.y * 2.0, 1.0);
}
}