QML ShaderEffect and property type
-
Hi all,
I would like to pass a matrix3x3 to my openGL script but I can't find the right type to use in QML.
It works with a matrix4x4 in the following example :@
ShaderEffect {
...property matrix4x4 uMatrix: Qt.matrix4x4(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1) ...
}
@Unfortunately the QML type "matrix3x3" does not exist. I tried many other types without success.
Does anyone have a solution please ? -
amund_l Thanks for reply.
In my shader I use a matrix3x3 so I would like to set it directly from QML.
Another solution would be to convert a matrix4x4 to matrix3x3 at the beginning of my shader. Is it possible ?
Something like :
@
mat3 matrix3x3 = matrix4x4 * ???;"
@ -
The property types which are provided by QtQuick are listed at http://doc-snapshot.qt-project.org/qt5-stable/qtquick/qtquick-qmltypereference.html#basic-types however not all of them have conversions to uniforms/varyings in ShaderEffect. Matrix3x3 doesn't exist at all. vector2d, vector3d, vector4d, quaternion and matrix4x4 should all have conversions.
Cheers,
Chris.