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

Problems building or running the engine, queries about how to use features etc.
Post Reply
Nickak2003
Gremlin
Posts: 196
Joined: Thu Jun 10, 2004 4:19 am
x 13
Contact:

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

Post 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)

Nickak2003
Gremlin
Posts: 196
Joined: Thu Jun 10, 2004 4:19 am
x 13
Contact:

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

Post by Nickak2003 »

nevermind, the materials not loaded!

Nickak2003
Gremlin
Posts: 196
Joined: Thu Jun 10, 2004 4:19 am
x 13
Contact:

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

Post 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.

Nickak2003
Gremlin
Posts: 196
Joined: Thu Jun 10, 2004 4:19 am
x 13
Contact:

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

Post 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?

Nickak2003
Gremlin
Posts: 196
Joined: Thu Jun 10, 2004 4:19 am
x 13
Contact:

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

Post by Nickak2003 »

OK, have to use
setDatablockOrMaterialName
not
setMaterialName

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4546
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 955
Contact:

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

Post by dark_sylinc »

Hi!

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

Cheers

Post Reply