diff --git a/code/nel/include/nel/3d/dynamic_material.h b/code/nel/include/nel/3d/dynamic_material.h index 4e07443d3..bc89a88a2 100644 --- a/code/nel/include/nel/3d/dynamic_material.h +++ b/code/nel/include/nel/3d/dynamic_material.h @@ -81,6 +81,7 @@ namespace NL3D public: CDynMaterial(); ~CDynMaterial(); + void reconstruct(); void clear(); void serial( NLMISC::IStream &f ); std::string getClassName(){ return "CDynMaterial"; } diff --git a/code/nel/src/3d/dynamic_material.cpp b/code/nel/src/3d/dynamic_material.cpp index 3ef282b26..7202f9a05 100644 --- a/code/nel/src/3d/dynamic_material.cpp +++ b/code/nel/src/3d/dynamic_material.cpp @@ -150,9 +150,7 @@ namespace NL3D CDynMaterial::CDynMaterial() { - SRenderPass *p = new SRenderPass(); - p->setName( "pass1" ); - passes.push_back( p ); + reconstruct(); } CDynMaterial::~CDynMaterial() @@ -160,6 +158,14 @@ namespace NL3D clear(); } + void CDynMaterial::reconstruct() + { + clear(); + SRenderPass *p = new SRenderPass(); + p->setName( "pass1" ); + passes.push_back( p ); + } + void CDynMaterial::clear() { std::vector< SRenderPass* >::iterator itr = passes.begin(); diff --git a/code/nel/src/3d/material.cpp b/code/nel/src/3d/material.cpp index deb447d2c..0a16687c8 100644 --- a/code/nel/src/3d/material.cpp +++ b/code/nel/src/3d/material.cpp @@ -641,6 +641,8 @@ void CMaterial::createDynMat() { if( dynMat == NULL ) dynMat = new CDynMaterial(); + else + dynMat->reconstruct(); SRenderPass *p = dynMat->getPass( 0 );