Git Product home page Git Product logo

openscenegraph's Introduction

Build Status Coverity Status Documentation ABI Tracker

Introduction

Welcome to the OpenSceneGraph (OSG).

For information on the project, in-depth details on how to compile and run libraries and examples, see the documentation on the OpenSceneGraph website:

http://www.openscenegraph.org/index.php/documentation

For support please use the github OpenSceneGraph Discussions forum:

https://github.com/openscenegraph/OpenSceneGraph/discussions

For the impatient, we've included quick build instructions below, these are are broken down is three parts:

  1. General notes on building the OpenSceneGraph
  2. macOS release notes
  3. iOS release notes

If details below are not sufficient then head over to the openscenegraph.org to the Documentation/GettingStarted and Documentation/PlatformSpecifics sections for more indepth instructions.

Robert Osfield. Project Lead. 26th April 2018.


Section 1. How to build OpenSceneGraph

If you are using the vcpkg dependency manager you can download and install OpenSceneGraph from source with CMake integration using a single command:

vcpkg install osg

The OpenSceneGraph uses the CMake build system to generate a platform-specific build environment. CMake reads the CMakeLists.txt files that you'll find throughout the OpenSceneGraph directories, checks for installed dependencies and then generates files for the selected build system.

If you don't already have CMake installed on your system you can grab it from http://www.cmake.org, use version 2.8.0 or later. Details on the OpenSceneGraph's CMake build can be found at:

http://www.openscenegraph.org/projects/osg/wiki/Build/CMake

Under Unix-like systems (i.e. Linux, IRIX, Solaris, Free-BSD, HP-UX, AIX, macOS) use the cmake or ccmake command-line utils. Note that cmake . defaults to building Release to ensure that you get the best performance from your final libraries/applications.

cd OpenSceneGraph
cmake .
make
sudo make install

Alternatively, you can create an out-of-source build directory and run cmake or ccmake from there. The advantage to this approach is that the temporary files created by CMake won't clutter the OpenSceneGraph source directory, and also makes it possible to have multiple independent build targets by creating multiple build directories. In a directory alongside the OpenSceneGraph use:

mkdir build
cd build
cmake ../OpenSceneGraph
make
sudo make install

Under Windows use the GUI tool CMakeSetup to build your VisualStudio files. The following page on our wiki dedicated to the CMake build system should help guide you through the process:

http://www.openscenegraph.org/index.php/documentation/platform-specifics/windows

Under macOS you can either use the CMake build system above, or use the Xcode projects that you will find in the OpenSceneGraph/Xcode directory. See release notes on macOS CMake build below.

For further details on compilation, installation and platform-specific information read "Getting Started" guide:

http://www.openscenegraph.org/index.php/documentation/10-getting-started

Section 2. Release notes on macOS build, by Eric Sokolowski et al.

There are two ways to compile OpenSceneGraph under macOS. The recommended way is to use CMake to generate Xcode project files and then use Xcode to build the library. The default project will be able to build Debug or Release libraries, examples, and sample applications.

The alternative is to build OpenSceneGraph from the command line using make or ninja using the instructions for Unix-like systems above.

Here are some key settings to consider when using CMake:

  • BUILD_OSG_EXAMPLES - By default this is turned off. Turn this setting on to compile many great example programs.
  • CMAKE_OSX_ARCHITECTURES - Xcode can create applications, executables, libraries, and frameworks that can be run on more than one architecture. Use this setting to indicate the architectures on which to build OSG. x86_64 is the only supported value for OS versions > 10.7.
  • OSG_BUILD_APPLICATION_BUNDLES - Normally only executable binaries are created for the examples and sample applications. Turn this option on if you want to create real macOS .app bundles. There are caveats to creating .app bundles, see below.
  • OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX - By default macOS uses the imageio plugin instead of the plugins for the individual file types (e.g. jpg, gif, etc.) to load image file types. The imageio plugin can handle all popular file formats through the ImageIO framework.
  • OSG_WINDOWING_SYSTEM - You have the choice to use Cocoa, Carbon, or X11 when building applications on macOS. Cocoa is the default for OS versions >= 10.5. Carbon and X11 are no longer actively supported, either by Apple or the OSG community.

APPLICATION BUNDLES (.app bundles)

The example programs when built as application bundles only contain the executable file. They do not contain the dependent libraries as would a normal bundle, so they are not generally portable to other machines. They also do not know where to find plugins. An environmental variable OSG_LIBRARY_PATH may be set to point to the location where the plugin .so files are located. OSG_FILE_PATH may be set to point to the location where data files are located. Setting OSG_FILE_PATH to the OpenSceneGraph-Data directory is very useful when testing OSG by running the example programs.

Many of the example programs use command-line arguments. When double-clicking on an application (or using the equivalent "open" command on the command line) only those examples and applications that do not require command-line arguments will successfully run. The executable file within the .app bundle can be run from the command-line if command-line arguments are needed.

Section 3. Release notes on iOS build, by Thomas Hogarth

