Hi guys,

thanks for all your answers. Unfortunately, I am leaving for a week holidays in one hour.
Anyway, the problem is following:
- I am generating shadow volumes "on the fly" in cull visitor
- It works perfectly, except the cases when mirrors are used - let's recall that mirror turns right-handed coordinate system to left-handed, thus the programmer needs to change FrontFace setting to keep face culling working properly. - Ignoring FrontFace settings, I may construct anti-shadow volume that produces wrong results when mixed with non-anti volumes, etc. - Moreover, blending and alpha test settings should be detected and semi-transparent object should not cast shadows. I can detect them bellow in the scene graph during triangle collecting traversal, but what about attributes above my shadow node? Ignoring them may result in wrong results.

I guess, the best solution is to query "current traversal state" for blending and front face settings. At least that is what I have done in another scene graph library. Other option is to traverse scene graph up from my shadowed node to see if there are any attributes important for myself.

But if there is no nice solution, lets leave the problem. I just wanted to create complete issue-free solution, as this solution may be contributed back to OSG one day when stable enough.

John


Wojciech Lewandowski wrote:
Hi John,
If you need this to setup uniforms for shadow fragment shaders then maybe standard GL gl_FrontFacing variable could do the trick ? Its available at least in GLSL 1.50 and above. I have not checked when it was introduced maybe its available in earlier GLSL profiles. Wojtek
*From:* PCJohn <mailto:[email protected]>
*Sent:* Thursday, August 05, 2010 12:41 AM
*To:* OpenSceneGraph Users <mailto:[email protected]>
*Subject:* Re: [osg-users] threading and captureCurrentState


    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.
I that case a different question: How to get "current" osg::FrontFace attribute? I mean the one that would be active for any drawable traversed at the present moment during cull traversal that is just in progress and I am handling it in my custom Shadow class that is already working perfectly except some attribute values that user may pass from the scene graph above and that need to be properly handled to cast shadows correctly. The answer: "you do not need it" would be wrong at the moment.

Thx,
John

------------------------------------------------------------------------
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
------------------------------------------------------------------------

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to