Drawn 2D images are messed up on some computers (most)

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Drawn 2D images are messed up on some computers (most)

Post by Skomakarn »

Hello.

When I try to draw 2D images, it works great on my computer, and looks just like it should, but on most of the computers owned by people who try to run my programs, the 2D images (ITextures, using IVideoDriver::draw2DImage()), the textures appear duplicated, moved, scaled and the entire thing they see on the screen just turns into a mess.

I always use the OpenGL renderer for my programs, but this error shows up on these computers if I try using another one as well.

Here is an example, of what an old menu I made should look like (and looks like, on my computer):

Image

This is what it looks like for most of the people who try to run it, while only a few get a flawless render:

Image

Am I missing something? Am I supposed to implement some kind of double buffer to avoid this? Why doesn't this happen at all computers (more importantly, why does it happen at all, and how do I fix it?)?

I can't make a commercial game if this is what people will get.
Last edited by Skomakarn on Mon Aug 10, 2009 10:30 am, edited 1 time in total.
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Are your texture non-power-of-two? In that case it depends if the cards to support that - and many cards don't. To test if that's the reason just use some textures with sizes like 256, 512, 1024 and check if is fine then on other computers.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Post by Skomakarn »

CuteAlien wrote:Are your texture non-power-of-two? In that case it depends if the cards to support that - and many cards don't. To test if that's the reason just use some textures with sizes like 256, 512, 1024 and check if is fine then on other computers.
Yes, they are. I know that might cause problems when using them on meshes, but should it really be a problem when trying to draw them in 2D space?
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Yes it's unfortunately also a problem for the 2D-GUI. Maybe we have a solution some day, but for now it might help to disable NPOT-support on your card for testing. I think you can all driver->disableFeature(EVDF_TEXTURE_NPOT, true) to do that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Post by Skomakarn »

So, you're saying using GUI images instead wouldn't make a difference, either?

Is it notably slow disabling such a feature, or could I use it at least once every frame, to enable for the 3D, and then disable for the 2D (if disabling it means any difference to the 3D, of course; exactly what is NPOT-support?), without any loss of performance?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Whyt kind of gfx card do you have? Did you install the latest drivers? IIRC, ATI has major problems with NPOT features, so we might add a work-around if that's the case. We need a proper test for this, though, so maybe you don't want to install latest drivers and lend us a hand while testing the work-around.
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Post by Skomakarn »

hybrid wrote:Whyt kind of gfx card do you have? Did you install the latest drivers? IIRC, ATI has major problems with NPOT features, so we might add a work-around if that's the case. We need a proper test for this, though, so maybe you don't want to install latest drivers and lend us a hand while testing the work-around.
NVIDIA Quadro FX 570M, but, like I said, it works fine for me. It's not on my computer the problem appears.

If you fix a work-around before this friday noon, though, I could try it out on my girlfriend's computer. I think she had the problem on the one I have access to at the moment.

Otherwise, if we're "lucky", the problem might also appear on my older, stationary computer at home.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, the work-around would be to disable NPOT for some card lines - so we'd need to know which hw driver and card type this happens on.
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Post by Skomakarn »

hybrid wrote:Well, the work-around would be to disable NPOT for some card lines - so we'd need to know which hw driver and card type this happens on.
I'll boot her computer up right away, and see if it happens on this one. If it does, I'll tell you about the card it has.

Still I'm wondering, though, if disabling NPOT causes any difference to the 3D rendering, and exactly what is.

EDIT: Yeah, the bug appears, and the card is RADEON 9700 PRO (and she has a secondary one of the same model).

EDIT 2: Disabling NPOT makes no difference on her computer.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Oh wait, there are parts in the images which are not shown at all on the first screenshot. Please show the code for the menu rendering. How many images do you overlap here, do you use alpha blending or something? Maybe it's just some zbuffer problem?
The pixelation seems to be a NPOT problem, but this might be solved with some filtering already.
CuteAlien
Admin
Posts: 9716
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

NPOT stands for non-power-of-two. Cards that support that should be able to work also with textures in such resolutions. So my idea was that by disabling this feature on your card, you might see the same problems on your own system which might help in solving them as you wouldn't have to copy the application to other computers to find out how it looks. But I'm exactly sure if that works... you have to try.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

I always use the OpenGL renderer for my programs, but this error shows up on these computers if I try using another one as well.
Does this include Burning's Video Renderer?

If you run this demo on the computer experiencing problems do you also get screwed up images? http://www.wc3jass.com/files/Klagui.zip

Ultimately what will help us solve this is if you write a small test case that draws an image or too and shows this problem.

For the devs, theres a mention of the 9700 Pro on this page regarding NPOT textures. It seems we have to use an alternate extension and a different coordnate system? (0 - width instead of 0 - 1)

http://www.opengl.org/wiki/NPOT_Textures
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Hey, interesting page. That's EXT_texture_rectangle, an extension which is only half the way to real NPOT, and also with these issues of the different coordinate system. It also has the problem that you can only clamp this texture, i.e. no texture repeat. This can, as the text suggest, also emulated by padding of the texture. We could support this if we know that a texture is only used that way. This would require another texture creation flag and some extension handling. Since this might be quite useful for full-screen images and Direct3D also has this feature, we should consider this add-on for 1.7 maybe.
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Post by Skomakarn »

The table, cup, pen and notebook all are one image, the size of the window.
Then every item in the menu is one menu, but only half the image is drawn, using clipping. One half of the image is the unhovered button, and one part is the hovered one. Then the pencil cursor is semitransparent, with antialias, and the drop shadow.
Skomakarn
Posts: 18
Joined: Mon Aug 03, 2009 1:03 pm

Post by Skomakarn »

Would I get this problem if I use a POT texture, but try to draw an NPOT part of it, using a clipping rectangle in draw2DImage?
Post Reply