[osg-users] osgEarth - terrain on demand

5 views
Skip to first unread message

Glenn Waldron

unread,
Jan 22, 2009, 8:19:33 AM1/22/09
to OpenSceneGraph Users
Announcing osgEarth, a new open source toolkit that enables on-demand terrain generation in OpenSceneGraph applications.

osgEarth brings web-based geospatial visualization to OSG. It it built on the osgTerrain library, and operates in a manner similar to the technology that underlies products like NASA WorldWind, Google Earth, or Microsoft Virtual Earth.

With osgEarth you can generate a terrain model at run-time by connecting to a wide variety of imagery and elevation data sources, including WMS, TMS, Google maps, TIFF files, and more. Or extend it by writing your own driver.

osgEarth is LGPL. Visit the wiki to download it and give it a try!

http://osgearth.org



Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791

Tomlinson, Gordon

unread,
Jan 22, 2009, 8:45:30 AM1/22/09
to OpenSceneGraph Users
Very cool Glenn
 
.....
 

Gordon

__________________________________________________________
Gordon Tomlinson

Product Manager 3D
Email  : gtomlinson @ overwatch.textron.com
__________________________________________________________
(C): (+1) 571-265-2612
(W)
: (+1) 703-437-7651

"Self defence is not a function of learning tricks
but is a function of how quickly and intensely one
can arouse one's instinct for survival"
- Master Tambo Tetsura

 
 


From: osg-user...@lists.openscenegraph.org [mailto:osg-user...@lists.openscenegraph.org] On Behalf Of Glenn Waldron
Sent: Thursday, January 22, 2009 8:20 AM
To: OpenSceneGraph Users
Subject: [osg-users] osgEarth - terrain on demand

Jean-Sébastien Guay

unread,
Jan 22, 2009, 9:19:06 AM1/22/09
to OpenSceneGraph Users
Hi Glenn,

> With osgEarth you can generate a terrain model at run-time by connecting
> to a wide variety of imagery and elevation data sources, including WMS,
> TMS, Google maps, TIFF files, and more. Or extend it by writing your own
> driver.

Wait, I don't quite get it. What is the relation (if any) between
osgEarth and VPB? Is osgEarth kind of like VPB since it generates
terrain databases, but with the difference that it does it on request
instead of as a pre-process, and also that it goes and fetches the
necessary data from standard sources automatically?

J-S
--
______________________________________________________
Jean-Sebastien Guay jean-seba...@cm-labs.com
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Glenn Waldron

unread,
Jan 22, 2009, 9:25:38 AM1/22/09
to OpenSceneGraph Users
On Thu, Jan 22, 2009 at 9:19 AM, Jean-Sébastien Guay <jean-seba...@cm-labs.com> wrote:
Hi Glenn,


With osgEarth you can generate a terrain model at run-time by connecting to a wide variety of imagery and elevation data sources, including WMS, TMS, Google maps, TIFF files, and more. Or extend it by writing your own driver.

Wait, I don't quite get it. What is the relation (if any) between osgEarth and VPB? Is osgEarth kind of like VPB since it generates terrain databases, but with the difference that it does it on request instead of as a pre-process, and also that it goes and fetches the necessary data from standard sources automatically?

That's right J-S. osgEarth never actually writes any terrain geometry to disk. Rather, it generates terrain tiles at run time as you navigate the scene. The only relationship to VPB is that they both use osgTerrain.

Glenn

Jean-Sébastien Guay

unread,
Jan 22, 2009, 9:38:00 AM1/22/09
to OpenSceneGraph Users
Hi Glenn,

> That's right J-S. osgEarth never actually writes any terrain geometry to
> disk. Rather, it generates terrain tiles at run time as you navigate the
> scene. The only relationship to VPB is that they both use osgTerrain.

OK, that's much clearer.

Very interesting. If terrain is never written to disk though, won't
there be lots of effort re-done over and over, say in multiple runs of
the software where the user goes over the same areas? You could probably
cache generated terrain to disk since I guess the Earth changes only
seldom :-)