With CMake 3.11, XCode 9.4 and the iOS sdk 11.4 installed you can generate an iOS XCode project using the following command line:

export THIRDPARTY_PATH=/path/to/3rdParty
cmake ./ -G Xcode -DOSG_BUILD_PLATFORM_IPHONE:BOOL=ON \
-DIPHONE_SDKVER="11.4" \
-DIPHONE_VERSION_MIN="10.0" \
-DOPENGL_PROFILE:STRING=GLES3 \
-DOSG_CPP_EXCEPTIONS_AVAILABLE:BOOL=ON \
-DBUILD_OSG_APPLICATIONS:BOOL=OFF \
-DBUILD_OSG_EXAMPLES:BOOL=ON \
-DOSG_WINDOWING_SYSTEM:STRING=IOS \
-DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX="imageio" \
-DDYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
-DDYNAMIC_OPENTHREADS:BOOL=OFF \
-DCURL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/curl-ios-device/include" \
-DCURL_LIBRARY:PATH="$THIRDPARTY_PATH/curl-ios-device/lib/libcurl.a" \
-DFREETYPE_INCLUDE_DIR_freetype2:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include/freetype" \
-DFREETYPE_INCLUDE_DIR_ft2build:PATH="$THIRDPARTY_PATH/freetype-ios-universal/include" \
-DFREETYPE_LIBRARY:PATH="$THIRDPARTY_PATH/freetype-ios-universal/lib/libFreetype2.a" \
-DTIFF_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/tiff-ios-device/include" \
-DTIFF_LIBRARY:PATH="$THIRDPARTY_PATH/tiff-ios-device/lib/libtiff.a" \
-DGDAL_INCLUDE_DIR:PATH="$THIRDPARTY_PATH/gdal-ios-device/include" \
-DGDAL_LIBRARY:PATH="$THIRDPARTY_PATH/gdal-ios-device/lib/libgdal.a"

Be sure to set the THIRDPARTY_PATH to the path containing your thirdparty dependencies. Set IPHONE_SDKVER to the version of the iOS sdk you have installed, in this instance 11.4. IPHONE_VERSION_MIN controls the deployment sdk used by xcode, and lastly set OPENGL_PROFILE to the version of GLES you want to use.

Once this completes an XCode project will have been generated in the osg root folder. Open the generated Xcode project, select the example_osgViewerIPhone target. In 'General' tab set a development team.

Once this is done you should be able to build and deploy the example_osgViewerIPhone target on your device.

openscenegraph's People

Contributors

aluaces avatar andesengineering avatar blobfish avatar capostrophic avatar d-a-heitbrink avatar dan-t avatar dedowsdi avatar emminizer avatar ewmailing avatar filnet avatar flashk avatar glebm avatar gwaldron avatar haojia521 avatar juval avatar kornerr avatar laurensvoerman avatar longhuan2018 avatar marchelbling avatar mathieu avatar mp3butcher avatar mplatings avatar mxgrey avatar openscenegraph avatar remoe avatar rhabacker avatar rickyviking avatar robertosfield avatar tomhog avatar valid-ptr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openscenegraph's Issues

osgQt fails to build

The CMakeLists.txt has these lines

SET(SOURCES_H
    ${HEADER_PATH}/QGraphicsViewAdapter
)

IF ( Qt5Widgets_FOUND )
    QT5_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" )
ELSE()
    QT4_WRAP_CPP( SOURCES_H_MOC ${SOURCES_H} OPTIONS "-f" )
ENDIF()

For some weird reason moc fails with rather cryptic message: moc: Too many input files specified (all google results link to spaces in paths, which is not the case). The response file for moc looks like so:

-I"G:/prog/osg/3.2.1-rc1/include"
-I"G:/prog/osg/build-3.2.1-rc1/include"
-D_SCL_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE
-DOSGQT_LIBRARY
-DWIN32
-f
-o
G:/prog/osg/build-3.2.1-rc1/src/osgQt/__/__/include/osgQt/moc_QGraphicsViewAdapter.cpp
G:/prog/osg/3.2.1-rc1/include/osgQt/QGraphicsViewAdapter

By removing the -f (that expects an argument) we can pass this step but compilation hits another wall because of the lines 47-48 in BufferObject

typedef int GLintptr;
typedef int GLsizeiptr;

that redefine types defined in Qt's own implementation of OpenGL.

stdexcept header missing

Hello

During installation, I got an error saying std::runtime is not a member of std (at /src/osgPlugins/daedaewriter.cpp line267). Simply including stdexcept solved it. Please include it in the source as well.

Thanks,
Rohan

how to convert osg::Image from cv::Mat?

I hava try to convert osg::Image from cv::Mat: teximg
osg::ref_ptrosg::Image image = new osg::Image();
image->setImage(teximg.cols, teximg.rows, teximg.channels(), GL_RGB, GL_BGR, GL_UNSIGNED_BYTE, teximg.data, osg::Image::AllocationMode::NO_DELETE,1);

