Commit Graph

3878 Commits

Author SHA1 Message Date
Robert Osfield
90703f99ee Added missing initializer for _epsilon 2013-08-01 17:38:34 +00:00
Robert Osfield
07365c1073 Added osg::RenderInfo::pushRenderBin()/popRenderBin() and RenderInfo::getRenderBinStack() and getCameraStack() access methods for getting access to the current RenderBin/RenderStage. 2013-08-01 07:19:45 +00:00
Robert Osfield
364e2765e7 Added Intersector::get/setEpsilon(double) to allow users to control what epsilon is used by the LineSegmentIntersector when doing testing of itersections with bounding boxes 2013-07-31 13:11:49 +00:00
Robert Osfield
9c9939e5d4 From Aurelien Albert, "Here is the code to get access to OpenGL handle of an osg::FrameBufferObject" 2013-07-31 07:11:07 +00:00
Robert Osfield
75fd039dba Added GL2Extensions::isDrawBuffersSupported() and usage of this in FrameBufferObject.cpp to prevent crash under GLES2 when users attempt to use MRT when it's not supported 2013-07-24 13:02:32 +00:00
Robert Osfield
8d3e46dfac Updated SO version for post 3.2 era. 2013-07-24 12:25:18 +00:00
Robert Osfield
75226e6b68 Added getCallbacks() methods 2013-07-24 12:17:06 +00:00
Robert Osfield
a802729562 Added FRAME_BUFFER_OBJECT enum 2013-07-22 10:15:59 +00:00
Robert Osfield
95d5a19319 Updated OpenThreads version 2013-07-22 10:15:44 +00:00
Robert Osfield
cda0b615de Updated version number for svn/trunk to 3.3.0 for all new feature development 2013-07-19 14:55:36 +00:00
Robert Osfield
95a5f3ed0f Updated version number to 3.2.0-rc1 in prep for create the 3.2 branch, and 3.2.0-rc1 2013-07-19 14:06:11 +00:00
Robert Osfield
170cbb9018 Updater version for 3.1.10 dev release 2013-07-19 10:17:26 +00:00
Robert Osfield
2f1d3626de From Johannes Scholz, "as we need to dynamically add and remove Effects to and from our Application, I created a small patch for osgFX/Registry to add the osgFX::Registry::removeEffect(effect*) method and extended osgFX::Registry::Proxy to call removeEffect upon its destruction." 2013-07-19 06:56:13 +00:00
Robert Osfield
0175c820af From Mathieu Marache, "we found that events where not caught when running in ON_DEMAND frame scheme : GraphicsWindow::checkEvents() always return false and GraphicsWindowQt doesn't overload it.
here is a simple fix that will return if the list is empty or not and will match the comment in checkEvents()
2013-07-19 06:20:46 +00:00
Robert Osfield
82f7031ab5 From Lionel Lagarde, "The extension name is misspelled. It conflicts with GLEW." 2013-07-18 16:27:17 +00:00
Robert Osfield
095b64dc41 From Aurelien Albert, "Recently I had to integrate a client OpenGL library with OSG. For textures and other StateAttribute I've done that by subclassing osg::StateAttribute and this works well.
But for glPrograms, in order to get all osg's uniform management system to work, I had to subclass osg::program::PerContextProgram.

