mfranz [Sun, 15 Feb 2009 16:54:39 +0000 (16:54 +0000)]
"io.flush() implementation from Melchior. Also add a final filetype
element to the io.stat() array, which has been sitting around on my
box for a while and doesn't seem to have broken anything." -- Andy
Tim Moore [Thu, 29 Jan 2009 06:22:42 +0000 (07:22 +0100)]
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.
durk [Tue, 27 Jan 2009 22:43:13 +0000 (22:43 +0000)]
For the first time (no pun intended) in almost ten years time (again no
pun intended) that I'm touching the time library.
Brian Schack reported that the traffic scheduler messes up the timestamps
of the atlas network output. As it turns out, the c library functions
asctime, and gmtime use a static copy of the tm struct to do the internal
formatting. Our linux port of the SGTime class, incidentally, also stored
it's master time stamp in this very same struct. Thus, formatting an
arbitrary time value, would have the unwanted side effect of time travel.
Usually, this would go unnoticed, because the actual time parameters would
be updated before any damage could be done. But unwanted side effects, as
in Brian's example could occur.
On the MSVC port this appears to not have been a problem. Since that port
used a copy of the tm struct to store it's master time stamps. Since the
MSVC code also compiles cleanly on linux, it seems to be the way to go to
use that approach. In addition, it also removes some conditional compile
directives.
I've only run a short test, but didn't see any undesirable side effects.
Tim Moore [Wed, 28 Jan 2009 06:43:09 +0000 (07:43 +0100)]
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.
jmt [Fri, 26 Dec 2008 12:08:28 +0000 (12:08 +0000)]
Add some syntactic helpers to allow distance/course to be queried between
two geodetic points. This still entails a full _geo_inverse_wgs_84 call,
but makes call sites neater.
mfranz [Sun, 21 Dec 2008 15:01:11 +0000 (15:01 +0000)]
- shininess is in the rage 0..128
- restore fg/plib compatibility (there is/was no <shininess> group)
(we may want to change that in the (near?) future, though)
fredb [Fri, 19 Dec 2008 07:39:09 +0000 (07:39 +0000)]
Stuart Buchanan :
Attached is yet another 3D clouds patch, to fix the following:
1) The 3D clouds were not modified by the cloud coverage, due to some problems with osg::Switch
2) METAR changes to cloud coverage were not obeyed.
3) Making changes via the Cloud dialog had no effect unless 3D clouds were toggled.
4) Cloud cover was too sparse.
5) 3D Stratus clouds caused performance issues on some hardware (fixed by removing 3D stratus from cloudlayers.xml - it will now be a 2D layer).
fredb [Thu, 11 Dec 2008 08:24:35 +0000 (08:24 +0000)]
Stuart :
- Removes the cloud type re-use code - I think they aren't worth the graphical artefacts that they cause in light of Tim's improvements
- Changes the transparency of the clouds. Previously, the clouds were transparent at 0m distance, opaque at 200m, then gradually more transparent to the fog limits. This meant they were generally quite transparent. Now, they are opaque from 200m to 15km, then become transparent at 20km. A side effect of this is that the current textures could probably benefit from being made slightly transparent to improve the blending of the sprites against each other.
fredb [Sat, 6 Dec 2008 23:02:42 +0000 (23:02 +0000)]
Stuart Buchanan :
- Replaces simple shader attributes with vectors (this was missed out of the last patch by mistake)
- Includes Yon's Fog update code (Thanks!)
- Fixes a bug since 1.0 where --enable-real-weather-fetch stopped the other weather scenarios from working.
fredb [Thu, 4 Dec 2008 20:56:03 +0000 (20:56 +0000)]
Stuart Buchanan :
This provides the following enhancements & bug fixes
- Fix the chequer-board bug.
- Add proper cloud coverage function - so scattered clouds are now truly scattered.
- Add real-time control for visibility range.
- Use a limited set of clouds rather than generating a completely new Geode for each cloud. This saves sorting and display time.
- Add controls to Rendering dialog to allow fine-tuning of the number of sprites, cloud visibility and the number of different types of cloud.
- Add some variance to the sort back-off to avoid all clouds being sorted at the same time.
- Pack attributes into vectors for performance
- Re-order the cloud type determination code so that if a cloud layer could either be stratus or cumulus, cumulus is used.
- Lowered the cloud level in the standard cloud configuration slightly so a cumulus layer is generated rather than stratus.
These last two mean that you should see some 3D cumuli if disabling real weather fetch.
My thanks to Yon Uriarte for his help with performance work.
fredb [Sun, 30 Nov 2008 23:06:18 +0000 (23:06 +0000)]
Stuart:
Attached is another clouds patch. This does the following:
1) Puts the 3D clouds in a cloud rendering bin, to reduce the transparent edge problem. Viewing 3d clouds against a 2D layer _above_ it now blends correctly. There is still a problem when viewing a layer below the 3d clouds, and I'm not sure if/how I'll manage to solve that. Thanks to Tim for pointing me at the correct code (again).
2) Performance improvement by calculating the Bounding box when the cloud is generated rather than ever time it is requested.
fredb [Wed, 26 Nov 2008 07:28:10 +0000 (07:28 +0000)]
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.
fredb [Sun, 23 Nov 2008 12:14:56 +0000 (12:14 +0000)]
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.
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.