Page 1 of 1

IGUIStaticText elements disappear with textures > 2

Posted: Tue Aug 08, 2006 3:48 am
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

Posted: Tue Aug 08, 2006 3:17 pm
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.