light_world.lua/lib/shaders/postshaders/tilt_shift.glsl

12 lines
472 B
Plaintext
Raw Normal View History

2014-04-08 17:45:21 +00:00
extern Image imgBuffer;
2014-03-28 02:32:32 +00:00
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords){
vec4 pixel = Texel(texture, texture_coords);
2014-04-08 17:45:21 +00:00
vec4 pixelBuffer = Texel(imgBuffer, texture_coords);
2014-03-28 02:32:32 +00:00
if(texture_coords.y > 0.5) {
2014-04-08 17:45:21 +00:00
return vec4(pixel.rgb * (texture_coords.y - 0.5) * 2.0 + pixelBuffer.rgb * (1.0 - texture_coords.y) * 2.0, 1.0);
2014-03-28 02:32:32 +00:00
} else {
2014-04-08 17:45:21 +00:00
return vec4(pixel.rgb * (0.5 - texture_coords.y) * 2.0 + pixelBuffer.rgb * texture_coords.y * 2.0, 1.0);
2014-03-28 02:32:32 +00:00
}
}