J-S and All,

After a sleep I have taken another look at the subject and I would like to propose other approach: In general I doubt I will be able to foresee all types of problems and doubt I could add flags to suppress all responsible pieces of code. On the other hand all such problems could be solved by overriding proper shadow technique class. So as general recommedation I would suggest overriding one of the ViewDependentShadow classes and their associated ViewData class when defaults setttings not work.

However, I understand that overridng proper Shadow class and their ViewData might be bit more complicated than overriding simpler things like node callback. So as a mid-solution for those lazy or those who don't know how to override a class, I would propose adding SetShadowMapCameraSettingsCallback. If added, this calback will be called whenever shadow camera stateset is filled, if not added default settings will be applied. This way if one needs to change some setings he may simply override calback and make it their way.

Does it sound reasonable ?

Wojtek

-----Original Message-----
From: Jean-Sébastien Guay [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 15, 2008 10:21 PM
To: [EMAIL PROTECTED]; OpenSceneGraph Users
Subject: Re: [osg-users] Advice on interacting with osgShadow


Hi Wojtek,

Turning on AlphaTest/AlphaFunc is not mutually exclusive with RenderBin
override. I don't want to make decision that has to be its either this or
that. I would like to leave RenderBin override as default. I would also
add
setShadowMapRenderingSettings/getShadowMapRenderingSettings methods to
allow
user turn it off if he decides. So my conclusion is I would like to add
the
submission as sent to the codebase.

Excellent, I agree with this. I tested your code and it works for me, so
you can send it to osg-submissions whenever you want.

I could suggest that instead of using

    OVERRIDE_RENDER_BINS_WITH_OPAQUE_BIN = 1,
    SET_COLOR_MASK_TO_FALSE = 2,

you use the bit shift notation, which I find easier to read and maintain
(and please align the values... :-) ):

    OVERRIDE_RENDER_BINS_WITH_OPAQUE_BIN = 1 << 0,
    SET_COLOR_MASK_TO_FALSE              = 1 << 1,
    SOME_OTHER_SETTING                   = 1 << 2,

but that's just a style issue and subject to personal taste.

Also you could add a doxygen comment for the ShadowMapRenderingSettings
enum, which would explain what the values are useful for. Otherwise,
it's pretty cryptic for users (unless they search the mailing lists and
find this thread :-) ).

J-S
--
______________________________________________________
Jean-Sebastien Guay    [EMAIL PROTECTED]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/

_______________________________________________
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