Search code examples
qtqt3d

Qt3D SceneLoader issue with alpha materials


I'm using SceneLoader to load an obj + mtl model which has some materials with alpha. Geometry data is loaded correctly but materials with transparency are rendered fully opaque.

this the definition of the material shown opaque:

newmtl Glass
Ka 0.5000 0.5000 0.5000
Kd 0.5000 0.5000 0.5000
Ks 0.5000 0.5000 0.5000
Tf 0.0000 1.0000 1.0000
d 0.5000
illum 4

Is this a Qt bug or a bad assimp parsing?


Solution

  • Seems that using SceneLoader with an ".obj" file doesn't parse transparency parameters quite well. The solution to my problem was using the "qgltf" application so I could convert my model to gltf format (besides it has lower loading times). Then edit the generated qgltf file by adding the parameter "transparency" to the corresponding material.