Hi Nicolas,

I've been wondering how hard it would be to add a tile loader mode
where the default texture is ignored, and instead, a photo texture of
the tile is applied.  It may not be an optimal photo-texture
implementation (but it might be good enough to be fun and
interesting?)

Maybe we still want to keep some sense of the material libs for
populating areas with random objects/trees/cows/horses, and for
determining surface/gear properties and interactions.

For what it's worth, this past weekend I was playing around with
www.openaerialmap.org ... they have a wms server that allows you to
query any rectangular section of their imagery at any resolution.

wget 
http://www.openaerialmap.org/wms?Service=WMS&Version=1.0.0&SRS=EPSG:4326&Styles=&Request=GetMap&BBox=-93.32931459,45.05137159,-92.98475016,45.22498271&Width=700&Height=500&Layers=World&Format=image/jpeg

This fetches a 700x500 jpeg image covering lon = -93.329 to -92.985
and lat 45.051 to 45.225 (I didn't type all the decimal places ...)

The only caveate is that they seem to limit usage of this feature so
after you fetch an image or two, you get an internal server error for
a while ... perhaps if we decide this is the way to go, we could
coordinate something with them to mirror the data so flightgear users
can good access to it without killing their server(s?)

Luckily for me, the openaerialmap imagery for my home area here is
every bit as good as google's imagery.  That's not the case for much
of the rest of the world, but still it's an interesting source if we
wanted to develop photo-real scenery features in flightgear ... and as
we move forward, I'm sure more and better free imagery will become
available.

Regards,

Curt.

On Wed, Oct 1, 2008 at 8:08 AM, Nicolas wrote:
> Hi,
>
> Here some tests about the ground textures for photo scenery.
>
> Terragear build BTG. Each BTG contains several 3D objects with a
> material property (city, wood...)
>
> Is it possible that terragear cuts a texture for these 3D objets...
>
> In fact, my proposition is very simple. In the function SGLoadBTG, I
> replace :
>
> osg::Node* node = tileGeometryBin.getSurfaceGeometry(matlib);
>
> By :
>
> cout << path; // sample : Terrain/w010n40/w005n48/2876058.btg
>
> phototexture = path;
> phototexture =~ s/btg$/dds/; // or PNG, JPG...
>
> if (phototexture found) {
>  osg::Node* node = tileGeometryBin.loadPhotoScenery(matlib);
>  if (node)
>    terrainGroup->addChild(node);
> }
> else {
>  osg::Node* node = tileGeometryBin.getSurfaceGeometry(matlib);
>  if (node)
>    terrainGroup->addChild(node);
> }
>
> And loadPhotoScenery(...) {
>  int n;
>  char buffer[128];
>
>  if (materialTriangleMap.empty())
>    return 0;
>
>  osg::Group* groupe = new osg::Group;
>
>  osg::Geode* geode = new osg::Geode;
>  SGMaterialTriangleMap::const_iterator i;
>
>  for (n=0, i = materialTriangleMap.begin(); i !=
> materialTriangleMap.end(); ++i, n++) {
>    snprintf(buffer, 128, "Textures/PhotoScenery/%d.dds", n);
>
>    osg::Texture2D* FaceTexture = new osg::Texture2D;
>    FaceTexture->setDataVariance(osg::Object::DYNAMIC);
>    osg::Image* Face = osgDB::readImageFile(buffer);
>    FaceTexture->setImage(Face);
>    osg::Geometry* geometry = i->second.buildGeometry();
>
>    osg::StateSet* stateOne = new osg::StateSet();
>
> stateOne->setTextureAttributeAndModes(0,FaceTexture,osg::StateAttribute::ON);
>    geometry->setStateSet(stateOne);
>
>    geode->addDrawable(geometry);
>  }
>
>  groupe->addChild(geode);
>
>  return geode;
> }
>
>
> With this solution, my issue is : How can I generate photo texture with
> terragear ? Is it possible ?
>
>
> Regards,
>
> Nicolas
>
>
> Le mardi 23 septembre 2008 à 13:16 +0200, Tim Moore a écrit :
>> Frederic Bouvier wrote:
>> > Hi Tim,
>> >
>> > Tim Moore wrote :
>> >> This code did survive the OSG port, but was removed in a later
>> >> reorganization of  the tile loading code. It's easy enough
>> >> to put this back in, but the old code would add the local
>> >> material permanently to the material library; is that really
>> >> desired? I would think the local material should get deleted
>> >> when the tile is deleted.
>> >
>> > I tried to restore that code this past weekend but I experienced
>> > random access violation when loading the texture. I was wondering
>> > if loading textures in the pager thread was legal.
>>
>> It is legal to load textures from the pager thread, but there might now be a
>> problem with adding a material to the material library in the pager thread. 
>> Is
>> the access violation really "random?"
>>
>> Tim
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Flightgear-devel mailing list
>> Flightgear-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Flightgear-devel mailing list
> Flightgear-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/flightgear-devel
>



-- 
Curtis Olson: http://baron.flightgear.org/~curt/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to