share/hedgewars/Data/Shaders/default.fs
author unc0rr
Sat, 09 Jul 2016 22:40:44 +0300
changeset 11840 24f309d75da8
parent 11795 2028bd2a6c5b
child 12879 286e170f4f6b
permissions -rw-r--r--
Use less weird options
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11795
2028bd2a6c5b Set medium floating precision to shaders
frd
parents: 11317
diff changeset
     1
precision mediump float;
2028bd2a6c5b Set medium floating precision to shaders
frd
parents: 11317
diff changeset
     2
8334
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
     3
uniform sampler2D tex0;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
     4
uniform vec4 tint;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
     5
uniform bool enableTexture;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
     6
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
     7
varying vec2 tex;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
     8
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
     9
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    10
void main()
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    11
{
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    12
    if(enableTexture){
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    13
        gl_FragColor = texture2D(tex0, tex) * tint;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    14
    }else{
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    15
        gl_FragColor = tint;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    16
    }
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    17
}