I've noticed that with OSG 3.x, the behaviour of some shaders, especialy in 
relation with the alpha channel changed.

Most notable in what is related to this bug:
http://code.google.com/p/flightgear-bugs/issues/detail?id=427

what follows is a copy of my post on that bug report:

Did a bit of testing on this one, and I think I found a fix. It affects not  
only airplane models, but anything that has a texture with an alpha channel  
when shaders are enabled. My theory is something changed in the way OSG  
handles things in shaders, but I'm no expert.

Apparently in this line (line 48 in default.frag, also present in similar  
form in models-default.frag and tree frag):

gl_FragColor = mix(gl_Fog.color, fragColor, fogFactor);

fragColor.a gets mixed too in newer versions of OSG, as oposed to  OSG  
versions pre 3.0 where the mix operation would affect only fragColor.rgb.

Changing the line to this:

gl_FragColor = vec4(mix(gl_Fog.color.rgb, fragColor.rgb, fogFactor), 
fragColor.a);

fixes it here, and applying the same to tree.frag and model-default.frag  
fixes similar problems with trees and scenery objects.

Easily testable with --visibility-miles=2 to get a thicker fog.

------------------------------------------------------------------------------
Doing More with Less: The Next Generation Virtual Desktop 
What are the key obstacles that have prevented many mid-market businesses
from deploying virtual desktops?   How do next-generation virtual desktops
provide companies an easier-to-deploy, easier-to-manage and more affordable
virtual desktop model.http://www.accelacomm.com/jaw/sfnl/114/51426474/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to