share/hedgewars/Data/Shaders/default.fs
author Wuzzy <almikes@aol.com>
Tue, 22 Nov 2016 16:39:54 +0100
changeset 11977 bc7788e8723b
parent 11795 2028bd2a6c5b
child 12879 286e170f4f6b
permissions -rw-r--r--
Give infinite ropes in Running for survival mission
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
}