share/hedgewars/Data/Shaders/default.fs
author nemo
Fri, 05 Jan 2018 16:12:19 -0500
changeset 12879 286e170f4f6b
parent 11795 2028bd2a6c5b
child 12886 a089326f0e16
permissions -rw-r--r--
apparently this is GLES2 only
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
12879
286e170f4f6b apparently this is GLES2 only
nemo
parents: 11795
diff changeset
     1
#ifdef GL_ES
11795
2028bd2a6c5b Set medium floating precision to shaders
frd
parents: 11317
diff changeset
     2
precision mediump float;
12879
286e170f4f6b apparently this is GLES2 only
nemo
parents: 11795
diff changeset
     3
#endif
11795
2028bd2a6c5b Set medium floating precision to shaders
frd
parents: 11317
diff changeset
     4
8334
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
     5
uniform sampler2D tex0;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
     6
uniform vec4 tint;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
     7
uniform bool enableTexture;
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
varying vec2 tex;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    10
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
void main()
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    13
{
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    14
    if(enableTexture){
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    15
        gl_FragColor = texture2D(tex0, tex) * tint;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    16
    }else{
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    17
        gl_FragColor = tint;
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    18
    }
abb48dd39e26 Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff changeset
    19
}