On Wed, Aug 4, 2010 at 2:19 PM, PCJohn <pec...@fit.vutbr.cz> wrote:

>  Hi Tim,
>
>
> Tim Moore wrote:
>
>
> On Wed, Aug 4, 2010 at 9:33 AM, PCJohn <pec...@fit.vutbr.cz> wrote:
>
>> Hi,
>>
>> captureCurrentState name is misleading - it is not capturing state from
>> OpenGL.
>> It should be, maybe, getCurrentState. It is just taking last pushed
>> attributes on the state stack. These attributes are returned in the StateSet
>> given as parameter. Thus, the function should work any time during cull
>> traversal, I guess.
>>
>>  No. CullVisitor::pushStateSet does not affect the graphics state
> immediately. It is used to build the state graph that is used during the
> draw traversal to change the state. You really can't use osg::State for much
> outside of the graphics traversal.
>
> We do not understand each other. I am not using it outside cull traversal,
> neither I want to do anything with OpenGL state.
>
You can not use captureCurrentState() to do anything sensible in the cull
traversal. The State object is not modified during the cull traversal. By
the way, although changes to the State don't necessarily cause an immediate
change to the OpenGL state, those changes usuallly follow soon after.

>
>
>  I do not understand, but it work with SingleThreaded and
>> CullDrawThreadPerContext while it crashes with DrawThreadPerContext and
>>  CullThreadPerCameraDrawThreadPerContext. It seems to me like two threads
>> are accessing state stack...
>>
>>  There isn't a state stack. See
> http://www.bricoworks.com/articles/stateset/stateset.html and
> http://www.bricoworks.com/articles/stategraph/stategraph.html.
>
>   Yes. There is. Oh. I see. Sorry for confusion, you call it attribute
> stack.... and that is a correct name for it.
> Anyway, there is State::_attributeMap that is composed of AttributeStack
> structs and they have a member attributeVec that is serving as a stack of
> attributes. The top of the stack is "current" attribute or the last pushed
> attribute. That is the one I need to get. Until now, I see a threading issue
> like two threads manipulating the "attribute stack".
>
> I'll say it again: you can't access those attribute stacks from the cull
traversal. They don't contain anything sensible.

Tim

> John
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to