Commit Graph

9213 Commits

Author SHA1 Message Date
Robert Osfield
dcadd69c5a Added releaseGLObjects(..) and resizeGLObjectBuffers(..) to osgShadow::ShadowTechnique's 2016-02-04 17:52:44 +00:00
Robert Osfield
5ff6fe7c68 Commented out debug message 2016-02-04 17:35:32 +00:00
Robert Osfield
d8d37e3da7 Added new Identifer, ValueMap and ValueStack class to build 2016-02-04 13:07:55 +00:00
Robert Osfield
041ab29d1f Added osg::Identifer, osg::ValueMap and osg::ValueStack classes to provide a general purpose means for storing and retrieving values from map or stack containers.
Typical use will be for storing and passing values between nodes during traversals.
2016-02-04 13:04:40 +00:00
Robert Osfield
90a0170d47 Fixed build with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF. 2016-01-29 11:54:17 +00:00
Robert Osfield
39b1f379dc Fixed check against Drawable::isCullingActive().
Removed old code intended to check the Geode parent of a Drawable to see if it's CullingActive is true as this was broken by the change osg::Drawable being derived from osg::Node rather than osg::Object.
2016-01-27 10:06:33 +00:00
Robert Osfield
4deca2d38b From Jannik Heller and Robert Osfield, introduced ReadResult/WriteResult::statusMessage() method that creates a std::string from the stutus value and message string. 2016-01-25 12:23:04 +00:00
OpenSceneGraph git mirror maintainer
72cc10e309 Merge pull request #51 from scrawl/occlusionqueryfix_osg
From Jannik Heller, "Check for presence of occlusion query extension"
2016-01-25 11:05:40 +00:00
Robert Osfield
4b2912e096 From John Farrier, "Best I can tell, there is an enumeration for NEVER_CHECK_GL_ERRORS in CheckForGLErrors, defined in State. State.cpp does check to see if you want MORE error checking, but there is no way to turn OFF error checking. This change allows disabling of OpenGL error checking." 2016-01-25 10:45:07 +00:00
Robert Osfield
a83b390d55 From Patrick Neary, "In ShaderComposer::getOrCreateProgram(), tesselation control and evaluation shaders are processed but not added to the shader program." 2016-01-25 10:25:15 +00:00
Robert Osfield
b141c0f63e Changed the prototype from NULL to osg::DummyObject to address a bug in reading .osgt + .osgx where an image is written out but fails to read the file causes subsequent parts of the file to be mis-read 2016-01-22 10:09:00 +00:00
Robert Osfield
5cb486f7c5 Added osg::MultiDrawArrays which wraps up glMultiDrawArrays extension. 2016-01-22 09:47:49 +00:00
Robert Osfield
2791d280ae From Sukender, "Collada writer fix : Fixed wrong handling of duplicate names in Collada writer.
The uniquify() method was not checking if the new name was actually in use or not.

Collada with rename option : Added an option to Collada writer, to rename uncommon IDs (geometries, materials...) to something more compatible (especially Google Earth).
Characters which may be interpreted as an URI are replaced with '_'. Useful if you want to ensure names having spaces or slashes to behave correctly. This may be undesired if original naming must be somewhat kept (hence making it an option)."
2016-01-21 12:40:11 +00:00
Robert Osfield
4de2fc120d Merge branch 'master' of https://github.com/openscenegraph/osg 2016-01-20 17:51:03 +00:00
Robert Osfield
8fc287c1b7 Added asUpdate/Cull/EventVisitor and asCamera/asDrawable to osg::Object and usage of these within the code base to avoid dynamic_cast<> usage. 2016-01-20 17:49:10 +00:00
Robert Osfield
1219a6d3bf Added more osg::Object::as*() methods and usage of these through the code base to avoid use of dynamic_cast<> when using UpdateVisitor/CullVisitor/EventVIisitor etc. 2016-01-20 15:13:19 +00:00
Robert Osfield
e5a7c353ae From Jannik Heller, "This submission fixes a typo in the new GLObjectManager
sheduleGLObjectForDeletion(GLuint globj);

should be

