Tim Moore
cb07210bc7
Move Texture unit builder into TexBuilder.cxx
...
Do the refactoring necessary to make that work.
2009-11-13 22:41:11 +01:00
Tim Moore
3e40d624a8
Effects for models
...
Basically working, at last. Among other things, create effects in
models loaded directly from .ac files; this can happen, for example,
with the random models from the materials library.
2009-11-13 22:41:11 +01:00
Tim Moore
63ce675914
Splicing visitor for rewriting scene graphs with a minimum of copying
2009-11-13 22:41:11 +01:00
Tim Moore
14e5e87a4d
Dump texture attributes of StateSet into effect property tree
...
Also, decode blend function.
2009-11-13 22:41:11 +01:00
Tim Moore
e7e81c6639
getStateAttribute utility function
...
This provides a concise, typesafe way to get attributes from osg::StateSet.
Also, blew away BackRefInserter.
2009-11-13 22:41:11 +01:00
Tim Moore
23d0601d82
Add support for blend functions and alpha test functions in effects
2009-11-13 22:41:11 +01:00
Tim Moore
6db9138eeb
wip for effects in models
...
multi-index for effect attributes
2009-11-13 22:41:10 +01:00
Tim Moore
6a7c200002
remove CopyPolicy from ModelRegistry
...
Put the responsibility for copying a loaded model directly in
SGReaderWriterXML.
2009-11-13 22:41:10 +01:00
Tim Moore
a25e859fa7
fix typo
2009-11-10 22:10:57 +01:00
Tim Moore
4e2eb2f24c
Move propertyExpression code from flightgear to simgear
...
Also add a function (possibly redundant) to access the global property
root.
2009-11-09 15:53:10 +01:00
Tim Moore
ecd0a53412
Add writeLocalData functions for internal scenegraph classes
...
This makes the scenegraph dump more complete and therefore more useful.
2009-09-22 12:56:28 +02:00
Tim Moore
3456434e37
check for null effect in EffectCullVisitor
...
An EffectGeode might not have any effect.
2009-09-18 15:43:46 +02:00
Tim Moore
454c5b1ed2
Merge branch 'tat/configure' into next
2009-09-17 12:25:19 +02:00
Tim Moore
819d3f5ded
Merge branch 'topic/projection' into next
2009-09-17 12:22:06 +02:00
Tim Moore
9cbbe55598
Merge branch 'frohlich/weak' into next
2009-09-17 12:18:33 +02:00
timoore
d4289c5d54
Change trees code to use a faster OpenGL path
...
The (random) dimensions of a large number of trees is stored in an
array shared by all the tree geodes. The coordinates of the origin of
each tree are replicated in an another array. This allows an entire
block of trees to be rendered with a few OpenGL calls, instead of one
function call per tree.
2009-08-25 16:14:13 +02:00
timoore
01a896ef5b
New effects from Till Busch: crops, water, landmass
...
As shown at LinuxTag, with modifications from Tim Moore: the base
landmass texture is mixed with the steepness and snow effects. Till's
new syntax for textures in effect files was also added. syntax for
textures. Also, syntax for accessing internal textures, such as Till's
3D noise texture, was added.
Several bugs in the effect inheritance algorithm were fixed.
2009-08-09 23:56:10 +02:00
Tim Moore
59ef7d8fd1
Create a singleton for the parser table
2009-07-19 23:05:04 +02:00
Tim Moore
1f308c9ec3
Move definition of SGRawBase<...>::printOn out of simgear namespace
...
They are declared in the global namespace, and MSVC insists that they be
defined there.
2009-07-19 22:39:16 +02:00
Tim Moore
4943d3aa53
Add missing return statements
2009-07-18 10:12:59 +02:00
Tim Moore
828d561113
Store material data with Effect
...
Somehow this got left out, which broke ground intersection queries.
2009-07-17 16:18:12 +02:00
Tim Moore
fc7ec4299e
include file change to make simgear work with OSG 2.9.X again
2009-07-16 23:09:10 +02:00
timoore
8e718fe288
Add new Effects files to vcproj
2009-07-16 12:09:45 +02:00
timoore
efec9070e1
Fixes for technique predicates
...
Get tests based on properties and OpenGL extensions working.
2009-07-16 12:09:44 +02:00
timoore
e3646d4d4a
more effects features
...
Materials can specify an effect.
Add support for PolygonMode and initial support for Uniform.
2009-07-16 12:09:44 +02:00
timoore
4219f16f61
Construct effects from property lists
...
The material code constructs a property list from its input parameters.
Enable dumping of Pass and Technique objects to a file.
Default effect now uses texture node instead of texture0
2009-07-16 12:09:44 +02:00
timoore
c3b1802e95
materials use only simgear::Effect
...
Eliminate SGMaterial::get_state function.
Use Effect in BVH visitor, ocean tile generation, and airport signs.
2009-07-16 12:09:44 +02:00
timoore
40fe078021
Use Effect to implement point lights
...
This allows different OpenGL features (point sprites, point attenuation) to
be used depending on hardware support.
2009-07-16 12:09:44 +02:00
timoore
a5a6600e74
Use SGExpressions for evaluating a Technique's validity
2009-07-16 12:09:44 +02:00
timoore
03b9303f22
Overhaul of SGExpression
...
Polymorphic additions to expressions: Add an expression base class
with a method for dynamically determining the type of an expression.
Add variables, predicates and boolian expressions.
Support for parsing trees of expressions
2009-07-16 12:09:44 +02:00
timoore
b5a59ea6f9
Work in progress for Technique validation
2009-07-16 12:09:44 +02:00
timoore
c6b2124129
Use Effects in materials library, and therefore in scenery
2009-07-16 12:09:44 +02:00
timoore
d320a6facb
Effects framework
2009-07-16 12:09:43 +02:00
timoore
0793c2cb8c
Blow away unused SGMaterialLib::add_item functions
2009-07-16 12:09:43 +02:00
timoore
d14755abb8
cleanup
...
Add support for boost::mem_fn to SGSharedPtr.
Remove a couple of "using" declarations from scene/model/model.hxx
2009-07-16 12:09:43 +02:00
timoore
abd4aa2e6b
Add PropertyList typedef for vectors of property list nodes.
2009-07-16 12:09:43 +02:00
timoore
58417e78e5
Add a method to setStringValue that takes a std::string argument
2009-07-16 12:09:43 +02:00
timoore
390eb1c6e9
Don't cache results of getDisplayName
...
Return a std::string result instead of char *.
2009-07-16 12:09:43 +02:00
timoore
d4c6530a72
Add VEC3D and VEC4D property types
...
Add "extended" argument to readProperties, which controls whether the vector
property types are accepted by the XML reader.
2009-07-16 12:09:43 +02:00
timoore
ff17b44a41
Extend properties to support new property types.
...
An SGRawBase class has been added as a base class to the SGRawValue
hierarchy so that SGPropertyValue functions don't necessarily need to
know the type of the value stored in the node.
A new SGRawValueContainer class stores properties that shouldn't be
stored in the node itself. PropertyTraits indicates if a type is
stored in the property node or externally.
Add getValue and SetValue template member functions to SGPropertyNode.
Read and write new extended properties.
Rearrange props.hxx a bit so that the template magic actually works.
Split out extended raw value virtual functions into a seperate base class.
SGRawExtended is chosen as a base class of SGRawValue for extended property
types.
2009-07-16 12:09:43 +02:00
timoore
5bd2d47571
Cleanup of properties
...
Change most uses of the SGPropertyNode _value union to use static_cast.
Move SGPropertyNode::Type out of the class into simgear::props namespace. Add
a PropertyTraits class so that templates can calculate the property type tag
based on a C++ type.
In destructor, delete _value.val if it is not 0 (and the property is not
aliased).
2009-07-16 12:09:43 +02:00
Tim Moore
b633b8d0d3
change MAX_PATH to max_path to avoid Windows compilation problems
2009-06-17 11:37:21 +02:00
Tim Moore
76948416a9
overhaul sg_throwable to behave like a proper exception
...
Make sg_throwable inherit from std::exception.
change exception objects to contain C strings: exception objects should not
include objects, like std::string, whose copy constructor could throw.
2009-06-16 11:11:13 +02:00
Tim Moore
7e7ce2f38e
Merge branch 'maint' into next
2009-05-18 00:34:06 +02:00
Tim Moore
006f90997a
Merge branch 'maint' into next
2009-03-31 00:04:30 +02:00
Tim Moore
342de209a2
Merge branch 'topic/nasal' into next
2009-02-16 00:48:00 +01:00
Tim Moore
ff7e70f4d5
Merge branch 'topic/gcintersect' into next
2009-02-13 10:07:15 +01:00
Tim Moore
950f51909c
New getPrimitive function.
...
This searches for the primitive found in an OSG intersection query.
2009-02-13 09:40:05 +01:00
Tim Moore
f86e6d344c
Make SGSubsystemGroup::Member copy constructor private.
...
The copy constructor wouldn't make any sense and would confuse ownership of
the subsystem pointer. Problem noted by John Denker.
2009-02-07 00:37:47 +01:00
Tim Moore
08581282dd
Merge branch 'topic/cloudz' into next
2009-02-06 19:16:19 +01:00
Tim Moore
e1e47e76ec
Turn off z buffer writes for clouds.
...
This is standard practice for semi-transparent objects and should cut down
on the flickering and other sorting artifacts.
2009-02-06 17:48:23 +01:00
Tim Moore
22c7df5936
Merge branch 'maint' into next
2009-02-04 11:03:20 +01:00
Tim Moore
81a44d1340
Merge branch 'releng/1.9.1' into maint
2009-02-04 11:02:30 +01:00
Tim Moore
589dae7b0c
Build trees under a transform note that is rotated to Z-up.
...
This allows the tree geometry to be shared across the entire scene because it
doesn't need to be rotated for each scenery tile.
2009-01-30 11:18:08 +01:00
Tim Moore
3ff13189aa
Don't expand all the trees into display lists.
...
This can chew up large amounts of memory for questionable gains. We do
let the tree model geometry be in a display list if OSG chooses to put
it there.
Various renaming and cleanup. Save some memory by reverting
ShaderGeometry's base class back to osg::Drawable.
2009-01-30 11:17:02 +01:00
Tim Moore
7151c3fac1
Merge branch 'topic/yontree' into next
2009-01-28 07:53:38 +01:00
Tim Moore
3e023b77dd
Merge branch 'maint' into next
2009-01-28 07:53:31 +01:00
Tim Moore
31d9eaf54c
Use osg::Geometry code to draw trees ourselves.
...
This reverts back in the direction of Yon's original patch: the model is
drawn within ShaderGeometry::drawImplementation. This saves a lot of memory
over the previous approach of creating a PrimitiveSet for each model.
2009-01-28 07:43:09 +01:00
Tim Moore
781c445d14
Merge branch 'topic/modelopt' into next
2009-01-23 23:27:48 +01:00
Tim Moore
26a416399f
Merge branch 'topic/yontree' into next
2009-01-23 23:27:37 +01:00
Tim Moore
f7dc7f039e
QuadTreeBuilder: create leaves on demand
...
This avoids lots of empty leaves.
2009-01-23 19:30:29 +01:00
Tim Moore
3c74fea087
Rewrite ShaderGeometry to use display lists and OSG primitives.
...
Based on a patch from Yon Uriarte.
Eliminate _trees list from ShaderGeometry
Use the position and scale values that are already available.
2009-01-23 19:29:18 +01:00
Tim Moore
be0635bfd3
Optimize empty groups from .ac models
...
The OSG optimizer seems to have changed since this work was originally done.
2009-01-23 16:11:23 +01:00
Tim Moore
6723ef95c2
Merge branch 'maint' into next
2009-01-19 00:13:07 +01:00
Tim Moore
1a8fd62680
Protect against division by zero in QuadTreeBuilder
...
This could only happen when there's one leaf in the tree, or all the objects
happen to have the same position. Noticed by Csaba Halaz
2009-01-19 00:04:59 +01:00
Tim Moore
8b57ed46b1
Sort cloud sprites using std::sort, based on projected Z.
...
A "cleanup" of cloud sorting.
2009-01-16 00:37:40 +01:00
Tim Moore
25c08e56c2
Merge branch 'foo' into next
2009-01-15 22:52:11 +01:00
Tim Moore
a47d5536fa
Merge branch 'maint' into next
2009-01-14 22:34:20 +01:00
Tim Moore
db8f7f21e8
Remove OptionsPusher and manipulation of osgDB dataFilePathList.
...
The bug it worked around has been fixed in the OSG ac3d loader, and changing
the path list has unpleasant multithreading implications.
2009-01-14 22:13:12 +01:00
Tim Moore
3c312c55f1
Merge branch 'maint' into next
2009-01-14 12:13:44 +01:00
Tim Moore
2d11419cba
SGPropertyNode must increment / decrement the reference counter in an aliased
...
node.
From Csaba Halász.
2009-01-14 12:10:23 +01:00
Tim Moore
07a4508944
Merge branch 'topic/mat-anim' into next
2009-01-13 22:58:45 +01:00
Tim Moore
62913739bb
Merge branch 'maint' into next
2009-01-13 22:52:19 +01:00
Tim Moore
55e9d8d944
SGMaterialAnimation: Don't install an update callback if values are static
2009-01-13 15:35:15 +01:00
Tim Moore
a9439d58c7
SGMaterialAnimation: factor out update of osg::Material
2009-01-13 13:15:34 +01:00
Tim Moore
62864637a3
Merge branch 'maint' into next
2009-01-12 13:14:31 +01:00
timoore
ecf0a1a736
Fix include path
2009-01-08 23:06:23 +01:00
timoore
966b9e5c2b
Use a singleton Fog attribute for all 3D clouds.
...
Don't update this Fog with any kind of update callback; instead, update from
the sky repaint method.
2008-12-10 22:39:48 +00:00
timoore
1625192c81
Use StateAttributeFactory for CullFace and ShadeModel attributes
2008-12-10 22:39:23 +00:00
timoore
c5e8c6603c
Use Boost singleton template for our singletons
2008-12-10 22:39:02 +00:00
timoore
37e541d326
Render cloud layers with face culling
...
Also, allow definition of colors for the cloud layer corners for debugging.
2008-12-10 22:38:34 +00:00
timoore
862a827fe6
Add cullFaceFront as a state attribute to the StateAttributeFactory
2008-12-10 22:38:14 +00:00
timoore
b96c5c9e4b
Render sky with depth test off.
...
Also, don't set BACKGROUND_BIT for cloud layers.
2008-12-10 22:37:52 +00:00
timoore
ae5297e6d7
logstream improvements from Yon Uriarte
...
Avoid descending into iostream when a message won't be logged.
2008-11-29 00:17:29 +00:00
timoore
bad80521a8
Track time in TileCache; assign new tiles the current time
2008-11-24 22:08:31 +00:00
timoore
98cecfe940
Templates for interacting with OSG objects
2008-11-21 14:48:15 +00:00
timoore
2e65538fb5
Template functions and overloaded functions for accessing property values.
...
These are useful for writing templates that manipulate properties.
2008-11-18 22:16:58 +00:00
timoore
cc17cc4af7
Respect precipitation-enable property
...
From Csaba Halász
2008-10-31 09:46:23 +00:00
timoore
6afd7e1a38
enable world coordinate particle fix
2008-10-30 23:51:41 +00:00
timoore
19aac5b14c
Keep non-local particles in a Z-up frame that is periodically moved.
...
This eliminates jitter and other rendering problems.
For the moment this is dependent on an osg fix.
Also, don't read wind properties from FlightGear; provide a mechanism
for fg to set the wind.
2008-09-11 10:19:05 +00:00
timoore
12495547c4
Don't use osgDB::SharedStateManager::share in SGLoadTexture2D
...
It is not safe to call this function from the database pager thread;
in any event, state sets and textures created in the database pager
will get passed through the SharedStateManager anyway.
2008-08-29 07:39:05 +00:00
timoore
29aad066f0
pointers in Particles object should be ref_ptr
2008-08-11 08:32:13 +00:00
timoore
74d3bdc68c
Return eof after a number of reptetitions of file input.
2008-08-07 22:24:01 +00:00
timoore
cf19b81dd4
forward declare osg::DrawElementsUShort for real
2008-07-29 02:54:48 +00:00
timoore
942fa53ed9
Add repeat option to SGFile.
...
This supports auto-looping over a playback file, for demos and such.
2008-07-19 16:01:20 +00:00
timoore
1729841083
Eliminate empty default constructor for SGReaderWriterBTGOptions
2008-07-19 16:00:58 +00:00
timoore
c8c693db53
From Benoit Laniel: replace SG threading constructs with those from OpenThreads
...
Also, move any static local mutexes up to global level.
2008-06-12 08:14:40 +00:00
timoore
7bc37651c3
add OSGVersion.hxx to VC7.1 project file
2008-06-02 20:26:07 +00:00
timoore
4fe43c3e50
OSG DatabasePager interface change in 2.5.1
...
Move OSG version macro from FlightGear to simgear
2008-06-02 20:22:16 +00:00
timoore
0826b7c3ca
Replace header files istream and ostream with iosfwd
2008-06-02 20:21:50 +00:00