first commit
This commit is contained in:
43
tb/shader/TextureBrowser.fragsh
Normal file
43
tb/shader/TextureBrowser.fragsh
Normal file
@@ -0,0 +1,43 @@
|
||||
#version 120
|
||||
|
||||
/*
|
||||
Copyright (C) 2010-2017 Kristian Duske
|
||||
|
||||
This file is part of TrenchBroom.
|
||||
|
||||
TrenchBroom is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
TrenchBroom is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with TrenchBroom. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
uniform float Brightness;
|
||||
uniform sampler2D Texture;
|
||||
uniform bool ApplyTinting;
|
||||
uniform vec4 TintColor;
|
||||
uniform bool GrayScale;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = texture2D(Texture, gl_TexCoord[0].st);
|
||||
|
||||
gl_FragColor = vec4(vec3(Brightness / 2.0 * gl_FragColor), gl_FragColor.a);
|
||||
gl_FragColor = clamp(2.0 * gl_FragColor, 0.0, 1.0);
|
||||
|
||||
if (GrayScale) {
|
||||
float gray = dot(gl_FragColor.rgb, vec3(0.299, 0.587, 0.114));
|
||||
gl_FragColor = vec4(gray, gray, gray, gl_FragColor.a);
|
||||
}
|
||||
|
||||
if (ApplyTinting) {
|
||||
gl_FragColor = vec4(gl_FragColor.rgb * TintColor.rgb * TintColor.a, gl_FragColor.a);
|
||||
gl_FragColor = clamp(2.0 * gl_FragColor, 0.0, 1.0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user