Commit Graph

4378 Commits

Author SHA1 Message Date
James Turner
1b7f310ea6 Merge FreeBSD patches.
Taken from:
http://svnweb.freebsd.org/ports/head/devel/simgear/files/
2014-11-11 22:29:24 +00:00
Stuart Buchanan
365ddb84a7 Limit number of random objects per triangle 2014-11-07 22:22:55 +00:00
Stuart Buchanan
5fef44b11c Change parameter name to avoid clash with cull-face 2014-10-27 22:40:27 +00:00
Stuart Buchanan
1480aa9bb8 Pass whether light is directional to shader.
Patch from Thorsten RENK.
2014-10-21 20:27:46 +01:00
Torsten Dreyer
75271c44a8 Precipitation updates from ThorstenR
Since the consensus seems to be that the precipitation clipping issue is with the panel code, attached is  my proposed update for the precipitation system in SG and FG

* without corresponding control structures in FGData it falls back to default, except I have fixed an inconsistency in freezing behavior - previously rain changed suddenly to snow when the temperature dropped below zero, but the reverse transition was dragged out and gave odd visible motion with the wind as snow gradually changed back to rain with the particle speed not well defined. Now both transitions are sudden. And I see no more particles flow against the wind

* with

 <!-- definitions for the detailed precipitation manager -->
 <precipitation-control>
     <rain-droplet-size type="float" userarchive="n">0.015</rain-droplet-size>
     <snow-flake-size type="float" userarchive="n">0.03</snow-flake-size>
     <detailed-precipitation type="bool" userarchive="n">false</detailed-precipitation>
     <illumination type="float" userarchive="n">1.0</illumination>
     <clip-distance type="float" userarchive="n">5.0</clip-distance>
  </precipitation-control>

added to Environment/environment.xml, the new system allows to switch more detailed management on. This provides

* explicit setting of rain droplet size and snow flake size by the weather system

* automatic sqrt(r) scaling of the vertical speed of raindrops

* automatic transition to snow when freezing for small droplets but hail for large droplet sizes (looks like snow, but has different particle dynamics)

* an illumination scaling factor to dim the precipitating based on the light we have in the scene (I still need to devise a property rule to set this automatically)

The clip distance is also exposed now and considered at startup of the system - might be useful for e.g. airships when the gas bag provides rain cover (?)   or to be simply off for open airplanes
2014-10-21 10:46:48 +02:00
Torsten Dreyer
543f1b7902 Set sun color below horizon
Thorsten Renk:
The following patch sets the sun color to alpha=0 when
the sun is below the local horizon, removing the oddity
that the sun is seen 'through' the terrain when the terrain
at large distance is rendered by the skydome.
2014-10-08 12:45:01 +02:00
Stuart Buchanan
93a63a0678 Further work to clean up UniformCache for Effects 2014-09-27 22:05:30 +01:00
Torsten Dreyer
2bf79a2fa1 Merge branch 'UniformFactory' into next
Merging in Stuart's fix for the Effect system
2014-09-27 21:50:44 +02:00
Torsten Dreyer
ab956f15c3 A better fix for crash in the Effect System
Stuart has improved the UniformCache approach, here are his
changes:
- We have a UniformCache so that each unique Uniform is only created once
- As part of the UniformFactory we also have a queue of listeners that are still to be added
- When the main thread sends an Update node visitor across the Effects,
  all queued listeners are de-queued and added.
2014-09-27 21:48:36 +02:00
Thomas Geymayer
deceee8997 Fix compiler warnings. 2014-09-22 18:24:13 +02:00
Thomas Geymayer
b3c7d63809 Let ENABLE_TESTS enable/disable also the new Boost.Tests. 2014-09-22 18:21:52 +02:00
Clément de l'Hamaide
2026c665b2 Improve the <usage> tag feature
Do not load the <model> if <usage> tag is found as child.
Instead the load is triggered later by FlightGear
2014-09-21 22:05:45 +02:00
Thomas Geymayer
36fd005bb9 cppbind: check if ghost is of wrong type.
- Throw an exception if converting an object
   from Nasal fails due to a wrong type (nil
   does not throw).
 - Update cppbind test cases accordingly (and
   refactor another test suite to use Boost.
   Test).
2014-09-15 23:42:12 +02:00
Torsten Dreyer
46bed67cce first stab at UniformFactory 2014-09-05 11:28:58 +02:00
Torsten Dreyer
5b9af0c0aa Revert "Partial fix for crash in SGPropertyNode::fireValueChanged"
This reverts commit f33ad357e9.
2014-09-05 11:28:28 +02:00
Thomas Geymayer
85090180d0 canvas::Text: fix global StateSet and line start cursor pos with empty line. 2014-08-31 19:24:58 +02:00
Torsten Dreyer
f33ad357e9 Partial fix for crash in SGPropertyNode::fireValueChanged
The effect system used Listeners on property nodes to get the values
for shader uniforms. These listeners get deleted by an osg thread
causing access to freed memory when this happens while the main thread
calls fireValueChanged.

