Okay, I've pushed an experimental version of a grain overlay texture for the 
model ubershader  to FGData. It affects Atmospheric Light Scattering only, i.e. 
will be absent in the default rendering, which should make for easy comparison.

For lack of texture units, I had to take the rainbow coloring of reflections 
out  for the moment (again, only in the Atmosperic Light Scattering version). I 
can't visually spot a difference, and in any case a 2d texture lookup call 
seems an overkill for a simple 1d color table, so I plan to replace that by a 
function eventually. As far as I can see and test, this shouldn't take any 
framerate unless used.

The grain overlay is configured pretty much like any other model effect in the 
ubershader - a model specific effect file needs to set the flags, which are

* grain-texture-enabled: does what you think it does, needs to be 1 to work
* grain-magnification : the texture magnification relative to the base texture 
- I think values between 10 and 100 would work here

The grain texture itself needs to be declared as n=14. The grain texture should 
be largely transparent and seamless - I think unlike for the terrain tiling 
artefacts are not an issue for artificial patterns, they actually occur.

For a quick check, inserting the following xml code into 
Aircraft/Citation-Bravo/Models/Effects/reflect.eff

<texture n="14">
        <image>Textures.high/Terrain/grain_texture.png</image>
        <filter>linear-mipmap-linear</filter>
        <wrap-s>repeat</wrap-s>
        <wrap-t>repeat</wrap-t>
        <internal-format>normalized</internal-format>
</texture>
<grain-texture-enabled>1</grain-texture-enabled>
<grain-magnification>50</grain-magnification>

gives me this effect for the hull of the Bravo which is now re-painted using 
the terrain grain texture at high resolution


http://users.jyu.fi/~trenk/pics/overlay.jpg

Looks a bit like a military version... 

So, please play with it - it's basically down to how well the grain overlay can 
be made.

* Thorsten
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to