share/hedgewars/Data/Shaders/default.fs
author Wuzzy <almikes@aol.com>
Fri, 06 May 2016 17:26:06 +0200
changeset 11814 8eccc307ca1e
parent 11795 2028bd2a6c5b
child 12879 286e170f4f6b
permissions -rw-r--r--
Frontend: Increase space for help text in the footer
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
}