share/hedgewars/Data/Shaders/default.fs
author Wuzzy <Wuzzy2@mail.ru>
Wed, 18 Jul 2018 01:35:59 +0200
changeset 13506 36f3f77e9b1b
parent 12886 a089326f0e16
child 15293 042a5e8d9c59
permissions -rw-r--r--
Switch from http:// to https:// URLs where possible

#ifdef GL_ES
precision mediump float;
#endif

uniform sampler2D tex0;
uniform vec4 tint;
uniform bool tintAdd;
uniform bool enableTexture;

varying vec2 tex;


void main()
{
    if(enableTexture){
        if (tintAdd){
            tint.a = 0.0;
            gl_FragColor = clamp(texture2D(tex0, tex) + tint, 0.0, 1.1);
        }else{
            gl_FragColor = texture2D(tex0, tex) * tint;
        }
    }else{
        gl_FragColor = tint;
    }
}