I am trying to load a simple cube with per-vertex color information from a Stanford PLY file using QML.
My entity looks like this:
Entity
{
id: circle
property Material materialPoint: Material {
effect: Effect {
techniques: Technique {
renderPasses: RenderPass {
shaderProgram: ShaderProgram {
vertexShaderCode: loadSource("qrc:/imports/org/aid/shared/geometry/shaders/point.vert")
fragmentShaderCode: loadSource("qrc:/imports/org/aid/shared/geometry/shaders/point.frag")
}
}
}
}
parameters: Parameter { name: "pointSize"; value: 2 }
}
property alias translation: circleTransform.translation
property alias rotation : circleTransform.rotationZ
Mesh
{
id: circleMesh
source: "qrc:/resources/models/rg.ply"
}
Transform
{
id: circleTransform
scale : 1
}
components:
[materialPoint, circleTransform, circleMesh]
}
I have also tried replacing the material property with the default Qt material purposely created to solve this problem:
property Material materialPoint: PerVertexColorMaterial {}
.
Unfortunately, there are no per-vertex colors visible in the scene.
Is there any recommended way of importing a PLY file with vertex color data in QML? (I suppose it is possible to achieve this if one writes the logic in C++ and creates a specialized QML entity for doing so, but the functionality should be available already).