I guess you generate low LODs first so that the user gets to see
something at least, and then refine as time goes by... What kind of time
can you expect to get good detail, and can you move about freely while
the updates are progressing?

This sounds a bit like my Masters project, where you could move around a
scene and move/deform objects, and the high-quality lighting would
update progressively without ever stopping interaction.

Good work, I look forward to trying it out.

Glenn Waldron

unread,
Jan 22, 2009, 9:54:47 AM1/22/09
to OpenSceneGraph Users
On Thu, Jan 22, 2009 at 9:38 AM, Jean-Sébastien Guay <jean-seba...@cm-labs.com> wrote:
Hi Glenn,


That's right J-S. osgEarth never actually writes any terrain geometry to disk. Rather, it generates terrain tiles at run time as you navigate the scene. The only relationship to VPB is that they both use osgTerrain.

OK, that's much clearer.

Very interesting. If terrain is never written to disk though, won't there be lots of effort re-done over and over, say in multiple runs of the software where the user goes over the same areas? You could probably cache generated terrain to disk since I guess the Earth changes only seldom :-)

osgEarth has a configurable caching mechanism that caches source data tiles, so most of the work only happens the first time you encounter a tile.
 
I guess you generate low LODs first so that the user gets to see something at least, and then refine as time goes by... What kind of time can you expect to get good detail, and can you move about freely while the updates are progressing?

Time to bring in new subtiles depends entirely on the data source and its composition. Once the data is cached though, the speed is really not much different than with a VPB database (not that we've actually measured it.) But yes, osgEarth uses the standard PagedLOD, osgTerrain, and ReaderWriter plugin mechanisms, so background paging works just as with a pre-generated terrain. 

The result is quite similar to what you get with WorldWind, Google Earth, etc.

Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC

unread,
Jan 22, 2009, 10:28:17 AM1/22/09
to OpenSceneGraph Users
Glenn,

It looks like a great product. I look forward to exploring this in more
detail...

Great job...

-Shayne

-----Original Message-----
From: osg-user...@lists.openscenegraph.org
[mailto:osg-user...@lists.openscenegraph.org] On Behalf Of Glenn
Waldron
Sent: Thursday, January 22, 2009 6:20 AM
To: OpenSceneGraph Users
Subject: [osg-users] osgEarth - terrain on demand

Perry Miller

unread,
Jan 22, 2009, 11:04:43 AM1/22/09
to OpenSceneGraph Users
Hi Glenn,

Nice product. The focus on dynamic terrain generation reminded me of
Minerva (www.minerva-gis.org).

I'm interested in your take on how the two projects compare and contrast...

Perry

Glenn Waldron

unread,
Jan 22, 2009, 11:15:53 AM1/22/09
to OpenSceneGraph Users
Hi Perry,

I have played with Minerva in the past but have only briefly looked at the source. We do have it on the list of other terrain technologies in the FAQ (http://wush.net/trac/osgearth/wiki/FAQ).

One major goal with osgEarth was ease of integration -- achieved by leveraging as much of OSG's existing terrain support as possible -- standard loaders, osgTerrain, and paged LODs. I think perhaps osgEarth is unique in this respect.



Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791


Perry Miller

unread,
Jan 22, 2009, 11:59:10 AM1/22/09
to OpenSceneGraph Users
Hi Glenn,

The way you've packaged this technology is impressive. I'm not sure
what could be easier than "osgviewer myFile.earth".

I asked about comparison to Minerva (and I should have included
ossimPlanet in that question) because I am genuinely interested in how
open-source projects market themselves, and how the barrier-to-entry
can make a big difference in long-term adoption.

Also, while Minerva uses OSG to draw, it's underlying tiling engine is
not based on osgDB::DatabasePager. It used to be, but we ran into some
problems that were specific to our application and had to roll our own
dynamic tiles. If you've had similar difficulties, or see them over
the horizon, I am interested in discussing this further with you. Feel
free to email me directly if you prefer.

Perry

Rafa Gaitan

unread,
Jan 22, 2009, 2:22:10 PM1/22/09
to OpenSceneGraph Users
Hi Glenn,

The work is really impressive, we have done "something similar" on OSG Virtual Planets, but the access to geospatial data is done by Java and gvSIG.

Is it possible in osgEarth to change layers during runtime?. We made lots of efforts for that in our work but with some difficulties.

Greetz
Rafa.
--
Rafael Gaitán Linares
Instituto de Automática e Informática Industrial  http://www.ai2.upv.es
Ciudad Politécnica de la Innovación
Universidad Politécnica de Valencia

Glenn Waldron

unread,
Jan 22, 2009, 2:52:07 PM1/22/09
to OpenSceneGraph Users
Hi Rafa,

osgEarth renders each image layer in a separate texture unit and uses multi-texturing to apply them at run time. So, you can adjust each layer's appearance, visibility and blending by tweaking the texture attributes. This approach is of course limited to your available texture units. We have plans to incorporate additional techniques including run-time image compositing and multi-pass rendering.

Adding and removing sources dynamically is not something we've tried yet, though I believe the architecture will readily support it. It's on the list.

I saw your post the other day about OSG Virtual Planets, and it looks impressive. I plan to take a closer look when I get a chance!



Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791


Rafa Gaitan

unread,
Jan 22, 2009, 3:01:20 PM1/22/09
to OpenSceneGraph Users
On Thu, Jan 22, 2009 at 8:52 PM, Glenn Waldron <gwal...@gmail.com> wrote:
Hi Rafa,

osgEarth renders each image layer in a separate texture unit and uses multi-texturing to apply them at run time. So, you can adjust each layer's appearance, visibility and blending by tweaking the texture attributes. This approach is of course limited to your available texture units. We have plans to incorporate additional techniques including run-time image compositing and multi-pass rendering.

We have the same approach of the use of multitexturing, and we also have plans to incorporate multi-pass rendering :) I think the path is similar! :)
 


