Assert in _loadMaterial

paiden

28-02-2006 19:49:28

I always get an assert saying:

Program:...
File: ..\src\OgrePagingLandScapeTexture_Image.cpp
Line:76

Expression: !templateMaterial.isNull()

...


And another question.
_loadMaterial does the following:

mMaterial=MaterialManager::getSingleton().getByName(matname);

with: natname="ImageTexture.0.0ps_texture_1k" WHY?

PLSM is really hard to learn :(

tuan kuranes

28-02-2006 20:29:13

!templateMaterial.isNull() means you do not have "PagingLandScape.Template.VertexPixelShaded" material script in your resources ?

it should be in "PagingLandScapeTemplate.material" file that should be in media/paginglandscape2/materials/scripts/

For each page, plsm2 create a material from a template, and create a unique name to reference it, "imageTexture.0.0ps_texture_1k" which is "texturemode+X+Y+terrain name". Ogre may still have it in its resource manager if page was unloaded not long ago, so we ask materialmanager if it still has it. otherwise we create it.

paiden

03-03-2006 16:22:13

That was the Problem.

I set the Resource-Paths with Ogre::ResourceGroupManager::addResourceLocation, but forgot to call Ogre::ResourceGroupManager::initializeAllResourceGroups.