scheduleGLObjectForDeletion(GLuint globj)"
2016-01-19 14:49:56 +00:00
Robert Osfield
84c202f2ab From Jannik Heller, "removed a const_cast that wasn't necessary" 2016-01-19 14:16:58 +00:00
Robert Osfield
55a8f4abbc Renamed DrawableUpdate/Event/Cull callbacks to use new include/osg/Callback versions 2016-01-19 11:39:28 +00:00
Robert Osfield
3e92c1fc43 Added osg::Object::asStateSet() implementation and usage to avoid use of dynamic_cast<> 2016-01-18 20:05:20 +00:00
Robert Osfield
340615de55 Replaced dynamic_cast<*Callback> with as*Callback() implementation/usage. 2016-01-18 19:04:28 +00:00
Robert Osfield
7409820a8f Added Simplifier::requiresDownSampling()/requiresDownSamplingImplementation() to make it possible for the
Simplfifer::ContinueSimplificationCallback to be able to decide whether up or downsampling is required,
removing the previous hardwards reliance on getSampleRatio<1.0.
2016-01-18 11:50:07 +00:00
Robert Osfield
8882fb697e From Wojciech Lewandowski, Visual Studio 2008 compatibility fix
Two fixed files:

osgPlugins/osgjs/JSON_Objects
osgPlugins/stl/ReaderWriterSTL.cpp.

They did not compile with VS 2008 (recent master from Github). It looks like they defined stdint types  (missing in VS 2008) but code using them also included <osg/Types> header. Errors were caused by minor differences in signed int definitions. I just removed own definitions and added include<osg/Types> instead. It solves the problem and makes the code clearer now.
2015-12-14 17:59:45 +00:00
scrawl
9aba89c88d Check for presence of occlusion query extension 2015-12-06 18:20:41 +01:00
Robert Osfield
c7f32e11f2 From Jordi Torres, Fix for missing header file in distribution
osg/TriangleLinePointIndexFunctor was not being installed because it was not added to the CMakeLists.txt
2015-11-23 13:15:05 +00:00
Robert Osfield
a1cfb037f4 Added support for copying include/osgViewer/config headers on make install. 2015-11-23 11:45:01 +00:00
Robert Osfield
0401ab4ce7 Fixed warning message.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15178 16af8721-9629-0410-8352-f15c8da7e697
2015-11-09 15:13:51 +00:00
Robert Osfield
15f866a322 Addded setting of the Locator CoordinateSystemType
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15177 16af8721-9629-0410-8352-f15c8da7e697
2015-11-09 15:10:50 +00:00
Robert Osfield
a4600e46f9 From Jannik Heller, fix typo of OSG_COMPILE_CONTEXTS.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15176 16af8721-9629-0410-8352-f15c8da7e697
2015-11-09 10:43:15 +00:00
Robert Osfield
1ad8ba358e From Mathias Froehlich, "Avoid per frame X11 roundtrips"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15173 16af8721-9629-0410-8352-f15c8da7e697
2015-11-05 14:38:04 +00:00
Robert Osfield
2e9c4b1aed Restructed the setting of the RenderStage ClearColor/ClearMask to make the code more readable and to avoid double setting of the ClearMask.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15171 16af8721-9629-0410-8352-f15c8da7e697
2015-10-26 11:41:48 +00:00
Robert Osfield
f893dc5ad1 From Alberto Luaces, "here are two minimal capitalization fixes for mingw cross-compilation, where case sensitivity matters."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15169 16af8721-9629-0410-8352-f15c8da7e697
2015-10-23 15:04:13 +00:00
Robert Osfield
85cdfff7a7 From Sebastian Messershmidt, "The uncommented pointer type QTimerEvent */*event*/ leads to a compiler error under visual studio 2010"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15167 16af8721-9629-0410-8352-f15c8da7e697
2015-10-23 11:07:21 +00:00
Robert Osfield
dd996a3289 Introduced CMake option OSG_PROVIDE_READFILE option that defaults to ON, but when switched to OFF disables the building of the osgDB::read*File() methods,
forcing users to use osgDB::readRef*File() methods.  The later is preferable as it closes a potential threading bug when using paging databases in conjunction
with the osgDB::Registry Object Cache.  This threading bug occurs when one thread gets an object from the Cache via an osgDB::read*File() call where only
a pointer to the object is passed back, so taking a reference to the object is delayed till it gets reassigned to a ref_ptr<>, but at the same time another
thread calls a flush of the Object Cache deleting this object as it's referenceCount is now zero.  Using osgDB::readREf*File() makes sure the a ref_ptr<> is
passed back and the referenceCount never goes to zero.