Adding and removing sources dynamically is not something we've tried yet, though I believe the architecture will readily support it. It's on the list.

We are doing a major refactor to support a LayerManager class for our Terrains, so we can for example share layers between different terrains, or the whole LayerManager. Of course all our requirements are from the gvSIG project and the fact to support their data model.

I will be following osgEarth evolution.



I saw your post the other day about OSG Virtual Planets, and it looks impressive. I plan to take a closer look when I get a chance!

Thanks, maybe we can merge efforts, there are lots of open source GIS applications outside that the use of 3D will push them up! :).


Rafa.

 

Robert Osfield

unread,
Jan 23, 2009, 10:27:41 AM1/23/09
to OpenSceneGraph Users
Hi Glenn,

Congratulations on a great looking addition to the OSG family ;-)

Please add notice of the osgEarth library to the community news page
listed on the OSG front page.

http://www.openscenegraph.org/projects/osg/wiki/News/AddCommunityNews

I'm sure opengl.org and modsim.org and game dev websites would also be
interested in the new development too.

Cheers,
Robert.

Glenn Waldron

unread,
Jan 23, 2009, 11:47:35 AM1/23/09
to OpenSceneGraph Users
Robert,

Thanks for the kind words. I've added it to the Community News page as you recommended.



Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791


Robert Osfield

unread,
Jan 23, 2009, 12:15:56 PM1/23/09
to OpenSceneGraph Users
Hi Glenn,

On Fri, Jan 23, 2009 at 4:47 PM, Glenn Waldron <gwal...@gmail.com> wrote:
> Thanks for the kind words. I've added it to the Community News page as you
> recommended.

Thanks.

I've just checked out osgEarth svn/trunk and attempted to compile but
found that the FIND_PACKAGE(LIBZIP) in osgEarth/CMakeLists.txt should
read FIND_PACKAGE(LibZip), I presume you do most of dev under
Windows...

