Skip to content

Commit aa6a1ea

Browse files
committed
Plugins: Assimp - try to detect material transparency
1 parent 63ba6a3 commit aa6a1ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

PlugIns/Assimp/src/AssimpLoader.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,12 @@ static MaterialPtr createMaterial(const aiMaterial* mat, const Ogre::String &gro
982982
omat->setDiffuse(clr.r, clr.g, clr.b, clr.a);
983983
}
984984

985+
if (clr.a < 1.0f)
986+
{
987+
omat->setSceneBlending(SBT_TRANSPARENT_ALPHA);
988+
omat->setDepthWriteEnabled(false);
989+
}
990+
985991
// specular
986992
clr = aiColor4D(1.0f, 1.0f, 1.0f, 1.0f);
987993
if (AI_SUCCESS == aiGetMaterialColor(mat, AI_MATKEY_COLOR_SPECULAR, &clr))

0 commit comments

Comments
 (0)