curt [Sun, 9 Nov 2008 15:39:54 +0000 (15:39 +0000)]
Manuel Massing:
Attached is a small fix for the sorting in CloudShaderGeometry.cxx.
I think the sorting problem stems from the osg idiosyncracy
to store transposed matrices...so the intuitive
osg::Vec4f p = vm * osg::Vec4f(_cloudsprites[i]->position.osg(), 1.0f);
needs to be replaced with...
osg::Vec4f p = vm.preMult(osg::Vec4f(_cloudsprites[i]->position.osg(), 1.0f);
The patch also optimizes the distance calculation - it evaluates the distances
in model space instead of eye space, which reduces computation to a dot-
product instead of a matrix multiplication.
fredb [Thu, 6 Nov 2008 21:58:07 +0000 (21:58 +0000)]
Stuart Buchanan :
It fixes the following issues (to a greater or lesser extent):
1) Performance. Quad trees used to improve culling, and the sprites are placed on the surface of a sphere rather than
randomly throughout the cloud, requiring fewer textures. This saves about 5-10fps on my machine.
2) Disabled 3D clouds have no performance impact. Previously they were still in the scenegraph. Now they are removed.
3) Clouds are now loaded on start-up, and don't require the scenario to be changed, they also work with METAR.
4) The cloud field is shifted as you travel. There's a small bug in that the clouds "jump" as you reach the edge of the field.
5) Iterative sorting of sprites. This doesn't appear to solve the alpha blending problem completely, but may help a bit.
mfranz [Sat, 18 Oct 2008 18:44:36 +0000 (18:44 +0000)]
fix regression: sgLoad3DModel_internal should not make assumptions
about the type of SGModelData. This *can* have to do with Nasal,
but doesn't have to. That's entirely that class instance's business.
mfranz [Tue, 14 Oct 2008 13:01:01 +0000 (13:01 +0000)]
allow to modify the XML animation config of a loaded submodel by
defining an <overlay> branch, which is copied over the submodel's
properties before the animations are evaluated
mfranz [Tue, 14 Oct 2008 11:03:39 +0000 (11:03 +0000)]
Move omit-node part from startElement to endElement to allow nodes
of this type to have children. We have to save the omit state on the
stack for that.
andy [Tue, 30 Sep 2008 16:48:36 +0000 (16:48 +0000)]
Fixes for bugs shaken out in the recent push: die properly for nil
indexes in slices. Fix string conversion issue with bare "+" and "-".
Fix lexing of exponent expressions such that "1e" is not a number.
andy [Fri, 26 Sep 2008 18:22:12 +0000 (18:22 +0000)]
Sync with Nasal upstream (Melchior already had a chance to test this,
so hopefully not too much breaks). New syntax features:
1. Call-by-name function arguments. You can specify a hash literal in
place of ordered function arguments, and it will become the local
variable namespace for the called function, making functions with many
arguments more readable. Ex:
Declared arguments are checked and defaulted as would be expected:
it's an error if you fail to pass a value for an undefaulted argument,
missing default arguments get assigned, and any rest parameter
(e.g. "func(a,b=2,rest...){}") will be assigned with an empty vector.
2. Vector slicing. Vectors (lists) can now be created from others
using an ordered list of indexes and ranges. For example:
var v1 = ["a","b","c","d","e"]
var v2 = v1[3,2]; # == ["d","c"];
var v3 = v1[1:3]; # i.e. range from 1 to 3: ["b","c","d"];
var v4 = v1[1:]; # no value means "to the end": ["b","c","d","e"]
var i = 2;
var v5 = v1[i]; # runtime expressions are fine: ["c"]
var v6 = v1[-2,-1]; # negative indexes are relative to end: ["d","e"]
The range values can be computed at runtime (e.g. i=1; v5=v1[i:]).
Negative indices work the same way the do with the vector functions
(-1 is the last element, -2 is 2nd to last, etc...).
3. Multi-assignment expressions. You can assign more than one
variable (or lvalue) at a time by putting them in a parenthesized
list:
(var a, var b) = (1, 2);
var (a, b) = (1, 2); # Shorthand for (var a, var b)
(var a, v[0], obj.field) = (1,2,3) # Any assignable lvalue works
var color = [1, 1, 0.5];
var (r, g, b) = color; # works with runtime vectors too
timoore [Fri, 29 Aug 2008 07:39:05 +0000 (07:39 +0000)]
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.
andy [Mon, 25 Aug 2008 16:53:34 +0000 (16:53 +0000)]
Fix typing error with fgetc in readln(). On most boxes, this would
cause a spurious EOF when there was a 0xff in the stream. But on PPC,
char is unsigned (for reasons known only to IBM) and it would loop
forever.
fredb [Sat, 2 Aug 2008 11:31:47 +0000 (11:31 +0000)]
Update MSVC 7.1 projects - Adapt to OSG 2.6.0-rc1 : location of header files should now be searched in the install directory, here ..\..\..\install\msvc71\OpenSceneGraph\include
- remove the SG_GLxxxx_H #defines, since OSG provides its own versions
- this exposed a bizarre issue on Mac where dragging in <AGL/agl.h> in
extensions.hxx was pulling in all of Carbon to the global namespace
- very scary. As a result, I now need to explicitly include CoreFoundation
in fg_init.cxx.
- change SG_USING_STD(x) to using std::x
Issues:
- the logic for X11 and Win32 in RenderTexture and extensions is tortured,
please see if you agree I got all the ifdefs correct.
Reduce compiler.h to almost nothing (but it's worth keeping around I think, for
the MSVC and MipsPro warning stuff).
As a result of this patch, simgear/sg_traits.h can be deleted. So can SGCMath.h,
but I'll do that separately.
There is one more 'mechanical' change to come - getting rid of SG_USING_STD(X),
but I want to keep that separate from everything else. (There's another mechnica
l change, replacing <math.h> with <cmath> and so on *everywhere*, but one step a
t a time)
Attached patches remove BORLANDC, and hence SG_MATH_EXCEPTION_CLASH and SG_INCOM
PLETE_FUNCTIONAL from SimGear and FlightGear.
As a result, SG_HAVE_STD_INCLUDES is now *always* set, so I will get the boring
fixes for that done, but separately. I'm still auditing the other things in comp
ilers.h - there's a lot that can die now BORLAND is gone.
"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.