Commit Graph

2236 Commits

Author SHA1 Message Date
fredb
800ad40c4c Csaba/Jester : fix the material animation and display night textures 2009-01-13 10:37:38 +01:00
Tim Moore
62864637a3 Merge branch 'maint' into next 2009-01-12 13:14:31 +01:00
fredb
4d4ac7ea24 fix end of file 2009-01-12 13:13:04 +01:00
fredb
119651482d ignore generated files 2009-01-12 13:12:50 +01:00
timoore
ecf0a1a736 Fix include path 2009-01-08 23:06:23 +01:00
jmt
94942d1ac4 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.
2009-01-08 23:05:12 +01:00
jmt
b0a5b54949 Fix test-program linkage now sgmath depends on sgstructure. 2009-01-02 23:52:46 +01:00
jmt
ac57eab8ac Fix a potential crash when OSG is misconfigured, and an appropriate image
loading plugin cannot be found.
2008-12-26 11:42:04 +00:00
mfranz
74a4144193 compilation fix: <cstring> for strcmp() 2008-12-22 18:01:34 +00:00
mfranz
5c44cb0f01 - 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)
2008-12-21 15:01:11 +00:00
durk
c044d711ef Documentation update regarding OpenAL and OSG. 2008-12-20 09:10:43 +00:00
curt
f2132f6a7d Attempt to sort out the version number mess in preparation for a 1.9.0 release. 2008-12-19 20:39:59 +00:00
fredb
69871b15ff 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).
2008-12-19 07:39:09 +00:00
mfranz
f4ec02a592 James TURNER: make the index of the current waypoint available 2008-12-18 22:51:58 +00:00
fredb
53f7743678 Stuart :
the 3D clouds now respect changes to the environment caused by updated METAR etc.

It also increases the AlphaFunc as suggested by Tim.
2008-12-14 18:47:30 +00:00
fredb
15893bc558 Csaba/Jester : fix a problem with tex transform animation 2008-12-12 20:02:44 +00:00
fredb
73b974f1b5 Csaba/Jester : fix a problem with material animation 2008-12-12 19:57:25 +00:00
fredb
0e7bdc208b Print the name of the file generating an OpenAL error 2008-12-12 07:41:44 +00:00
fredb
e0a07b7a92 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.
2008-12-11 08:24:35 +00:00
fredb
4da58e8846 Update MSVC 7.1 projects. Add Boost 2008-12-11 08:23:37 +00: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
durk
f7e91f1f08 Finalizing the preparation of SimGear-1.99.5-rc2. 2008-12-10 18:20:36 +00:00
fredb
2d77178ba3 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.
2008-12-06 23:02:42 +00:00
fredb
b38e6d8bf3 Ugly hack to fix a memory corruption problem 2008-12-06 23:01:24 +00:00
fredb
b601cdb6a5 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.
2008-12-04 20:56:03 +00:00
fredb
2803154213 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.
2008-11-30 23:06:18 +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
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