diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-11-08 16:16:16 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2022-03-18 22:56:54 +0100 |
commit | a184f2e0abfa0daf9190b72901208373dd5c1f79 (patch) | |
tree | 915f42c5debae2c7627e45621f1462c05eab0308 /examples/quick/quickwidgets/qquickwidgetversuswindow_opengl/wobble.frag | |
parent | 40b6bcfb1b6297f36659b36d393c9a33403d8360 (diff) |
Make QQuickWidget QRhi-based
When it comes to examples, quickwidget has the direct OpenGL usage
removed because we want this example to be working with any graphics
API. qquickviewcomparison, which features direct OpenGL usage within
its Qt Quick scene, is renamed to a more descriptive name and is also
getting a doc landing page. It continues to be requesting OpenGL (via
QRhi) explicitly.
Change-Id: Iae5b835441f3af229e9746e14dedbe9d1a62b2b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'examples/quick/quickwidgets/qquickwidgetversuswindow_opengl/wobble.frag')
-rw-r--r-- | examples/quick/quickwidgets/qquickwidgetversuswindow_opengl/wobble.frag | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/examples/quick/quickwidgets/qquickwidgetversuswindow_opengl/wobble.frag b/examples/quick/quickwidgets/qquickwidgetversuswindow_opengl/wobble.frag new file mode 100644 index 0000000000..9fddf1a162 --- /dev/null +++ b/examples/quick/quickwidgets/qquickwidgetversuswindow_opengl/wobble.frag @@ -0,0 +1,20 @@ +#version 440 + +layout(location = 0) in vec2 qt_TexCoord0; +layout(location = 0) out vec4 fragColor; + +layout(binding = 1) uniform sampler2D source; + +layout(std140, binding = 0) uniform buf { + mat4 qt_Matrix; + float qt_Opacity; + float amplitude; + float frequency; + float time; +}; + +void main() +{ + vec2 p = sin(time + frequency * qt_TexCoord0); + fragColor = texture(source, qt_TexCoord0 + amplitude * vec2(p.y, -p.x)) * qt_Opacity; +} |