QUItCoding / qnanopainter

Library for implementing OpenGL accelerated Qt (Quick) C++ UI components.
http://quitcoding.com
Other
396 stars 77 forks source link

Vertex Texture Mapping #72

Open mariuszmaximus opened 1 year ago

mariuszmaximus commented 1 year ago

Is possible draw vertex and map texture UV to vertex ?

Like https://people.eecs.berkeley.edu/~ug/slide/pipeline/assignments/as9/texture.gif

NielsMayer commented 1 year ago

What about using Qt Quick Effect Maker (see for example Examples/Qt-6.5.1/quickeffectmaker/wiggly/WigglyEffect )

Here's my use of it in trying to develop a torture-test to show problems with QML Media Player and/or QtMultimedia with the new ffmpeg back-end on Linux. Animations are jittery and jerky until forcibly reverting back to the old gstreamer backend. Causes the exact same problems with qnanopainter unfortunately (not a qnanopainter bug, a Qt bug).

QtQuick effects maker in this case is doing what you're asking for, warping a layered composition of video, the particle system example from Examples/Qt-6.5.1/quick/particles/emitters/trailemitter.qml, and two rotating qml rectangles (which show the jitter effect more clearly).

image

QUItCoding commented 1 year ago

Nice demo Niels!

@Marius: Like Niels said, you can apply ShaderEffect for QNanoPainter item to move vertices (and do other effects). Shader effect can be done live editing with the Qt Quick Effect Maker. Alternatively if you only need to rotate the item around x/y/z axis, you can use Item Rotation transform https://doc.qt.io/qt-6/qml-qtquick-rotation.html

mariuszmaximus commented 1 year ago

@NielsMayer, @QUItCoding I would like use qnanopainter in QWidget application like in sample hellowidget hellowindow I woudl like do scan conversion

fig8-1