just encountered this assertation failure. i have 2 scene managers, one for the level and one just to display a compass needle (via Render to texture and cegui).
It occurs as soon as I use an animated material, like this one:
Code: Select all
material test/sparkreal
{
technique
{
pass
{
alpha_rejection greater 150
scene_blend alpha_blend
cull_hardware none
cull_software none
texture_unit
{
anim_texture spark1.png spark2.png spark3.png 0.5
}
}
}
}
i can see it animate briefly when the object is created, and then the error occurs.
DimA's function does not help, but i do not create dynamic materials, just call entity->setMaterialName().
edit: using OGRE 1.4.7 [Eihort], SDK.
and clicking "retry to debug the application" is pretty much useless, since it stops at mRoot->startrendering()
edit2: the exact error:
edit3: i'm creating the rendertexture like this:
Code: Select all
compSceneMgr= mRoot->createSceneManager(ST_GENERIC);
compNeedleNode = compSceneMgr->getRootSceneNode()->createChildSceneNode();
Entity *ent = compSceneMgr->createEntity("compassent","CompassNeedle.mesh");
SceneNode *meshNode = compNeedleNode->createChildSceneNode();
meshNode->attachObject(ent);
compassCam = compSceneMgr->createCamera("compasscam");
compassWnd = wmgr->getWindow("compass");
unsigned int width = compassWnd->getPixelSize().d_width;
unsigned int height = compassWnd->getPixelSize().d_height;
TexturePtr renderTex = TextureManager::getSingleton().createManual( "CompassRttTex",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D,
width, height, 0, PF_R8G8B8A8, TU_RENDERTARGET );
compassCam->setAspectRatio(Real(width) / Real(height));
compassCam->setPosition(0,1.2,0);
compassCam->pitch(Degree(-90));
compassCam->setNearClipDistance(0.01);
RenderTarget *rttTex = renderTex->getBuffer()->getRenderTarget();
Viewport *v = rttTex->addViewport(compassCam);
v->setClearEveryFrame(true);
v->setBackgroundColour(ColourValue(0,0,0,0));
MaterialPtr mat = MaterialManager::getSingleton().create("CompassRttMat",
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
TextureUnitState* t = mat->getTechnique(0)->getPass(0)->createTextureUnitState("CompassRttTex");
t->setTextureAddressingMode(TextureUnitState::TAM_CLAMP);
CEGUI::Texture* ceguiTex = mGUIRenderer->createTexture(renderTex);
CEGUI::String imageSetName = "compassimgset";
Imageset* textureImageSet = ImagesetManager::getSingleton().createImageset(imageSetName, ceguiTex);
textureImageSet->defineImage("compassneedle", Point(0.0f, 0.0f), Size(ceguiTex->getWidth(), ceguiTex->getHeight()), Point(0.0f,0.0f));
compassWnd->setProperty("Image", "set:"+imageSetName+" image:compassneedle");
(copypaste from the sample)