To ensure the OSG builds when OSG_PROVIDE_READFILE is to OFF the many cases of osgDB::read*File() usage had to be replaced with a ref_ptr<> osgDB::readRef*File()
usage.  The avoid this change causing lots of other client code to be rewritten to handle the use of ref_ptr<> in place of C pointer I introduced a serious of
templte methods in various class to adapt ref_ptr<> to the underly C pointer to be passed to old OSG API's, example of this is found in include/osg/Group:

    bool addChild(Node* child); // old method which can only be used with a Node*

    tempalte<class T> bool addChild(const osg::ref_ptr<T>& child) { return addChild(child.get()); } // adapter template method

These changes together cover 149 modified files, so it's a large submission. This extent of changes are warrent to make use of the Object Cache
and multi-threaded loaded more robust.



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15164 16af8721-9629-0410-8352-f15c8da7e697
2015-10-22 13:42:19 +00:00
Robert Osfield
572bb61a2d Added osg::flushAllDeletedGLObjects to clean up of graphics context after the existing osg::deleteAllGLObjects() to catch any cases where delete doesn't flush GL objects.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15150 16af8721-9629-0410-8352-f15c8da7e697
2015-10-08 15:58:24 +00:00
Robert Osfield
27962a73ee Introduced usage of OSG_INIT_SINGLETON_PROXY into DatabasePager::prototype() and Registry::instance(), removing the InitRegistry proxy object in src/osgViewer/ViewerBase.cpp.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15147 16af8721-9629-0410-8352-f15c8da7e697
2015-10-05 10:58:32 +00:00
Robert Osfield
ef6f2dbcfd Added fix for case when Renderer is assigned to a Camera that has now View
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15141 16af8721-9629-0410-8352-f15c8da7e697
2015-09-25 11:15:04 +00:00
Robert Osfield
e878e53cab From Curtis Rubel, "I would like to submit the attached file for inclusion in future releases of
OpenSceneGraph and the OpenThreads library.

The changes in the file simply remove a few ifndef's that currently
do not allow Linux systems to fully utilize the PThread real-time
scheduling API.

Since Linux now fully supports the PThread scheduling API it would
be beneficial to have it available to use as necessary.  I have
been testing this change since OSG release 3.3.7 and have not seen
any ill affects.

The Priority scheduling api is further protected by another ifdef:

#ifdef ALLOW_PRIORITY_SCHEDULING

that only appears to be defined in the pthreads implementation as
well.  This would make it unlikely that anyone would be affected
by this unless they are intentionally wanting to run with priority
scheduling.  In which case on Linux they would need to make
these same modifications themselves to utilize it to its full extent.

Attached file is for the current trunk as of this date.
"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15140 16af8721-9629-0410-8352-f15c8da7e697
2015-09-25 10:11:52 +00:00
Robert Osfield
7aae720636 Refactored the way that FrameStamp is managed in osgViewer::Renderer to avoid thread conflicts
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15138 16af8721-9629-0410-8352-f15c8da7e697
2015-09-25 10:09:27 +00:00
Robert Osfield
f626d85c2b From John Hedström,"Texture2DArray support for the .osg serializer"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15136 16af8721-9629-0410-8352-f15c8da7e697
2015-09-24 14:14:37 +00:00
Robert Osfield
62764a56c5 Added support for serializing Camera::ImplicitBufferAttachmentRenderMask and ImplicitBufferAttachmentResolveMask properties.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15135 16af8721-9629-0410-8352-f15c8da7e697
2015-09-24 10:52:35 +00:00
Robert Osfield
57d0538f1e Quietened down debug messages
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15134 16af8721-9629-0410-8352-f15c8da7e697
2015-09-24 10:48:57 +00:00
Robert Osfield
80e5338194 Fixed line endings.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15132 16af8721-9629-0410-8352-f15c8da7e697
2015-09-24 09:29:03 +00:00
Robert Osfield
161246d864 Refactored the GL object deletion management to use new osg::GraphicsObjectManager/GLObjectManager base classes, and osg::ContextData container.
This approach unifies much of the code handling the clean up of OpenGL graphics data, avoids lots of local mutexes and static variables that were previously required,
and enables the clean up scheme to be easily extended by users providing their own GraphicsObjectManager subclasses.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15130 16af8721-9629-0410-8352-f15c8da7e697
2015-09-23 09:47:34 +00:00
Robert Osfield
cb3396b0e5 From Jannik Heller, "I've hit what I believe to be a bug (or at the very least, an unintuitive behaviour) in the osg::Geometry copy constructor. I noticed it when using osg::clone on a Geometry with vertex buffer objects, and the copy flags DEEP_COPY_ARRAYS. To be precise, I add a Geometry to an osgUtil::IncrementalCompileOperation, then osg::clone the Geometry. I was getting reports from users of random crashes happening.
I believe the offending lines are in the osg::Geometry copy constructor:

    if ((copyop.getCopyFlags() & osg::CopyOp::DEEP_COPY_ARRAYS))
    {
        if (_useVertexBufferObjects)
        {
            // copying of arrays doesn't set up buffer objects so we'll need to force
            // Geometry to assign these, we'll do this by switching off VBO's then renabling them.
            setUseVertexBufferObjects(false);
            setUseVertexBufferObjects(true);
        }
    }

