Unsolved [Qt3D] QPlaneMesh only one side is visible?
-
Maybe just a silly question. I'm playing with Qt3D and can draw stuff using in-built meshes. However, for QPlaneMesh, it appears to me that just one side of it is visible. Does any one know how to make both sides appear in the rendered scene?
Thanks...
-
@ymhsieh Although it may be better to create your own Material, we were able to display both sides of QPhongMaterial with the following code.
// Material auto material = new Qt3DExtras::QPhongMaterial(rootEntity); auto cullFront = new Qt3DRender::QCullFace(); cullFront->setMode(Qt3DRender::QCullFace::NoCulling); for (auto tech : material->effect()->techniques()) { for (auto renderPass : tech->renderPasses()) { renderPass->renderStates().removeIf([=](Qt3DRender::QRenderState* renderState) { return dynamic_cast<Qt3DRender::QCullFace*>(renderState) != NULL; }); renderPass->addRenderState(cullFront); } }