From da45ef472118a0cdffe6a93e0de9a8f3c582aff6 Mon Sep 17 00:00:00 2001 From: auria Date: Mon, 22 Feb 2010 20:26:26 +0000 Subject: [PATCH] Some tweaks with alpha. I thought this'd fix Mr Ice Block floating eyes, but it's not the case *sigh* git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@4802 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/graphics/material.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/graphics/material.cpp b/src/graphics/material.cpp index 0e80f5bd0..8f42b2a25 100644 --- a/src/graphics/material.cpp +++ b/src/graphics/material.cpp @@ -129,18 +129,27 @@ void Material::install(bool is_full_path) void Material::setMaterialProperties(video::SMaterial *m) const { if (m_alpha_testing) + { // 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_alpha_blending) + { + m->ZWriteEnable = false; // for transluscent stuff, don't write to the Z buffer m->MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; + } else if (m_sphere_map) + { m->MaterialType = video::EMT_SPHERE_MAP; + } else if (m_lightmap) + { m->MaterialType = video::EMT_LIGHTMAP; + } if (!m_lighting) {