This patch changes the update method to polling for scalar properties.
This isn't 100% threadsafe, too. But at least it does not crash anymore.
2014-08-29 15:30:25 +02:00
Clément de l'Hamaide
c30ce67e16 Remove Textures.high logic 2014-08-27 22:08:20 +02:00
Torsten Dreyer
3ca7369fb2 Canvas: add stroke-linejoin handling for path elements 2014-08-26 00:08:35 +02:00
Thomas Geymayer
088ce31f7c canvas::KeyboardEvent: C0/C1 control characters are not printable. 2014-08-25 21:49:44 +02:00
Thomas Geymayer
4f94c22241 Canvas: add method clearFocusElement. 2014-08-25 21:49:21 +02:00
Thomas Geymayer
e1791b3006 canvas::Text: clean up and expose character/cursor positions. 2014-08-23 15:54:07 +02:00
Stuart Buchanan
e608ed5a01 Use surface-lights effect for random tile lights. 2014-08-10 20:20:42 +01:00
Thomas Geymayer
35ebb16215 Canvas: prepare for keypress events. 2014-08-10 19:39:18 +02:00
Thomas Geymayer
68d0891665 Canvas: fix element mouse hit detection with OSG 3.3.2. 2014-08-10 15:37:43 +02:00
Stuart Buchanan
b11ff19a0f Fix VS2010 lack of fminf 2014-08-10 12:54:58 +01:00
Stuart Buchanan
e7e616e07c New materials.xml format 2014-08-09 20:34:08 +01:00
bcoconni
14f2f9e917 Added some OSG headers for the correct evaluation of the OSG_VERSION_LESS_THAN macro. 2014-08-09 19:53:19 +02:00
Thomas Geymayer
791273c61d Update for OpenSceneGraph 3.3.2 API changes. 2014-08-09 18:13:45 +02:00
Thomas Geymayer
519326f751 Add simple keyboard event demo application. 2014-08-08 00:59:06 +02:00
Thomas Geymayer
d1f5d92a7b Move canvas::AlignmentFlag to separate file.
Mapping in a separate file allows easier exposing of
values and string representation to Nasal.
2014-08-03 16:39:26 +02:00
Christian Schmitt
f448898531 Fix lights appearing three times.
The 3 lights showing up are fixed by my patch. It's the old way of
calculating a normal (PLIB-style) that makes them show up.
2014-08-03 13:13:59 +02:00
Thomas Geymayer
d9b66fc0ef canvas::Layout: support for alignment.
Set alignment inside layouts, taking care of where
excess space is distributed.
2014-08-03 12:02:39 +02:00
Thomas Geymayer
3bcd0bafd5 Lots of (mostly) doxygen fixes/cleanup. 2014-08-01 00:13:25 +02:00
Thomas Geymayer
942181c8ae Canvas: Support for preventDefault() on Events. 2014-07-30 17:16:26 +02:00
Thomas Geymayer
7df39b9fc8 Fallback for old Boost (also with UTF8-CPP library). 2014-07-30 12:44:21 +02:00
Thomas Geymayer
f41b18f064 Improve (mostly Canvas event related) documentation. 2014-07-29 23:57:59 +02:00
Thomas Geymayer
c5d649aa0b Canvas: basic Keyboard event support (with input focus). 2014-07-29 22:22:20 +02:00
Thomas Geymayer
64ac22f50c Canvas: warn for missing tff and png plugins. 2014-07-27 12:11:09 +02:00
Thomas Geymayer
719ee36f5c Canvas: backdrop/stroke option for text (based on Gijs patch). 2014-07-27 11:05:49 +02:00
Thomas Geymayer
92851135d4 Doxygen: disable (not working) latex output and update version. 2014-07-22 12:51:01 +02:00
Thomas Geymayer
76fc47b24b canvas::Layout: support for contents margins. 2014-07-22 12:00:24 +02:00
Thomas Geymayer
f25abad9d7 Move overflow protected add helpers to math. 2014-07-22 11:45:28 +02:00
Thomas Geymayer
23413b4781 canvas::Layout: clear parent/canvas after calling onRemove. 2014-07-21 23:56:41 +02:00
Thomas Geymayer
e036dfc5bf Hopefully final fix for old gcc... 2014-07-21 13:26:09 +02:00
Thomas Geymayer
9260bea850 One more fix for old gcc. 2014-07-21 12:22:33 +02:00
Thomas Geymayer
c1f09034e0 Trying to make old gcc on Jenkins happy. 2014-07-21 10:54:31 +02:00
Thomas Geymayer
557e4f75b5 canvas::Layout: support for hiding items. 2014-07-21 00:25:59 +02:00
Thomas Geymayer
e71d6b24d7 cppbind: helper to call Nasal methods on NasalWidget. 2014-07-21 00:22:15 +02:00
Thomas Geymayer
726a4c6d10 canvas::NasalWidget: check for empty setGeometry callback. 2014-07-20 23:31:32 +02:00