Commit Graph

2036 Commits

Author SHA1 Message Date
timoore
605125c0e7 Random object support from Stuart Buchanan
In addition to Stuart's changes, there's an independent quad tree
builder class for constructing loose quad trees from scene graph nodes.

Stuart also implemented changes to the random number generator suggested by
Andy Ross.
2008-01-06 15:04:43 +00:00
fredb
65d0ee126a Update MSVC 7.1 projects 2008-01-04 21:45:41 +00:00
fredb
4db6435090 Remove warnings 2008-01-04 21:45:14 +00:00
timoore
4383fd3c45 Give the sky a BACKGROUND_BIT nodemask
Add a MODEL_BIT and tag clouds with that.

Remove vestigial post_root from sky code.
2008-01-04 07:33:42 +00:00
timoore
b6be76b0ab background node mask 2008-01-04 07:33:23 +00:00
frohlich
92d8fa1193 Modified Files:
simgear/scene/model/SGClipGroup.cxx
	simgear/scene/model/SGClipGroup.hxx Update the clip group.
2007-12-31 15:49:01 +00:00
frohlich
9c51bf3edf Modified Files:
simgear/scene/model/animation.cxx: Create animation inputs if not
	already there. Fixes broken texture animations from past checkin.
2007-12-31 15:48:02 +00:00
frohlich
cf0e4e6f8c Modified Files:
Makefile.am SGPickCallback.hxx: add proirities for pick callbacks.
2007-12-26 19:19:51 +00:00
frohlich
c3719f35e3 Modified Files:
animation.cxx animation.hxx: Make use of the expression stuff.
	Factors out common code with other animations stuff in flightgear.
2007-12-26 19:12:04 +00:00
frohlich
0b1f074bcf 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.
2007-12-26 19:10:40 +00:00
frohlich
7fe8514434 Modified Files:
scene/model/SGClipGroup.cxx: Oops, add missing simgear_config.h
2007-12-26 19:08:45 +00:00
frohlich
37c4dcf8ba 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.
2007-12-26 19:05:06 +00:00
frohlich
e33dd3c499 Modified Files:
simgear/props/props.hxx: Add a bunch of convinience functions.
2007-12-26 19:03:21 +00:00
timoore
94be52886e Pass ReaderWriter options to SGMaterialAnimation
It needs to grab the path list from options in order to support the texture
change animation.
2007-12-23 23:33:04 +00:00
timoore
6646aa5644 Fix tiny bugs in sun constructor and repaint code 2007-12-22 23:01:36 +00:00
timoore
d556eba296 Add StateAttributeFactory files to VS project file 2007-12-21 06:29:36 +00:00
timoore
a5b573b2d3 optimize groups from .AC file optimizer run 2007-12-21 06:25:40 +00:00
timoore
18d30ea8fa Repaint 2D cloud layers using texture combiner
Don't change the color in the cloud layer geometry
2007-12-21 06:25:13 +00:00
timoore
4324ffccf4 Fix cloud layer - point lights visibility issue
Move point lights to render bin 8, clouds to render bin 9. Turn on
AlphaFunc for cloud layers.

Create a StateAttributeFactory object to create and share common state
objects.
2007-12-21 06:24:53 +00:00
fredb
182ee9d7e4 Update MSVC 7.1 projects 2007-12-18 22:25:24 +00:00
timoore
68c1cfed46 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.
2007-12-13 23:30:24 +00:00
timoore
1159784538 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.

Change include syntax in PathOptions.cxx
2007-12-11 11:07:21 +00:00
timoore
e683b5fdec Check for null options before changing path in registry 2007-12-10 08:30:43 +00:00
timoore
3c409c5070 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.
2007-12-09 22:38:10 +00:00
timoore
4b7361dfe7 Add operator!= to SGBucket 2007-12-07 23:35:04 +00:00
timoore
037d5c11a5 Add option to SGLoadTexture2D to load dynamic textures 2007-12-07 09:13:34 +00:00
mfranz
95d857e091 - comparison: don't crash if second element is missing
- better messages ("panel"?!)
2007-12-06 17:57:41 +00:00
timoore
4efa087cd1 Don't modify OSG Registry with file path
To set a path when loading model files, use an osg ReaderWriter::Options object.

Put locks in ModelRegistry::readNode and ModelRegistry::readImage to avoid
conflicts when files are loaded from both the pager and the main thread.
2007-12-04 22:38:40 +00:00
fredb
60f0003436 Update MSVC 7.1 projects 2007-12-02 12:28:30 +00:00
timoore
fdb265cd6e Change the main ModelRegistry callback function to stash the substituted file in the cache. 2007-11-29 23:56:49 +00:00
timoore
34704a17f2 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.
2007-11-29 23:56:31 +00:00
timoore
4a959ec2fd 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.
2007-11-29 23:56:09 +00:00
timoore
f182886fce Start of cleanup of scene graph node masks 2007-11-29 23:55:35 +00:00
timoore
2fbaddbecf 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.
2007-11-29 23:55:01 +00:00
timoore
cafcecf03d StateSet optimizations
Use only one shared StateSet to control GL_NORMALIZE. This removes
thousands of state sets from the scene graph.

Fix a typo that was causing two copies of groundLights0 to be added to
each tile.
2007-11-18 23:31:03 +00:00
timoore
49473845cf Some scene graph optimizations
When loading terrain, use DrawElementsUShort where possible.

Don't chunk unconnected triangles in the terrain into seperate
Geometry sets; make the sets as big as possible.
2007-11-18 23:30:34 +00:00
durk
d4d4ed22a0 Minor documentation updates. 2007-11-18 14:21:41 +00:00
durk
240ed6f0b1 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).
2007-11-17 09:16:58 +00:00
frohlich
084a24e958 Improove texture sharing. 2007-11-09 05:55:50 +00:00
frohlich
cd9e3648e9 Update node masks 2007-11-09 05:52:58 +00:00
curt
7ed51be4e6 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.)

Curt.
2007-11-05 21:42:29 +00:00
durk
0c8358ae67 - 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.
2007-10-15 18:49:50 +00:00
durk
25cefd9129 * Fixed memory leak in RenderTexture.cpp (tiny, but still...)
* Added Timestamping debugging code to SGSubsystems (ported from plib
  branch).
2007-10-14 13:46:13 +00:00
timoore
af75c0ca0c Add ability to override existing model files with .osg files.
This enables off-line optimization of models and other special effects.
2007-10-12 22:46:35 +00:00
timoore
a91b2629d3 Manage OSG object cache explicitly
Don't have Registry::ReadNodeImplementation store its results in the
object cache; instead store the optimized model in the cache.
2007-10-12 22:46:13 +00:00
mfranz
de9070dba1 better standard compliance: allow empty top level tags (<PropertyList>) 2007-10-10 12:45:53 +00:00
timoore
813b518b6f 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.
2007-10-04 20:53:22 +00:00
timoore
c47e800f60 Order the cloud layers properly using OSG RenderBin 2007-10-02 21:43:52 +00:00
timoore
8398f45d43 ocean state set in osg::Geometry
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.

Problem reported by grtux (gh.robin@laposte.net)
2007-09-30 19:51:49 +00:00
timoore
aeaaa50f6c 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.
2007-09-05 22:12:00 +00:00