Re: [Interest] Qt Quick and animatic 12MP image
Why not make it a new TableView (new, 5.12) of images? Sent: Wednesday, September 05, 2018 at 8:08 AM From: "Tomasz Olszak" To: "Qt Interest" Subject: [Interest] Qt Quick and animatic 12MP image Hi, I want to animate (change flickable contentX and contentY) image position in screen. Image is bigger(4000x3000) than screen. Currently, I implemented it on I7 ivybridge on Kubuntu 18.04. It simply stutters few times a second. If anyone has integrated Intel GPU - could I kindly ask to check if it also stutter for him? Is it a GPU limit to handle such big texture or perhaps I can tweak something to make it fluent: Snippet: https://pastebin.com/gU7AzvrL Iinstead of image I used Rectangles. On bottom of snippet is qtdiag output related to my presenting my OpenGL settings. Thanks in advance, Tomek ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Qt Quick and animatic 12MP image
Because I have one image to show :) It needs to be panned around using some remote controller. There is also option f uniform animation for x/y but I can't make it fluent. Seems like it is issue with Qt Quick rendering, The snippet I provided contains internal rectangle just to show that something is moving. You can set gradient and remove internal rectangles though. I just can't make fluent scroll of big items. Something jumps in, either it is GC, or GPU cleans some internal cache. I'm trying to find some expertise here. śr., 5 wrz 2018 o 16:03 Jason H napisał(a): > Why not make it a new TableView (new, 5.12) of images? > > > *Sent:* Wednesday, September 05, 2018 at 8:08 AM > *From:* "Tomasz Olszak" > *To:* "Qt Interest" > *Subject:* [Interest] Qt Quick and animatic 12MP image > Hi, I want to animate (change flickable contentX and contentY) image > position in screen. Image is bigger(4000x3000) than screen. Currently, I > implemented it on I7 ivybridge on Kubuntu 18.04. > It simply stutters few times a second. If anyone has integrated Intel GPU > - could I kindly ask to check if it also stutter for him? Is it a GPU limit > to handle such big texture or perhaps I can tweak something to make it > fluent: > > Snippet: https://pastebin.com/gU7AzvrL > > Iinstead of image I used Rectangles. On bottom of snippet is qtdiag output > related to my presenting my OpenGL settings. > > > Thanks in advance, > Tomek > > ___ Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest > ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Qt Quick and animatic 12MP image
2018-09-05 14:08 GMT+02:00 Tomasz Olszak : > Hi, I want to animate (change flickable contentX and contentY) image > position in screen. Image is bigger(4000x3000) than screen. Currently, I > implemented it on I7 ivybridge on Kubuntu 18.04. > It simply stutters few times a second. If anyone has integrated Intel GPU > - could I kindly ask to check if it also stutter for him? Is it a GPU limit > to handle such big texture or perhaps I can tweak something to make it > fluent: > > Instead of flickable i'd use GridView (which uses flickable). Only the items actually on screen will be instantiated, so it scales much better. If your real case is an image and your GPU supports texture sizes as big as your image size then maybe something like this could be faster (let a shader to the zooming/cropping): import QtQuick 2.9 import QtQuick.Window 2.2 Window { visible: true width: 640 height: 480 Image { id: img source: "http://www.letsgodigital.org/images/producten/1515/testrapport/underwater-photos.jpg"; visible: false } Flickable { anchors.fill: parent id: flicker contentWidth: dummyFlickItem.width contentHeight: dummyFlickItem.height Item { id: dummyFlickItem width: img.sourceSize.width height: img.sourceSize.height } } ShaderEffect { anchors.fill: flicker property variant src: img property real xPosition: flicker.visibleArea.xPosition property real yPosition: flicker.visibleArea.yPosition property real widthRatio: flicker.visibleArea.widthRatio property real heightRatio: flicker.visibleArea.heightRatio vertexShader: " uniform highp mat4 qt_Matrix; attribute highp vec4 qt_Vertex; attribute highp vec2 qt_MultiTexCoord0; uniform highp float xPosition; uniform highp float yPosition; uniform highp float widthRatio; uniform highp float heightRatio; varying highp vec2 coord; void main() { coord.x = xPosition + widthRatio*qt_MultiTexCoord0.x; coord.y = yPosition + heightRatio*qt_MultiTexCoord0.y; gl_Position = qt_Matrix * qt_Vertex; }" fragmentShader: " varying highp vec2 coord; uniform sampler2D src; uniform lowp float qt_Opacity; void main() { gl_FragColor = texture2D(src, coord); }" } } ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Qt Quick and animatic 12MP image
Ola, thanks for the snippet. Unfortunately I don't see any difference. But what is interesting - at least on my I7 haswell laptop now (also Kubuntu 18.04). When my snippet starts it stutters for about 2 seconds then is super fluent. There is one condition though - you can't move mouse. As soon as you use mouse it stutters a lot. Tomorrow I will try with eglfs and QT_QPA_EGLFS_HIDECURSOR=true. Seems like it is related to cursor rendering or input handling. śr., 5 wrz 2018 o 17:20 Ola Røer Thorsen napisał(a): > 2018-09-05 14:08 GMT+02:00 Tomasz Olszak : > >> Hi, I want to animate (change flickable contentX and contentY) image >> position in screen. Image is bigger(4000x3000) than screen. Currently, I >> implemented it on I7 ivybridge on Kubuntu 18.04. >> It simply stutters few times a second. If anyone has integrated Intel GPU >> - could I kindly ask to check if it also stutter for him? Is it a GPU limit >> to handle such big texture or perhaps I can tweak something to make it >> fluent: >> >> > Instead of flickable i'd use GridView (which uses flickable). Only the > items actually on screen will be instantiated, so it scales much better. > > If your real case is an image and your GPU supports texture sizes as big > as your image size then maybe something like this could be faster (let a > shader to the zooming/cropping): > > > import QtQuick 2.9 > > import QtQuick.Window 2.2 > > > Window { > > visible: true > > width: 640 > > height: 480 > > > Image { > > id: img > > source: > "http://www.letsgodigital.org/images/producten/1515/testrapport/underwater-photos.jpg"; > > visible: false > > } > > > Flickable { > > anchors.fill: parent > > id: flicker > > contentWidth: dummyFlickItem.width > > contentHeight: dummyFlickItem.height > > > Item { > > id: dummyFlickItem > > width: img.sourceSize.width > > height: img.sourceSize.height > > } > > } > > > ShaderEffect { > > anchors.fill: flicker > > property variant src: img > > property real xPosition: flicker.visibleArea.xPosition > > property real yPosition: flicker.visibleArea.yPosition > > property real widthRatio: flicker.visibleArea.widthRatio > > property real heightRatio: flicker.visibleArea.heightRatio > > > vertexShader: " > > uniform highp mat4 qt_Matrix; > > attribute highp vec4 qt_Vertex; > > attribute highp vec2 qt_MultiTexCoord0; > > > uniform highp float xPosition; > > uniform highp float yPosition; > > uniform highp float widthRatio; > > uniform highp float heightRatio; > > > varying highp vec2 coord; > > void main() { > > coord.x = xPosition + widthRatio*qt_MultiTexCoord0.x; > > coord.y = yPosition + heightRatio*qt_MultiTexCoord0.y; > > gl_Position = qt_Matrix * qt_Vertex; > > }" > > fragmentShader: " > > varying highp vec2 coord; > > uniform sampler2D src; > > uniform lowp float qt_Opacity; > > void main() { > > gl_FragColor = texture2D(src, coord); > > }" > > } > > } > > > > ___ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest > ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
Re: [Interest] Qt Quick and animatic 12MP image
Just would like to update if someone is interested. It was GPU performance issue. 1. I tested it when 2 screens were connected. With one screen it is a lot more fluent 2. When I tested it with eglfs on small device mother board with Intel HD Graphics 510 it works super smooth. 3. On Kubuntu 18.04 seems rendering mouse cursor has significant impact on performance. Thanks for help! śr., 5 wrz 2018 o 23:06 Tomasz Olszak napisał(a): > Ola, thanks for the snippet. > > Unfortunately I don't see any difference. > > But what is interesting - at least on my I7 haswell laptop now (also > Kubuntu 18.04). When my snippet starts it stutters for about 2 seconds then > is super fluent. There is one condition though - you can't move mouse. As > soon as you use mouse it stutters a lot. > Tomorrow I will try with eglfs and QT_QPA_EGLFS_HIDECURSOR=true. Seems > like it is related to cursor rendering or input handling. > > śr., 5 wrz 2018 o 17:20 Ola Røer Thorsen napisał(a): > >> 2018-09-05 14:08 GMT+02:00 Tomasz Olszak : >> >>> Hi, I want to animate (change flickable contentX and contentY) image >>> position in screen. Image is bigger(4000x3000) than screen. Currently, I >>> implemented it on I7 ivybridge on Kubuntu 18.04. >>> It simply stutters few times a second. If anyone has integrated Intel >>> GPU - could I kindly ask to check if it also stutter for him? Is it a GPU >>> limit to handle such big texture or perhaps I can tweak something to make >>> it fluent: >>> >>> >> Instead of flickable i'd use GridView (which uses flickable). Only the >> items actually on screen will be instantiated, so it scales much better. >> >> If your real case is an image and your GPU supports texture sizes as big >> as your image size then maybe something like this could be faster (let a >> shader to the zooming/cropping): >> >> >> import QtQuick 2.9 >> >> import QtQuick.Window 2.2 >> >> >> Window { >> >> visible: true >> >> width: 640 >> >> height: 480 >> >> >> Image { >> >> id: img >> >> source: >> "http://www.letsgodigital.org/images/producten/1515/testrapport/underwater-photos.jpg"; >> >> visible: false >> >> } >> >> >> Flickable { >> >> anchors.fill: parent >> >> id: flicker >> >> contentWidth: dummyFlickItem.width >> >> contentHeight: dummyFlickItem.height >> >> >> Item { >> >> id: dummyFlickItem >> >> width: img.sourceSize.width >> >> height: img.sourceSize.height >> >> } >> >> } >> >> >> ShaderEffect { >> >> anchors.fill: flicker >> >> property variant src: img >> >> property real xPosition: flicker.visibleArea.xPosition >> >> property real yPosition: flicker.visibleArea.yPosition >> >> property real widthRatio: flicker.visibleArea.widthRatio >> >> property real heightRatio: flicker.visibleArea.heightRatio >> >> >> vertexShader: " >> >> uniform highp mat4 qt_Matrix; >> >> attribute highp vec4 qt_Vertex; >> >> attribute highp vec2 qt_MultiTexCoord0; >> >> >> uniform highp float xPosition; >> >> uniform highp float yPosition; >> >> uniform highp float widthRatio; >> >> uniform highp float heightRatio; >> >> >> varying highp vec2 coord; >> >> void main() { >> >> coord.x = xPosition + widthRatio*qt_MultiTexCoord0.x; >> >> coord.y = yPosition + heightRatio*qt_MultiTexCoord0.y; >> >> gl_Position = qt_Matrix * qt_Vertex; >> >> }" >> >> fragmentShader: " >> >> varying highp vec2 coord; >> >> uniform sampler2D src; >> >> uniform lowp float qt_Opacity; >> >> void main() { >> >> gl_FragColor = texture2D(src, coord); >> >> }" >> >> } >> >> } >> >> >> >> ___ >> Interest mailing list >> Interest@qt-project.org >> http://lists.qt-project.org/mailman/listinfo/interest >> > ___ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest