diff options
author | Kaj GrΓΆnholm <kaj.gronholm@qt.io> | 2021-11-11 09:24:27 +0200 |
---|---|---|
committer | Kaj GrΓΆnholm <kaj.gronholm@qt.io> | 2021-11-30 10:03:33 +0200 |
commit | 3b7b9ac2e7ffd23236c2611b485f4085c827128b (patch) | |
tree | b3ac25f073dcb3431cdc1332b2e58096a0e6de81 /quickmultieffect/shaders/bluritems.frag | |
parent | 85317aac92ee8151bce8771dc7dceb9c00d1c99d (diff) |
Qt 6 port of the MultiEffectqt6
Port the Qt Quick MultiEffect to Qt 6. The API remains fully compatible,
while the implementation changes to use Qt RHI. Instead of creating the
optimal shader at run time, contains 30+ pre-baked shaders and the most
suitable ones are selected based on which effects user enables.
The shaders contain OpenGL, OpenGL ES, Vulkan, Direct 3D and Metal
versions. Includes compile.bat to regenerate the qsb shaders.
Task-number: QTBUG-88645
Change-Id: Iabbf262d73a823cd24872ffddf01762811186c58
Reviewed-by: Tomi KorpipÀÀ <tomi.korpipaa@qt.io>
Diffstat (limited to 'quickmultieffect/shaders/bluritems.frag')
-rw-r--r-- | quickmultieffect/shaders/bluritems.frag | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/quickmultieffect/shaders/bluritems.frag b/quickmultieffect/shaders/bluritems.frag new file mode 100644 index 0000000..4198e2f --- /dev/null +++ b/quickmultieffect/shaders/bluritems.frag @@ -0,0 +1,21 @@ +#version 440 + +layout(location = 0) in vec2 texCoord0; +layout(location = 1) in vec2 texCoord1; +layout(location = 2) in vec2 texCoord2; +layout(location = 3) in vec2 texCoord3; +layout(location = 0) out vec4 fragColor; + +layout(std140, binding = 0) uniform buf { + mat4 qt_Matrix; + float qt_Opacity; + vec2 offset; +}; + +layout(binding = 1) uniform sampler2D source; + +void main() { + vec4 sourceColor = (texture(source, texCoord0) + texture(source, texCoord1) + + texture(source, texCoord2) + texture(source, texCoord3)) / 4.0; + fragColor = sourceColor * qt_Opacity; +} |