diff options
author | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-04-28 18:35:38 +0200 |
---|---|---|
committer | Yoann Lopes <yoann.lopes@theqtcompany.com> | 2015-04-30 09:02:20 +0000 |
commit | fe13f5bb05ef278eb5109a9518118dda7ddb0b9d (patch) | |
tree | 167e3b090efb82e41dac6fd2cd8fd5504a72a60b /src/qtmultimediaquicktools/shaders/triplanaryuvvideo.frag | |
parent | 61033aa420b4d34107e3cc67e8751506bc4ab745 (diff) |
Minor refactor of built-in QSGVideoNodes.v5.5.0-beta1
- Load shader source from resource files.
- Correctly report material types: each material can use different
shaders depending on the video pixel format but it was reporting
a unique material type. This was causing the node to keep using
the same shader even if its pixel format changed.
Change-Id: Ib903ecd6e7dd1dd56d7cefe255ab7049933df17d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/qtmultimediaquicktools/shaders/triplanaryuvvideo.frag')
-rw-r--r-- | src/qtmultimediaquicktools/shaders/triplanaryuvvideo.frag | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/qtmultimediaquicktools/shaders/triplanaryuvvideo.frag b/src/qtmultimediaquicktools/shaders/triplanaryuvvideo.frag new file mode 100644 index 000000000..dad8bb5a9 --- /dev/null +++ b/src/qtmultimediaquicktools/shaders/triplanaryuvvideo.frag @@ -0,0 +1,18 @@ +uniform sampler2D plane1Texture; +uniform sampler2D plane2Texture; +uniform sampler2D plane3Texture; +uniform mediump mat4 colorMatrix; +uniform lowp float opacity; + +varying highp vec2 plane1TexCoord; +varying highp vec2 plane2TexCoord; +varying highp vec2 plane3TexCoord; + +void main() +{ + mediump float Y = texture2D(plane1Texture, plane1TexCoord).r; + mediump float U = texture2D(plane2Texture, plane2TexCoord).r; + mediump float V = texture2D(plane3Texture, plane3TexCoord).r; + mediump vec4 color = vec4(Y, U, V, 1.); + gl_FragColor = colorMatrix * color * opacity; +} |