author | alfadur |
Wed, 10 Oct 2018 23:54:57 +0300 | |
changeset 13894 | 7984ed53ac3b |
parent 12891 | a089326f0e16 |
child 15298 | 042a5e8d9c59 |
permissions | -rw-r--r-- |
12884 | 1 |
#ifdef GL_ES |
11800 | 2 |
precision mediump float; |
12884 | 3 |
#endif |
11800 | 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; |
12891 | 7 |
uniform bool tintAdd; |
8334
abb48dd39e26
Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff
changeset
|
8 |
uniform bool enableTexture; |
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 |
varying vec2 tex; |
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 |
|
abb48dd39e26
Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff
changeset
|
13 |
void main() |
abb48dd39e26
Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff
changeset
|
14 |
{ |
abb48dd39e26
Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff
changeset
|
15 |
if(enableTexture){ |
12891 | 16 |
if (tintAdd){ |
17 |
tint.a = 0.0; |
|
18 |
gl_FragColor = clamp(texture2D(tex0, tex) + tint, 0.0, 1.1); |
|
19 |
}else{ |
|
20 |
gl_FragColor = texture2D(tex0, tex) * tint; |
|
21 |
} |
|
8334
abb48dd39e26
Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff
changeset
|
22 |
}else{ |
abb48dd39e26
Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff
changeset
|
23 |
gl_FragColor = tint; |
abb48dd39e26
Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff
changeset
|
24 |
} |
abb48dd39e26
Added shaders and -GL2 option
Michael Hartman <omh1280@gmail.com>
parents:
diff
changeset
|
25 |
} |