You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
506 B
24 lines
506 B
|
|
uniform sampler2D tex;
|
|
|
|
uniform vec4 background_color;
|
|
uniform mat4 color_transformation;
|
|
|
|
void main( void ) {
|
|
vec4 orig = texture2D(tex, gl_TexCoord[0].st);
|
|
|
|
|
|
gl_FragColor = background_color + color_transformation * orig;
|
|
|
|
{ // shine
|
|
vec2 offset = vec2(0.01, 0.0);
|
|
|
|
vec4 a = texture2D(tex, gl_TexCoord[0].st - offset);
|
|
vec4 b = texture2D(tex, gl_TexCoord[0].st + offset);
|
|
|
|
if(length(a-b) < 0.1 && length(orig.rgb) > 0.3)
|
|
gl_FragColor *= 1.0 + 0.01/length(a-b);
|
|
}
|
|
|
|
gl_FragColor.a = 1.0;
|
|
}
|
|
|