Commit Graph

2004 Commits

Author SHA1 Message Date
Robert Osfield
3531bec43c Added State::getMaxTextureCoords() and State::getMaxTextureUnits() inline methods. 2014-01-07 11:01:32 +00:00
Robert Osfield
afab78ed40 Preliminary support for wrapping methods in the lua script plugin. 2013-12-25 17:36:32 +00:00
Robert Osfield
723ecfad8d Removed the unused Texture::Extensions::numTextureUnits() 2013-12-16 11:28:10 +00:00
Robert Osfield
91033a3a1f From Kristofer Tingdahl, Build fix for svg plugin that makes sure the version of librsvg is at sufficient, and fixed a missing virtual destructor warning. 2013-11-22 09:48:02 +00:00
Robert Osfield
d3a7115c45 Removed trailing spaces, added missing return to last lines 2013-11-22 09:38:50 +00:00
Robert Osfield
a54b999ccc Added Geometry::drawVertexArraysomplemetation(..) and drawPrimitivesImplemenation(..) methods that are called from drawImplementation(..). These new vertex methods
allow subclasses from osg::Geometry to specialize the vertex array setup or how the primitives are dispatched to OpenGL.
2013-11-21 10:31:34 +00:00
Robert Osfield
d8c1c4bbeb From Stephan Huber, compile fix for OpenGL ES on iOS. 2013-11-18 13:31:44 +00:00
Robert Osfield
80c45ad46a Added BoundingBox::contains(const vec_type& v, value_type epsilon) method with new epsilon parameter to make it easier to test for containment in the presence of numerical errors 2013-11-18 12:45:04 +00:00
Robert Osfield
6f6c44446c Introduced a cast(T) method into the ImageUtils template functor to allow code reading images to handle casting from source data to a form that a user can use more conviently 2013-11-06 09:23:21 +00:00
Robert Osfield
ff8fe4143e From Likasz Izebski, "added support for etc2/eac compression" 2013-10-28 12:03:55 +00:00
Robert Osfield
c45f3aa4fb Merged changes to DisplaySettings from Stephan Huber in prep for controlling the menu hiding behaviour under OSX.
Added new WindowSystemInterface::setDisplaySettings() method to provide a mechanism for passing settings onto the WindowSystemInterface so it can then set up the system appropriately.

Added assignment of the DisplaySettings to the WindowSystemInterface in Viewer/ComppsiteViewer::realize().
2013-10-22 19:12:34 +00:00
Robert Osfield
4493d11ca3 Added State::releaseGLObjects() and ShaderComposer::releaseGLObjects() to avoid problems with cleanup of graphics context 2013-10-21 16:35:12 +00:00
Robert Osfield
9146ba7d44 From Vladimir Chebeav, fix for removal of nested callbacks 2013-10-18 08:37:18 +00:00
Robert Osfield
08ec0a11bf From Laurens Voerman, compile fix for VisualStudio 2013-10-10 14:45:57 +00:00
Robert Osfield
b5b020a138 Updated version number after 3.3.0 dev release 2013-10-04 16:28:49 +00:00
Robert Osfield
0eb435e118 Re-ordered the public/protected sections to keep the public section all together 2013-10-02 11:28:38 +00:00
Robert Osfield
5015ec4b5d From Aurelien Albert, "I'm working with OSG and a customer low-level OpenGL library.
To make easier "lazy apply" on the customer OpenGL shaders, the easiest way was to add an accessor to current OSG state's UniformMap.

I've also added accessors for modes and texture, since it could be usefull in the same way.

All methods are const, so I think there is no side-effects."
2013-10-01 17:01:21 +00:00
Robert Osfield
6d8f40d13a Added support for passing parameters in and out of scripts.
Implemented support for osg::ValueObject in LuaScriptEngine.
2013-09-24 15:17:42 +00:00
Robert Osfield
796314c339 Changed NodeVisitor so that is subclasses from osg::Object rather than osg::Referenced to enable it to be used with serialization and scripting 2013-09-24 15:08:23 +00:00
Robert Osfield
6bc413530e Added compoundClassName() convinience method to standardize the generation of the compoundClassName. 2013-09-20 10:25:23 +00:00
Robert Osfield
bd7ec9c5f7 Added initial cut of basic scripting support, introducing an osg::Script object to wrap up the individual scripts, osg::ScriptCallback for assigning a Script as node callback and an osg::ScriptEngine base class that plugins implement to provided support for specific scripting languages.
Provided are lua, python and V8 (for javascript) plugins that just open up enough of a link to the respective libs to run a script, there is no scene graph <-> script communication in current implementation.
2013-08-09 16:51:06 +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
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
a802729562 Added FRAME_BUFFER_OBJECT enum 2013-07-22 10:15:59 +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
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
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
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
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
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
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