Skip to content

Commit

Permalink
[NemoIcon] Fixup fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Oct 25, 2023
1 parent 5818476 commit a7532b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/controls/qml/NemoIcon.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Image {

layer.effect: ShaderEffect {
id: shaderItem
property color tint: nemoIcon.color
property color color: nemoIcon.color
property variant source: nemoIcon
fragmentShader: "shaders/NemoIcon.frag.qsb"
}
Expand Down
7 changes: 3 additions & 4 deletions src/controls/qml/shaders/NemoIcon.frag
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ layout(binding = 1) uniform sampler2D source;
layout(std140, binding = 0) uniform buf {
mat4 qt_Matrix;
float qt_Opacity;
vec4 tint;

vec4 color;
} ubuf;

void main()
{
vec4 c = texture(source, qt_TexCoord0);
float lo = min(min(c.x, c.y), c.z);
float hi = max(max(c.x, c.y), c.z);
fragColor = ubuf.qt_Opacity * vec4(mix(vec3(lo), vec3(hi), ubuf.tint.xyz), c.w);
fragColor = c * ubuf.color * ubuf.qt_Opacity;
}

0 comments on commit a7532b6

Please sign in to comment.