"tim recently noticed the database pager was repeatedly loading and unloading
the same objects. he also tracked down the problem to missing bounding sphere
information in osgDB::PagedLOD. this is a simplicistic approach to fix this:
SGPagedLOD will now remember whatever value it sees for getBound() after
loading a child. this patch will make database pager run much calmer."
It turns out that the database pager causes the texture image to be
unloaded after it is applied, so the image and its file name may not
be available for doing the livery substitution. Ask a work around we
set the name of the texture to its file name.
this is a small (-1/+3) patch to fix pick animations on scenery objects.
since picking apparently doesn't care for polygon offsets, the objects
got into the picklist in the wrong way. now, no matter if the "highlight
group" or the "normal group" gets hit first, the callback will fire.
Allows to load submodels with path relative to current model path.
Submodel path must be prefixed by ./ otherwise path is relative to fg_root ( current behavior )
timoore [Mon, 24 Mar 2008 21:41:30 +0000 (21:41 +0000)]
Change the tile light group node mask to traverse VASI lights too.
The change to set the light group node mask to LIGHTS_BITS caused
VASI/PAPI lights to not be displayed during the day. This patch fixes
that and optimizes VASI creation a bit.
timoore [Sat, 22 Mar 2008 09:30:26 +0000 (09:30 +0000)]
model paging patch from Till Busch
Comments from Till:
I started the project at the end of february with a simple idea: move all
3d-model loading to the DatabasePager-thread. my first attempts looked
promising, though they were a little too optimistic (or naive?). the patch
has evolved a lot since.
currently it does the following things:
1. revive SGModelLib, move functions for xml-model-loading there
2. replace all calls to sgLoad3dModel with calls to either
SGModelLib::loadModel() or SGModelLib::loadPagedModel()
almost all models will be loaded by the DatabasePager. the few exceptions are:
your own plane, shared models in scenery, random objects, AIBallistic models.
3. simplify mode-loading functions (avoid passing around fg_root)
4. avoid supurious MatrixTransform nodes in loaded models
mfranz [Thu, 20 Mar 2008 17:20:54 +0000 (17:20 +0000)]
- warnings--
- make one-shot sounds subject to volume and pitch control (To get
constant volume/pitch during the whole lifetime, just *configure*
the sound that way.)
timoore [Tue, 4 Mar 2008 08:58:33 +0000 (08:58 +0000)]
cleanup of precipitation contribution
Reindent everything to Stroustrup style and make member variable style
consistent.
Remove unused header files.
SGPrecipitation is now a subclass of osg::Referenced.
Initialize snow and ice intensity to 0 directly. The methods that set
the intensities change the value slowly and so don't work when the
initial value is garbage.
timoore [Sat, 2 Feb 2008 23:01:27 +0000 (23:01 +0000)]
Cleanup and performance tuning of the random trees code.
The QuadTreeBuilder class was completely revamped as a templated class
to support flexible creation of scene graph quad trees, and a major
bug was fixed as well. Now it actually generates quadtrees instead of
some weird striped thing.
One StateSet is shared among all the "forests." The trees are drawn
after normal terrain objects to minimize some of the transparency
related artifacts.
Lighting was implemented in the ShaderGeometry shader (for both
polygon sides). Ambient-diffuse values for trees are hard-coded in
TreeBin.cxx.
DotOsg wrappers were added for ShaderGeometry so it can be output in
the scene graph dump.
frohlich [Wed, 26 Dec 2007 19:10:40 +0000 (19:10 +0000)]
Modified Files:
Makefile.am
Added Files:
SGExpression.cxx SGExpression.hxx: Add not yet complete but already
usable expression tree. Will be used with the panel code.
frohlich [Wed, 26 Dec 2007 19:05:06 +0000 (19:05 +0000)]
Modified Files:
Makefile.am
Added Files:
SGClipGroup.cxx SGClipGroup.hxx: Add helper group node for reuse
of clipping planes. Will be used for the panel code.
timoore [Thu, 13 Dec 2007 23:30:24 +0000 (23:30 +0000)]
Use node masks and shared state sets to manage ground lights
Do away with the switch in each terrain tile for the ground lights. They are
turned on by node masks now.
Share state sets among all the light nodes and manage the fog values through a
"GroundLightManager" instead of having separate state sets and callback
functions for each group in each tile.
timoore [Tue, 11 Dec 2007 11:07:21 +0000 (11:07 +0000)]
minor fix to ModelRegistry and syntax changes for Windows
Create the local path in the right order in OptionsPusher. When
OptionsPusher is used, put it inside a new code block so the order of
destruction with respect to the mutex on reader functions id clear.
Add #include <algorithm> to top of ModelRegistry.cxx.
timoore [Sun, 9 Dec 2007 22:38:10 +0000 (22:38 +0000)]
Work around osg Registry path list problems
The OSG reader plugins overwrite the path list passed in options with the local
directory of the file being read, forcing you to set the path list in
the Registry. I think this a bug, but in the meantime here's a workaround.
timoore [Thu, 29 Nov 2007 23:56:31 +0000 (23:56 +0000)]
Avoid copying drawables and dirtying display lists.
For the alpha-test animation, use an OVERRIDE attribute on the state
set of the top level node instead of copying drawables and state sets
throughout the model.
As a temporary hack in the blend animation, don't use display lists in
the cloned drawables.
These changes are aimed at cutting down the number of display lists
that the pager needs to compile.
timoore [Thu, 29 Nov 2007 23:56:09 +0000 (23:56 +0000)]
rewrite ModelRegistry callbacks as a template with pluggable policy classes
In a big effort to improve use of the object cache, provide a
ModelRegistryCallback template class with different policies for
substitution, caching, optimization, etc.
Change SGTexDataVarianceVistor to make StateSets static too.
timoore [Thu, 29 Nov 2007 23:55:01 +0000 (23:55 +0000)]
Move SGReadFileCallback from model.cxx to public class ModelRegistry
Move SGReadFileCallback and all its help classes into a new
ModelRegistry class that also provides an interface to add custom
callbacks for specific file extensions. SGReaderWriterBTG uses that to
keep any further processing from being done on .btg files. Various
namespace-releated cleanup was done on this code too.
durk [Sat, 17 Nov 2007 09:16:58 +0000 (09:16 +0000)]
Refined debug timing control:
- Added a SampleStatistic class (from the old deprecated libg++) library.
- Make time statistics and printing conditionable
- Added an interface function to switch time stamp collection and printing
on and off from the application (defaults to off).
curt [Mon, 5 Nov 2007 21:42:29 +0000 (21:42 +0000)]
In the original flightgear native/binary scenery terrain data format, we
used short's extensively to represent counts of objects (number of points,
number of texture coordinates, number of traingle strips, etc.) and we used
shorts to index into larger structures. But this capped many of our structure
sizes to a maximum of 32768.
By switching to unsigned shorts in the future, we can double the maximum
object/index counts without losing anything. This was a pretty major
oversight in our original specification.
I have bumped up the native object file version from 6 to 7 and added code
in the reader to maintain full backwards compatibilty with version 6
scenery files (i.e. the current 0.9.10 scenery release.)
durk [Mon, 15 Oct 2007 18:49:50 +0000 (18:49 +0000)]
- A few fixes to ensure SimGear compiles again on cygwin.
* on cygwin, isnan is declared in ieeepf.h
* CYGWIN is a special case in that it is windows based, but sometimes
folows unix conventions. SGAtomic compilation failed on an illegal
volatile type cast without the additional __CYGWIN__ define check.
timoore [Thu, 4 Oct 2007 20:53:22 +0000 (20:53 +0000)]
Don't reset the random texture base when rebuilding a cloud layer
This fix removes obnoxious visuals (texture jumping) when a cloud
layer is moved due to a metar update or, more significantly, when
switching from metar to a scenario. Also, I switched to using a TexMat
to displace the cloud texture in order to avoid writing the texture
array every frame.
Put the ocean tile state set in osg::Geometry, not the osg::Geode, so that
is readily available during intersection testing and can be used to find the
corresponding SGMaterial.
Fix material animations with only a <texture-prop>
On 8/31/07, K. Hoercher <wbhoer@gmail.com> wrote:
> > Some notes:
> > - I found that in order to make the example from model-howto.html work
> > ( starting at "To make a texture replaceable at runtime") one has to
> > specify a valid (i.e. loadable) <texture> in the material animation.
The cause seems to be the condition in SGMaterialAnimation.cxx l.277
ignoring any texture update by the UpdateCallback (only there
<texture-prop> is looked at) without an already existing stateSet.
That in turn will not be created with a <texture-prop> alone l. 379ff.
Unless I overlooked some compelling reason contradicting, I'd like to
suggest allowing for a stateSet to be created for those situations
too. I think that would match the behaviour of animation.cxx
(PRE_OSG_PLIB_20061029) and is imho the more expected and also
documented one.