Commit Graph

13581 Commits

Author SHA1 Message Date
Robert Osfield
33b838e437 From Jannik Heller, "This submission makes the osgFX::Technique traverse as a normal Group if the visitor is not a cull visitor.
As for motivation behind the change, I think it makes more sense that way because only the CullVisitor cares about rendering. Say an intersection visitor or update visitor only needs to traverse the subgraph once, not once for each pass. For these visitors there is no point in traversing the subgraph more than once, since it's exactly the same graph. Another motivation is the performance improvement had when an intersection visitor tests against a multipass Technique."

 Note about mods by Robert Osfield, "Changed dyanmic_cast<> and check against getTraversalType() to utilize the new asCullVisitor() instead to improve efficiency."
2016-03-01 11:57:02 +00:00
Robert Osfield
707c1a32aa Within the #pragmatic shader composition code added platform specific line endings for WIN32 vs all other platforms to "\r\n" and "\n" respectively. 2016-03-01 11:45:20 +00:00
Robert Osfield
d055216740 From Wee See and Robert Osfield, Introduced StatsHandler::collectWhichCamerasToRenderStatsFor(osgViewer::ViewerBase* viewer, osgViewer::ViewerBase::Cameras& cameras) method to make it
possible to customize which Cameras the handler renders stats for.
2016-03-01 11:06:39 +00:00
Robert Osfield
5d03bb9a2b From Jannik Heller, "This submission fixes a stuttering issue that may occur when occlusion query nodes are in view. The problem is that OSG retrieves the occlusion query result without first checking if it's available (GL_QUERY_RESULT_AVAILABLE). Thus, the driver has to sync with the GPU i.e. wait for all queued draw calls to complete. This is particularly bad in V-Synced situations where the driver may be using multi frame queueing techniques - coupled with the fact that OSG only runs an occlusion query every 5th frame, results in very unpleasant stuttering in some situations.
The change I made is to check GL_QUERY_RESULT_AVAILABLE before retrieving the query, to ensure that there won't be a stall. If the query result is not available yet, we'll leave it alone and try again in the next frame.

Had to make a few more changes than I'd liked, mostly because the TestResult mechanism wasn't designed for holding on to query objects for more than one frame. As well, I'm thinking that RetrieveQueriesCallback and ClearQueriesCallback could be merged together, if we wanted to go for more refactoring. For though now my strategy is to make as little changes as possible. Let me know what you think of the patch."
2016-03-01 10:37:41 +00:00
Robert Osfield
be98c884bd From Ognjen Kostic, "Some android phones have no support for OES_element_index_uint extension that is required if glDrawElements is to be called with GL_UNSIGNED_INT for element type.
In OSG 3.4, osgText::Text( ::_quadIndices) uses DrawElementsUInt that will fail on these devices and no text will appear - tested on Samsung Galaxy Trend 2 SM-G313HN.

When DrawElementsUInt is replaced with DrawElementsUShort it works, although I'm not sure if this can cause other problems with some fonts.

Fix:
- In include\osgText\Text, line 316:
        replace: "osg::ref_ptr< osg::DrawElementsUInt > _quadIndices;"
        with:    "osg::ref_ptr< osg::DrawElementsUShort > _quadIndices;"

- In src\osgText\Text.cpp, line 2094:
        replace: "_quadIndices = new DrawElementsUInt(PrimitiveSet::TRIANGLES);"
        with:    "_quadIndices = new DrawElementsUShort(PrimitiveSet::TRIANGLES);"
"
2016-03-01 10:21:14 +00:00
Robert Osfield
f73d1fb7ea Refactored the parsing of #pragma to address problems handling #pragma without () usage. 2016-02-29 15:06:36 +00:00
Robert Osfield
370cb7bc6e Fixed debug build 2016-02-24 16:01:00 +00:00
Robert Osfield
31fad1476f From Jannik Heller, osgParticle freeze on cull fix, ammended by Robert Osfield to make if statements a little more readable. 2016-02-23 10:12:31 +00:00
Robert Osfield
e8ac5af41b From Anish Thomas, "Underflow bug in BufferObject pool usage" 2016-02-22 09:19:51 +00:00
Robert Osfield
78aaf7955e From Bjorn Blissing, "I stumbled upon a strange ifdef-case inside Geometry.cpp
Currently the code looks like this:

