From 13e8e2faf9eba74bd40b0167bc15061b49f220f6 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Sun, 29 Mar 2009 13:24:54 +0000 Subject: [PATCH] 1) Changed transparency mode to use ..._REF material, which avoids the necessity of additional changes to avoid issues with Z buffer sorting (and it is faster, too) 2) Added support for sphere maps. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3309 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/material.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/material.cpp b/src/material.cpp index f2c1e8a3f..f7f06d5fc 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -120,6 +120,13 @@ void Material::install(bool is_full_path) void Material::setMaterialProperties(scene::IMeshBuffer *mb) const { if(m_transparency) - mb->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; + // 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. + mb->getMaterial().MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF; + if(m_sphere_map) + mb->getMaterial().MaterialType = video::EMT_SPHERE_MAP; // FIXME: more parameters need to be set! } // setMaterialProperties