On Tue, Mar 18, 2008 at 3:45 PM, Wojciech Lewandowski
<[EMAIL PROTECTED]> wrote:
> > I'm just tying up some other work, once this is done I'll do a quick
>  > review of Camera usage.
>
>  Thanks for explanations, I no longer disturb. Let me know if I could help.

You've already been a great help, pinpointing the problem was the
hardest part of this jigsaw :-)

I've been reviewing the inheritance mask, it covers a wide range of
features, including items like lighting, cull masks etc, the types of
stuff that is often useful to inherit.

The Viewer use of master Camera, slave Camera and SceneView for
internal rendering implementation all rely upon top down inheritance
of settings, so I believe it makes sense for these to retain the
default InheritanceMask of ALL_VARIABLES.

However, the needs of InheritanceMask of RTT Camera's is somewhat
different, when you actively change the clear colour, or the computing
of the projection matrix you really don't want to go inheriting this
same value.  The old buggy implementation in
CullVisitor::apply(Camera&) meant that in effect as an inheritance
mask set to 0x0, which as this worked better than the current system
then to replicate it we'd want to set the inheritince mask to 0x0.

Since osg::Camera's are just constructed the same no matter whether
they are viewer ones or ones in the scene graph it isn't possible to
just choose a different default inheritince mask in each context.
Such a scheme would also obscure what is going on under the hood.
What we really need it keep a consistent system with clear rules of
inheritance that are applied across all types of Cameras, no matter if
they are in scene graph or in viewer.  The awkward bit is that we need
to keep backwards compatibility as well.

The solutions I can think of right now are:

    1) Change have the CullSetting::InhertacenMask default to 0x0 and
have all Viewer code to related Camera's and
         SceneView to explicitly set the InheritanceMask to ALL_VARIABLES

    2) Leave CullSetting::InheritanceMask as ALL_VARIABLE default, and
change all RTT/in scene graph Cameras to
         explictly disable the InhertianceMask they do not need.

    3) Leave CullSetting::InheritanceMask as ALL_VARIABLE default and
have the CullSettings::setVariable() calls all
        optional disable the associated part of the InhertianceMask to
off.  This disabling would be done by default. i.e

       CullSettings::setComputeNearFarMode(mode, bool
disableInhertianceOfComputeNearFarMode=true);

I think option 3 would probably give us reasonable backwards
compatibility, but... it would hide a bit of what is going on w.r.t
InheritanceMask and be inconstistent with the way the rest of the OSG
works w.r.t set/get methods.

Can anyone else think of any other options?

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

Reply via email to