Fixing this doesn't get me a complete build yet though, I get the
following error, but not being CMake expert I can't spot right away
how to fix the problem:

cmake .
CMake Error at CMakeModules/ModuleInstall.cmake:38 (INSTALL):
install TARGETS given no LIBRARY DESTINATION for shared library target
"osgEarth".
Call Stack (most recent call first):
src/osgEarth/CMakeLists.txt:73 (INCLUDE)


-- Configuring incomplete, errors occurred!

Donn Mielcarek

unread,
Jan 23, 2009, 12:28:54 PM1/23/09
to OpenSceneGraph Users
I've been trying to get it to compile under Windows.
Apparently there is no libzip currently available for
Windows (which uses zip.h, not to be confused with
ziplib, which uses zlib.h).

Jason Beverage

unread,
Jan 23, 2009, 12:31:01 PM1/23/09
to OpenSceneGraph Users
Hi Robert,

I'm going to take a look at the Cmake issues under Linux and I'll let you know when I've figured them out.

Thanks!

Jason

On Fri, Jan 23, 2009 at 12:15 PM, Robert Osfield <robert....@gmail.com> wrote:

Glenn Waldron

unread,
Jan 23, 2009, 12:33:34 PM1/23/09
to OpenSceneGraph Users
Donn,

LibZip is optional -- if you leave it blank in CMake, you should be ok. It is only there to enable a ZIP-file-based cache, which is experimental anyway.

Otherwise, I posted a pre-built LibZip for windows on the wiki under the build docs.




Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791


Jan Ciger

unread,
Jan 23, 2009, 5:22:04 PM1/23/09
to OpenSceneGraph Users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason Beverage wrote:
> Hi Robert,
>
> I'm going to take a look at the Cmake issues under Linux and I'll let
> you know when I've figured them out.
>
> Thanks!
>

I have managed to configure it on Linux, but when compiling, it tries to
link the plugins in strange place:

$ make
- -- Configuring done
- -- Generating done
- -- Build files have been written to: /media/backup/osg/osgearth
[ 55%] Built target osgEarth
Linking CXX shared module //osgdb_earth.so
/usr/bin/ld: cannot open output file //osgdb_earth.so: Permission denied
collect2: ld returned 1 exit status
make[2]: *** [/osgdb_earth.so] Error 1
make[1]: *** [src/osgPlugins/earth/CMakeFiles/osgdb_earth.dir/all] Error 2
make: *** [all] Error 2

It is not supposed to put anything in the root directory. Is there an
environment variable or something to configure to tell it where to put
these libraries?

Jan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFJekMMn11XseNj94gRAvjdAJ4tA5sRUFdKsY/E8vVIOKH/oj3+WQCfWPsy
FxLybfu23L0kJnfEXOCeRdU=
=Bpow
-----END PGP SIGNATURE-----

Jason Beverage

unread,
Jan 23, 2009, 7:04:52 PM1/23/09
to OpenSceneGraph Users
Hi Jan,

I'm trying to figure out why that is this evening.  I committed some fixes earlier to get the core library building and the plugins are the last bit of CMake wizardry I need to figure out:)

Thanks!

Jason

Jason Beverage

unread,
Jan 23, 2009, 7:56:58 PM1/23/09
to OpenSceneGraph Users
Hi everyone,

I've just committed some CMake fixes and osgEarth now builds and runs for me on Ubuntu.

The only thing I had to do extra to get it to work was manually copy the plugins generated by osgEarth to the osgPlugins directory (/usr/local/lib/osgPlugins-2.7.9 on Ubuntu with SVN).  I'm going to see if I can get osgEarth to install it's plugins directly in the osgPlugins directory during install.

Could those of you trying on Linux do an update and let me know how things work?

Thanks!

Jason

Robert Osfield

unread,
Jan 24, 2009, 4:53:25 AM1/24/09
to OpenSceneGraph Users
Hi Jason,

I've just done an svn update and osgEarth now compiles and installs
under Linux ;-)

