aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/scenegraph_lancelot/data/shaders/atlas
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2020-05-14 17:45:00 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2020-05-19 09:43:08 +0200
commit5188167e633af743548be90db4fdcd2791dd9637 (patch)
treed93d26dc1faa280c007d4c28fa8f540fb4a07727 /tests/manual/scenegraph_lancelot/data/shaders/atlas
parent085af2f28845b14180d7ff07d5d98b51d2e8bb01 (diff)
Lancelot test for ShaderEffect atlas textures
Task-number: QTBUG-83975 Pick-to: 5.15 Change-Id: Icfff2aa9172bf10a1918be5364f27ed6faf94575 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/manual/scenegraph_lancelot/data/shaders/atlas')
-rw-r--r--tests/manual/scenegraph_lancelot/data/shaders/atlas/atlas.qml51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/manual/scenegraph_lancelot/data/shaders/atlas/atlas.qml b/tests/manual/scenegraph_lancelot/data/shaders/atlas/atlas.qml
new file mode 100644
index 0000000000..06c254253e
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/shaders/atlas/atlas.qml
@@ -0,0 +1,51 @@
+import QtQuick 2.15
+
+Item {
+ width: 320
+ height: 480
+
+ Column {
+ spacing: 10
+ padding: 5
+
+ Repeater {
+ model: ["sand_16x16.png", "circle_16x16.png", "star_16x16.png", "square_16x16.png"]
+ Row {
+ spacing: 20
+ Image {
+ id: img
+ source: "../../shared/" + modelData
+ }
+
+ // Non-atlased: copies subrect of atlas to a new texture
+ ShaderEffect {
+ width: img.width
+ height: img.height
+ property variant source: img
+ fragmentShader: "qrc:shaders/gradientgrid.frag"
+ supportsAtlasTextures: false
+ }
+
+ // Atlased: qt_MultiTexCoord0 points to the atlas subrect
+ ShaderEffect {
+ width: img.width
+ height: img.height
+ property variant source: img
+ fragmentShader: "qrc:shaders/gradientgrid.frag"
+ supportsAtlasTextures: true
+ }
+
+ // Subrect mode: qt_MultiTexCoord0 goes from 0.0 to 1.0,
+ // and qt_Subrect_source specifies the atlas subrect
+ ShaderEffect {
+ width: img.width
+ height: img.height
+ property variant source: img
+ fragmentShader: "qrc:shaders/gradientgrid.frag"
+ vertexShader: "qrc:shaders/subrect.vert"
+ supportsAtlasTextures: false
+ }
+ }
+ }
+ }
+}