Page 1 of 1

ogre-next, billboards::v1, white rects render, no matrial

Posted: Thu Feb 13, 2020 6:29 pm
by Nickak2003
I am trying to get billboards working in ogre-next, the geometry renders but the material is white. The scene is only lit with ambient lighting.

The material script loads and is as follows:

Code: Select all

hlms hlms_bullet pbs
{
	diffuse_map	Rocks_Diffuse.tga
}

Code: Select all

class BulletCollection {
	Ogre::v1::BillboardSet* mBillboardSet{ nullptr };
	Ogre::SceneNode* mSN{ nullptr };

	std::vector< Ogre::v1::Billboard* > mBillboards;

public:
	void setup(Graphics& graphics, std::string materialName) {
	
		mBillboardSet = graphics.getSceneManager()->createBillboardSet(100);
		mBillboardSet->setDefaultDimensions(10, 10);
		mBillboardSet->setMaterialName(materialName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
		Ogre::FloatRect textCords[] = { Ogre::FloatRect(1.0,1.0,0.0,0.0) };
		mBillboardSet->setTextureCoords(textCords, 1);
		graphics.getSceneManager()->setFog();

		Ogre::Aabb aabb = aabb.BOX_INFINITE;
		mBillboardSet->setBounds(Ogre::Aabb(aabb), aabb.mHalfSize.length() * 2);
		
		mSN = graphics.getSceneManager()->getRootSceneNode()->createChildSceneNode(Ogre::SCENE_DYNAMIC);

		mSN->attachObject(mBillboardSet);
	}
	
	void addBillboard(Ogre::Vector3 position) {
		Ogre::v1::Billboard* b = mBillboardSet->createBillboard(position);

		mBillboards.push_back(b);
	}


b]Ogre Version:[/b] 2.2
Operating System: win10
Render System: dx

Code: Select all

Ogre.log (optional)

Re: ogre-next, billboards::v1, white rects render, no matrial

Posted: Thu Feb 13, 2020 6:55 pm
by Nickak2003
nevermind, the materials not loaded!

Re: ogre-next, billboards::v1, white rects render, no matrial

Posted: Thu Feb 13, 2020 7:04 pm
by Nickak2003
actually, why isn't the material loading? And how can I load it? I used this same material on my manual object and it loaded it automagically.

Re: ogre-next, billboards::v1, white rects render, no matrial

Posted: Thu Feb 13, 2020 7:25 pm
by Nickak2003
i set the material to be of a material i know to already be loaded, my robot, which loads fine, and it still says,
Ogre: Can't assign material hlms_robot1 because this Material does not exist. Have you forgotten to define it in a .material script?

Re: ogre-next, billboards::v1, white rects render, no matrial

Posted: Thu Feb 13, 2020 7:30 pm
by Nickak2003
OK, have to use
setDatablockOrMaterialName
not
setMaterialName

Re: ogre-next, billboards::v1, white rects render, no matrial

Posted: Fri Feb 14, 2020 5:27 am
by dark_sylinc
Hi!

You figured it out.
One more thing: when it comes to billboards, unlit materials work better than pbs ones.

Cheers