Running osgearth_seed I get a seg fault, perhaps associated with me
not configuring a cache...

osgearth_seed tests/google_imagery.earth
Warning: Image Google maps satellite imagery has no cache.
There are no caches specified for the given map. Please configure a
cache in the mapconfig
Segmentation fault

Perhaps I need to do some background reading.... on mapconfig... :)

Robert.

On Sat, Jan 24, 2009 at 12:56 AM, Jason Beverage

Rahul Jain

unread,
Jan 24, 2009, 6:43:24 AM1/24/09
to OpenSceneGraph Users
HI Glenn,

Great work !

I am testing your project and the results are phenomenal. The best
example i like is traffic.earth, combining data from google and yahoo
is simply awesome :)

But i am facing problem while loading local data through osgEarth. I
created a simple boston.earth file containing the boston data which
goes like this ...

<map name="imagery sample" type="projected">
<image name="boston_inset" driver="gdal">
<url>../data/boston-inset.tif</url>
<tile_size>256</tile_size>
</image>
</map>

While running osgviewer boston.earth, i am getting a segmentation fault :
*** glibc detected *** osgviewer: munmap_chunk(): invalid pointer:
0x000000000063ab3e ***

I am using the latest svn version of osgEarth built against OSG-2.7.4 ,
gdal 1.3.2, libzip-0.9 . My OS is Open-Suse-10.3-x86_64

Cheers
RJ

> ------------------------------------------------------------------------

Glenn Waldron

unread,
Jan 24, 2009, 8:58:31 AM1/24/09
to OpenSceneGraph Users
Hi Robert,

Indeed, you do need to set up a cache in the earth file in order to seeding to work. (It shouldn't crash of course - that is a bug.)

There are two examples of how to set up caching in the "tests" directory:

"simple_caching.earth" shows a single, map-level cache
"advanced_caching.earth" show how to override caching props at the source level.

Also, you can read up on cache configuration on the wiki here:
http://wush.net/trac/osgearth/wiki/EarthFileCaching



Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791


Jason Beverage

unread,
Jan 24, 2009, 9:51:31 AM1/24/09
to OpenSceneGraph Users
Hi RJ

I'm getting the same error from the gdal plugin in ubuntu. On windows
I'm using fwtools and it works fine. Im heading out of town today but
I'll take a look at it as soon as I get back tommorow.

Thanks!

Jason

Jan Ciger

unread,
Jan 24, 2009, 10:30:59 AM1/24/09
to OpenSceneGraph Users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason Beverage wrote:
> Hi everyone,
>
> I've just committed some CMake fixes and osgEarth now builds and runs
> for me on Ubuntu.
>
> The only thing I had to do extra to get it to work was manually copy the
> plugins generated by osgEarth to the osgPlugins directory
> (/usr/local/lib/osgPlugins-2.7.9 on Ubuntu with SVN). I'm going to see
> if I can get osgEarth to install it's plugins directly in the osgPlugins
> directory during install.
>
> Could those of you trying on Linux do an update and let me know how
> things work?

Cool, it compiles and runs now, minus the segfault with the cache as
Robert noted elsewhere.

Good work!

Jan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFJezQyn11XseNj94gRAhC9AKDBxhLwF9AybwnaQoNaI24i/Ajs4gCg1hJO
Nestm4nS8qmhdzajD5LzBck=
=xS2k

Jason Beverage

unread,
Jan 24, 2009, 11:09:40 AM1/24/09
to OpenSceneGraph Users
Hi Jan and Robert,

If you run osgearth_seed on the simple_caching.earth file does it also segfault or does it only segfault when you don't have a cache defined?

Thanks!

Jason

Robert Osfield

unread,
Jan 25, 2009, 4:48:31 AM1/25/09
to OpenSceneGraph Users
Hi Jason,

On Sat, Jan 24, 2009 at 4:09 PM, Jason Beverage <jasonb...@gmail.com> wrote:
> If you run osgearth_seed on the simple_caching.earth file does it also
> segfault or does it only segfault when you don't have a cache defined?

When I run :

osgearth_seed tests/simple_caching.earth

I get a long series of output of the form:

Processing 1332
Processing 13320
Processing 13321
Processing 13322
Processing 13323
Processing 1333

Then a Segmentation fault.

Robert.

Jan Ciger

unread,
Jan 25, 2009, 7:06:17 AM1/25/09
to OpenSceneGraph Users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason Beverage wrote:
> Hi Jan and Robert,
>
> If you run osgearth_seed on the simple_caching.earth file does it also
> segfault or does it only segfault when you don't have a cache defined?

If I define the cache, it tries to compute something and then segfaults
at the end.

Jan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFJfFW2n11XseNj94gRAt9wAJ9iajQ4CSlT3Ti2oNH1N6pdeaqbkQCePMlU
NSCVMotvYnuX3i8Au8+s0ig=
=7tl0

Jason Beverage

unread,
Jan 25, 2009, 10:56:53 PM1/25/09
to OpenSceneGraph Users
Hi Robert and Jan,

I just committed a fix to osgearth that removes the segfault at the end of the seeding.  Works fine for me now in Ubuntu.

Thanks!

Jason

Jason Beverage

unread,
Jan 25, 2009, 11:16:29 PM1/25/09
to OpenSceneGraph Users
Hi Rahul,

I just committed a fix to osgEarth for the GDAL plugin and it is working fine for me in both Windows and Linux now.  Can you see if your test works after an SVN update?

Thanks!

PS.  The Yahoo Maps and Google Traffic example is my favorite too;)

