Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
Hi Nicolas, if I understand you correctly, you want FlightGear to superimpose a given texture over a whole terrain tile, given that a texture file with the same name as the tile is found. I think that this would require that either a) TerraGear generate appropriate texture coordinates for the tile, mapping the texture continuously over the whole tile, or b) in case of loadPhotoScenery, the texture coordinates contained in the .btg.gz must be ignored and rebuilt on the fly by FlightGear. Variant a) might be possible by creating a copy of the photo tool using a whole texture instead of a chopped texture. However, it is questionable whether such a large texture for a whole tile is well handled by the graphics subsystem. Variant b) might have generate a large amount of processor load when loading a tile, as the generation of the texture coordinates requires transformation of vertex coordinates from cartesian to geodetic, which involves a lot of heavy maths (which is one of the reasons why TerraGear is doing such calculations up-front). I'm not sure why the photo-tool from TerraGear is not applicable for you. Cheers, Ralf - 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
Alex Perry wrote: How does it work? Where is the source code for the serving side of the OAM stuff? As far as I remember there's an SVN link somewhere on the explanatory pages. Chris is known for doing (almost) every backend stuff in Python, which typically works - we're successfully using some of his work at our MapServer site as well (TileCache for example). Nevertheless, when you're doing some quick turns with FlightGear, you sometimes even face trouble loading the Scenery tiles from the local disk !! right in time. I wonder how people think they're going to fetch aerial imagery from a distant network service via HTTP without further delay These guys that host OAM and our Landcover-DB indeed _do_ serve sort of a flight simulation with imagery from a remote network service, BUT they use dedicated servers and they have networking of the sort which the average user would not even dream of. They use ossimPlanet for integration of OpenSceneGraph with common GIS datasources. BTW, Alex, this all takes place at Calit2 in SD, which should be pretty close to you ;-) Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -- - 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
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=WMSVersion=1.0.0SRS=EPSG:4326Styles=Request=GetMapBBox=-93.32931459,45.05137159,-92.98475016,45.22498271Width=700Height=500Layers=WorldFormat=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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
Curtis Olson wrote: 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 ... OAM runs on the sister-machine to our Landcover and Scenery Model webservice - same hardware, same location, same storage systems, same network uplink. As far as I can tell, the current OAM webservice, even though it runs on really 'nice' hardware, is to be considered as being a 'prototype'. Therefore it should not be expected to stand the workload of a 'production' system, especially not for a large user base, Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -- - 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
How does it work? Where is the source code for the serving side of the OAM stuff? On Wed, Oct 1, 2008 at 4:26 PM, Martin Spott [EMAIL PROTECTED] wrote: OAM runs on the sister-machine to our Landcover and Scenery Model webservice - same hardware, same location, same storage systems, same network uplink. As far as I can tell, the current OAM webservice, even though it runs on really 'nice' hardware, is to be considered as being a 'prototype'. Therefore it should not be expected to stand the workload of a 'production' system, especially not for a large user base, - 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
Frederic Bouvier wrote: Hi, Ralf Gerlich wrote : Hi! Curtis Olson wrote: Sure, just like any aircraft or object model can have it's own textures. There may be some nuances that have disappeared over the years since I doubt this has been heavily tested, but I used to have a KSJC demo with about 1 pixel per foot resolution. And don't forget that you could place an [snip] in simgear/scene/tgdb/leaf.cxx branch PRE_OSG_PLIB_20061029, there is this code : 139 : SGMaterial *mat = matlib-find( material ); 140 : if ( mat == NULL ) { 141 : // see if this is an on the fly texture 142 : string file = path; 143 : string::size_type pos = file.rfind( / ); 144 : file = file.substr( 0, pos ); 145 : // cout current file = file endl; 146 : file += /; 147 : file += material; 148 : // cout current file = file endl; 149 : if ( ! matlib-add_item( file ) ) { 150 :SG_LOG( SG_TERRAIN, SG_ALERT, 151 :Ack! unknown usemtl name = material 152 : in path ); [snip] I didn't test it, but at least, the intention was there ;-) 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. 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
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. -Fred -- Frédéric Bouvier http://my.fotolia.com/frfoto/ Photo gallery - album photo http://fgsd.sourceforge.net/ FlightGear Scenery Designer - 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
Tim Moore wrote : 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? The crash occurred in the openthread code, and looked like a race condition or a synchronisation problem. I don't have the details at hand, but it was never on the same image file. I tested with a modified version of the Brest scenery, that I hacked by hand with an HEX editor to add the .dds extension to the material string. -Fred -- Frédéric Bouvier http://my.fotolia.com/frfoto/ Photo gallery - album photo http://fgsd.sourceforge.net/ FlightGear Scenery Designer - 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
[Flightgear-devel] Loading Textures for Photo-Scenery?
Hi all! In the FlightGear forum we came upon the question of how FlightGear locates textures, e.g. used by scenery generated with the TerraGear photo-command. http://www.flightgear.org/forums/viewtopic.php?f=5t=2149 As far as I understand the current OSG loader code, all textures must be defined in the materials.xml. According to Fred Bouvier, in the old PLIB-days textures not defined in the materials.xml where searched for in the same folder the .btg.gz-file was located in. I didn't check the PLIB-code, but from a look into the OSG-code I have seen that currently no such search is performed. Is this even possible with the current architecture? It seems sensible to me to distribute such textures with the scenery instead of the base package. Cheers, Ralf - 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
Sure, just like any aircraft or object model can have it's own textures. There may be some nuances that have disappeared over the years since I doubt this has been heavily tested, but I used to have a KSJC demo with about 1 pixel per foot resolution. And don't forget that you could place an .ac model at ground level and somehow forget to place the .btg file if you really wanted to. Curt. On Thu, Sep 18, 2008 at 6:11 AM, Ralf Gerlich wrote: Hi all! In the FlightGear forum we came upon the question of how FlightGear locates textures, e.g. used by scenery generated with the TerraGear photo-command. http://www.flightgear.org/forums/viewtopic.php?f=5t=2149 As far as I understand the current OSG loader code, all textures must be defined in the materials.xml. According to Fred Bouvier, in the old PLIB-days textures not defined in the materials.xml where searched for in the same folder the .btg.gz-file was located in. I didn't check the PLIB-code, but from a look into the OSG-code I have seen that currently no such search is performed. Is this even possible with the current architecture? It seems sensible to me to distribute such textures with the scenery instead of the base package. Cheers, Ralf - 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=100url=/ ___ 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=100url=/___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
Hi! Curtis Olson wrote: Sure, just like any aircraft or object model can have it's own textures. There may be some nuances that have disappeared over the years since I doubt this has been heavily tested, but I used to have a KSJC demo with about 1 pixel per foot resolution. And don't forget that you could place an .ac model at ground level and somehow forget to place the .btg file if you really wanted to. Well, I think that photo may be better suited, as it takes the task of taking care of the height-field from the author. Loading a terrain tile differs in quite some way from loading an object model or aircraft, which also involves the use of the material library. The latter currently only loads its materials from materials.xml, but does not search for tile-specific textures in the scenery folders. I was rather hinting that maybe somebody more informed about the architecture of the terrain subsystem might want to implement this type of search. ;-) Cheers, Ralf - 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
Hi, Ralf Gerlich wrote : Hi! Curtis Olson wrote: Sure, just like any aircraft or object model can have it's own textures. There may be some nuances that have disappeared over the years since I doubt this has been heavily tested, but I used to have a KSJC demo with about 1 pixel per foot resolution. And don't forget that you could place an .ac model at ground level and somehow forget to place the .btg file if you really wanted to. Well, I think that photo may be better suited, as it takes the task of taking care of the height-field from the author. Loading a terrain tile differs in quite some way from loading an object model or aircraft, which also involves the use of the material library. The latter currently only loads its materials from materials.xml, but does not search for tile-specific textures in the scenery folders. I was rather hinting that maybe somebody more informed about the architecture of the terrain subsystem might want to implement this type of search. ;-) in simgear/scene/tgdb/leaf.cxx branch PRE_OSG_PLIB_20061029, there is this code : 139 : SGMaterial *mat = matlib-find( material ); 140 : if ( mat == NULL ) { 141 : // see if this is an on the fly texture 142 : string file = path; 143 : string::size_type pos = file.rfind( / ); 144 : file = file.substr( 0, pos ); 145 : // cout current file = file endl; 146 : file += /; 147 : file += material; 148 : // cout current file = file endl; 149 : if ( ! matlib-add_item( file ) ) { 150 :SG_LOG( SG_TERRAIN, SG_ALERT, 151 :Ack! unknown usemtl name = material 152 : in path ); 153 : } else { 154 :// locate our newly created material 155 :mat = matlib-find( material ); 156 :if ( mat == NULL ) { 157 : SG_LOG( SG_TERRAIN, SG_ALERT, 158 : Ack! bad on the fly material create = 159 :material in path ); 160 :} 161 : } 162 : } I didn't test it, but at least, the intention was there ;-) -Fred -- Frédéric Bouvier http://my.fotolia.com/frfoto/ Photo gallery - album photo http://fgsd.sourceforge.net/ FlightGear Scenery Designer - 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
Hi! Frederic Bouvier wrote: in simgear/scene/tgdb/leaf.cxx branch PRE_OSG_PLIB_20061029, there is this code : [SNIP] I didn't test it, but at least, the intention was there ;-) In the OSG-version I didn't find anything similar, so I'd say that it's missing. I am not able to do anything about it - both due to missing knowledge about OSG and due to time constraints - so I hope somebody with the necessary abilities will pick this up as a feature request. Cheers, Ralf - 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=100url=/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] Loading Textures for Photo-Scenery?
On Thu, Sep 18, 2008 at 9:31 AM, Ralf Gerlich wrote: Hi! Frederic Bouvier wrote: in simgear/scene/tgdb/leaf.cxx branch PRE_OSG_PLIB_20061029, there is this code : [SNIP] I didn't test it, but at least, the intention was there ;-) In the OSG-version I didn't find anything similar, so I'd say that it's missing. I am not able to do anything about it - both due to missing knowledge about OSG and due to time constraints - so I hope somebody with the necessary abilities will pick this up as a feature request. It's a shame if this was removed from the OSG version, but I can verify that it was working at one time (probably several years ago now.) And I don't think the btg loader in flightgear differs all that much from any other model loader, except that the btg loader is part of simgear and the other model loaders are part of the scene graph library. And the btg loader understands how to handle certain higher level constructs such as references to the materials database library and references to runway light structures. But at the core, the btg format is just another 3d model format ... simplistic, but optimized to handle terragear output. Regards, Curt. -- 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=100url=/___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel