Skip to content

Commit

Permalink
Fix forgotten material properties for meshes (also seems to have been…
Browse files Browse the repository at this point in the history
… forgotten for cubes previously). This allows transparent png images to work properly
  • Loading branch information
MirceaKitsune authored and celeron55 committed Nov 27, 2012
1 parent 6b92722 commit 5f798d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/content_cao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,11 @@ class GenericCAO : public ClientActiveObject
m_prop.visual_size.X));
u8 li = m_last_light;
setMeshColor(m_meshnode->getMesh(), video::SColor(255,li,li,li));

m_meshnode->setMaterialFlag(video::EMF_LIGHTING, false);
m_meshnode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
m_meshnode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
m_meshnode->setMaterialFlag(video::EMF_FOG_ENABLE, true);
}
else if(m_prop.visual == "mesh"){
infostream<<"GenericCAO::addToScene(): mesh"<<std::endl;
Expand All @@ -936,6 +941,11 @@ class GenericCAO : public ClientActiveObject
m_prop.visual_size.X));
u8 li = m_last_light;
setMeshColor(m_animated_meshnode->getMesh(), video::SColor(255,li,li,li));

m_animated_meshnode->setMaterialFlag(video::EMF_LIGHTING, false);
m_animated_meshnode->setMaterialFlag(video::EMF_BILINEAR_FILTER, false);
m_animated_meshnode->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF);
m_animated_meshnode->setMaterialFlag(video::EMF_FOG_ENABLE, true);
}
else
errorstream<<"GenericCAO::addToScene(): Could not load mesh "<<m_prop.mesh<<std::endl;
Expand Down

0 comments on commit 5f798d9

Please sign in to comment.