but then get a error:
0x000007FEEA09C3F9 (msvcr120.dll)
Have exception without processing 0xC0000005

Viewer on Multi-Monitor system crashes without --screen parameter using OSG 3.4.0

If you have a multi-monitor setup (e.g. 2 Monitors attached) running the latest stable release 3.4.0 of OpenSceneGraph, the application crashed at startup when no --screen parameter is set. (OSG tries to use all monitors by default, worked with 3.2.3) This doesn't happen if you explicitely call osgviewer --screen 0 to start rendering only at one screen.

osgjs plugin

Hello!
I can export from osg to osgjs fromat with osgjs plugin. Please tell me:i can load from osgjs to osg format?

OpenSceneGraph-3.0 branch not mirrored

I really appreciate this git mirror of the OSG subversion. The OpenSceneGraph-3.0 branch was recently created in the SVN, and it would be great if that branch could also be mirrored here.

FindFBX.cmake is broken on OS X

FindFBX does not find the FBX sdk on Mac.

Install path is: /Applications/Autodesk/FBX SDK/2014.1/
Search path in FindFBX is /Applications/Autodesk/FBXSDK20141

But changing it still does not fix it. Not sure where the issue is.

Additionally the ReaderWriterFBX.h states that the plugin "requires the FBX SDK version 2013.3 or 2014.1", but FindFBX is trying to find 2015.1 first then 2014.2, and finally 2014.1 with a comment that searching for 2014.1 is probably a typo?

FindAVFoundation.cmake is broken on OSX 10.11 (and above)

The find script is looking for specific versions of OSX rather than versions above a suitable release:

IF(${OSG_OSX_SDK_NAME} STREQUAL "macosx10.8" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.9" OR ${OSG_OSX_SDK_NAME} STREQUAL "macosx10.10")

issue in RayIntersector::intersectAndClip

Hi,

There are possible division by zero errors in RayIntersector::intersectAndClip.
I added a few if statements below, and it seems to work.
Thanks.

Alex

    if (d[i] >= 0.)
    {
        // trivial reject of segment wholly outside
        if (s[i] > bb_max[i]) return false;

        if (s[i] < bb_min[i])
        {
    if(d[i] == 0.) return false;//!!!added this
            // clip s to xMin
            double t = (bb_min[i]-s[i])/d[i] - epsilon;//!!!!possible division by zero
            if (t>0.0) s = s + d*t;
        }
    }

    // test direction
    if (d[i] >= 0.)
    {
        // compute end_t based on xMax
        if(d[i] != 0.0) {//!!!added this
            double t = (bb_max[i]-s[i])/d[i] + epsilon; //!!!!possible division by zero
            if (t < end_t)
                end_t = t;
        }
    }

Support for gtkglext-quartz on Mac OS X

Hi,

Could you please provide support for gtkglext that was built against the gtk2 quartz backend in the CMake scripts?
I am currently revising the openscenegraph formula for Homebrew to ensure it builds properly against our soon to be released revised gtk+ formula, which will be quartz backend ONLY.

For now I managed to fix the problem using the following hack, but ideally a proper detection of the gtkglext version would be necessary.

Thanks in advance!

diff --git a/CMakeModules/FindGtkGl.cmake b/CMakeModules/FindGtkGl.cmake
index 321cede..6497589 100644
--- a/CMakeModules/FindGtkGl.cmake
+++ b/CMakeModules/FindGtkGl.cmake
@@ -10,7 +10,7 @@ IF(PKG_CONFIG_FOUND)
     IF(WIN32)
         PKG_CHECK_MODULES(GTKGL gtkglext-win32-1.0)
     ELSE()
-        PKG_CHECK_MODULES(GTKGL gtkglext-x11-1.0)
+        PKG_CHECK_MODULES(GTKGL gtkglext-quartz-1.0)
     ENDIF()

 ENDIF()

osgplanets example not running correctly

When I run osgplanets example, it output just this in the terminal without showing any graphics or opening any window:

rotateSpeed corrected by factor 0.5
Rorbits corrected by factor 15
Radius corrected by factor 10

Note that it didn't crash and stayed running, I kept it for 6 hours and still nothing changed.

My OS is Fedora 23.
I built OSG from the latest commit at the time of writing this issue.
All other examples are working fine.

how to generate lod of terrain models

Now, I generate a large terrain model(_.obj__.mtl OR *.ive) by way of point cloud of UAV images, and then I geo-reference the model. The issue I got is how I could generate the LODs of terrain model to display the model in my scene.

how to extract decompress images from an IVE

OSG issue : I have a question about extracting images from an IVE with compressed textures.
osg::Texture2D *texture2D = dynamic_cast
(geometry->getOrCreateStateSet()->getTextureAttribute(0, osg::StateAttribute::TEXTURE));
osg::ref_ptrosg::Image image = texture2D->getImage();//but image is compressed

freetype

I have install freetype2.6.1
platform: OS X 10.11
but

Warning: dynamic library '/usr/local/lib/osgPlugins-3.5.2/osgdb_freetype.so' exists, but an error occurred while trying to open it:
dlopen(/usr/local/lib/osgPlugins-3.5.2/osgdb_freetype.so, 9): Library not loaded: /usr/local/lib/libfreetype.6.dylib
  Referenced from: /usr/local/lib/osgPlugins-3.5.2/osgdb_freetype.so
  Reason: image not found
Error reading file /Users/retech/Documents/Git/OpenSceneGraph-Data/fonts/arial.ttf: file not handled
font:0x0

otool:

bogon:osgPlugins-3.5.2 retech$ otool -L osgdb_freetype.so 
osgdb_freetype.so:
    /Users/retech/Documents/Git/OpenSceneGraph/lib/libosgText.143.dylib (compatibility version 143.0.0, current version 3.5.2)
    /usr/local/lib/libfreetype.6.dylib (compatibility version 19.0.0, current version 19.1.0)
    /Users/retech/Documents/Git/OpenSceneGraph/lib/libosgDB.143.dylib (compatibility version 143.0.0, current version 3.5.2)
    /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility version 2.0.0, current version 157.0.0)
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 22.0.0)
    /usr/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
    /Users/retech/Documents/Git/OpenSceneGraph/lib/libosgUtil.143.dylib (compatibility version 143.0.0, current version 3.5.2)
    /Users/retech/Documents/Git/OpenSceneGraph/lib/libosg.143.dylib (compatibility version 143.0.0, current version 3.5.2)
    /Users/retech/Documents/Git/OpenSceneGraph/lib/libOpenThreads.20.dylib (compatibility version 20.0.0, current version 3.3.0)
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
    /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
    /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)

