This is how I create the billboard:
Code: Select all
billboardSetInstance = sceneManager->createBillboardSet(1);
billboardSetInstance->setDefaultDimensions(1.0,1.0);
billboardSetInstance->setDatablockOrMaterialName("billboardMat",
Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
// billboardSetInstance->setTextureStacksAndSlices(1,1);
Ogre::v1::Billboard* billboardInstance = billboardSetInstance->createBillboard(0.0,0.0,0.0);
// billboardInstance->setTexcoordRect(Ogre::FloatRect(0,0,1,1));
// billboardInstance->setColour(Ogre::ColourValue(1.0, 0.5, 0.5, 0.5));
// billboardInstance->setTexcoordIndex(0);
Ogre::SceneNode* billboardNode = static_cast<Ogre::SceneNode*>(
mGraphicsSystem->getSceneManager()->getRootSceneNode()->createChild());
billboardNode->attachObject(billboardSetInstance);
I suspected that there might be a problem with texcoords, so I tried the stuff in the comments (in sane combinations), to no effect, the square remains white.
The material itself seems to be working, as I use it with a v2 mesh, and it shows up as expected. How exactly the material is associated with the mesh is lost on me (using tutorial files as base), but I assume that the createItem call does the necessary work.
Here is the material script 'billboardMat':
Code: Select all
hlms billboardMat pbs
{
ambient 0.5 0.5 0.5
diffuse 1.0 1.0 1.0
diffuse_map billboardtex.dds
}
My question now is, how would I diagnose what is going on? Any help is appreciated.
-j