Page 1 of 1

Any idea why this sprite bug happens?

Posted: Mon Mar 07, 2011 9:28 am
by MolokoTheMole
As you can see on the screenshot, the soldier should carry only one weapon. But on some systems the weapon is drawn using all sprite animation files at once.

http://npshare.de/files/fa267672/screen ... -06-05.jpg

Normally it uses just one. This is how the sprite file looks like:
http://npshare.de/files/2e0fe9a3/um_sniper.png

This happens on Radeon x1650 with latest Omega drivers. Any idea how to fix this?

Posted: Mon Mar 07, 2011 9:33 am
by Mel
Looks like the rifle is being draw from all the texture space, not only the part where it should be restricted to.

You could draw a quad whose mapping coordinates corresponded to those of the sprite you need at each time.

Posted: Mon Mar 07, 2011 10:49 am
by MolokoTheMole
Mel wrote:You could draw a quad whose mapping coordinates corresponded to those of the sprite you need at each time.
Yeah that's what I do I just map UV coordinates to the frame. However it doesn't work on that specific system.

Posted: Mon Mar 07, 2011 12:51 pm
by hybrid
Do you use manually coded texture coords or texture matrix? What size is the whole sprite?

Posted: Mon Mar 07, 2011 3:32 pm
by MolokoTheMole
The size of the gun sprite is 77x70.
The frame size is 77x14.
I use texture coords in vertices.

The coordinates are calculated from the sprite size.
Based on Texture->getSize().Height

This might be the problem... I remember this function giving different results on some systems. Why would it do that?

Posted: Mon Mar 07, 2011 4:20 pm
by REDDemon
probably if you query hardware features on that system you will notice that NQuad textures are not supported. First you must try giving as input a square texture (possibly a power of 2.. so 128x128?)..

http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=40497

Posted: Mon Mar 07, 2011 10:06 pm
by hybrid
Argh, that's probably once more an incomplete NPOT support where either wrapping doesn't work or some other stuff is going on.
What are Omega drivers?

Posted: Tue Mar 15, 2011 8:30 am
by MolokoTheMole
Omega drivers, no idea, I can find out.

Could it a possible fix be a different texture wrapping?

Posted: Tue Mar 15, 2011 8:31 am
by hybrid
Yes, sometimes certain wrapping modes are not available with NPOT textures. Or the driver did not properly implement all wrapping modes. Just try some others.