Any idea why this sprite bug happens?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
MolokoTheMole
Posts: 109
Joined: Tue Jan 09, 2007 1:18 pm

Any idea why this sprite bug happens?

Post 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?
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post 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.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
MolokoTheMole
Posts: 109
Joined: Tue Jan 09, 2007 1:18 pm

Post 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.
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Do you use manually coded texture coords or texture matrix? What size is the whole sprite?
MolokoTheMole
Posts: 109
Joined: Tue Jan 09, 2007 1:18 pm

Post 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?
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Post 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
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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?
MolokoTheMole
Posts: 109
Joined: Tue Jan 09, 2007 1:18 pm

Post by MolokoTheMole »

Omega drivers, no idea, I can find out.

Could it a possible fix be a different texture wrapping?
Crimson Glory full Irrlicht game source code!
What I Do - my blog & dev log
Currently developing Link-Dead
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

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