Hi,

Dann habe ich gestern wirklich was verpasst...

Wonderfull - I think it must be same for objects and
aircrafts? They got the same problems - the textures
looks very often washed-out like the runway texture on
the first picture.

Possible?

Greetings
HHS


--- Olaf Flebbe <[EMAIL PROTECTED]> schrieb:

> Hi,
> 
> I had the chance to get a small lecture on OSG. I
> tried out anisotropic 
> filtering for improving the look of the runways.
> IMHO the result is amazing.
> 
> Compare yourself -- have a look the markings on the
> runway:
> 
>
http://www.oflebbe.de/oflebbe/FlightGear/withoutfilter.jpg
> 
>
http://www.oflebbe.de/oflebbe/FlightGear/with8filter.jpg
> 
> Without any drop in framerate ...
> 
> Filtering can be switch on and controlled as per
> SGMaterial.
> 1. == default off
> Please note that only powers of two are valid.
> 
> Cheers
>    olaf
> > Index: simgear/scene/material/mat.cxx
>
===================================================================
> RCS file:
>
/var/cvs/SimGear-0.3/SimGear/simgear/scene/material/mat.cxx,v
> retrieving revision 1.34
> diff -u -r1.34 mat.cxx
> --- simgear/scene/material/mat.cxx    3 Dec 2006
> 17:27:46 -0000        1.34
> +++ simgear/scene/material/mat.cxx    20 Apr 2007
> 20:59:00 -0000
> @@ -141,6 +141,7 @@
>    wrapu = props->getBoolValue("wrapu", true);
>    wrapv = props->getBoolValue("wrapv", true);
>    mipmap = props->getBoolValue("mipmap", true);
> +  filtering = props->getDoubleValue("filtering",
> 1.0);
>    light_coverage =
> props->getDoubleValue("light-coverage", 0.0);
>  
>    // surface values for use with ground reactions
> @@ -204,6 +205,7 @@
>      wrapv = true;
>  
>      mipmap = true;
> +    filtering = 1.0f;
>      light_coverage = 0.0;
>  
>      solid = true;
> @@ -233,7 +235,7 @@
>              SG_LOG( SG_GENERAL, SG_INFO, "Loading
> deferred texture "
>                                            <<
> _status[i].texture_path );
>              assignTexture(_status[i].state.get(),
> _status[i].texture_path,
> -                                         wrapu,
> wrapv, mipmap );
> +                                         wrapu,
> wrapv, mipmap, filtering );
>              _status[i].texture_loaded = true;
>         }
>      }
> @@ -279,7 +281,7 @@
>  
>          if ( !defer_tex_load ) {
>              SG_LOG(SG_INPUT, SG_INFO, "    " <<
> _status[i].texture_path );
> -         assignTexture( stateSet,
> _status[i].texture_path, wrapu, wrapv );
> +         assignTexture( stateSet,
> _status[i].texture_path, wrapu, wrapv, 1, filtering
> );
>              _status[i].texture_loaded = true;
>          } else {
>              _status[i].texture_loaded = false;
> @@ -316,7 +318,7 @@
>  }
>  
>  void SGMaterial::assignTexture( osg::StateSet
> *state, const std::string &fname,
> -                 int _wrapu, int _wrapv, int
> _mipmap )
> +                 int _wrapu, int _wrapv, int
> _mipmap, float filtering )
>  {
>     map<string, osg::ref_ptr<osg::Texture2D>
> >::iterator _tex_cache_iter;
>     _tex_cache_iter = _tex_cache.find(fname);
> @@ -324,6 +326,7 @@
>     {
>        osg::Texture2D* texture =
> SGLoadTexture2D(fname, _wrapu, _wrapv,
>                                                 
> mipmap ? -1 : 0);
> +      texture->setMaxAnisotropy( filtering);
>        state->setTextureAttributeAndModes(0,
> texture);
>        _tex_cache[fname] = texture;
>     }
> Index: simgear/scene/material/mat.hxx
>
===================================================================
> RCS file:
>
/var/cvs/SimGear-0.3/SimGear/simgear/scene/material/mat.hxx,v
> retrieving revision 1.25
> diff -u -r1.25 mat.hxx
> --- simgear/scene/material/mat.hxx    29 Oct 2006
> 19:27:09 -0000        1.25
> +++ simgear/scene/material/mat.hxx    20 Apr 2007
> 20:59:01 -0000
> @@ -252,6 +252,9 @@
>    // use mipmapping?
>    int mipmap;
>  
> +  // use anisotropic filtering
> +  float filtering;
> +
>    // coverage of night lighting.
>    double light_coverage;
>  
> @@ -293,7 +296,7 @@
>    void build_state( bool defer_tex_load );
>    void set_state( osg::StateSet *s );
>  
> -  void assignTexture( osg::StateSet *state, const
> std::string &fname, int _wrapu = TRUE, int _wrapv =
> TRUE, int _mipmap = TRUE );
> +  void assignTexture( osg::StateSet *state, const
> std::string &fname, int _wrapu = TRUE, int _wrapv =
> TRUE, int _mipmap = TRUE, float filtering = 1.0f );
>  
>  };
>  
> > Index: materials.xml
>
===================================================================
> RCS file:
> /var/cvs/FlightGear-0.9/data/materials.xml,v
> retrieving revision 1.88
> diff -u -r1.88 materials.xml
> --- materials.xml     28 Jan 2007 11:43:50 -0000      1.88
> +++ materials.xml     20 Apr 2007 21:13:40 -0000
> @@ -126,29 +126,34 @@
>  <material>
>   <name>pa_taxiway</name>
>   <texture>Runway/pa_taxiway.rgb</texture>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_tiedown</name>
>   <texture>Runway/pa_tiedown.rgb</texture>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_dspl_thresh</name>
>   <texture>Runway/pa_dspl_thresh.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_dspl_arrows</name>
>   <texture>Runway/pa_dspl_arrows.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_threshold</name>
>   <texture>Runway/pa_threshold.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>   <wrapv>false</wrapv>
>  </material>
>  
> @@ -156,234 +161,273 @@
>   <name>pa_L</name>
>   <texture>Runway/pa_L.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_R</name>
>   <texture>Runway/pa_R.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_C</name>
>   <texture>Runway/pa_C.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_0l</name>
>   <texture>Runway/pa_0l.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_0r</name>
>   <texture>Runway/pa_0r.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_1c</name>
>   <texture>Runway/pa_1c.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_1l</name>
>   <texture>Runway/pa_1l.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_1r</name>
>   <texture>Runway/pa_1r.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_11</name>
>   <texture>Runway/pa_11.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_2c</name>
>   <texture>Runway/pa_2c.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_2l</name>
>   <texture>Runway/pa_2l.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_2r</name>
>   <texture>Runway/pa_2r.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_3c</name>
>   <texture>Runway/pa_3c.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_3l</name>
>   <texture>Runway/pa_3l.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_3r</name>
>   <texture>Runway/pa_3r.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_4c</name>
>   <texture>Runway/pa_4c.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_4r</name>
>   <texture>Runway/pa_4r.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_5c</name>
>   <texture>Runway/pa_5c.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_5r</name>
>   <texture>Runway/pa_5r.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_6c</name>
>   <texture>Runway/pa_6c.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_6r</name>
>   <texture>Runway/pa_6r.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_7c</name>
>   <texture>Runway/pa_7c.rgb</texture>
>   <wrapu>false</wrapu>
> + <filtering>8.</filtering>
>  </material>
>  
>  <material>
>   <name>pa_7r</name>
>   <texture>Runway/pa_7r.rgb</texture>
>   <wrapu>false</wrapu>
> 
=== message truncated ===>
-------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2
> express and take
> control of your XML. No limits. Just data. Click to
> get it now.
> http://sourceforge.net/powerbar/db2/>
_______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/flightgear-devel
> 



      __________________________________  Yahoo! Clever: Stellen Sie Fragen und 
finden Sie Antworten. Teilen Sie Ihr Wissen. www.yahoo.de/clever


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to