You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not Working, so I say to go the documentation to see how the methods work, the properties are Qvariant type. I looked how to do, QVariant :: FromValue() it does not work either.
My question is how to get textures through qvariant or QAbsractTexture ?
Please i need help ???
The text was updated successfully, but these errors were encountered:
You have to first load the texture and then pass it on the material.
Something like: QMetalRoughMaterial *mat = new QMetalRoughMaterial(); Qt3DRender::QTextureLoader *textureLoader = new Qt3DRender::QTextureLoader(); textureLoader->setSource(QUrl(QStringLiteral("qrc:/texture/metal/Metal03_col.jpg")); mat->baseColor().setValue(QVariant::fromValue(textureLoader));
sorry but is not work. i used just the example of Qt basicshapes-cpp and i added your code by replace it into sphere material, and the result is this:
the code is here:
Qt3DExtras::QMetalRoughMaterial *mat = new Qt3DExtras::QMetalRoughMaterial(); Qt3DRender::QTextureLoader *textureLoader = new Qt3DRender::QTextureLoader(); textureLoader->setSource(QUrl(QStringLiteral("qrc:/texture/Rock035_2K_Color.jpg"))); mat->baseColor().setValue(QVariant::fromValue(textureLoader));
I noticed this message in execution: QObject::connect(QOpenGLContext, Unknown): invalid nullptr parameter QString::arg: Argument missing: " Max Work Group Size: 1024, 1024, 64\n Max Work Group Count: 65535, 65535, 65535\n Max Invocations: 65535\n Max Shared Memory Size: 1024\n" , 32768
i was thinking if I reduced the size of the images, maybe is gonna work , but nothing
hello,
I tried to use QMetalRoughMaterial for my cube to see how it's work. i saw the example in QML and i tried to translate it in C++ code That's it :
Qt3DExtras::QMorphPhongMaterial *mat {new Qt3DExtras::QMorphPhongMaterial(this)}; mat->baseColor().setValue(QUrl(QStringLiteral("qrc:/texture/metal/Metal03_col.jpg"))); mat->metalness().setValue(QUrl(QStringLiteral("qrc:/texture/metal/Metal03_met.jpg"))); mat->roughness().setValue(QUrl(QStringLiteral("qrc:/texture/metal/Metal03_rgh.jpg"))); mat->normal().setValue(QUrl(QStringLiteral("qrc:/texture/metal/Metal03_nrm.jpg"))); mat->ambientOcclusion().setValue(QUrl(QStringLiteral("qrc:/texture/metal/Metal03_disp.jpg")));
Not Working, so I say to go the documentation to see how the methods work, the properties are Qvariant type. I looked how to do, QVariant :: FromValue() it does not work either.
My question is how to get textures through qvariant or QAbsractTexture ?
Please i need help ???
The text was updated successfully, but these errors were encountered: