Am Freitag, den 20.05.2011, 19:06 +0200 schrieb ThorstenB: 
> On 19.05.2011 20:38, Lauri Peltonen wrote:
> > So the solution is either change the clear color to what it was, or make
> > it ramp linearly to black or something with altitude.
> >
> > Or change simgear/scene/sky.cxx around line 117 (repaint method), there
> > is a
> > if ( effective_visibility>  1000.0 ) {
> >    ...
> > } else {
> >    // turn off sky
> >    disable();
> > }

> My suggestion: we try removing the condition now and see if anyone sees 
> new issues.
After looking into this more closely, I revert my suggestion. Not a good
idea to remove the condition. It's there for several reasons:
* Switches off sun/moon/stars when visibility is low. Looks odd when
there's a bright (red) sun or stars in very dense the fog - so we have
to keep this.
* Also switches off the blue (or colorful) sky dome at low visibility.

Before the patch, the clear color was synchronized to the current fog
color:
        SGVec4f clearColor(l->adj_fog_color());
Hence, switching off the sky dome turned all empty bits into fog -
including the entire sky.

So, we need something in the scenery which can be painted with the fog
color. For anyone interested in working on it (Lauri? ;-) ) here are
some options:

* Change the sky dome itself so its color can uniformly be switched to
"fog color" when visibility is low, and then (the easy part ;-) ) move
the sky dome element above the switched sky group (so it's not affected
when the other sky elements are switched off).

* Switch the sky dome off but introduce/enable a new "fog dome" at low
visibility (painted with the fog color).

* Or, change the implementation of FGLighting::adj_fog_color
(and ::sky_color) to return black as the current fog/sky color at high
altitudes - and keep all the other stuff.

The last option is probably the easiest. But not sure what the "right"
solution was - maybe an osg/scenery expert can comment? (Tim/Mathias?)

I've reverted the original patch for now, since we'll need to work on
the particular renderer.cxx lines anyway to solve the issue - and there
were also a few minor "technical" things (see revert-commit comment), so
we should provide a better patch once we know how to solve the fog issue
altogether.

Tracker issue:
http://code.google.com/p/flightgear-bugs/issues/detail?id=319

cheers,
Thorsten



------------------------------------------------------------------------------
What Every C/C++ and Fortran developer Should Know!
Read this article and learn how Intel has extended the reach of its 
next-generation tools to help Windows* and Linux* C/C++ and Fortran 
developers boost performance applications - including clusters. 
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to