On Monday 05 March 2012 13:27:00 thorsten.i.r...@jyu.fi wrote:
> > There is an important issue though, the functions appear to be different
> > for objects and terrain.
> 
> What?? Both model-default.eff and terrain-default.eff refer to
> terrain-haze.vert/frag as shaders - how can the fog function be different
> if they're using the same shader code???
> 
> I think you're mistaken here.
> 
> The fog function is different for clouds and rain layers (because clouds
> and fog are the same stuff, so there need to be different rules) and for
> the skydome (because the atmosphere fogs in a different way looking
> straight up than looking straight down).
> 
> Cheers,
> 
> * Thorsten
> 

Sorry, my bad, I remembered something like that, but it was in fact me 
thinking that it would need a separate function for objects.

Anyway, first thing i noticed while looking more carefully at the code is this 
(terrain-haze.vert line 126):
// now the light-dimming factor
    earthShade = 0.9 * smoothstep(terminator_width+ terminator, -
terminator_width + terminator, yprime_alt) + 0.1;

which has undefined behaviour. smoothstep(a, b, x) requires specificaly 
that a < b.

Also, all light terms should have alpha 1.0 not 0.0.

Will report more as i find them :)

Cheers,
Emilian

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to