Code:
    DrawElementsUByte* elems = new DrawElementsUByte(PrimitiveSet::TRIANGLES);
    elems->push_back(0);
    elems->push_back(1);
    elems->push_back(2);

    elems->push_back(2);
    elems->push_back(3);
    elems->push_back(0);
    geom->addPrimitiveSet(elems);
    geom->addPrimitiveSet(new DrawArrays(PrimitiveSet::QUADS,0,4));

The second condition looked really strange (note the ! sign), and results in pretty much all code paths uses the first code. The correct version should probably be that only people with GLES1 or GLES2 should use GL_TRIANGLES to simulate quads. And all others should use the native support for GL_QUADS.
"
2016-02-19 15:01:27 +00:00
Robert Osfield
09bde307de To the COLLADA_INCLUDE_DIR search paths added the directories:
/usr/local/include/collada-dom2.4
    /usr/local/include/collada-dom2.2
    /opt/local/include/collada-dom2.4
    /opt/local/include/collada-dom2.2
    /usr/include/collada-dom2.4
    /usr/include/collada-dom2.2

To enable recent versions of the DOM to be found in their new install locations.
2016-02-19 12:19:12 +00:00
Robert Osfield
58f940c0f1 Updated the AuthenticationDetails::HttpAuthentication enum to reflect current libcurl values 2016-02-18 19:53:36 +00:00
Robert Osfield
9bdb3f55dd Replaced (long int) with more portable (GLint64) 2016-02-18 10:57:19 +00:00
Robert Osfield
08a1c45605 From Tony Vasile, "This is a fix for the handling of OpenFlight files with switches whose children have a transformation matrix on them. It may break other things and I have only tested this with one of my models." 2016-02-18 10:04:04 +00:00
Robert Osfield
93b10f35c1 From Mourad Boufarguine, "This submission fixes typos in Uniform::getTypename() method in Uniform.cpp (missing "r" in usampler names)." 2016-02-18 09:25:48 +00:00
Robert Osfield
51136204d2 Renamed zero and one to transparentCount and opaqueCount to avoid confusion in their meaning and usage. 2016-02-18 08:50:06 +00:00
Robert Osfield
c297fd18b2 Fixed warning 2016-02-17 17:47:38 +00:00
Robert Osfield
4f36b553b3 Commented out unused functions and variable. 2016-02-17 17:44:05 +00:00
Robert Osfield
f6372f2fab Introduced a separate GLuint64 one variable to get around a 32bit build timer issue under Windows. 2016-02-17 15:59:13 +00:00
Robert Osfield
98ca24ff4e From Laurens Voerman, "a few additions in the repository (asDrawableEventCallback / asDrawableCullCallback) made this version a bit outdated,
so I get so new warnings. This update can fix those warnings."
2016-02-17 15:09:14 +00:00
Robert Osfield
67202b2662 From Romain Ouabdelkader, "This is a fix for osgText to calculate kerning and to load glyph3D with the text's font resolution.
Font::getKerning(...), Font::getGlyph3D(...) doesn't ask for a font resolution so it uses the last font resolution requested by Font:: getGlyph(...).
This can leads to different results depending of the precedent call to Font::getGlyph(...).
See http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2016-January/271952.html for more infos.

