Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Ogre::TextureUnitState* t = myMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0);
t->setTextureName(myTextureName, myGroup);
I also saw that it's possible to retrieve a TexturePtr from a name and a groupName with TextureManager's getByName function but once I have the texturePtr I have no way to apply it to my material.
Am I missing something ? Is there another way to do that ?
Jac00b wrote:
I also saw that it's possible to retrieve a TexturePtr from a name and a groupName with TextureManager's getByName function but once I have the texturePtr I have no way to apply it to my material.
Am I missing something ? Is there another way to do that ?
The online doco doesn't have that API feature but my local 1.8.0 doco does have it ?!!? The online doco also says it was last updated in 2010 for version 1.7.1 so something screwy might be afoot. I'll ask the moderators in another forum. Anyway, try what I suggested anyway.
Thanks for your solution, unfortunately I don't have the setTexture function in my 1.7.4 version. Don't know why.
But, I saw that setTextureName function is loading the texture from its parent group, so maybe if I create my material in the appropriate group I'll be able to load the proper texture. I'll try this and let you know.
If you have any other solution, please let me know.
Thanks.
It works fine, but for the first loading only.
If I load myTexture.jpg in group groupA then I reload my application and try to load myTexture.jpg in group groupB everything is fine, in both cases the correct texture is loaded.
But, when I load textures one after the other, the first loaded texture is always loaded afterwards, no matter on which material or what is the material's group.