parent
1b5814c0f2
commit
192a57e2e1
6 changed files with 115 additions and 1 deletions
@ -0,0 +1,27 @@ |
||||
/* |
||||
* SPDX-FileCopyrightText: 2011, 2014 Martin Gräßlin <mgraesslin@kde.org> |
||||
* SPDX-License-Identifier: GPL-2.0-or-later |
||||
*/ |
||||
|
||||
#version 440 |
||||
|
||||
layout (std140, binding = 0) uniform buf { |
||||
highp mat4 u_matrix; |
||||
lowp float u_opacity; // offset 64 |
||||
highp float u_saturation; // offset 68 |
||||
highp float u_brightness; // offset 72 |
||||
} ubuf; // size 76 |
||||
|
||||
layout (binding = 1) uniform sampler2D qt_Texture; |
||||
|
||||
layout (location = 0) in highp vec2 v_coord; |
||||
layout (location = 0) out highp vec4 fragColor; |
||||
|
||||
void main() { |
||||
lowp vec4 tex = texture(qt_Texture, v_coord); |
||||
if (ubuf.u_saturation != 1.0) { |
||||
tex.rgb = mix(vec3(dot( vec3( 0.30, 0.59, 0.11 ), tex.rgb )), tex.rgb, ubuf.u_saturation); |
||||
} |
||||
tex.rgb = tex.rgb * ubuf.u_brightness; |
||||
fragColor = tex * ubuf.u_opacity; |
||||
} |
||||
@ -0,0 +1,22 @@ |
||||
/* |
||||
* SPDX-FileCopyrightText: 2011, 2014 Martin Gräßlin <mgraesslin@kde.org> |
||||
* SPDX-License-Identifier: GPL-2.0-or-later |
||||
*/ |
||||
|
||||
#version 440 |
||||
|
||||
layout (std140, binding = 0) uniform buf { |
||||
highp mat4 u_matrix; |
||||
lowp float u_opacity; |
||||
highp float u_saturation; |
||||
highp float u_brightness; |
||||
} ubuf; |
||||
|
||||
layout (location = 0) in highp vec4 vertex; |
||||
layout (location = 1) in highp vec2 texCoord; |
||||
layout (location = 0) out highp vec2 v_coord; |
||||
|
||||
void main() { |
||||
v_coord = texCoord; |
||||
gl_Position = ubuf.u_matrix * vertex; |
||||
} |
||||
Loading…
Reference in new issue