So at what point did you store the _activeContextID member attribute?
as it is only valid during a current Draw phase.



On 6/15/07, Serge Lages <[EMAIL PROTECTED]> wrote:
Hi Anders,


I remenber having such a problem with CEGUI and multitexturing, here is my
drawImplementation which works fine now :

void CEGUIDrawable::drawImplementation(osg::RenderInfo&
renderInfo) const
 {
    osg::State    *state = renderInfo.getState();

    if (state->getContextID() != _activeContextID)
    {
        return;
    }

    state->setActiveTextureUnit(0);
    state->setClientActiveTextureUnit(0);
    CEGUI::System::getSingleton().renderGUI();


state->checkGLErrors("CEGUIDrawable::drawImplementation");
}

But my problem was just CEGUI textures going all white when looking to a
multitextured object, so maybe you have a new one. :)

Good luck !


On 6/15/07, Anders Backman <[EMAIL PROTECTED]> wrote:
>
> Hi all (again).
>
> Now to another issue.
>
> I have an implementation of a CEGUI integration into OSG.
> It has been working just fine, up until where I have a multitextured
> Spider (rendered using ReplicantBody) in the scene.
> As far as I know and can see, ReplicantBody does not set any states
> explicitly outside a StateSet.
>
> The same
> Now Im not blaiming the spider for the problem, its just something
> with it that messes up the CE gui drawing.
>
> It disappear from the screen, until there is something rendered using
> osgText, then it pops back into the display!
>
> It seems that something in the state is leaking? from osgText that
> makes it possible to render the CEgui drawable
>
> This is what happens:
>
> 1. Render CEGUI only -> ok
> 2. Render spider, cegui disappears, if spider is culled, cegui does
> not come back!
> 3. add text to scene ->cegui comes back
> 4 remove text -> cegui disappears
>
>
>
> CEGUI is rendered with the stateset:
>
> osg::StateSet* stateset = geode->getOrCreateStateSet();
>
stateset->setMode(GL_DEPTH_TEST,osg::StateAttribute::OVERRIDE
|
> osg::StateAttribute::OFF);
>
>
stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
> stateset->setRenderBinDetails(100,"RenderBin");
> stateset->setMode(GL_BLEND,osg::StateAttribute::OVERRIDE
> |osg::StateAttribute::ON);
>
>
> stateset->setTextureMode(0, GL_TEXTURE_2D,
> osg::StateAttribute::OVERRIDE |osg::StateAttribute::ON);
>
>
stateset->setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE
> |osg::StateAttribute::OFF);
>
> And in CEGUI:drawable() Im using the same state settings as in the
> osgcegui example:
>
>         renderInfo.getState()->setActiveTextureUnit(0);
>
>         renderInfo.getState()->disableAllVertexArrays();
>
>        m_ui->getSingletonPtr()->renderGUI();
>
>
>
> Replicantbody (the spider) is using the state:
>
> submesh_state_set->setTextureAttribute(map_id, texture);
> submesh_state_set->setTextureMode(map_id, GL_TEXTURE_2D,
> osg::StateAttribute::ON);
> submesh_state_set->setMode(GL_TEXTURE_COORD_ARRAY,
osg::StateAttribute::ON);
>
>
> Im guessing that one of the drawables (ReplicantBody, CEGUI) is
> leaking/missing a StateSet setting.
>
> But whats puzzling me is that osgText seems to leave something behind
> that enables the drawing of CEGUI again...
> So with osgText everything works.
>
> Before digging into the dirt, Is there something here that ring a bell?
>
> --
>
>
>
________________________________________________________________
> Anders Backman               Email:    [EMAIL PROTECTED]
> HPC2N/VRlab                  Phone:    +46 (0)90-786 9936
> Umea university              Cellular: +46 (0)70-392 64
67
> S-901 87 UMEA SWEDEN         Fax:      +46 90-786 6126
>                                http://www.cs.umu.se/~andersb
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>



--
Serge Lages
 http://www.magrathea-engine.org
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/



--


________________________________________________________________
Anders Backman               Email:    [EMAIL PROTECTED]
HPC2N/VRlab                  Phone:    +46 (0)90-786 9936
Umea university              Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN         Fax:      +46 90-786 6126
                              http://www.cs.umu.se/~andersb
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to