This fix adds a font resolution parameter to Font::getKerning(...), Font::getGlyph3D(...) and to the font implementations.
This was made under the base revision r15182."
2016-02-15 13:30:39 +00:00
Robert Osfield
937ef73521 From Laurens Loerman, Fix for "Visual Studio 2013 gives me a large amount (2778) of warnings about inheritance via dominace (C4250)." 2016-02-15 12:37:05 +00:00
Robert Osfield
9bde2ef631 Added support for NodeMask to osg::Drawable serializers 2016-02-11 16:25:47 +00:00
Robert Osfield
3e0435febd From Jannik Heller , GL object deletion fix.
"This submission changes deleteGLObject calls to scheduleGLObjectForDeletion, to ensure that the actual deletion happens from the correct thread (the graphics thread). This fixes the leak I reported in http://forum.openscenegraph.org/viewtopic.php?t=15567 , and possibly also http://forum.openscenegraph.org/viewtopic.php?t=15564."
2016-02-05 20:29:22 +00:00
Robert Osfield
8cefa05e3a From "Jannik Heller", I just updated to the latest commit and noticed that drawable cull callbacks were no longer working. As it turns out there was a missing implementation of the asDrawableCullCallback() and asDrawableEventCallback(), after implementing these methods everything is working as expected. 2016-02-04 20:15:14 +00:00
Robert Osfield
aa17f5441a From Laurens Voerman,
"E:\osg\osgSvnGit\OpenSceneGraph\include\osg/Callback(286): warning C4099: 'osg::DrawableUpdateCallback' : type name first seen using 'class' now seen using 'struct' (E:\osg\osgSvnGit\OpenSceneGraph\src\osgUtil\RenderBin.cpp)
          E:\osg\osgSvnGit\OpenSceneGraph\include\osg/Callback(27) : see declaration of 'osg::DrawableUpdateCallback'

attached is a modified version of include/osg/Callback:
changing
- struct OSG_EXPORT DrawableUpdateCallback : public virtual Callback
- {
to
+ class OSG_EXPORT DrawableUpdateCallback : public virtual Callback
+ {
+ public:

and the same changes for DrawableEventCallback and DrawableCullCallback"
2016-02-04 19:53:13 +00:00
Robert Osfield
e00977f3c2 Added OSG_EXPORT 2016-02-04 19:40:14 +00:00
Robert Osfield
e1eaeced8c From Laurens Voerman, "While compiling with Visual Studio 12 (aka 2013 update 3) I get a these errors:
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(364): error C2039: 'min' : is not a member of 'std'
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(364): error C3861: 'min': identifier not found
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(372): error C2039: 'min' : is not a member of 'std'
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(372): error C3861: 'min': identifier not found
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(381): error C2039: 'min' : is not a member of 'std'
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(381): error C3861: 'min': identifier not found
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(436): error C2039: 'min' : is not a member of 'std'
E:\osg\osgSvnGit\OpenSceneGraph\src\osg\PrimitiveSet.cpp(436): error C3861: 'min': identifier not found

I suggest to replace std::min by osg::minimum, attached is a (zipped) modified version of src/osg/PrimitiveSet.cpp
applies to the git reposetory only (updated 1 Feb 2016 ae6bade641ee4d8436ef69e7a7a347be81195a47 )

"
2016-02-04 19:38:23 +00:00
Robert Osfield
dcadd69c5a Added releaseGLObjects(..) and resizeGLObjectBuffers(..) to osgShadow::ShadowTechnique's 2016-02-04 17:52:44 +00:00
Robert Osfield
f373bcf23d Added osg::resizeGLObjectBuffers(..) and osg::releaseGLObjects(..) functions to make it easier to call these methods on objects which ref_ptr<> or C pointers are held for. 2016-02-04 17:36:33 +00:00
Robert Osfield
5ff6fe7c68 Commented out debug message 2016-02-04 17:35:32 +00:00
Robert Osfield
f8306f145a Added NodeVisitor::g/setValueMap and g/setValueStack, and osg::PushPopObject and osg::PushPopValue helper classes for pushing/popping values to the NodeVisitor's ValueStack. 2016-02-04 13:12:33 +00:00
Robert Osfield
b4eb8d4597 Improved the speed of the ValueObject get/setting by utilizing typeid() and static_cast<> in place of original dynamic_cast<>'s 2016-02-04 13:10:28 +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
bc33515360 Added C++ gitignore entries 2016-01-26 09:57:26 +00:00
Robert Osfield
e4a59bcd9d Added .gitignore to queiten down git status reports 2016-01-25 19:38:44 +00:00
OpenSceneGraph git repository
7455db439a Merge pull request #42 from podsvirov/topic-upgrade-doxygen-configuration
From Konstantin Podsvirov, "Corrects an incorrect parsing of header files
without an extension when used doxygen larger 1.8.3.1"
2016-01-25 14:18:58 +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