Jason

Robert Osfield

unread,
Jan 26, 2009, 4:41:01 AM1/26/09
to OpenSceneGraph Users
Hi Jason,

On Mon, Jan 26, 2009 at 3:56 AM, Jason Beverage <jasonb...@gmail.com> wrote:
> I just committed a fix to osgearth that removes the segfault at the end of
> the seeding. Works fine for me now in Ubuntu.

Seg fault is gone now, thanks :-)

I can now run

>osgearth_seed simple_caching.earth

it runs to completion without any error.

But if I run:

> osgearth_seed google_maps.earth
Warning: Image Google maps has no cache.


There are no caches specified for the given map. Please configure a
cache in the mapconfig

I can now run osgviewer google_maps.earth and it works almost seamlessly :-)

I say almost seamlessly because there is some osgTerrain functionality
I haven't implemented yet that will stitch adjacent tiles together to
prevent any cracks in the seems and to average out the texel values
along the boundary. This will be for a future rev of OSG, 2.10
prehaps, but the nice thing is that osgEarth will not have to change
at all to get the extra functionality as osgTerrain will be able to do
it automatically ;-)

Robert.

Robert Osfield

unread,
Jan 26, 2009, 5:38:49 AM1/26/09
to OpenSceneGraph Users
Hi Glenn and Jason,

I've been browsing through the various sample .earth files, it really
is very cool how easy it is to plugin and play.

I have seen a couple of tile errors when browsing though, with the
following error reported on the command line:

TIFF loader: Error opening file

Also if I run advanced_cache.eath I occassionally get the these TIFF
errors too, as well as a coodindate system warning:

> osgearth_seed advanced_caching.earth
ERROR 6: EPSG PCS/GCS code 3785 not found in EPSG support files. Is
this a valid
EPSG coordinate system?
Warping ../data/boston-inset.tif to global-geodetic
Overriding profile to GLOBAL_GEODETIC due to profile in MapConfig
Warning: Heightfield WorldWind DEM has no cache.
Processing
Processing 0

I have no clue what this means I'm afraid...

W.r.t TIFF error, is this an error in the osg plugin? Or the file?
Or the libtiff library we use under Linux? I can't answer this, but a
first step might be to record the name/contents of the file.

Guy Wallis

