Billboard animated textures from a sprite / tile map

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Ondninja
Posts: 20
Joined: Tue Aug 14, 2007 10:58 am

Billboard animated textures from a sprite / tile map

Post by Ondninja »

What is an easy way to use a tile-textures map (with fx 4 rows and 4 column of sprites), with the billboard texture animation?

I have made an effect system, which right now uses billboard texture animation. But the problem is that each frame is stored in seperate files, and loaded into an array.

I like to combine the spritemap method, so that i can look up the frames for the billboards in ONE map instead.

So is there a way to speficy a position from a file when i load the textures?

There are a method to load an image from data (createImageFromData). Maybe this could be used to load an image from a region, and later feed this to the addTexture metod??
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You should probably use just one large texture (unless it becomes too large for the gfx card) and create an animator based on texture matrices. That way you save a lot of ressources.
Ondninja
Posts: 20
Joined: Tue Aug 14, 2007 10:58 am

Post by Ondninja »

Thanks. Sounds like the solution i need.

But when i access the getTextureMatrix(0) I begin to get assertions in the ireferencecounted.h file.

I have tried to just assign the matrix to a variable, and not doing anything else like shown here.

Code: Select all

matrix4 m = effect->getMaterial(0).getTextureMatrix(0);
The debugger breaks here:

_IRR_DEBUG_BREAK_IF(ReferenceCounter <= 0) // someone is doing bad reference counting.

--ReferenceCounter;
if (!ReferenceCounter)
{
delete this;
return true;
}


So it seems that something is going on in getTextureMatrix(0), which does some erronous referencecounting. Or i am doing something wrong.

Do you know what is gong on?
Post Reply