[fixed]IGUIStaticText->setBackgroundColor()

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.
Post Reply
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

[fixed]IGUIStaticText->setBackgroundColor()

Post by pc0de »

This problem started happening at revision 1424. Here's the code snippet for testing:

Code: Select all

IGUIStaticText* stext = getGUI()->addStaticText(L" ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 ",
        rect<s32>(50,50,350,75),false,false,0,true);

stext->setBackgroundColor(SColor(255,128,0,0));
stext->setOverrideColor(SColor(255,255,255,255));
Output from revision 1422:
Image
Output from revision 1424 (up to the latest):
Image

Notes:
  • This only happens under OpenGL.
    Happens on both Widows & Linux.
    If setBackgroundColor() is commented out, the text appears correctly.
Debugging lead me down into COpenGLDriver::setRenderStates2DMode where I quickly became dizzy and then resurfaced to let the experts figure it out.
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Additional testing and notes:

The images in the first post aren't using Irrlicht's default font. Instead, it uses a font named "tdeffont" located in this file: defaults.zip.

Code for loading the font:

Code: Select all

getFileSystem()->addZipFileArchive("defaults.zip");
m_defaultFont = getGUI()->getFont("tdeffont.xml");
if(m_defaultFont)
{
    m_defaultFont->grab();
    getGUI()->getSkin()->setFont(m_defaultFont);
}
m_monoFont = getGUI()->getFont("monospace.xml");
if(m_monoFont)
    m_monoFont->grab();
If I don't load the above fonts, the output appears correctly using the default font:
Image

If I set the default skin font to "m_monoFont", it also appears correctly:
Image

Thinking that the problem may be related to the font I'm using, I modified another app to use Irrlicht's default font. This application loads several meshes and textures. Initially the static text appeared fine, but after moving the camera to view the different scene nodes, the static text changed to look semi-transparent similar to the screen shot in the first post: (right side pasted in)
Image

Sometimes it would switch back to looking correct, but not consistently.
merovingian
Posts: 37
Joined: Thu Feb 28, 2008 4:34 am
Location: Perth, Western Australia

Post by merovingian »

Just thought I'd chime in with a "me too" post.

I have recently started building my own Irrlicht DLL from the SVN truck. I checked-out revision 1489. My application looks fine when using Direct X, but I have the same faded look to the text when using OpenGL (under Windows in both cases - I haven't checked under Linux). Irrlicht 1.4.1 does not exhibit the problem, so it's a recent change.

Image
Image

I'm using the fonthaettenschweiler font that is distributed with Irrlicht. What I have noticed is that if I remove the Irrlicht logo from the bottom right hand corner, the text is fine. I say this like its significant, even though I have no idea how.

As you may also notice, I have the bonus problem that, under OpenGL, my Load-Haul-Dump vehicle mysteriously disappears from the RTTs in the top corners, but its lighting remains. I guess that's a topic for another thread, but given that the OpenGL RTTs are still suffering from the problem of being flipped, the situation with OpenGL RTTs is going from bad to worse. Sadly the problem remains even if I get rid of the Irrlicht logo. That dang logo, why can't its behaviour be consistent?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, I've fixed the font problem in revision 1503. It was a missing texture property, which lead to a bilinear interpolation for the font. This wasn't intended, though.
The RTT problem is a different one. Please repost in another thread (including the images) and provide also some code how you're drawing the minimaps.
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Thanks. The text part is now working fine.

In one of my tests, the background portion of the static text flickers when the app starts up and then disappears after a couple of seconds...

I'll post back if I can eliminate it being related to my app code.
merovingian
Posts: 37
Joined: Thu Feb 28, 2008 4:34 am
Location: Perth, Western Australia

Post by merovingian »

hybrid wrote: The RTT problem is a different one. Please repost in another thread (including the images) and provide also some code how you're drawing the minimaps.
I'm sorry for not doing this, but today was my first visit to the forums since you posted your message.

Upon seeing your message, I updated to the latest trunk (1530) and I see that both the text and the RTT problem are fixed. I presume you are responsible for both, so many thanks for that.

OpenGL RTTs are still flipped, not that I was expecting that they wouldn't be. I know you're aware of that problem but AFAIK there is no specific bug thread for them. Is it helpful for me to create one?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The RTT problem should have been solved for some month already. The texture coords are flipped, such that a draw2dimage should result in correct images even for RTTs. So I guess we need some code to reproduce this problem...
merovingian
Posts: 37
Joined: Thu Feb 28, 2008 4:34 am
Location: Perth, Western Australia

Post by merovingian »

I don't see any difference with 1530. My code is the same as it was when we first discussed the issue in April in the last 4 posts on the following page:

http://irrlicht.sourceforge.net/phpBB2/ ... highlight=

So my code should now be working? It works for DirectX.

If you think my code is OK, then I will make a new bug report thread.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The fixes only happened in SVN/trunk, not in the 1.4 branch. Since I had to play with the texture coords I didn't want to corrupt the stable branch. But trunk definitely works, just tested it :D
merovingian
Posts: 37
Joined: Thu Feb 28, 2008 4:34 am
Location: Perth, Western Australia

Post by merovingian »

My Irrlicht build is a check-out of 1530 from the SVN trunk. So I am not sure where I've gone wrong. I just tried to look through the SVN log to see at what revision you made the fix, but didn't see any comment that immediately stood out - can you please tell me what source file (or files) have the fix, and what revision that file should be? So I can check whether I do indeed have the fix in my tree.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The changes were made to the draw2DImage methods in COpenGLDriver.cpp in revision 1368:
r1368 | hybrid | 2008-06-12 14:00:41 +0200 (Do, 12 Jun 2008) | 1 line

Fixed draw2DImage methods for RTT usage under OpenGL.
merovingian
Posts: 37
Joined: Thu Feb 28, 2008 4:34 am
Location: Perth, Western Australia

Post by merovingian »

Thanks Hybrid. I definitely have the changes in my tree. But I still suffer the issue, it seems. I think I built my DLL correctly, so I am a little mystified as to where I've gone wrong.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Ok, then please open a new thread and post some screenshots and code to reproduce the problem (try to use example 13 in order to avoid too much new code). Please also add this problem to the bug tracker on SourceForge: https://sourceforge.net/tracker/?atid=5 ... unc=browse
Post Reply