unread,
Jan 26, 2009, 5:58:19 AM1/26/09
to OpenSceneGraph Users

Hello,

I just tried to do something in osg that produces different behavior depending on which platform I compile it on. I realize it’s an ugly thing to do, but I set up a global variable v that is of type osg::Vec3 and then made it an array of size 12:

 

osg::Vec3 v[12];

 

If I compile the code in debug mode using MSVC v9, (or using optimization with the gnu compiler under IRIX) the code works fine. If I compile it using the ‘Release’ setting in MSVC I find setting the global in one part of my code isn’t detected in other sections – which see the array’s initial values (all zeros).

 

If I use an osg::Vec3Array everything works fine, irrespective of platform.

 

Is it simply not a good idea to use an array of osg::Vec3 (and I’m lucky it happens to work at all), or is something up with the MSVC optimizer?

 

Thanks,

 

Guy

Tanguy Fautre

unread,
Jan 26, 2009, 6:16:26 AM1/26/09
to OpenSceneGraph Users

Hi Guy,

 

AFAIK this should work. Could you reduce that problem to a small example program so we could actually review the code?

 

 

Cheers,

 

Tanguy

Ralph Kern

unread,
Jan 26, 2009, 6:34:29 AM1/26/09
to osg-...@lists.openscenegraph.org
hi Guy,

are you perhaps using multiple threads on a multi core machine? then it
might be a cache coherence problem. You'd need to declare your shared
data as volatile:

volatile osg::Vec3 v[12];

regards Ralph

Guy Wallis schrieb:

_______________________________________________

Jan Ciger

unread,
Jan 26, 2009, 6:35:32 AM1/26/09
to OpenSceneGraph Users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jason Beverage wrote:
> Hi Robert and Jan,
>
> I just committed a fix to osgearth that removes the segfault at the end
> of the seeding. Works fine for me now in Ubuntu.

Now it seems to work fine :)

Thanks a lot.

Jan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFJfaABn11XseNj94gRAiO7AJ0ZLU7+XakbC5hxkJXdViOsRcsNEwCfS44o
6bnzt9ISEEHy0sckwHTK7TI=
=cgbw

Jan Ciger

unread,
Jan 26, 2009, 6:37:10 AM1/26/09
to OpenSceneGraph Users
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Guy Wallis wrote:
> Hello,
>
> I just tried to do something in osg that produces different behavior
> depending on which platform I compile it on. I realize it’s an ugly
> thing to do, but I set up a global variable v that is of type osg::Vec3
> and then made it an array of size 12:
>

Please, do not hijack the thread - post a new message instead of
replying to a random message in the list with a new subject.

Thank you,

Jan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFJfaBmn11XseNj94gRApMXAJ95WJMkuCzepZYqx9GoCGLfL2SKngCfbN9G
B96wfqIMo0E6oInc7qgZNH0=
=znO0

Rahul Jain

unread,
Jan 26, 2009, 8:16:07 AM1/26/09
to OpenSceneGraph Users
Hi Jason ,

Thanks, after SVN update the problem is resolved.

The another issue i just came across is that images with single
band(Gray) can not be loaded. Looking at the code of
ReaderWriterGDAL.cpp it seems that the image with the single band are
not handled. Is it intentional or its just that you have not come
across single channel raster image ? I would love to add the support
for single channel image and contribute back, if it is not already on
your radar.

cheers,
RJ

> <mailto:osg-...@lists.openscenegraph.org>


> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
>
> _______________________________________________
> osg-users mailing list
> osg-...@lists.openscenegraph.org

> <mailto:osg-...@lists.openscenegraph.org>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Jason Beverage

unread,
Jan 26, 2009, 9:19:43 AM1/26/09
to OpenSceneGraph Users
Hi Robert,

Glad to hear that things are working well for you!

The osgearth_seed application simply runs through a series of tile keys and tries to load them through the cache defined in the .earth file.  If no cache is defined in the .earth file, then there really isn't anything for osgearth_seed to do, so it just exits early.