Toggling the vertex buffer objects off then on again actually touches not only the arrays controlled by DEEP_COPY_ARRAYS, but also the PrimitiveSets which are controlled by DEEP_COPY_PRIMITIVES. This means if the user has copyflags of only DEEP_COPY_ARRAYS, we are modifying arrays that belong to the original const Geometry& we are copying from. I believe this shouldn't be allowed to happen because we are using a const& specifier for the original Geometry.

In my case the osgUtil::IncrementalCompileOperation was trying to compile the geometry, while in the main thread a clone operation toggled the VBO's off and on, a crash ensues.

In the attached patch, you will find a more efficient handling of VBO's in the osg::Geometry copy constructor, so that only the Arrays that were actually deep copied have their VBO assigned, and no changes are made to Arrays that already had a valid VBO assigned. In addition, the DEEP_COPY_PRIMITIVES flag is now honored so that VBO's are set up correctly should a user copy a Geometry with only that flag.
"



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15129 16af8721-9629-0410-8352-f15c8da7e697
2015-09-04 15:35:24 +00:00
Robert Osfield
aa96046632 From Julien Valentin, "Serializing custom geometry i ran into a crash due to a
setVertexAttribArrayList(array) with array containing NULL vertexAttrib.
I added a test in order to avoid it


Code:
void Geometry::setVertexAttribArrayList(const ArrayList& arrayList)
{
    _vertexAttribList = arrayList;

    dirtyDisplayList();

    if (_useVertexBufferObjects)
    {
        for(ArrayList::iterator itr = _vertexAttribList.begin();
            itr != _vertexAttribList.end();
            ++itr)
        {
if(itr->get())//ADDED
            addVertexBufferObjectIfRequired(itr->get());
        }
    }
}
"

and

"The bug i ran into is a crash reading osgt Geometry with null vertexattribs.
The only thing i added is a not nul check on array passed to setVertexAttribArrayList."

--------------------This line, and those below, will be ignored--

M    src/osg/Geometry.cpp


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15121 16af8721-9629-0410-8352-f15c8da7e697
2015-09-04 14:34:45 +00:00
Robert Osfield
0532c93c8c Corrected the Subload::generateTextureObject() return type to make it consistent with Texture::generateTextureObject(..)
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15117 16af8721-9629-0410-8352-f15c8da7e697
2015-08-14 15:25:08 +00:00
Robert Osfield
051ee49098 Updated shaders from OpenSceneGraph-Data with refactor of workaround to NVidia driver bug
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15110 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 10:18:09 +00:00
Robert Osfield
eba1cc6e4f Refactored workaround of NVidia nan lenght() bug.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15096 16af8721-9629-0410-8352-f15c8da7e697
2015-08-11 20:06:38 +00:00
Robert Osfield
41f284b678 Moved FIND_PACKAGE(Boost) to within the individual Find scripts that actually need it rather in the root CMakeLists.txt.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15093 16af8721-9629-0410-8352-f15c8da7e697
2015-08-11 08:43:40 +00:00