Here is a modified version of this class, which add some "virtual" method to allow easy subclassing."
2013-07-02 10:32:53 +00:00
Robert Osfield
08f741bcd9 From Pjotr Svetachov, "The binding of arrays is always set to BIND_UNDEFINED when using the array constructor because the binding parameter is ignored. Here is a fix." 2013-07-02 09:44:46 +00:00
Robert Osfield
d3c2896651 Added SceneView::Options enum enetries APPLY_GLOBAL_DEFAULTS and CLEAR_GLOBAL_STATESET to control whether a _globalStateSet->clear() and _globalStateSet->setGlobalDefaults() should be called.
osgViewer::Renderer doesn't use these enum settings so now no longer has a calls StateSet::clear() or StateSet::setGlobalDefaults() on the osg::Camera's StateSet.  Previously these were being
called and breaking the ability to attached state to Camera's StateSet.
2013-07-02 09:27:14 +00:00
Robert Osfield
ff3a6f4eb1 Removed BIND_INSTANCE_DIVISOR as they don't yet have any implementation backend to support them. 2013-07-01 10:22:34 +00:00
Robert Osfield
a64b412885 Reverted the usage of OSG_UNUSED and OT_UNUSED as in hindsight these should never have been merged. Adding code to quieten
inappropriate warnings is a bad programming practice and does not desrve a place in the OSG code base.
2013-07-01 08:21:13 +00:00
Robert Osfield
2e41e3f656 From Gill Peacegood, "fix for a memory leak in the DelaunayConstraint class" 2013-06-28 14:21:43 +00:00
Robert Osfield
4493cc817d From Laurens Voerman, "the current version of BufferObject causes a huge amount of warnings in Visual Studio 2012 like:
OpenSceneGraph/include\osg/BufferObject(701): warning C4138: '*/' found outside of comment (E:\osg\osgSvn\OpenSceneGraph\src\osg\Array.cpp)

adding a space before /* fixes the problem
        void removeClient(osg::Object * /*client*/) { --_numClients; }
"
2013-06-28 14:08:36 +00:00
Robert Osfield
353b18b27b From Aurelien Albert, Added support for glPrimitiveRestartIndex.
"The idea of this new OpenGL feature is :

- set RestartIndex = "n"
- draw elements strip
  -> when the index is "n", the strip is "stopped" and restarted

It's very usefull for drawing tiles with a single strip and a "restart" at the end of each row.

The idea a an OSG StateAttribute is :

