src/quick3d/quick3dscene3d/shaders/scene3dmaterial.frag
raw| 1 | #version 450 |
| 2 | |
| 3 | layout(std140, binding = 0) uniform buf { |
| 4 | mat4 qt_Matrix; |
| 5 | float qt_Opacity; |
| 6 | float visible; |
| 7 | }; |
| 8 | |
| 9 | layout(binding = 1) uniform sampler2D source; |
| 10 | |
| 11 | layout(location = 0) in vec2 qt_TexCoord; |
| 12 | layout(location = 0) out vec4 fragColor; |
| 13 | |
| 14 | void main() |
| 15 | { |
| 16 | if (visible < 0.0) |
| 17 | discard; |
| 18 | vec4 p = texture(source, qt_TexCoord); |
| 19 | float a = qt_Opacity * p.a; |
| 20 | fragColor = vec4(p.rgb * a, a); |
| 21 | } |