summaryrefslogtreecommitdiffstats
path: root/src/quick3d/quick3dscene3d/shaders/scene3dmaterial.frag
blob: 3b8bafeb7b411e093034b57e912df778cd9ba947 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#version 450

layout(std140, binding = 0) uniform buf {
    mat4 qt_Matrix;
    float qt_Opacity;
    float visible;
};

layout(binding = 1) uniform sampler2D source;

layout(location = 0) in vec2 qt_TexCoord;
layout(location = 0) out vec4 fragColor;

void main()
{
   if (visible < 0.0)
       discard;
   vec4 p = texture(source, qt_TexCoord);
   float a = qt_Opacity * p.a;
   fragColor = vec4(p.rgb * a, a);
}