Skip to content

Commit

Permalink
Plugins: Assimp - try to detect material transparency
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Mar 1, 2025
1 parent 63ba6a3 commit aa6a1ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions PlugIns/Assimp/src/AssimpLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,12 @@ static MaterialPtr createMaterial(const aiMaterial* mat, const Ogre::String &gro
omat->setDiffuse(clr.r, clr.g, clr.b, clr.a);
}

if (clr.a < 1.0f)
{
omat->setSceneBlending(SBT_TRANSPARENT_ALPHA);
omat->setDepthWriteEnabled(false);
}

// specular
clr = aiColor4D(1.0f, 1.0f, 1.0f, 1.0f);
if (AI_SUCCESS == aiGetMaterialColor(mat, AI_MATKEY_COLOR_SPECULAR, &clr))
Expand Down

0 comments on commit aa6a1ea

Please sign in to comment.