IGUIStaticText elements disappear with textures > 2

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
agrif
Posts: 12
Joined: Mon Feb 21, 2005 7:25 am

IGUIStaticText elements disappear with textures > 2

Post by agrif »

It seems that static text elements dissappear when you assign more than two textures to a scene node. Any scene node, and all text elements. I assume this spreads to other GUI elements as well, but I haven't tested it. I also have no idea why this happens.

It may be specific to the opengl renderer.

Below is the code that replicates it every time:

Code: Select all

#include "irrlicht.h"

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;

int main()
{
    IrrlichtDevice* device = createDevice(EDT_OPENGL, dimension2d<s32>(640, 480), 32, false, false, false, 0);
    IVideoDriver* driver = device->getVideoDriver();
    ISceneManager* smgr = device->getSceneManager();
    IGUIEnvironment* guienv = device->getGUIEnvironment();
    
    ISceneNode* node = smgr->addSphereSceneNode(30);
    node->setMaterialTexture(0, driver->getTexture("tex1.bmp"));
    node->setMaterialTexture(1, driver->getTexture("tex2.bmp"));
    node->setMaterialTexture(2, driver->getTexture("tex3.bmp")); // these two lines can be excluded, and the text appears
    node->setMaterialTexture(3, driver->getTexture("tex4.bmp"));
    
    IGUIStaticText* text = guienv->addStaticText(L"I'm Not Here!", rect<int>(10,10,200,22), true);
    
    while (device->run())
    {
        driver->beginScene(true, true, SColor(0,200,200,200));
        smgr->drawAll();
        guienv->drawAll();
        driver->endScene();
    }
    device->drop();
    return 0;
}

Of course, make sure there are all of the textures (any kind) when you run it.

I am using a modified Irrlicht, but the only modification relates to setting pixel shader constants (letting GLSL use more than one sampler). I haven't tested or seen this in linux, just windows.

Maybe something is wrong with my code, but I'm almost certain it's a bug.

agrif
Cows don't move, they tunnel.
Irrlicht .PLY Loader
agrif
Posts: 12
Joined: Mon Feb 21, 2005 7:25 am

Post by agrif »

Huh... when I woke up this morning the text element came back. Must've snuck in last night sometime. This bug could be very hard to replicate... maybe it was because my computer felt bored.

If I can replicate it again I'll look further into it, but for now it looks like that would be hard.
Cows don't move, they tunnel.
Irrlicht .PLY Loader
Post Reply