Fix forgotten material properties for meshes (also seems to have been forgotten for...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 26 Nov 2012 23:35:18 +0000 (01:35 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 27 Nov 2012 06:06:13 +0000 (08:06 +0200)
src/content_cao.cpp

index c7d21d278368f6d92625152e913b538043f47a37..8229ded62daec26eb3d3597b38e4ea9d360de490 100644 (file)
@@ -923,6 +923,11 @@ public:
                                        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;
@@ -936,6 +941,11 @@ public:
                                                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;