Usually we use to build geometry from code, because software modelers rarely support it (and 3d file formats doesn't support it) :

-RootNode <= "PrimitiveRestartIndex=0"     // So now, we know that our restart index is 0 for all drawables under this node
|
- Drawable 1 : triangles => as usual
|
- Drawable 2 : triangles strip => as usual
|
- Drawable 3 : triangles strip + "GL_PRIMITIVE_RESTART" mode = ON => use the restart index
|
- Drawable 4 : triangles strip + "GL_PRIMITIVE_RESTART" mode = ON => use the restart index
|
- Drawable 5 : triangles strip => as usual


With a StateAttribute, it's easy for the developper to say "0 will be my restart index for all this object" and then activate the mode only on some nodes.

The main problem is if you set and restart index value which is not included in the vertex array (for exemple set restart index = 100 but you have only 50 vertex). There is no problem with OpenGL, but some OSG algorithms will try to access the vertex[100] and will segfault.

To solve this, I think there is two ways :

1/ add restart index in osg::PrimitiveSet and use this value in all algorithms. It's a lot of work, maybe dangerous, and it concern only a few situations : developpers who use this extension should be aware of advanced OpenGL (and OSG) data management

2/ use a StateAttribute, and choose a "correct" restart index. In my applications, I always use "0" as a restart index and duplicate the first vertex (vertex[0] = vertex[1]). So there is no difference for OpenGL and all OSG algorithms works properly.
"
2013-06-28 13:43:46 +00:00
Robert Osfield
097aedf23c From David Callu, warning fixes and removal of spaces at end of lines. 2013-06-28 12:00:43 +00:00
Robert Osfield
d82768417d From David Callu, "in osgViewer::WoWVxDisplay::WoWVxDisplay(unsigned int type=20, unsigned int screenNum=0)
screenNum is unused.

fix attached.
"
2013-06-28 10:59:01 +00:00
Robert Osfield
db1f2c5eb1 From David Callu, added support for glVertexAttribLPointer and glVertexAttribIPointer, utilized via osg::Array::setPreserveDataType(true); 2013-06-28 10:51:22 +00:00
Robert Osfield
4fd6566e00 From David Callu, serializer support for new Vec* and Vec*Array classes 2013-06-28 08:57:42 +00:00
Robert Osfield
775c1443eb From David Callu, "Added Vec3ub, Vec3us, Vec4us, Vec2ub and Vec2us classes" 2013-06-27 17:37:03 +00:00
Robert Osfield
9f13e2fcb9 From Lionel Lagarde, "Support for paging and shared PBO"
"The attached file contains:
- a per-context read counter in GLBufferObject::BufferEntry
- a global client counter in BufferData
- the glue between Texture* and Image client counter
"
2013-06-27 16:44:32 +00:00
Robert Osfield
57947ea75c From Aurelien Albert, added passing on of the gl array normalize to OpenGL when uses vertex attribute aliasing. 2013-06-27 15:18:38 +00:00
Robert Osfield
90ceb88c12 Replaced deprecatated osg::Geometry::get*Binding() calls. 2013-06-27 14:46:16 +00:00
Robert Osfield
9f0bbbf831 Added osg::getBinding(osg::Array* array) convinience function that returns the Array::getBinding() is the array is not NULL, otherwise returns BIND_OFF. 2013-06-26 17:54:35 +00:00
Robert Osfield
bead0740f2 From Aurelien Albert, "This submission allow the user to specify how to setup VertexAttributeAliasing.
I think this is necessary on OpenGL 3.2+ since this is no more "default" locations in the OpenGL specs.

The default behaviour stay the same.

There is a few new methods on osg::State :

- resetVertexAttributeAlias : reset all vertex alias to osg's default ones
- set**Alias : set a vertex attribute alias configuration
- setAttributeBindingList : set the attribute binding list (allow to specify an empty list if you're using "layout" qualifier in glsl code to specify the bindings. This save some CPU operations)"
2013-06-26 13:00:12 +00:00
Robert Osfield
831a552dfa Removed unused methods 2013-06-26 12:59:40 +00:00
Robert Osfield
3de0ec1904 Removed #include<osg/Notify> as it's nolonger required in the header 2013-06-25 16:19:00 +00:00
Robert Osfield
1793466442 With assistance from Sukender, moved the depreacted osg::Geometry vertex indices and AttributeBinding definitions out into a separated namespace/class so to use
deprecated features you should now use deprecated_osg::Geometry in place of osg::Geometry.
2013-06-25 16:10:24 +00:00
Robert Osfield
addf8b1d2d Updatd SO_VERSION to reflect changes in ABI from merging submissions. 2013-06-24 12:30:08 +00:00
Robert Osfield
1e715b6877 From Sukender, "I recently pulled from the GIT mirror and found that "OSG_USE_DEPRECATED_GEOMETRY_METHODS=OFF" hides a little mistake: there is a "#include <osg/Notify>" inside the "osg" namespace, in inlude/osg/Geometry.
"
2013-06-24 12:27:19 +00:00
Robert Osfield
0896bd17bd From Lars Nillson, "The change in this submission is to take care of the setting given by a call to
setMaximumNumOfObjectsToCompilePerFrame(…).


Sometimes if you give a low number, more than the expected number of objects are compiled."
2013-06-24 11:14:13 +00:00
Robert Osfield
261db64a9e From Farshid Lashkari, "I've attached a small patch that extends the Image::readImageFromCurrentTexture method to support more depth texture pixel formats (16, 24, 32, 32F). In order to compile, I moved some depth pixel format definitions from FrameBufferObject to Image.
"
2013-06-24 09:51:30 +00:00
Robert Osfield
3c1a89604b From Christian Noon, "Got a simple patch for correcting a problem with the USE_COMPRESSOR_WRAPPER() macro in the osgDB::Registry. The problem is that the wrapper declaration doesn't match the one defined in the REGISTER_COMPRESSOR() method in the osgDB::ObjectWrapper method. This patch fixes the wrapper declaration so they both match properly. I ran into this problem using compressed files in an iOS application where all the libraries and plugins need to be built statically." 2013-06-24 09:31:34 +00:00
Robert Osfield
48020eed9e Introduced typedef's to make the code more readble and maintanable 2013-06-24 09:02:32 +00:00
Robert Osfield
4044fd5a74 From Wang Rui, "The file attached includes two new features for the serialization IO functionality. First, custom serializer version control should work now, just by defining a new REGISTER_CUSTOM_OBJECT_WRAPPER macro. For example:
// A custom class
namespace CustomDomain {

class MyGroup : public osg::Group
{
public:
    META_Node( CustomDomain, MyGroup );

    void setMyName( const std::string& n );
    const std::string& getMyName() const;

    void setMyID( int id );
    int getMyID() const;

    ...
};

}

// The serialization wrapper using a custom domain name
REGISTER_CUSTOM_OBJECT_WRAPPER( MyDomain,
                                CustomDomain_MyGroup,
                                new CustomDomain::MyGroup,
                                CustomDomain::MyGroup,
                                "osg::Object osg::Node osg::Group CustomDomain::MyGroup" )
{
    ADD_STRING_SERIALIZER( MyName, std::string() );
    {
        UPDATE_TO_VERSION_SCOPED( 1 );  // Updated for a new domain version
        ADD_INT_SERIALIZER( MyID, 0 );
    }
}

Save the class instance as follows:
osgDB::writeNodeFile( *myGroup, "serializer_test.osgt", new osgDB::Options("CustomDomains=MyDomain:1") );

The output file will include the domain version definition and all the class data, and can be read back. We can also force setting the domain version by the CustomDomains option while reading the saved files. If we save the class instance without any options, MyID will be ignored because the default domain version is 0.

This may help third-party libraries like osgEarth to maintain their own serializers without regarding to the OSG soversion changes.

Another feature added is a more robust binary format, which in fact adds a size-offset at each block's beginning. When there are problems or unsupported data types while reading, we can now directly jump to the block end indicated by the offset value. So a .osgb file will automatically ignore bad data and read remains as normal (at present it will fail at all). This feature will not break the backward compatibility, and can be disabled by setting "RobustBinaryFormat=false" while writing out.

Hope these changes can work smoothly with present and future community projects. Maybe we should also consider have an osgserializer example to test and demonstrate all things we can do now."
2013-06-24 08:48:55 +00:00
Robert Osfield
0a4bf71fbb Updated version number after dev release 2013-06-21 19:35:56 +00:00
Robert Osfield
9d9543ca0a From Pjotr Svetachov, introduced use of osg::observer_ptr<osg::Camera> in place of osg::Camera* 2013-06-21 13:59:18 +00:00
Robert Osfield
15fea448d8 Added new osg::Array::Binding parameter to osg::Geometry::set*Array(osg::Array* array, osg::Array::Binding binding=osg::Array::BIND_UNDEFINED) methods to make it easier for the user
to set the binding without the need to call the deprecated osg::Geometry::set*Binding(osg::Geometry::AttributeBinding)
2013-06-21 09:43:15 +00:00
Robert Osfield
64b0e1afd0 From Vladimir Chebaev, "I worked with osg::Particle and see that this class has setter osgParticle::setTextureTileRange and has no getters for startTile and endTile. This can be very uncomfortable.
I attached file with two getters."
2013-06-20 12:15:57 +00:00
Robert Osfield
bab56f9854 From Jan Ciger, compilation fix for Qt 5.0.2 2013-06-20 09:30:31 +00:00
Robert Osfield
df075ef9bb Cleaned up usage of BIND_PER_PRIMITIVE where possible. 2013-06-19 16:24:59 +00:00
Robert Osfield
9c127c2bca From Magnus Kessler, typo fixes to doxygen docs and comments 2013-06-19 12:32:40 +00:00