git-svn-id: svn://db.shs.com.ru/libs@586 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-09-02 14:08:38 +00:00
parent f862381b68
commit 3d06d2095e
929 changed files with 66799 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
#version 130
uniform sampler2D t0;
uniform vec2 vsize;
const vec3 luma = vec3(0.299, 0.587, 0.114);
void main(void) {
vec2 tc = gl_TexCoord[0].xy;//, dt = 1. / vsize;
vec3 dc0 = texture2D(t0, tc).rgb, dc1 = textureOffset(t0, tc, ivec2(1, 0)).rgb, dc2 = textureOffset(t0, tc, ivec2(0, 1)).rgb, dc3 = textureOffset(t0, tc, ivec2(1, 1)).rgb;
float l0 = dot(dc0, luma), l1 = dot(dc1, luma), l2 = dot(dc2, luma), l3 = dot(dc3, luma);
gl_FragColor.rgb = vec3(max(max(max(l0, l1), l2), l3), min(min(min(l0, l1), l2), l3), (l0 + l1 + l2 + l3) / 4.);
}