Hi, On Tuesday 18 March 2008 17:27, Robert Osfield wrote: > 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?
Move the inheritance mask from CullSettings to the camera. As you can see from your own suggestions abive the other users of the inheritance mask and CullSettings will just need a copy from its 'parent' settings. Initialize this mask in the camera to inherit all. This is what the previous implementation that ignored the mask completely did. You would preserve backwards compatibility with existing code with this. The reader of the code would better understand what happens and you could implement what you told me for the first cut how it *should* work instead of something you need to dig for in the sources. Well, I did not see that this past change brakes in the shadow thing, when I offered you codework for that old suggestion, but I saw that it will probably cause problems that would be better solved right. Also I expect every usage of a Camera being used in the wrong way since the inheritance mask has never worked in any way before our past change. I also think that a Camera that now makes use of the mask that was previously ignored will break much more of the compatibility than moving the mask to where it is used. Also it is better to get a 'heads up there has something changed' from the compiler than just some subtle errors ... Still offering time to implement that ... Greetings Mathias -- Dr. Mathias Fröhlich, science + computing ag, Software Solutions Hagellocher Weg 71-75, D-72070 Tuebingen, Germany Phone: +49 7071 9457-268, Fax: +49 7071 9457-511 -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Florian Geyer, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Prof. Dr. Hanns Ruder Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