I tried to add some support for normalzing the elevations of adjacent TerrainTiles in the TerrainTileEdgeNormalizerUpdateCallback class.  It seems to work well, but can be kind of slow depending on how fast you zooming around.  Are you seeing gaps between terrain tiles of the same LOD?

We don't currently do any texel normalization of the images, but that would be a welcome addition to osgTerrain indeed.

I'm curious as to how you were thinking of going about stitching together the adjacent tiles and if there would be a better way that through the update callback.

Thanks!

Jason

Jason Beverage

unread,
Jan 26, 2009, 9:37:54 AM1/26/09
to OpenSceneGraph Users
Hi Robert,


On Mon, Jan 26, 2009 at 5:38 AM, Robert Osfield <robert....@gmail.com> wrote:
Hi Glenn and Jason,

I've been browsing through the various sample .earth files, it really
is very cool how easy it is to plugin and play.

Thanks:)  We hoped to make writing new plugins as easy as possible.
 

I have seen a couple of tile errors when browsing though, with the
following error reported on the command line:

  TIFF loader: Error opening file

Also if I run advanced_cache.eath I occassionally get the these TIFF
errors too, as well as a coodindate system warning:

It seems that the JPL WMS server can get overloaded occasionally and will return an I believe that the JPL WMS server can get overloaded and will return a WMS exception or bad Tiff.
 


> osgearth_seed advanced_caching.earth
ERROR 6: EPSG PCS/GCS code 3785 not found in EPSG support files.  Is
this a valid
EPSG coordinate system?

This coordinate system error is because EPSG 3785 is probably not defined in your EPSG database.  EPSG 3785 is supposed to be the "official" epsg code for spherical/web mercator (http://www.iter.dk/post/2008/05/SphericalWeb-Mercator-EPSG-code-3785.aspx).  It seems that it is not included in the majority of epsg databases though, so I think I"m going to import the definition from a proj4 or wkt string.

Warping ../data/boston-inset.tif to global-geodetic
Overriding profile to GLOBAL_GEODETIC due to profile in MapConfig
The boston-inset.tif file is in a UTM projection, so to use it in a geodetic map, we are using GDAL's GDALAutoCreateWarpedVRT functionality to create a virtually warped GDALDataset to allow the file to be treated as geodetic without having to actually warp it to a different file on disk.
 

Jason Beverage

unread,
Jan 26, 2009, 9:40:58 AM1/26/09
to OpenSceneGraph Users
Hi Rahul,

Happy to hear that the GDAL plugin is working for you now.

The GDAL plugin is currently in its infancy, so it doesn't have support for anything other than RGB and RGBA datasets right now.  It shouldn't be too difficult to add support for single channel raster images like the current OSG GDAL plugin does.

I'll add the support for single channel raster images as a Trac Ticket.

If you want to take a stab at it, feel free:)

Thanks,

Jason

Paul Melis

unread,
Jan 26, 2009, 10:54:19 AM1/26/09
to OpenSceneGraph Users
Glenn Waldron wrote:
> Announcing osgEarth, a new open source toolkit that enables on-demand
> terrain generation in OpenSceneGraph applications.
>
> osgEarth brings web-based geospatial visualization to OSG. It it built
> on the osgTerrain library, and operates in a manner similar to the
> technology that underlies products like NASA WorldWind, Google Earth,
> or Microsoft Virtual Earth.
>
> With osgEarth you can generate a terrain model at run-time by
> connecting to a wide variety of imagery and elevation data sources,
> including WMS, TMS, Google maps, TIFF files, and more. Or extend it by
> writing your own driver.
>
> osgEarth is LGPL. Visit the wiki to download it and give it a try!
I haven't yet taken it for a spin, but here's warning I got during cmake
makefile generation:
Warning: Source file "Capabilities.cpp" is listed multiple times for
target "osgdb_osgearth_wms"

This is with CMake 2.4.8

Paul

Reply all
Reply to author
Forward
0 new messages