Commit Graph

2454 Commits

Author SHA1 Message Date
fredb
fa7490fb38 Stuart:
> Something has changed in the environment manager which means that clouds
> generateion is now inconsistent. I'm still tracking it down, as my recent
> changes shouldn't have affected this.

Well, the cause was a bug in my code, but it didn't expose itself until we moved
to multiple cameras. The attached patch fixes the problem.

I've also put in a new heuristic to improve the frame-rate. Clouds that are already sorted
are likely to still be sorted in subsequent frames. Therefore I've put in a back-off
mechanism for the bubble-sort pass. This should mean that if you stay completely
stationary, once the clouds become sorted they will eventually only perform a
bubble sort pass every 128 frames.
2008-11-26 07:28:10 +00:00
timoore
bad80521a8 Track time in TileCache; assign new tiles the current time 2008-11-24 22:08:31 +00:00
fredb
8303e30033 Stuart :
> Warning: detected OpenGL error 'valeur non valide' after RenderBin::draw(,)

Fixed in the patch below. For some reason the shader didn't like index 16 being used...

The patch also fixes the chequer-board effect that was causing very sparse cloud cover.
2008-11-24 20:26:12 +00:00
fredb
27de1e271e Stuart Buchanan :
Attached is a small patch for 3D clouds.
It provide the following:
1) Proper spherical distribution of sprites (previously they were distributed cylindrically - whoops)
2) Better shading, so the bottom of the cloud is darker than the top.
3) Fixed a couple of texture sizing bugs.
2008-11-23 12:14:56 +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
curt
e6371cbf9c 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.
2008-11-09 15:39:54 +00:00
fredb
0b8b6ac56a 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.
2008-11-06 21:58:07 +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
curt
91e22c1fb3 Tidy up for a source code "snapshot" release. 2008-10-30 17:51:00 +00:00
fredb
ad6129816d 3D clouds from Stuart Buchanan. Need a recent driver update, --enable-clouds3d option and a Weather Scenario to show up 2008-10-26 09:37:13 +00:00
curt
409db9d7ef Fix a few spelling errors. 2008-10-23 18:46:55 +00:00
mfranz
2ccd58e917 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.
2008-10-18 18:44:36 +00:00
mfranz
7585ad430a add global switch for particle systems 2008-10-17 21:15:58 +00:00
mfranz
c105c5a449 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
2008-10-14 13:01:01 +00:00
mfranz
54065b59a1 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.
2008-10-14 11:03:39 +00:00
durk
f9250ae522 Syd Adams: Replace rgb with png. 2008-10-14 05:04:43 +00:00
mfranz
2f8621ed3d s/multiplayer/multiplay/, as this seems to be the slightly more
official version (--multiplay option, /sim/multiplay/ properties etc.)
2008-10-10 09:48:03 +00:00
mfranz
98a3e7cffa if a model XML file contains a <multiplayer> block, copy its contents
to the model's property root (/ai/models/multiplayer[*])
2008-10-09 22:20:33 +00:00
andy
d7f2966216 Yeah, I really shouldn't be in the lexer 2008-09-30 21:52:44 +00:00
andy
8687b214e7 Another lexer fix 2008-09-30 20:19:01 +00:00
andy
f5f1f0da8e Fix broken lex.c checkin 2008-09-30 19:06:34 +00:00
andy
818359bfd0 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.
2008-09-30 16:48:36 +00:00
fredb
8174005ac8 MINGW patch by Csaba Halasz 2008-09-28 08:11:10 +00:00
andy
0180cae8c3 Fix parsing for degenerate cases like a[,] a[:] and {:}. The slicing syntax exposed the low-level generators to some new cases. 2008-09-26 19:18:19 +00:00
andy
dd1ea541ec 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:

   view_manager.lookat(heading:180, pitch:20, roll:0, x:X0, y:Y0, z:Z0,
                       time:now, fov:55);

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
2008-09-26 18:22:12 +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
ehofman
f3f8a211cd Make sure the compiler is aware that SGModelData a child of osg::Referenced, now gcc-3.3 will compile. 2008-09-04 08:52:47 +00:00
fredb
3edcbc3b99 Use a more relevant library name 2008-08-31 18:39:49 +00:00
fredb
5a1cc8745e Update version 2008-08-31 18:35:02 +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
curt
ff654ab094 - Update SimGear.dsp
- Assign an arbitrary prerelease version number
- Fix a "make dist" problem.
2008-08-28 17:52:43 +00:00
andy
e55f55cd3e 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.
2008-08-25 16:53:34 +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
fredb
7f9b3a8666 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 2008-08-02 11:31:47 +00:00
ehofman
426f6de16f final fixes for SG_USING_STD removal 2008-07-29 08:25:17 +00:00
timoore
cf19b81dd4 forward declare osg::DrawElementsUShort for real 2008-07-29 02:54:48 +00:00
ehofman
d4c7e95092 Replace SG_USE_STD() by using std:: 2008-07-28 07:52:13 +00:00
fredb
aa07b5bdd8 GL/wgl.h never existed, and a glx equivalent is not needed 2008-07-27 18:04:13 +00:00
ehofman
c7cbb22667 - 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.
2008-07-27 16:10:36 +00:00
fredb
ff72b68731 Remove unneeded inclusions of windows.h, GL.h and GLU.H 2008-07-27 15:15:33 +00:00
fredb
433be0e46b Maybe a more portable way to do it 2008-07-25 21:33:54 +00:00
fredb
900607034e Compile again with MSVC 2008-07-25 21:27:46 +00:00
ehofman
733e6fa14f 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)
2008-07-25 18:35:40 +00:00
ehofman
cd72eb20c6 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.
2008-07-25 10:39:20 +00:00
ehofman
d754e616a5 remove a workaround for the C++ / stdlibary bug which existed aeons ago on Mac. 2008-07-25 08:34:15 +00:00
ehofman
d613e0a488 Patch to remove macintosh and MWERKS from Simgear. 2008-07-24 19:16:50 +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