Commit Graph

2510 Commits

Author SHA1 Message Date
Tim Moore
ddd72b2b37 Use an effect for 3d clouds 2009-11-26 11:40:41 +01:00
Tim Moore
7f5df1fb66 Support for shader program attributes in effects
Also, use a hash table for the effect shader program cache.
2009-11-26 11:39:34 +01:00
Tim Moore
2e71b64de1 Better error reporting for effects
Throw an exception when an undefine attribute value is found in an effect.

Also, fix a typo in TexEnvCombine operand attributes.
2009-11-26 11:32:00 +01:00
Tim Moore
45f1f9263f add a property debugging function 2009-11-26 10:38:31 +01:00
ehofman
878288f06a Don't forget to apply the doppler adjustment factor to the listener velocity also 2009-11-24 14:17:54 +01:00
ehofman
406cdf8d16 test for implementations with 'bad' doppler effects and adjust for it. 2009-11-24 14:17:54 +01:00
ehofman
5b28b024ae fix test programs 2009-11-24 14:17:54 +01:00
ehofman
7c693d8107 proper listener velocity calculation, this has no effect yet but is required when other models start emitting sounds. 2009-11-24 14:17:54 +01:00
Tim Moore
b8a6d1ac4d add depth attribute to Effect 2009-11-23 09:15:47 +01:00
Tim Moore
40533f50df Drop required Boost version from 1.37 to 1.34
Use boost/tr1 to bring in std::tr1::unordered_map instead of the Boost
version.
2009-11-22 23:05:11 +01:00
Tim Moore
539ced191b Move tree shaders to an effect
Also, improve effect hash keys.
2009-11-22 00:32:51 +01:00
Tim Moore
1a400b890b Effect file support for GL_VERTEX_PROGRAM_TWO_SIDE and POINT_SIZE 2009-11-22 00:27:53 +01:00
Tim Moore
ebe5a5579c shader language predicate 2009-11-20 22:59:15 +01:00
ehofman
afb18ca75b the wrong name also mislead me: rotate velocity to the proper quat 2009-11-19 23:01:49 +01:00
ehofman
01c62932bd make the relative positions fixed against the body again. 2009-11-18 23:25:55 +01:00
ehofman
6cd8db7b28 Set to default distance attenuation function but change the parameters a but for better sound effects (and most of all quieter sounds at greta distance 2009-11-18 23:25:51 +01:00
ehofman
bb46d91bc6 What do you know, the real problem turned out to be the distance attenuation function.. 2009-11-17 06:43:41 +01:00
Tim Moore
3cd5322496 descend into Effects to find default material animation values 2009-11-16 22:43:41 +01:00
Tim Moore
cadecdcab7 add a transparent texture for effects
This is used as a default texture for the chrome animation.

Also, fix a typo in creating combiners.
2009-11-16 22:42:46 +01:00
Tim Moore
cd4030b7db Make MultiChangeListener derive publicly from SGPropertyChangeListener
Otherwise it doesn't work as a listener!
2009-11-16 22:39:56 +01:00
Tim Moore
0a2264cad4 When instantiating effects, copy user data of any created nodes.
This bug was the cause of the huge memory consumption / death reported at some places:
the BVH data on "raw" .ac models (random objects) was dropped on the floor.
2009-11-15 23:51:08 +01:00
Tim Moore
bb2a02daa8 Bump boost version to 1.37 2009-11-15 01:17:34 +01:00
Tim Moore
5991195062 optimize creation and sharing of effects
Implement equality test and hash for for property trees.  In an
Effect, make a hash table of Effects that inherit from it keyed on
their unmerged property tree. Using that, makeEffect() should return a
single Effect for given property tree description. Animations may
change that in the future...
2009-11-13 22:41:11 +01:00
Tim Moore
54c4055af3 Effects in models working for transparent materials and chrome animation
Implementation of animated effect values via the property system.

Add names for TexEnvCombine attributes
2009-11-13 22:41:11 +01:00
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
ehofman
e3f70b7125 temporarily remove listener (viewer) and source offsets. they mess things up 2009-11-12 22:59:43 +01:00
Tim Moore
a25e859fa7 fix typo 2009-11-10 22:10:57 +01:00
ehofman
5b2af1f6b3 also recalculate the velocity in update_pos_and_orienation, so pass the north-east-down velocity directly and orientate position, orientation and velocity to OpenGL/OpenAL frames (x-right, y-up and z-back) 2009-11-10 16:29:16 +01:00
ehofman
59df72c4b0 allow sound effects in the configuration file to be added to the 'avionics' sample group by setting '<type>avionics</type>'. 2009-11-10 06:42:26 +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
b905f4b8aa Property system optimizations
Profiling startup with the new effects code exposed some performance
gotchas. The objective is to reduce allocation of std::string
temporaries, especially when looking up node path names. Also, I
changed some paths to initialize strings with strings instead of char *;
this causes less allocation, at least with glibc. Also, eliminate
the old version of find_node and its helper functions by writing the
template version of find_node_aux to handle an explicit index
parameter.

Also, add const char[] as an internal property type

This doesn't actually add a new type to the property system, but allows using
character arrays as arguments to certain templates.
2009-11-09 15:52:54 +01:00
ehofman
fefe87ed1e Remove old MSVC6.0 files that doen't work anymore 2009-11-09 10:45:15 +01:00
ehofman
b66905c2f6 Oops, it was the scenery up vector, not the viewer up vector 2009-11-07 08:52:16 +01:00
ehofman
39472e4d81 Save a costly SGVec3d::fromGeod() calculation 2009-11-07 08:52:16 +01:00
ehofman
85fba1325a pass the geodetic position and view orientation to the sky reposition function 2009-11-05 16:17:29 +01:00
ehofman
0f39f05fa1 small fixes 2009-11-04 23:05:22 +01:00
ehofman
8d551c2664 fix directional sound orientation 2009-11-04 23:05:21 +01:00
ehofman
346a22f684 adjust to recent changes 2009-11-04 23:05:21 +01:00
ehofman
b1571e4437 some small fixes 2009-11-04 23:05:21 +01:00
ehofman
5ac2abe3ab Remove more unneeded code and properly set relative position and sound direction 2009-11-02 23:20:59 +01:00
ehofman
5b15426cc6 Small code reorganization, mostly removing unneeded code 2009-11-02 23:20:59 +01:00
ehofman
1ac944b7c1 Position and orientation fixes thanks to Tim Moore (finaly). Code optimizations by moving code over from SGSoundSample to SGSampleGroup which means it will only run once for every sample group instead of once for every sample. 2009-11-02 23:20:58 +01:00
ehofman
fd90dbb123 silently clip pitch and gain to their maximum values 2009-11-01 21:52:37 +01:00