diff options
author | BlockMen <nmuelll@web.de> | 2015-09-28 20:49:38 +0200 |
---|---|---|
committer | BlockMen <nmuelll@web.de> | 2015-10-25 12:06:08 +0100 |
commit | 50ba7e114d0937061f988c9452904dd2456399b5 (patch) | |
tree | dab9054e22208e42841c29d3b38f3e1fe8134cda /src/content_cao.cpp | |
parent | 6907c3e40a16d491fd0f7b224ba30a58e0777a24 (diff) | |
download | minetest-50ba7e114d0937061f988c9452904dd2456399b5.tar.gz minetest-50ba7e114d0937061f988c9452904dd2456399b5.tar.bz2 minetest-50ba7e114d0937061f988c9452904dd2456399b5.zip |
Add option to disable backface culling for models
- Disabled by default (except players)
- Fixes #2984
Diffstat (limited to 'src/content_cao.cpp')
-rw-r--r-- | src/content_cao.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/content_cao.cpp b/src/content_cao.cpp index e864063a4..72f6145b0 100644 --- a/src/content_cao.cpp +++ b/src/content_cao.cpp @@ -934,10 +934,15 @@ void GenericCAO::addToScene(scene::ISceneManager *smgr, ITextureSource *tsrc, u8 li = m_last_light; setMeshColor(m_animated_meshnode->getMesh(), video::SColor(255,li,li,li)); + bool backface_culling = m_prop.backface_culling; + if (m_is_player) + backface_culling = false; + 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); + m_animated_meshnode->setMaterialFlag(video::EMF_BACK_FACE_CULLING, backface_culling); } else errorstream<<"GenericCAO::addToScene(): Could not load mesh "<<m_prop.mesh<<std::endl; |