mirror of
https://github.com/MaurycyLiebner/enve.git
synced 2024-11-22 01:42:02 +00:00
37 lines
1.2 KiB
GLSL
37 lines
1.2 KiB
GLSL
|
// enve - 2D animations software
|
||
|
// Copyright (C) 2016-2020 Maurycy Liebner
|
||
|
|
||
|
// This program 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.
|
||
|
|
||
|
// This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
|
||
|
// enve uses OpenGL 3.3
|
||
|
#version 330 core
|
||
|
// output color
|
||
|
layout(location = 0) out vec4 fragColor;
|
||
|
|
||
|
// processed texture coordinate, from the vertex shader
|
||
|
in vec2 texCoord;
|
||
|
|
||
|
// texture provided by enve
|
||
|
uniform sampler2D texture;
|
||
|
// the value for the 'red' property
|
||
|
uniform float red;
|
||
|
|
||
|
void main(void) {
|
||
|
// texture pixel color at the coordinate
|
||
|
vec4 color = texture2D(texture, texCoord);
|
||
|
// assign value to the output color,
|
||
|
// multiply red by the 'red' property value
|
||
|
fragColor = vec4(color.r * red, color.g, color.b, color.a);
|
||
|
}
|