OpenSceneGraph: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Removed some outdated stuff.)
(44 intermediate revisions by 19 users not shown)
Line 1: Line 1:
__TOC__
[[File:Flightgear uml associations class diagram.png|thumb|270px|An [[UML Diagrams|UML]] class diagram disclosing the associations between some classes of the FlightGear source code.]]


As of October 29th 2006, FlightGear has migrated from PLIB to OpenSceneGraph.
= Downloading OpenSceneGraph =


Thanks to Mathias Fröhlich, we can use an current OpenSceneGraph SVN version
{{Note|as of 12/2017, people may have to build using at least OSG 3.4 due to some compilation issues -for details, refer to [[Howto:Building FlightGear without HiDPI support]]}}


== Getting OpenSceneGraph ==
'''The latest stable release of OpenSceneGraph is recommended for building FlightGear from git.'''


=== The latest OSG version from svn ===
You should use the unstable development releases (or build OSG from git) only if you intend to develop FlightGear against new features under development in OpenSceneGraph. For all other cases the latest stable release of OpenSceneGraph is usually the best option.


The OpenSceneGraph project uses [http://svnbook.red-bean.com/nightly/en/index.html Subversion (SVN)].
== Downloading Stable OpenSceneGraph ==
The OpenSceneGraph project uses [http://svnbook.red-bean.com/nightly/en/index.html Subversion (SVN)] to distribute their sources.


'''Note''': The source code should not be downloaded to the build.osg directory, or the build will not work correctly. See below.


To check out OpenSceneGraph:
To download the '''latest stable version''' of OpenSceneGraph use:


     svn checkout http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk OpenSceneGraph  
     svn checkout http://svn.openscenegraph.org/osg/OpenSceneGraph/tags/OpenSceneGraph-3.0.1 OpenSceneGraph


The OpenSceneGraph repository includes all parts of OSG you need.
'''Manual Download''': If you don't want to use SVN, you can also pick a stable release from the OSG download page:


'''Download the latest stable release '''
http://www.openscenegraph.org/projects/osg/wiki/Downloads
 
If the main OSG site is down (frequently) you can also use one of its various mirrors:
 
http://www.freebsd.org/cgi/pds.cgi?ports/graphics/osg
 
== OpenSceneGraph developer versions ==
FlightGear developers may want to use a '''development release''' of OpenSceneGraph:
 
    svn checkout http://svn.openscenegraph.org/osg/OpenSceneGraph/tags/OpenSceneGraph-3.1.6 OpenSceneGraph
 
You can replace the "3.1.6" by future development OSG versions (if known to be compatible with FlightGear).
 
Alternatively, developers interested in '''today's OSG development''' can download the current OSG trunk.
 
'''WARNING''': The sources of current OSG development aren't always compatible with FlightGear. Only use these if you're interested in OSG development or developing new OSG features for FlightGear:
 
    svn checkout http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk OpenSceneGraph
 
= Compiling OpenSceneGraph =


http://www.openscenegraph.org/projects/osg/wiki/Downloads
OpenSceneGraph uses cmake. Since OSG version 2.7.3 (8th Oct 2008) a relatively new version of cmake is required. According to OSGs CMakeLists.txt it's 2.6.1 but cmake 2.6.0-5 from [http://backports.org/dokuwiki/doku.php backports.org] for Debian/Etch does the trick.
It's also possible to comment out lines 25 to 27 in OSGs CMakeLists.txt:
#    if(POLICY CMP0008)
#        cmake_policy(SET CMP0008 OLD)
#    endif(POLICY CMP0008)


== Compiling OpenSceneGraph ==


OpenSceneGraph uses cmake. A minimal build instruction for unix systems is
A minimal build instruction for unix systems is


  mkdir build.osg
  mkdir build.osg
  cd build.osg
  cd build.osg
  ccmake ../path/to/osg/source
  cmake ../path/to/osg/source
  make
  make
  make install
  make install
Line 34: Line 58:
On other systems the steps might be different.
On other systems the steps might be different.


Recommended options to set in the ccmake menus:
Recommended options to set in the cmake menus:
* Build type: Release
* Build type: Release
* You don't need to build the examples, wrappers or applications.
* You don't need to build the examples, wrappers or applications.


=== Installing OpenSceneGraph and FlightGear with --prefix ===
== Installing OpenSceneGraph and FlightGear with --prefix ==


If you use --prefix to choose were to install FlightGear and do not want to install OSG globally on the system this can be done with the following method:
If you use --prefix to choose were to install FlightGear and do not want to install OSG globally on the system this can be done with the following method:
Line 46: Line 70:
   mkdir build.osg
   mkdir build.osg
   cd build.osg
   cd build.osg
   cmake -D CMAKE_BUILD_TYPE="Release" -D CMAKE_CXX_FLAGS="-O3" -D CMAKE_C_FLAGS="-O3" \
   cmake -D CMAKE_BUILD_TYPE="Release" -D CMAKE_CXX_FLAGS_RELEASE="-O3 -pipe" -D CMAKE_C_FLAGS_RELEASE="-O3 -pipe" \
         -D CMAKE_INSTALL_PREFIX:PATH="$(MY_PREFIX)" ../path/to/osg/source
         -D CMAKE_INSTALL_PREFIX:PATH="${MY_PREFIX}" ../path/to/osg/source
   make
   make
   make install
   make install
Line 55: Line 79:
   mkdir build.osg
   mkdir build.osg
   cd build.osg
   cd build.osg
   cmake -D CMAKE_BUILD_TYPE="Release" -D CMAKE_CXX_FLAGS="-O3" -D CMAKE_C_FLAGS="-O3" \
   cmake -D CMAKE_BUILD_TYPE="Release" -D CMAKE_CXX_FLAGS_RELEASE="-O3 -pipe" -D CMAKE_C_FLAGS_RELEASE="-O3 -pipe" \
         -D CMAKE_INSTALL_PREFIX:PATH="$(MY_PREFIX)" -D CMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOLEAN="true" ../path/to/osg/source
         -D CMAKE_INSTALL_PREFIX:PATH="${MY_PREFIX}" -D CMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOLEAN="true" ../path/to/osg/source
   make
   make
   make install
   make install
Line 67: Line 91:
Installing with --prefix is a very nice way to keep several distinct and independent versions of FlightGear around. To start a new $PREFIX directory you'll also need to install plib in it, but that is easy. Most other needed dependencies are usually available through the package system of most Linux distributions (e.g. FreeGLUT, SDL, ALSA, etc).
Installing with --prefix is a very nice way to keep several distinct and independent versions of FlightGear around. To start a new $PREFIX directory you'll also need to install plib in it, but that is easy. Most other needed dependencies are usually available through the package system of most Linux distributions (e.g. FreeGLUT, SDL, ALSA, etc).


== lib64 ==
Content moved to [[Talk:OpenSceneGraph]] for now.
= Features and issues =
Historically FlightGear has used [[PLIB]] instead of '''OpenSceneGraph'''. [[FlightGear 1.9.0]], released Decemeber 22, 2008, marked the release of the OSG version of FlightGear. While much of the conversion to OSG has happened over the years, [[PLIB]] is still used for some functions.
Thanks to Mathias Fröhlich and Tim Moore, we can use recent OpenSceneGraph releases.


== Regressions in CVS/HEAD ==
This section is meant to always remain up to date with the latest version in CVS/HEAD, please make sure to add/delete items as necessary.
* feature to disable scenery rendering via /sim/rendering/draw-otw property is not working at the moment (11/2008)


== Current issues (very out of date) ==
== Current issues (very out of date) ==
Line 81: Line 116:
** A new overhead window in the C172 (inside out)
** A new overhead window in the C172 (inside out)


* Runway lighting seems to have rendering artefacts on ATI Cards.
* <strike>Runway lighting seems to have rendering artefacts on ATI Cards.</strike>


* Enhanced runway lighting option in the drop-down menu seems to have no effect - light always appear enhanced.
* <strike>Enhanced runway lighting option in the drop-down menu seems to have no effect - light always appear enhanced.</strike>


* Seneca II HSI: upper instrument clipping issue for NAV/HDG flags, heading bug, pointer
* <strike>Seneca II HSI: upper instrument clipping issue for NAV/HDG flags, heading bug, pointer</strike>




[[List of 'compatible' aircrafts]] TO BE CONTINUED (<b>NOTE:</b> the list is out of date.)
[[List of 'compatible' aircraft]] TO BE CONTINUED ('''NOTE:''' the list is out of date.)


== Missing features ==
== Missing features ==
Due to the migration from PLIB to OSG, some of the features seen in past versions of FlightGear are now temporarily non-functional. These are:
Due to the migration from PLIB to OSG, some of the features seen in past versions of FlightGear are now temporarily non-functional. These are:




* 3D clouds
* <strike>3D clouds</strike> 3D clouds back thanks to Stuart Buchanan still have some visual artifacts


* Rendering of some scenes is not perfect.
* <strike>Rendering of some scenes is not perfect.</strike>


* Shadows
* Shadows
Line 102: Line 137:
* Exhaust shader
* Exhaust shader


* Weather Radar is there, but of course not showing any clouds
* Weather Radar is not showing any clouds


* cloud layers don't follow the curve of the earth
* cloud layers don't follow the curve of the earth
Line 110: Line 145:
** Bump Mapped Clouds
** Bump Mapped Clouds


== Miscelaneous OSG benefits ==
== Miscellaneous OSG benefits ==
* Models and scenery load in a separate thread
* Tree shaders allow "forests" of trees
* Improved precipitation modeling
* "Pick" animations enable greater realism and ease of creation for 3D cockpits
* Multi-monitor views


Mathias: "I think that we should make use in the longer term of the Producers  
Mathias: "I think that we should make use in the longer term of the Producers  
Line 116: Line 156:
But not only multipipe installs will benefit from that. The Producer will also  
But not only multipipe installs will benefit from that. The Producer will also  
help to get benefit from multicore SMP machines.
help to get benefit from multicore SMP machines.
For that the following article is of huge interrest:
For that the following article is of huge interest:
http://www.donburns.net/OSG/Articles/OSGMP/"
http://www.donburns.net/OSG/Articles/OSGMP/"


== Getting the PLIB Code ==
= Getting the PLIB Code =


Use the tag <tt>PRE_OSG_PLIB_20061029</tt> for checking out the branch with the plib scenegraph.
Use the tag <tt>PRE_OSG_PLIB_20061029</tt> for checking out the branch with the plib scenegraph.
Line 142: Line 182:
The data directory should be the CVS HEAD version. Some aircraft, however, have a PRE_OSG_PLIB_20061029 branch that works better with FlightGear/plib, e.g Hawker Hunter.
The data directory should be the CVS HEAD version. Some aircraft, however, have a PRE_OSG_PLIB_20061029 branch that works better with FlightGear/plib, e.g Hawker Hunter.


== External links ==
= External link =
http://www.openscenegraph.org/
* http://www.openscenegraph.org/
 
{{Building}}
 
[[Category:Software]]

Revision as of 12:14, 31 December 2017

An UML class diagram disclosing the associations between some classes of the FlightGear source code.

Downloading OpenSceneGraph

Note  as of 12/2017, people may have to build using at least OSG 3.4 due to some compilation issues -for details, refer to Howto:Building FlightGear without HiDPI support

The latest stable release of OpenSceneGraph is recommended for building FlightGear from git.

You should use the unstable development releases (or build OSG from git) only if you intend to develop FlightGear against new features under development in OpenSceneGraph. For all other cases the latest stable release of OpenSceneGraph is usually the best option.

Downloading Stable OpenSceneGraph

The OpenSceneGraph project uses Subversion (SVN) to distribute their sources.

Note: The source code should not be downloaded to the build.osg directory, or the build will not work correctly. See below.

To download the latest stable version of OpenSceneGraph use:

   svn checkout http://svn.openscenegraph.org/osg/OpenSceneGraph/tags/OpenSceneGraph-3.0.1 OpenSceneGraph

Manual Download: If you don't want to use SVN, you can also pick a stable release from the OSG download page:

http://www.openscenegraph.org/projects/osg/wiki/Downloads

If the main OSG site is down (frequently) you can also use one of its various mirrors:

http://www.freebsd.org/cgi/pds.cgi?ports/graphics/osg

OpenSceneGraph developer versions

FlightGear developers may want to use a development release of OpenSceneGraph:

   svn checkout http://svn.openscenegraph.org/osg/OpenSceneGraph/tags/OpenSceneGraph-3.1.6 OpenSceneGraph

You can replace the "3.1.6" by future development OSG versions (if known to be compatible with FlightGear).

Alternatively, developers interested in today's OSG development can download the current OSG trunk.

WARNING: The sources of current OSG development aren't always compatible with FlightGear. Only use these if you're interested in OSG development or developing new OSG features for FlightGear:

   svn checkout http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk OpenSceneGraph

Compiling OpenSceneGraph

OpenSceneGraph uses cmake. Since OSG version 2.7.3 (8th Oct 2008) a relatively new version of cmake is required. According to OSGs CMakeLists.txt it's 2.6.1 but cmake 2.6.0-5 from backports.org for Debian/Etch does the trick. It's also possible to comment out lines 25 to 27 in OSGs CMakeLists.txt:

#    if(POLICY CMP0008)
#        cmake_policy(SET CMP0008 OLD)
#    endif(POLICY CMP0008)


A minimal build instruction for unix systems is

mkdir build.osg
cd build.osg
cmake ../path/to/osg/source
make
make install

On other systems the steps might be different.

Recommended options to set in the cmake menus:

  • Build type: Release
  • You don't need to build the examples, wrappers or applications.

Installing OpenSceneGraph and FlightGear with --prefix

If you use --prefix to choose were to install FlightGear and do not want to install OSG globally on the system this can be done with the following method:

OpenSceneGraph uses cmake so to build it do

 mkdir build.osg
 cd build.osg
 cmake -D CMAKE_BUILD_TYPE="Release" -D CMAKE_CXX_FLAGS_RELEASE="-O3 -pipe" -D CMAKE_C_FLAGS_RELEASE="-O3 -pipe" \
       -D CMAKE_INSTALL_PREFIX:PATH="${MY_PREFIX}" ../path/to/osg/source
 make
 make install

or if you want to avoid needing to set LD_LIBRARY_PATH

 mkdir build.osg
 cd build.osg
 cmake -D CMAKE_BUILD_TYPE="Release" -D CMAKE_CXX_FLAGS_RELEASE="-O3 -pipe" -D CMAKE_C_FLAGS_RELEASE="-O3 -pipe" \
       -D CMAKE_INSTALL_PREFIX:PATH="${MY_PREFIX}" -D CMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOLEAN="true" ../path/to/osg/source
 make
 make install


Configure and build SimGear and FlightGear with --prefix as usual.

No need to install any quickly changing software globally.

Installing with --prefix is a very nice way to keep several distinct and independent versions of FlightGear around. To start a new $PREFIX directory you'll also need to install plib in it, but that is easy. Most other needed dependencies are usually available through the package system of most Linux distributions (e.g. FreeGLUT, SDL, ALSA, etc).

lib64

Content moved to Talk:OpenSceneGraph for now.

Features and issues

Historically FlightGear has used PLIB instead of OpenSceneGraph. FlightGear 1.9.0, released Decemeber 22, 2008, marked the release of the OSG version of FlightGear. While much of the conversion to OSG has happened over the years, PLIB is still used for some functions.

Thanks to Mathias Fröhlich and Tim Moore, we can use recent OpenSceneGraph releases.

Regressions in CVS/HEAD

This section is meant to always remain up to date with the latest version in CVS/HEAD, please make sure to add/delete items as necessary.

  • feature to disable scenery rendering via /sim/rendering/draw-otw property is not working at the moment (11/2008)

Current issues (very out of date)

  • The 2D Panels and the rendering order of instruments ... is wrong.
  • transparency issues:
    • runway lights shine through panel:
    • runway lights shine through cloud layers in an awkward way:
    • 2D-cloud layers flood into cockpit
    • The prop of the C172 block the view on the waves of the carrier
    • The reflector gun sight on the Seahawk causes other transparent objects (carrier wake etc.) to disappear
    • A new overhead window in the C172 (inside out)
  • Runway lighting seems to have rendering artefacts on ATI Cards.
  • Enhanced runway lighting option in the drop-down menu seems to have no effect - light always appear enhanced.
  • Seneca II HSI: upper instrument clipping issue for NAV/HDG flags, heading bug, pointer


List of 'compatible' aircraft TO BE CONTINUED (NOTE: the list is out of date.)

Missing features

Due to the migration from PLIB to OSG, some of the features seen in past versions of FlightGear are now temporarily non-functional. These are:


  • 3D clouds 3D clouds back thanks to Stuart Buchanan still have some visual artifacts
  • Rendering of some scenes is not perfect.
  • Shadows
  • Exhaust shader
  • Weather Radar is not showing any clouds
  • cloud layers don't follow the curve of the earth
  • Menu Items have no effect
    • Enhanced Runway Lights
    • Bump Mapped Clouds

Miscellaneous OSG benefits

  • Models and scenery load in a separate thread
  • Tree shaders allow "forests" of trees
  • Improved precipitation modeling
  • "Pick" animations enable greater realism and ease of creation for 3D cockpits
  • Multi-monitor views

Mathias: "I think that we should make use in the longer term of the Producers capabilities for multiple view installations. But not only multipipe installs will benefit from that. The Producer will also help to get benefit from multicore SMP machines. For that the following article is of huge interest: http://www.donburns.net/OSG/Articles/OSGMP/"

Getting the PLIB Code

Use the tag PRE_OSG_PLIB_20061029 for checking out the branch with the plib scenegraph.


For SimGear, this works (more or less) as follows:


    cvs -d :pserver:cvsguest@cvs.simgear.org:/var/cvs/SimGear-0.3 login
    CVS passwd: guest
    cvs -d :pserver:cvsguest@cvs.simgear.org:/var/cvs/SimGear-0.3 co source
    cd source
    cvs up -rPRE_OSG_PLIB_20061029


For FlightGear, you have to update the "source" directory:

    cvs -d :pserver:cvsguest@cvs.flightgear.org:/var/cvs/FlightGear-0.9 login
    CVS passwd: guest
    cvs -d :pserver:cvsguest@cvs.flightgear.org:/var/cvs/FlightGear-0.9 co -rPRE_OSG_PLIB_20061029 source

The data directory should be the CVS HEAD version. Some aircraft, however, have a PRE_OSG_PLIB_20061029 branch that works better with FlightGear/plib, e.g Hawker Hunter.

External link