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
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.
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.
- 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).
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.