From b2b5b095b29c7c624d2c901918167d92f5ae79c7 Mon Sep 17 00:00:00 2001 From: auria Date: Thu, 29 Oct 2009 21:00:11 +0000 Subject: [PATCH] Fixed unlit materials (i.e. nitro color no more depends on your orientation) git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@4167 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/material.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/graphics/material.cpp b/src/graphics/material.cpp index ae9d7950b..bd97c7123 100644 --- a/src/graphics/material.cpp +++ b/src/graphics/material.cpp @@ -127,17 +127,26 @@ void Material::install(bool is_full_path) */ void Material::setMaterialProperties(video::SMaterial *m) const { - if(m_transparency) + if (m_transparency) // Note: if EMT_TRANSPARENT_ALPHA_CHANNEL is used, you have to use // scene_manager->getParameters()->setAttribute( // scene::ALLOW_ZWRITE_ON_TRANSPARENT, true); and enable // updates of the Z buffer of the material. Since the _REF // approach is faster (and looks better imho), this is used for now. m->MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; - else if(m_sphere_map) - m->MaterialType = video::EMT_SPHERE_MAP; - else if(m_alpha_blending) + else if (m_alpha_blending) m->MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; + if (m_sphere_map) + m->MaterialType = video::EMT_SPHERE_MAP; + + if (!m_lighting) + { + //m->setFlag( video::EMF_LIGHTING, false ); + m->AmbientColor = video::SColor(255, 255, 255, 255); + m->DiffuseColor = video::SColor(255, 255, 255, 255); + m->EmissiveColor = video::SColor(255, 255, 255, 255); + m->SpecularColor = video::SColor(255, 255, 255, 255); + } // FIXME: more parameters need to be set! } // setMaterialProperties