Add new option to materials.xml : disable z-buffer writes
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7364 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
eeafd79995
commit
225116fb6f
@ -67,6 +67,7 @@ Material::Material(const XMLNode *node, int index)
|
||||
node->get("slowdown-time", &m_slowdown_time );
|
||||
node->get("anisotropic", &m_anisotropic );
|
||||
node->get("backface-culling", &m_backface_culling );
|
||||
node->get("disable-z-write", &m_disable_z_write );
|
||||
std::string s("");
|
||||
node->get("graphical-effect", &s );
|
||||
if(s=="water")
|
||||
@ -149,6 +150,7 @@ void Material::init(unsigned int index)
|
||||
m_ignore = false;
|
||||
m_resetter = false;
|
||||
m_add = false;
|
||||
m_disable_z_write = false;
|
||||
m_max_speed_fraction = 1.0f;
|
||||
m_slowdown_time = 1.0f;
|
||||
m_sfx_name = "";
|
||||
@ -362,6 +364,11 @@ void Material::setMaterialProperties(video::SMaterial *m) const
|
||||
modes++;
|
||||
}
|
||||
|
||||
if (m_disable_z_write)
|
||||
{
|
||||
m->ZWriteEnable = false;
|
||||
}
|
||||
|
||||
if (modes > 1)
|
||||
{
|
||||
std::cerr << "[Material::setMaterialProperties] More than one main mode set for " << m_texname.c_str() << "\n";
|
||||
|
@ -75,6 +75,9 @@ private:
|
||||
/** Whether to use anisotropic filtering for this texture */
|
||||
bool m_anisotropic;
|
||||
|
||||
/** Set to true to disable writing to the Z buffer. Usually to be used with alpha blending */
|
||||
bool m_disable_z_write;
|
||||
|
||||
/** True if lightmapping is enabled for this material. */
|
||||
bool m_lightmap;
|
||||
float m_friction;
|
||||
|
Loading…
Reference in New Issue
Block a user