Collada plugin support

Hi I'm trying to use new collada plugin from

http://collada.org/mediawiki/index.php/DOM_guide:_Setting_up

specifically, the svn co https://collada-dom.svn.sourceforge.net/svnroot/collada-dom/trunk colladadom

When I setup the colladadom include path and library path and configure and make I get this error message. Usually about the namespace issue

osg/src/osgPlugins/dae/daeReader.h:162:5: error: unknown type name 'domUpAxisType'; did you mean 'ColladaDOM141::domUpAxisType'?

and enum type specification issues.

/Users/chrischoy/packages/osg/src/osgPlugins/dae/daeReader.h:359:61: error: C++ requires a type specifier for all declarations
osg::Image* processImageTransparency(const osg::Image*, domFx_opaque_enum, float transparency) const;

/Users/chrischoy/packages/osg/src/osgPlugins/dae/daeReader.h:360:154: error: C++ requires a type specifier for all declarations
osg::Texture2D* processTexture( ColladaDOM141::domCommon_color_or_texture_type_complexType::domTexture tex, const osg::StateSet, TextureUnitUsage, domFx_opaque_enum = FX_OPAQUE_ENUM_A_ONE, f...

Complaining about missing type of domFx_opaque_enum

On Linux, declaring an osgViewer::Viewer object globally segfaults when exiting via 'esc' - ver. 3.2.2

osgViewer::Viewer viewer;

int main( int argc, char** argv) {
  viewer.apply( new osgViewer::SingleWindow(0,0,640,480) );
  viewer.run();
}

The above program will exit normally if closed by clicking the 'close' button, but will segfault on a mutex lock if closed via 'esc'. Moving the viewer declaration inside main fixes it.

When closing via the close button it never enters the loop in GLBufferObjectManager::deleteAllGLBufferObjects()

When closing via esc it does. I suspect that closing the window frees buffer objects in a way that hitting 'esc' doesn't, and that the viewer needs to issue a call to destroy the window. Making the viewer local to main must allow proper cleanup to occur before the program completely terminates.

Maybe it's a non issue, but I thought I'd bring it to your attention.

Cmake error when build on MAC OSX 10.10

When i try to build OSG on MAC OSX 10.10, the follow error arised:
CMake Error at CMakeLists.txt:178 (LIST): list index: 2 out of range (-2, 1)
then i comment out line 178 of CMakeList.txt, it can work well now

Fails to find default collada-dom include directory on OS X 10.9.5

When trying to build OpenSceneGraph with collada-dom 2.4 installed on OS X 10.9.5, I get a build failure where it complains about a missing dae.h.

[ 86%] Building CXX object src/osgPlugins/dae/CMakeFiles/osgdb_dae.dir/daeReader.cpp.o
cd /tmp/open-scene-graph20150903-1074-ipfyil/OpenSceneGraph-3.4.0/build/src/osgPlugins/dae && /usr/local/Library/ENV/4.3/clang++   -DCOLLADA_DOM_SUPPORT141 -DNO_BOOST -Dosgdb_dae_EXPORTS -std=c++11 -stdlib=libc++  -Wno-conversion -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -fPIC -I/tmp/open-scene-graph20150903-1074-ipfyil/OpenSceneGraph-3.4.0/include -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks -I/tmp/open-scene-graph20150903-1074-ipfyil/OpenSceneGraph-3.4.0/build/include -I/usr/local/opt/collada-dom/include/collada-dom -I/usr/local/opt/collada-dom/include/collada-dom/1.4    -o CMakeFiles/osgdb_dae.dir/daeReader.cpp.o -c /tmp/open-scene-graph20150903-1074-ipfyil/OpenSceneGraph-3.4.0/src/osgPlugins/dae/daeReader.cpp
In file included from /tmp/open-scene-graph20150903-1074-ipfyil/OpenSceneGraph-3.4.0/src/osgPlugins/dae/daeReader.cpp:14:
/tmp/open-scene-graph20150903-1074-ipfyil/OpenSceneGraph-3.4.0/src/osgPlugins/dae/daeReader.h:19:10: fatal error: 'dae.h' file not found
#include <dae.h>
         ^

The default installation of collada-dom for newer versions (2.2, 2.4), when built from source, looks like it will install its headers in a version-qualified subdirectory under include, like include/collada-dom2.2 or include/collada-dom2.4, not include/collada-dom.

But CMakeModules/FindCOLLADA.cmake is only looking for non-version-qualified dirs.

    /usr/local/include/colladadom
    /usr/local/include/collada-dom
    /opt/local/include/collada-dom
    /usr/include/
    /usr/include/colladadom
    /usr/include/collada-dom

This was noticed when doing a build in Homebrew; see Homebrew/legacy-homebrew#43536 for details if you're curious.

It seems like the CMake scripts should be modified to look for collada-dom2.*, to work smoothly with the default collada-dom installation.

Specifying -DCOLLADA_INCLUDE_DIR doesn't seem to be sufficient to get this working. I tried cmake -DCMAKE_INSTALL_PREFIX=/tmp/test-open-scene-graph -DCOLLADA_INCLUDE_DIR=/usr/local/opt/collada-dom/include/collada-dom2.4 .. | tee cmake.log. When i do that, it no longer errors out on a missing dae.h, but fails to find another header from the 1.4 DOM subdirectory.

[ 87%] Building CXX object src/osgPlugins/dae/CMakeFiles/osgdb_dae.dir/daeReader.cpp.o
cd /tmp/open-scene-graph20151126-78498-1ygkfdp/OpenSceneGraph-3.4.0/build/src/osgPlugins/dae && /usr/local/Library/ENV/4.3/clang++   -DCOLLADA_DOM_SUPPORT141 -DNO_BOOST -Dosgdb_dae_EXPORTS -I/tmp/open-scene-graph20151126-78498-1ygkfdp/OpenSceneGraph-3.4.0/include -F/Applications/Xcode-6.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks -I/tmp/open-scene-graph20151126-78498-1ygkfdp/OpenSceneGraph-3.4.0/build/include -I/usr/local/opt/collada-dom/include/collada-dom2.4 -I/1.4  -std=c++11 -stdlib=libc++  -Wno-conversion -arch x86_64 -isysroot /Applications/Xcode-6.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -fPIC   -o CMakeFiles/osgdb_dae.dir/daeReader.cpp.o -c /tmp/open-scene-graph20151126-78498-1ygkfdp/OpenSceneGraph-3.4.0/src/osgPlugins/dae/daeReader.cpp
In file included from /tmp/open-scene-graph20151126-78498-1ygkfdp/OpenSceneGraph-3.4.0/src/osgPlugins/dae/daeReader.cpp:14:
/tmp/open-scene-graph20151126-78498-1ygkfdp/OpenSceneGraph-3.4.0/src/osgPlugins/dae/daeReader.h:22:10: fatal error: 'dom/domCommon_color_or_texture_type.h' file not found
#include <dom/domCommon_color_or_texture_type.h>
         ^

That -I/usr/local/opt/collada-dom/include/collada-dom2.4 -I/1.4 looks like something's falling through the cracks with detecting the DOM root dir. Here's what I see after running that cmake.

$ grep -r COLLADA_DOM_R *
CMakeCache.txt:COLLADA_DOM_ROOT:PATH=/include/1.4/dom
$ grep -r COLLADA_INCL *
CMakeCache.txt:COLLADA_INCLUDE_DIR:PATH=/usr/local/opt/collada-dom/include/collada-dom2.4
CMakeCache.txt:COLLADA_INCLUDE_DOMANY_DIR:PATH=/usr/local/opt/collada-dom/include/collada-dom2.4

Looks like it's this code in FindCOLLADA.cmake, which doesn't match up with the locations for an installed collada-dom or use COLLADA_INCLUDE_DIR to locate the DOM includes.

# Check if COLLADA_DIR is set, otherwise use ACTUAL_3DPARTY_DIR:
SET( COLLADA_ENV_VAR_AVAILABLE $ENV{COLLADA_DIR} )
IF ( COLLADA_ENV_VAR_AVAILABLE )
    SET(COLLADA_DOM_ROOT "$ENV{COLLADA_DIR}/dom" CACHE PATH "Location of Collada DOM directory" FORCE)
ELSE ()
    SET(COLLADA_DOM_ROOT "${ACTUAL_3DPARTY_DIR}/include/1.4/dom" CACHE PATH "Location of Collada DOM directory" FORCE)
ENDIF()

OSG not building in OSX 10.11?

I get an error CMake Error at CMakeLists.txt:178 (LIST): list index: 2 out of range (-2, 1)

Can we get a minor patch that fixes this?

how to compress or decompress image texture using OpenScenGraph ?

I find following functions:

CompressDXT.h(45):void compressDXT3(const nvtt::OutputOptions::Private & outputOptions);
CompressDXT.h(64):void compressDXT3(const nvtt::CompressionOptions::Private & compressionOptions, const nvtt::OutputOptions::Private & outputOptions);
OptimalCompressDXT.h(44): void compressDXT3A(const ColorBlock & rgba, AlphaBlockDXT3 * dxtBlock);
QuickCompressDXT.h(43):void compressDXT3(const ColorBlock & rgba, BlockDXT3 * dxtBlock);
CompressDXT.h(45):void compressDXT3(const nvtt::OutputOptions::Private & outputOptions);
CompressDXT.h(64):void compressDXT3(const nvtt::CompressionOptions::Private & compressionOptions, const nvtt::OutputOptions::Private & outputOptions);
OptimalCompressDXT.h(44): void compressDXT3A(const ColorBlock & rgba, AlphaBlockDXT3 * dxtBlock);
QuickCompressDXT.h(43):void compressDXT3(const ColorBlock & rgba, BlockDXT3 * dxtBlock);

how to use those functions? how to compress or decompress image texture using OpenScenGraph ?and how to make jpg texture image maintain jpg format,then make ive or osgb file smaller?

Help required in compiling

Hello I am a newbie can you help me in compiling OSG. I don't understand the steps. Please provide me some help.

Thanks.

arial.ttf : file not handled

platform: OS X version:3.5.2
code:

    osg::ref_ptr<osgText::Font> font = osgText::readRefFontFile("fonts/arial.ttf");
    osgText::Text* text = new  osgText::Text;
    text->setFont(font);

error info:

bogon:bin retech$ ./osglogo 
Error reading file /Users/retech/Documents/Git/OpenSceneGraph-Data/fonts/arial.ttf: file not handled

Why failed to load TTF file(fail to create Font instance)?
and other example have the same problem,does need some plug when load TTF?

fails to build without -fpermissive

see https://galileo.mailstation.de/jenkins/job/pyro/107/artifact/107_build.log

snip:

[ 25%] Linking CXX shared library ../../lib/libosgTerrain.so
cd /var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/build/src/osgTerrain && /usr/x86_64-pc-linux-gnu/bin/cmake -E cmake_link_script CMakeFiles/osgTerrain.dir/link.txt --verbose=1
/usr/bin/x86_64-pc-linux-gnu-c++  -fPIC -pipe -O2 -march=x86-64 -mtune=generic -Wall -Wparentheses -Wno-long-long -Wno-import -pedantic -Wreturn-type -Wmissing-braces -Wunknown-pragmas -Wunused  -Wl,--as-needed -shared -Wl,-soname,libosgTerrain.so.130 -o ../../lib/libosgTerrain.so.3.4.0 CMakeFiles/osgTerrain.dir/DisplacementMappingTechnique.o CMakeFiles/osgTerrain.dir/Layer.o CMakeFiles/osgTerrain.dir/Locator.o CMakeFiles/osgTerrain.dir/TerrainTile.o CMakeFiles/osgTerrain.dir/TerrainTechnique.o CMakeFiles/osgTerrain.dir/Terrain.o CMakeFiles/osgTerrain.dir/GeometryTechnique.o CMakeFiles/osgTerrain.dir/GeometryPool.o CMakeFiles/osgTerrain.dir/Version.o ../../lib/libosgDB.so.3.4.0 -lGL ../../lib/libosgUtil.so.3.4.0 ../../lib/libosg.so.3.4.0 -lm -lrt ../../lib/libOpenThreads.so.3.3.0 -lpthread -ldl -lz -lGL -Wl,-rpath,/var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/build/lib: 
/var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/OpenSceneGraph-3.4.0/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp: In function 'void osgDBJPEG::jpeg_istream_src(j_decompress_ptr, std::istream*)':
/var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/OpenSceneGraph-3.4.0/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp:252:32: error: invalid conversion from 'osgDBJPEG::boolean (*)(j_decompress_ptr) {aka int (*)(jpeg_decompress_struct*)}' to 'boolean (*)(j_decompress_ptr) {aka boolean (*)(jpeg_decompress_struct*)}' [-fpermissive]
     src->pub.fill_input_buffer = fill_input_buffer;
                                ^
/var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/OpenSceneGraph-3.4.0/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp: In function 'void osgDBJPEG::jpeg_stream_dest(j_compress_ptr, std::ostream*)':
/var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/OpenSceneGraph-3.4.0/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp:381:35: error: invalid conversion from 'osgDBJPEG::boolean (*)(j_compress_ptr) {aka int (*)(jpeg_compress_struct*)}' to 'boolean (*)(j_compress_ptr) {aka boolean (*)(jpeg_compress_struct*)}' [-fpermissive]
     dest->pub.empty_output_buffer = empty_output_buffer;
                                   ^
/var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/OpenSceneGraph-3.4.0/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp: In function 'unsigned char* osgDBJPEG::simage_jpeg_load(std::istream&, int*, int*, int*, unsigned int*)':
/var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/OpenSceneGraph-3.4.0/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp:539:41: error: invalid conversion from 'int' to 'boolean' [-fpermissive]
     (void) jpeg_read_header(&cinfo, TRUE);
                                         ^
/var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/OpenSceneGraph-3.4.0/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp: In member function 'osgDB::ReaderWriter::WriteResult::WriteStatus ReaderWriterJPEG::write_JPEG_file(std::ostream&, const osg::Image&, int) const':
/var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/OpenSceneGraph-3.4.0/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp:761:87: error: invalid conversion from 'int' to 'boolean' [-fpermissive]
    jpeg_set_quality(&cinfo, quality, TRUE /* limit to baseline-JPEG values */);
                                                                              ^
/var/tmp/paludis/build/dev-games-OpenSceneGraph-3.4.0/work/OpenSceneGraph-3.4.0/src/osgPlugins/jpeg/ReaderWriterJPEG.cpp:768:45: error: invalid conversion from 'int' to 'boolean' [-fpermissive]
             jpeg_start_compress(&cinfo, TRUE);

Please update the ffmpeg detection/plugin for v.1.x+ otherwise compilation fails (solution included)

I tried compiling osgdb_ffmpeg on OSX using ffmpeg 1.0 from MacPorts, it fails with OSX 10.6.8 and Xcode 3.2.6 and OSX 10.7.5 and Xcode 4.5.

It seems that ffmpeg now ships a header file called "time.h" in libavutil, and the compiler gets to include this one before its own.

osg/CMakeModules/FindFFmpeg.cmake reads:

In ffmpeg code, old version use #include <header.h> and newer use #include <libname/header.h>

In OSG ffmpeg plugin, we use #include <header.h> for compatibility with old version of ffmpeg

I would suggest to modify FindFFmpeg.cmake so as to use #include <libname/header.h> only, as I did for a fork in shotdetect:
johmathe/shotdetect@ffb85ed

Then, ffmpeg includes in osg/src/osgPlugins/ffmpeg/FFmpegHeaders.hpp can be adapted accordingly.

What do you think?

Openscenegraph-3.4 branch install error with debug dll's on VS2013

The Openscenegraph-3.4 branch doesn't install debug dll's with cmake. Tested it with:

1f9725e

The Openscenegraph-3.4 Tag works:

https://github.com/openscenegraph/OpenSceneGraph/tree/OpenSceneGraph-3.4.0

Maybe because of:

6eaf2f5

?

I use VS2013 on win64 with CMake 3.6.2 (older also doesn't work). Here is the error:

 -- Installing: x64_debug_install/bin/osg130-osgd.dll
 CMake Error at src/osg/cmake_install.cmake:55 (file):
   file INSTALL cannot find
   "x64_debug/src/osg/osg130-osgd.pdb".
 Call Stack (most recent call first):
   src/cmake_install.cmake:33 (include)
   cmake_install.cmake:96 (include)

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: The command "setlocal\r [x64_debug\INSTALL.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: cmake\bin\cmake.exe -DBUILD_TYPE=Debug -P cmake_install.cmake\r [x64_debug\INSTALL.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd\r [x64_debug\INSTALL.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmEnd\r [x64_debug\INSTALL.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone\r [x64_debug\INSTALL.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmErrorLevel\r [x64_debug\INSTALL.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: exit /b %1\r [x64_debug\INSTALL.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :cmDone\r [x64_debug\INSTALL.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd\r [x64_debug\INSTALL.vcxproj]
  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(132,5): error MSB3073: :VCEnd" exited with code 1. [x64_debug\INSTALL.vcxproj]

overloaded isinf at src/osgPlugins/osgjs/json_stream

Hi

When installing osg version 3.4, I get the following error:

~/git/misc/osg/src/osgPlugins/osgjs/json_stream: In member function 'double json_stream::to_valid_float(double)': ~/git/misc/osg/src/osgPlugins/osgjs/json_stream:98:18: error: call of overloaded 'isinf(const double&)' is ambiguous ~/git/misc/osg/src/osgPlugins/osgjs/json_stream:98:18: note: candidates are: /usr/include/i386-linux-gnu/bits/mathcalls.h:203:1: note: int isinf(double) /usr/include/c++/4.6/cmath:534:3: note: bool std::isinf(long double) /usr/include/c++/4.6/cmath:530:3: note: bool std::isinf(double) /usr/include/c++/4.6/cmath:526:3: note: bool std::isinf(float)

My system information is:
gcc 4.6.4
Ubuntu 12.04 32bit
cmake 2.8.7

I have edited the source to std::isinf instead for now in my system

Texture2D setResizeNonPowerOfTwoHint break internal format

when setResizeNonPowerOfTwoHint is set to true, and if texture internal format type is FLOAT (e.g GL_RGBA32F_ARB) it texture behave as NORMALIZED texture. In other worlds, in shader texture2D() return value in range [0, 1], but if setResizeNonPowerOfTwoHint is set to false, all ok.

fail to compile osg

ffmpeg is cloned from https://github.com/FFmpeg/FFmpeg.git

After config osg with cmake-gui, when I run make, it reports below erros:

/root/osg/OpenSceneGraph-3.4.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp: In member function ‘void osgFFmpeg::FFmpegDecoderAudio::open(AVStream_, osgFFmpeg::FFmpegParameters_)’:
/root/osg/OpenSceneGraph-3.4.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:230:20: error: ‘AVCodecContext’ has no member named ‘get_buffer’
m_context->get_buffer = avcodec_default_get_buffer;
^
/root/osg/OpenSceneGraph-3.4.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:230:33: error: ‘avcodec_default_get_buffer’ was not declared in this scope
m_context->get_buffer = avcodec_default_get_buffer;
^
/root/osg/OpenSceneGraph-3.4.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:231:20: error: ‘AVCodecContext’ has no member named ‘release_buffer’
m_context->release_buffer = avcodec_default_release_buffer;
^
/root/osg/OpenSceneGraph-3.4.0/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp:231:37: error: ‘avcodec_default_release_buffer’ was not declared in this scope
m_context->release_buffer = avcodec_default_release_buffer;
^
make[2]: *** [src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/FFmpegDecoderAudio.o] Error 1
make[1]: *** [src/osgPlugins/ffmpeg/CMakeFiles/osgdb_ffmpeg.dir/all] Error 2
make: *** [all] Error 2

Link error with SDL on OSX 10.11

I can't finish the build of osgPlugins/sdl because of linking error.

[100%] Linking CXX shared module ../../../lib/osgPlugins-3.5.4/osgdb_sdl.so
Undefined symbols for architecture x86_64:
  "_SDL_JoystickNameForIndex", referenced from:
      JoystickDevice::JoystickDevice() in JoystickDevice.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/osgPlugins-3.5.4/osgdb_sdl.so] Error 1
make[1]: *** [src/osgPlugins/sdl/CMakeFiles/osgdb_sdl.dir/all] Error 2
make: *** [all] Error 2

It seems SDL is not well linked, but cmake has found it before using make command.

Here's the interesting part of CMakeCache.txt

//Path to a file.
SDL2_INCLUDE_DIR:PATH=/Users/mickaelb/Library/Frameworks/SDL2.framework/Headers

//Where the SDL2 Library can be found
SDL2_LIBRARY:STRING=/Users/mickaelb/Library/Frameworks/SDL2.framework;-framework Cocoa

//Path to a file.
SDL_INCLUDE_DIR:PATH=/Users/mickaelb/Library/Frameworks/SDL2.framework/Headers

//Where the SDL Library can be found
SDL_LIBRARY:STRING=/usr/local/lib/libSDL.dylib;-framework Cocoa

[...]

//Dependencies for the target
osgdb_sdl_LIB_DEPENDS:STATIC=general;OpenThreads;general;osg;general;osgDB;general;osgUtil;general;osgGA;general;/usr/local/lib/libSDL.dylib;general;-framework Cocoa;


[...]


//Details about finding SDL
FIND_PACKAGE_MESSAGE_DETAILS_SDL:INTERNAL=[/usr/local/lib/libSDL.dylib;-framework Cocoa][/Users/mickaelb/Library/Frameworks/SDL2.framework/Headers][v2.0.4()]
//Details about finding SDL2
FIND_PACKAGE_MESSAGE_DETAILS_SDL2:INTERNAL=[/Users/mickaelb/Library/Frameworks/SDL2.framework;-framework Cocoa][/Users/mickaelb/Library/Frameworks/SDL2.framework/Headers][v()]

[...]

SDL2_LIBRARY_TEMP:INTERNAL=/Users/mickaelb/Library/Frameworks/SDL2.framework;-framework Cocoa;-framework Cocoa;-framework Cocoa
SDL_LIBRARY_TEMP:INTERNAL=/usr/local/lib/libSDL.dylib;-framework Cocoa;-framework Cocoa;-framework Cocoa

I think CMake mixes SDL 1 and 2 but I'm not sure...

OSG not supported anymore on Android NDK 12

Hi,

as Android NDK dropped the support of the GNU++ compiler with version 11/12 in favour of clang++ it is not possible to use OSG on Android using an up-to-date NDK version.
Does OSG plan to integrate clang++ support? And when?

Thanks in advance for your reply

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.