mirror of
https://github.com/tanema/light_world.lua.git
synced 2024-12-24 20:24:19 +00:00
12 lines
451 B
GLSL
12 lines
451 B
GLSL
extern Image buffer;
|
|
|
|
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 pixel_coords){
|
|
vec4 pixel = Texel(texture, texture_coords);
|
|
vec4 pixel2 = Texel(buffer, texture_coords);
|
|
|
|
if(texture_coords.y > 0.5) {
|
|
return vec4(pixel.rgb * (texture_coords.y - 0.5) * 2.0 + pixel2.rgb * (1.0 - texture_coords.y) * 2.0, 1.0);
|
|
} else {
|
|
return vec4(pixel.rgb * (0.5 - texture_coords.y) * 2.0 + pixel2.rgb * texture_coords.y * 2.0, 1.0);
|
|
}
|
|
} |