[fixed]IGUIStaticText Background Not Visible

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 Background Not Visible

Post by pc0de »

I was able to isolate this problem (in revision 1510) outside of my framework code by creating a HillPlane with a transparent material:

Code: Select all

    SMaterial* mat = new SMaterial();
    ITexture* tex = m_videoDriver->getTexture("data/tex/grid.tga");
    mat->setTexture(0,tex);

    // causes static text background to disappear.
    mat->MaterialType = EMT_TRANSPARENT_ALPHA_CHANNEL;

    mat->setFlag(EMF_LIGHTING,false);
    mat->getTextureMatrix(0).setTextureScale(50.0,50.0);

    dimension2d<f32> tileSize(50,50);
    dimension2d<u32> tileCount(6,6);
    IAnimatedMesh* pmesh =
        m_sceneManager->addHillPlaneMesh("testHillPlane"
           ,tileSize,tileCount,mat);

    IAnimatedMeshSceneNode* pnode =
        m_sceneManager->addAnimatedMeshSceneNode(pmesh);
Without "mat->MaterialType = EMT_TRANSPARENT_ALPHA_CHANNEL":
Image

With "mat->MaterialType = EMT_TRANSPARENT_ALPHA_CHANNEL":
Image

As in this somewhat related post, it only happens when using OpenGL.

("grid.tga"link)
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

no problems here, neither with DX nor with OGL...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

To be sure - you tested against revision 1510, right? If so, can you test with this application: idebug? Thanks.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

ohh, sorry, I was testing it with v1.4.1 :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
drewbacca
Posts: 38
Joined: Tue Jan 30, 2007 6:49 pm

Post by drewbacca »

pc0de, you've been posting a lot of great bug reports about very similar problems to what I have been having. Here is a temporary work around to your problem:

change your background color lines from:
stext->setBackgroundColor(SColor(128,0,255,0));

to

stext->setBackgroundColor(SColor(129,0,255,0));

There are a couple things going on. I think with some of the latest openGL changes, some states aren't being set properly, as a result your line with the material type is affecting your text backgrounds.

I don't have any reference to back it up, but i believe irrlicht has some checks where if something is transparent with an alpha value below some threshold, it doesn't get rendered at all. It looks like it doesn't get rendered if alpha <=128 in this case.

I was having a problem where I updated to the svn rev that fixed the gui being filtered in openGL and suddenly my driver->draw3dline() calls weren't working. It turned out I was using an alpha value of zero, which adjusting solved my problem. Something in those irrlicht changes started taking alpha into account with my 3dlines which had the default MaterialType parameter of EMT_SOLID.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, correct. It's a missing update of the alpha test reference value. The default value for 3d material types is 0.5 as specified by the MaterialTypeParam (although I'll change this to 0.0 now, which is the actual value sent which is changed in the material renderers to 0.5). So since the alpha test is used, pixel values with alpha < reference are discarded...
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

Thanks drewbacca, great catch!

And thanks to hybrid and Acki for their attention as well.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, I should have added that the SVN has this bug fixed, it's not just fixed by workaround...
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

yup, got that. just tested 129, 128, 127... it's all good.
Post Reply