share/hedgewars/Data/Shaders/default.fs
author raptor <buckyballreaction@gmail.com>
Tue, 13 Aug 2019 13:10:12 -0600
changeset 15312 5b2dec63f4cf
parent 15293 042a5e8d9c59
permissions -rw-r--r--
Fix compiling on MacOS X by requiring c++11 standard. Building now requires MacOS X 10.8+ and CMake 3.9+

#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){
            vec4 tint_ = vec4(tint.xyz, 0.0);
            gl_FragColor = clamp(texture2D(tex0, tex) + tint_, 0.0, 1.1);
        }else{
            gl_FragColor = texture2D(tex0, tex) * tint;
        }
    }else{
        gl_FragColor = tint;
    }
}