Billboard Scale to Image

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
Herb
Orc
Posts: 412
Joined: Thu Jun 04, 2009 3:21 am
Location: Kalamazoo,MI
x 38

Billboard Scale to Image

Post by Herb »

So, I have a billboard set with a simple flat simple color image, can have billboards without trouble. It's great.

But...here's where I'm not not sure about things. I have a detailed image and want to display it on a billboard. Really, I want to define a size of billboard and have the material set to it scale to fit in the billboard size. How would I do that?

Here's what I have now. BillboardSet creation:

Code: Select all

    mBillboardLeafSet = mSceneMgr->createBillboardSet("foo", 12000);
    mBillboardLeafSet->setMaterialName("Leaf");
    mBillboardLeafSet->setDefaultDimensions(4.0f, 4.0f);
    mSceneMgr->getRootSceneNode()->attachObject(mBillboardLeafSet);
and a basic material script

Code: Select all

material Leaf
{
	technique
	{
		pass
		{
                       lighting off
                       scene_blend add
                       depth_write off
			
			texture_unit
			{
				leaf.jpg
			}
		}
	}
}
So, you can see I set the size of the billboard, but when I render in my application, the image on the billboard is all messed up (random color lines and such). So, is there a way to scale it on the billboard? Am I missing something? :?
Post Reply