Commit Graph

2299 Commits

Author SHA1 Message Date
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
Robert Osfield
0a4bf71fbb Updated version number after dev release 2013-06-21 19:35:56 +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
df075ef9bb Cleaned up usage of BIND_PER_PRIMITIVE where possible. 2013-06-19 16:24:59 +00:00
Robert Osfield
c8fa3244c2 From Jan Ciger, "I have found a problem when building OSG with Qt 5 support. Qt has the
following in the qopengl.h header:

# include <QtGui/qopengles2ext.h>
# ifndef GL_DOUBLE
#  define GL_DOUBLE GL_FLOAT
# endif
# ifndef GLdouble
typedef GLfloat GLdouble;
# endif

Unfortunately, when building for normal OpenGL (not GL/ES!) on Windows
with MSVC2012, GLdouble is not defined (it is not a macro but typedef)
and the code above produces a conflicting definition, making the
compile fail. I am attaching a bit hackish workaround for this problem
in osg/GL "
2013-06-19 12:19:28 +00:00
Robert Osfield
635993038a Changed header guard back to original, and removed deprecated enum 2013-06-18 14:52:26 +00:00
Robert Osfield
390316e579 Removed experiment GeometryNew as it's no longer required. 2013-06-18 11:49:03 +00:00
Robert Osfield
7d40c7258f Clean up up osg::Geometry, removing long deprecated support for array indices and BIND_PER_PRIMITIVE binding that forced OpenGL slow paths. osg::Geometry is now smaller and only supports OpenGL fasts paths.
New methods osg::Geometry::containsDeprecatedData() and osg::Geometry::fixDeprecatedData() provide a means for converting geometries that still use the array indices and BIND_PER_PRIMITIVE across to complient
versions.

Cleaned up the rest of the OSG where use of array indices and BIND_PER_PRIMITIVE were accessed or used.
2013-06-18 11:18:28 +00:00
Robert Osfield
1a7f2fcb3e Introduced new osg::PatchParameter StateAttribute class to wrap up glPatchParameter associated state.
Note, osg::Program::setParameter(GL_PATCH_VERTICES,num); is nolonger support and should be replaced by using the new PatchParameter class.
2013-06-11 10:52:37 +00:00
Robert Osfield
8cf9600e2c Fixed remove and add callback so they properly handle nested callbacks 2013-06-10 10:37:08 +00:00
Robert Osfield
49cfece9d4 Reorder member variables to ensure better packing in memory. 2013-06-05 07:55:05 +00:00
Robert Osfield
4f1e6b28e8 Moved the Array::AttribDivisor into the Array::Binding enum to avoid conflicts in settings between Binding and AttribDivisor.
Removed the vertify bindings/shared arrays handling from GeometryNew
2013-06-05 07:27:35 +00:00
Robert Osfield
eb693f6a92 Updates to GeometryNew, Array and ArraDispatchers to clean up GeometryNew so that is no longer uses ArrayData. 2013-06-04 19:04:26 +00:00
Robert Osfield
cbea97009c Added s/getNormalize(), s/getPreserveDataType(), s/getAttribDivisor() and s/getBinding() to osg::Array base class in preperation for refactor of osg::Geometry and introduction of new features. 2013-06-04 14:55:57 +00:00
Robert Osfield
caa3a06c70 Introduced GeometryNew which is a cleaned up version of Geometry that removes support for array indices.
GeometryNew is only temporary and will be renamed to Geometry on the completion of refactoring work and feedback from community.
Ported osggeometry across to use GeometryNew.
2013-06-04 09:32:59 +00:00
Robert Osfield
2dc53ceabb From Aurelien Albert, Added support for texture swizzle. 2013-06-03 15:10:53 +00:00
Robert Osfield
9b67578c47 Updated version and so_version in prep for 3.1.8 developer release 2013-06-03 14:38:23 +00:00
Robert Osfield
4697b3c68b From Art Tevs, int and uint Vec classes 2013-06-03 11:38:20 +00:00
Robert Osfield
efe52842fa From Aurelien Albert, "This submission is made against trunk version and add the loading of "glVertexAttribDivisor" extension." 2013-06-03 09:19:46 +00:00
Robert Osfield
47f574429a From Marcin Prus and Robert Osfield, moved the key parts of the .dds plugins computeRowWidthInBytes implementation into the osg::Image::computeImageSizeInBytes(..) to
address bugs in the computation of image size.
2013-05-28 14:14:45 +00:00
Robert Osfield
18c37d14cd Moved quad buffer definitions into include/osg/Camera 2013-05-27 08:10:42 +00:00
Robert Osfield
1284a0dd40 From Pawel Ksiezopolski, first email: "This submission adds texture buffer object ( defined in GL_ARB_texture_buffer_object extension ) to the osg::Texture* family.
TextureBuffer objects may use osg::Texture::bindToImageUnit(), so GLSL shaders are able to use not only texelFetch() function , but also functions defined in GL_ARB_shader_image_load_store extension : imageLoad(), imageStore(), imageAtomicAdd() etc."

second email: "After a while I found that osg::Texture::applyTexParameters() used with TextureBuffer may cause some OpenGL errors ( applying texture filters and wraps to TextureBuffer makes no sense ) so I fixed it."
2013-05-22 12:49:46 +00:00
Robert Osfield
c238a7cca2 From Michael Kapelko, "The provided patch (against SVN revision 13380) adds missing constness to returning calls (without it the user code does not compile)." 2013-05-14 16:18:41 +00:00
Robert Osfield
1a683e2f83 From Ulrich Hertlein, "Attached is a patch that introduces 'static_cast<unsigned int>' on some instances where
the code returns '.size()' of a std::vector.  This caused some warnings when using clang++
on OS X."
2013-05-14 16:12:21 +00:00
Robert Osfield
f1d5ba4278 Updated version after dev release 2013-05-14 13:34:54 +00:00
Robert Osfield
9402efe38e Added DisplaySettings::KeystoneHint flag that can be set via --keystone-on and --keystone-off command line parameters, and the OSG_KEYSTONE env var 2013-05-10 17:59:07 +00:00
Robert Osfield
e545627571 Moved Keystone class into osgViewer library. 2013-05-09 15:18:14 +00:00
Robert Osfield
34a6b38983 Preperation for adding stereo support direclty into osgViewer. 2013-04-15 14:21:32 +00:00
Robert Osfield
dd8d7c2839 Updated developer release number 2013-03-21 16:42:09 +00:00
Robert Osfield
ed35a0a07a Added check against isVertexBufferObjectSupported() in set*Pointer() methods 2013-03-21 16:22:30 +00:00
Robert Osfield
68fdae5761 From Lukasz Izdebski,"added support for gl_SampleMaski." 2013-02-13 16:29:03 +00:00
Robert Osfield
63cd217c77 From Jordi Torres, Android build fix 2013-02-12 15:44:52 +00:00
Robert Osfield
2700c9d5e5 Updated SO version in prep for serialization foramt change 2013-02-07 11:08:34 +00:00
Robert Osfield
00c7e5e552 From Aurelien Albert, "This line,I use the "useVertexAttributeAliasing" mode in my application, and color arrays are not normalized, so shaders get [0.0-255.0] values instead of [0.0-1.0] values.
This patch fix this."

and those below, will be ignored
----

M    include/osg/State
2013-02-06 14:50:37 +00:00
Robert Osfield
19bfa92c91 Simplified include/osg/Math to use Standard C++ maths headers - <cmath> and <cfloat> 2013-02-06 12:02:05 +00:00
Robert Osfield
5297502a38 Updated version number after 3.1.4 developer release 2013-02-04 14:42:44 +00:00
Robert Osfield
6ec15736cd Standardized use of GL_HALF_FLOAT_NV and GL_HALF_FLOAT_ARB to GL_HALF_FLOAT 2013-01-31 16:26:06 +00:00
Robert Osfield
45585b78fb From Laurens Voerman, "I have implemented and tested (on windows only) your suggestion for resetCullingMask(), it's far less intrusive than my previous submission.
attached are the changes to current svn (28 Jan 2013 / rev :13312).
"
2013-01-28 14:30:21 +00:00
Robert Osfield
26a8f63212 From Wang Rui, "In the attached files I've added the Compute Shader support for OSG, as well as serializer updates and a new osgcomputeshaders example. My submission also include a setComputeGroups() function in Program for setting compute-shader work groups, and a bindToImageUnit() function in Texture for binding textures as image variables in shaders.
All code are tested on Windows 7 + NVIDIA GFX 570 with the latest GeForce 310.70 Driver (BETA), which could support OpenGL 4.3.

Compute shader information can be found at "http://www.opengl.org/registry/specs/ARB/compute_shader.txt"
"
2013-01-25 11:54:03 +00:00
Robert Osfield
f6450a1123 From Lukasz Izdebski, "Adding this GL mode makes possibly to use this GL Modes (added in core OpenGL 3.2) in Windows." 2013-01-25 11:08:32 +00:00
Robert Osfield
5aa1234fa4 Fixed usage of META_NodeVisitor so it doesn't include "" 2013-01-24 18:48:34 +00:00
Robert Osfield
0b1605ed08 From Wang Rui with edits from Robert Osfield, additional GLenums for cross platform build 2013-01-23 16:22:45 +00:00
Robert Osfield
83f9d0f3e6 Added Options support to ImageSequence LOAD_* functionality 2013-01-18 17:11:49 +00:00
Robert Osfield
5fb8cd6a9c Update SO_VERSION to reflect new API changes 2013-01-18 16:30:55 +00:00
Robert Osfield
a0980734ac Added LOAD_AND_RETAIN_IN_UPDATE_TRAVERSAL and LOAD_AND_DISCARD_IN_UPDATE_TRAVERSAL ImageSequence::Mode's to allow for ImageSequence usage without using background paging threads, instead loading all the images on demand in the update traversal. 2013-01-18 16:21:17 +00:00
Robert Osfield
4a0ce866c0 Updated SO version 2012-12-14 16:30:28 +00:00
Robert Osfield
32c0bc3b39 From Lionel Lagarde, "Here is a correction on the PixelBufferObject getter methods of Image.
The set method modify the buffer object of the BufferData while the get method returned the buffer object of the Image.

I've also removed the _bufferObject member of Image (not used anymore)."
--This line, Lionel Lagardeand those below, will be ignored--

M    include/osg/Image
2012-12-13 17:35:27 +00:00
Robert Osfield
e64d5e5eca Added template swapBytes method 2012-12-07 19:04:49 +00:00
Robert Osfield
5a88734598 Moved the expansion of the key codes into ApplicationUsage so that help is only generated for non zero keycodes. 2012-12-05 10:13:51 +00:00
Robert Osfield
e4a42fa65c Fixed error in Unfiform set method 2012-12-03 09:50:41 +00:00
Robert Osfield
8b30807ef1 From Paul Martz, build fixes 2012-11-19 11:25:52 +00:00
Robert Osfield
933baf5db4 Changed COLOUR to COLOR to be consistent with OpenGL spelling 2012-11-13 13:32:01 +00:00
Robert Osfield
92975a01fd Moved colour space conversion of volumes from the osgvolume example into osg/ImageUtils and added support for colorSpaceConversion="MODULATE_ALPHA_BY_LUMINANCE","MODULATE_ALPHA_BY_COLOUR","REPLACE_ALPHA_WITH_LUMINANCE" and "REPLACE_RGB_WITH_LUMINANCE" to .p3d <volume> tag 2012-11-13 13:16:10 +00:00
Robert Osfield
014f13f774 Refactored ImageSequence to better handle random access usage. 2012-11-08 11:19:31 +00:00
Robert Osfield
f9fd4342ba From Stephan Huber, "attached you'll find the latest versions of the QTKit + the AVFoundation-plugin, some changes to osgPresentation and a small enhancement für ImageIO.
I fixed some bugs and did some more tests with both of the video-plugins. I integrated CoreVideo with osgPresentation, ImageStream has a new virtual method called createSuitableTexture which returns NULL for default implementations. Specialized implementations like the QTKit-plugin return a CoreVideo-texture. I refactored the code in SlideShowConstructor::createTexturedQuad to use a texture returned from ImageStream::createSuitableTexture.

I did not use osgDB::readObjectFile to get the texture-object, as a lot of image-related code in SlideShowConstructor had to be refactored to use a texture.  My changes are minimal and should not break existing code.

There's one minor issue with CoreVideo in general: As the implementation is asynchronous, there might be no texture available, when first showing the video the first frame. I am a bit unsure how to tackle this problem, any input on this is appreciated.

Back to the AVFoundation-plugin: the current implementation does not support CoreVideo as the QTKit-plugin supports it. There's no way to get decoded frames from AVFoundation stored on the GPU, which is kind of sad. I added some support for CoreVideo to transfer decoded frames back to the GPU, but in my testings the performance was worse than using the normal approach using glTexSubImage. This is why I disabled CoreVideo for AVFoundation. You can still request a CoreVideoTexture via readObjectFile, though.
"
2012-10-24 10:43:01 +00:00
Robert Osfield
1796d55bea From Stephan Huber, OSX and iOS Video support via a QTKit plugin from OSX 10.7 and before, and an AVFoundation plugin for iOS and OSX10.8 and later. 2012-10-02 14:07:12 +00:00
Robert Osfield
03047f3e7f From Paul Martz, "This change to include/osg/GL correctly includes the OpenGL header on OSX 10.7 when building OSG trunk for GL3. It also adds some CPP defines for compatibility." 2012-09-26 08:42:04 +00:00
Robert Osfield
b3f8679b69 From Luc Frauciel, Added sRGB FrameBuffer string 2012-09-20 14:03:47 +00:00
Robert Osfield
01c7d87b1a From Farshid Lashkari, Added GLBeginEndAdapter::reset(), and _overallNormalAssigned, _overallColorAssigned flags to avoid the GLBeginEndAdapter adapter setting colour and normals when none has been assigned. 2012-09-20 11:18:19 +00:00
Robert Osfield
7fe5db073b Updated version after 3.1.3 dev release 2012-09-10 08:24:49 +00:00
Robert Osfield
f288f9e996 From Wojciech Lewandowski, "With current trunk I had an error while compiling osg/Image.cpp for IOS simulator / GLES2. Symbol GL_RGBA16 was missing. Adding #define GL_RGBA16 0x805B to Image header solves the problem. " 2012-09-07 14:55:09 +00:00
Robert Osfield
39dcea9ebb From Colin McDonald and Robert Osfield, converted Traits::sharedContext from GraphicsContext* to osg:observer_ptr<GraphicsContext> to prevent dangling pointer issues. 2012-09-05 21:03:41 +00:00
Robert Osfield
f5a3c40934 Moved the OSG_INIT_SINGLETON_PROXY macro into include/osg/Object to make it more generally useful and added it's usage into the RenderBinPrototypeList initialization. 2012-09-05 13:48:23 +00:00
Robert Osfield
fd2ee19b62 Updated SO version number to avoid collision with new additions to serializers 2012-09-05 09:30:33 +00:00
Robert Osfield
bc533022ae Added deprecated note to indices entry. 2012-09-05 08:42:14 +00:00
Robert Osfield
30c35cb407 Adjusted the #define's to help GLES2 build 2012-09-03 09:08:16 +00:00
Robert Osfield
583401970a Fixed typo 2012-08-22 16:39:47 +00:00
Robert Osfield
0a746faa2d Introduced Texture::Extensions::s/getPreferGenerateMipmapSGISForPowerOfTwo() flag that defaults to false for Radeon, true elsewhere.
This is used to workaround mipmapping bugs with ATI/AMD cards.
2012-07-12 16:41:53 +00:00
Robert Osfield
476dbf1c33 Fixed for including cmath before osg/Math. 2012-05-02 13:58:34 +00:00
Robert Osfield
d32160abde Added using base_class::set to the Matrix*Template class to enable the set() method from the base class to be used. 2012-04-27 09:43:25 +00:00
Robert Osfield
de05dd22a8 Restructed how the GL_SAMPLER_* #define's are placed to avoid build problems under GLES. 2012-04-19 14:58:35 +00:00
Robert Osfield
9f93b005cc From David Callu, "Here the fix for Matrix{2,3,4}x{2,3,4}{fd} defined in Uniform header.
My previous patch for Atomic Counter Uniform provide new template implementation
of Matrix{2,3,4}x{2,3,4}{fd}. This new implementation use Column-Major Matrix.
Original code define matrix as Row-Major matrix like other Matrix in OSG, and
my matrix implementation break compatibility with previous code.
For example osg_normalMatrix define in osg::State report by Roland Hill.
Thanks to Paul Martz to spot me when the bug appear."
2012-04-19 10:27:58 +00:00
Robert Osfield
01beb82041 From Mathias Froehlich, "Attached is a change to the slow path geometry dispatch tables that allows the
use of 3 component float color vectors."
2012-04-18 09:56:00 +00:00
Robert Osfield
b882467217 Updated version number 2012-04-18 09:50:23 +00:00
Robert Osfield
95cac0b549 From Ulrich Hertlein, Fix for MatrixTemplate compile errors 2012-04-06 10:42:17 +00:00
Robert Osfield
c0bd5cda99 From Magnus Kessler, typo and documentation fixes 2012-03-29 15:08:15 +00:00
Robert Osfield
68412a1784 From Magnus Kessler, "remove unecessary conversion from float in double precision method" 2012-03-29 09:57:47 +00:00
Robert Osfield
aab27e106c From David Callu, "Here an update of osg::Uniform :
- add non square matrix
- add double
- add all uniform type available in OpenGL 4.2
- backward compatibility for Matrixd to set/get an float uniform matrix
- update of IVE / Wrapper ReadWriter

implementation of AtomicCounterBuffer based on BufferIndexBinding

add example that use AtomicCounterBuffer and show rendering order of fragments,
original idea from geeks3d.com."
2012-03-29 09:43:12 +00:00
Robert Osfield
59d6931b59 Added int packing parameter to Image::readPixels(..) 2012-03-29 08:27:21 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
1e35f8975d For all OSG_GL*_FEATURE #defines changed 1's to true and 0's to false. 2012-03-21 16:02:32 +00:00
Robert Osfield
c3a0a8ddc3 Added Traits::getContextVersion(uint,uint) 2012-03-21 11:36:54 +00:00
Robert Osfield
cee53f6adc Updated version number 2012-03-21 11:26:09 +00:00
Robert Osfield
fc6fdeaa2c Updated version number for 3.1.1 dev release 2012-03-08 16:33:44 +00:00
Robert Osfield
fef2628d00 From Farshid Lashkari, "I've added support for reading contents of cubemap textures to the osg::Image::readImageFromCurrentTexture method. I added a new parameter to the method for specifying which face of the cubemap to read." 2012-03-08 16:05:17 +00:00
Robert Osfield
2c7b82b401 From David Callu, "I found a bug in osg::Program.
in osg::Program::PerContextProgram :

typedef std::vector<UniformModifiedCountPair> LastAppliedUniformList;
should be
typedef std::map<unsigned int, UniformModifiedCountPair> LastAppliedUniformList;

Intel driver can use index uniform value > 200000.
With a std::vector, this index uniform value generate an out of memory error

Nothing in OpenGL or GLSL specification define index uniform value rules.
And all other implementation that deal with uniform index in osg::Program
use a std::map.
This fix could have a little performance impact but this is the cost
to pay to work with
all driver."
2012-03-01 10:38:28 +00:00
Robert Osfield
2907284d00 Removed redudent spaces at ends of lines 2012-03-01 10:14:55 +00:00
Robert Osfield
84ca21655e Added build problem with using float Matrix. 2012-02-28 11:37:09 +00:00
Robert Osfield
48b9b25805 From Johannes Baeurele, "The osg::Image class now contains a 'supportsTextureSubloading()' method that is used inside the Texture2D::apply method. For now it only checks for the etc1 format in which case it returns 'false'. All other formats lead to a return value of 'true'.
Without the change the application does not work properly. First I get the notification that an OpenGL error occured. After some more of this error messages I see broken textures on the screen. With the changes attached to this message my application works as intended."

Note from Robert Osfield, changed the Image::supportsTextureSubloading() to be const and to be implemented in the .cpp rather than inline.
2012-02-20 12:03:14 +00:00
Robert Osfield
bd81dd5ff8 From Stephan Huber, attached you'll find a compile fix for the new introduced rowlength-feature on IOS/OpenGL ES builds 2012-02-10 15:57:51 +00:00
Robert Osfield
db49c23944 From Brad Christiansen, "The attached files add the ability to control when a paged child becomes eligible for expiry based on time and/or elapsed frames.
I found that some of the items that had been paged in were being expired on the first frame that they were not visible (as the cache was full). This resulted in excessive paging every time the view was moved. With the following changes I could only allow children to be expired if they had not been used for e.g. 30 seconds or 60 frames."
2012-02-06 12:06:40 +00:00
Robert Osfield
68f776e2cc From Paulk Martz, "Looks like the ClipNode::setReferenceFrame comment block came from LightSource. Fixing the comment block to refer to ClipNode instead of light source." 2012-01-24 17:40:31 +00:00
Robert Osfield
6d66e1abaa Added support for using GL_UNPACK_ROW_LENGTH in conjunction with texture's + osg::Image via new RowLength
parameter in osg::Image.  To support this Image::setData(..) now has a new optional rowLength parameter which
defaults to 0, which provides the original behaviour, Image::setRowLength(int) and int Image::getRowLength() are also provided.

With the introduction of RowLength support in osg::Image it is now possible to create a sub image where
the t size of the image are smaller than the row length, useful for when you have a large image on the CPU
and which to use a small portion of it on the GPU.  However, when these sub images are created the data
within the image is no longer contiguous so data access can no longer assume that all the data is in
one block.  The new method Image::isDataContiguous() enables the user to check whether the data is contiguous,
and if not one can either access the data row by row using Image::data(column,row,image) accessor, or use the
new Image::DataIterator for stepping through each block on memory assocatied with the image.

To support the possibility of non contiguous osg::Image usage of image objects has had to be updated to
check DataContiguous and handle the case or use access via the DataIerator or by row by row.  To achieve
this a relatively large number of files has had to be modified, in particular the texture classes and
image plugins that doing writing.
2012-01-24 14:34:02 +00:00
Robert Osfield
4e834dfc73 From Brad Christiansen, "Attached are some small changes to the ImageStream interface and the DirectShow and FFMPEG plugins to provide the current time being displayed in the image stream.
I don’t have access to an OSX or Linux dev machine to make the changes required to the quick time plugin. This plugin will just default to returning 0."
2011-12-23 16:27:25 +00:00
Robert Osfield
f6ace4a7d0 From Ulrich Hertlein, typo fixes 2011-12-23 16:14:51 +00:00
Robert Osfield
c86e2361d2 Moved the createSpotLightImage function into include/osg/ImageUtils 2011-12-19 09:37:57 +00:00
Robert Osfield
a548daa4be Added a check against OSX 10.6 to enable better selection of when to provide custom cosf etc. definition.
This change has been introduced to address recurcsion problems in 10.7 in the ac3d plugin.
2011-11-07 14:36:50 +00:00
Robert Osfield
9e903861a2 Fixed handling of Vec3dArray in GLBeginEdnAdapter/ArrayDispatchers. 2011-10-21 15:39:51 +00:00
Robert Osfield
d3cebab9a3 Added flipDepth() method 2011-10-21 10:59:42 +00:00
Robert Osfield
8a230d42ed From Luc Frauciel, "You'll find attached a new option that allow, when using LOD in USER_DEFINED_CENTER mode to expand the radius of the node by the radius of loaded objets.
Motivation ;
When using PagedLODs, you don't always know the real size of loaded children,
If it occurs that they  are out of predefined bounds, picking on the parts that are out of bound will fail
They also can be culled out too soon.
The problem often  occurs with long object (roads).
I've modified LOD and ProxyNode to include this option."

and later email:

"Attached the UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED version
There are impacts on some serializers (dae, osgWrapper).
I haven't modified deprecated osg, since it's deprecated"
2011-09-19 10:34:31 +00:00
Robert Osfield
420d8f6acf Added missing forward declaration 2011-09-14 10:22:04 +00:00
Robert Osfield
8345c85c3c Added asCamera() methods into osg::Camera and osg::Node 2011-09-14 10:02:11 +00:00
Robert Osfield
c1af863f78 From Morten Hauknes, "I have been using the getLastVisiblePixelCount on pre 3.0 osg. I believe maybe this was a private function that we made public in our side. I use(d) this method to make a simple algorithm to tell how much visible an object was in percent.
So with the 3.0 api change we propose the following change:
- put OSG_EXPORT on the QueryGeometry class so that we get access to the getNumPixels method.
- Create a function called getQueryGeometry that returns a casted _queryGeode->getDrawable(). Or a function called getQueryGeode that returns _queryGeode."
2011-09-13 13:38:26 +00:00
Robert Osfield
64fa6aec43 From Robert Milharcic, "This will hopefully fix some issues with osgQt, more precisely with GLWidget event handling. There are at least two current GL context braking events, QEvent::Hide and QEvent::ParentChange. When running in a multithreaded mode they both try to change current GL context in a wrong thread (main GUI thread). The QEvent::ParentChange is also problematic when running in a single threaded model because Qt is going to release current contex then delete it, and then it will create new one, and as a result the osg will continue to render to an invalid deleted context. This changes workaround above problems by deferring execution of the problematic evens. These events has to be enqueued and executed later. The enqueued event processing is currently done right after swap in a swapBuffersImplementation of GraphicsWindowQt while code is running in a render thread by calling QGLWidget handler directly. In principle the deferred events queue should be executed while in GUI thread but I couldn't find any reliable way to do this, that is without risking a deadlock. For now it is assumed, Qt is not going to execute any GUI thread only operations inside the QGLWidget handler." 2011-09-13 11:09:39 +00:00
Robert Osfield
408c2a2267 From Paul Martz, "Here's my proposed change regarding the osg-users post "small feature culling threshold". I've updated the comments and brought the default values into agreement, but didn't bother to add the environment variable support." 2011-09-13 09:59:21 +00:00
Robert Osfield
cc37579392 From Johannes Baeuerle, opptimization of ES support of osg/BufferObject 2011-09-12 16:17:33 +00:00
Robert Osfield
22dd9df78b Improved the clarity of doxygen comments 2011-09-12 12:04:46 +00:00
Robert Osfield
c8de3b70ca Updated SO version number to 90 to allow for recent changes to the ABI, and to set the base for the 3.1.0 series. 2011-09-12 10:46:42 +00:00
Robert Osfield
94777c4ef5 From Sukender, "I added private constructors to osg::ValueObject & TemplatedValueObject, to avoid allocation on the stack and ugly things like:
TemplatedValueObject<int> value(....);
 container->addUserObject(value);"
2011-09-12 10:43:24 +00:00
Robert Osfield
1fd3c84287 Added fine grained computation of the far plane when using the COMPUTE_NEAR_FAR_USING_PRIMITIVES ComputeNearFarMode.
Added COMPUTE_NEAR_FAR_USING_PRIMITIVES option that provides the original functionality where only the near plane
is computed in a fine grained way, with the far plane being computed simply from bound volumes.
2011-09-01 18:48:21 +00:00
Robert Osfield
4238629ebf Further work on basic ViewDependentShadowMaps, adding implementation of RTT camera and texgen setup. 2011-08-08 17:00:55 +00:00
Robert Osfield
0da1daca15 From Sukender, Fix for compile errors "public: static char const * const osg::ValueObjectClassNameTrait< xxx >::s_className" already defined in xxx.obj" 2011-07-15 09:47:34 +00:00
Robert Osfield
d3d536f0a5 Fixed typo 2011-06-27 10:20:37 +00:00
Robert Osfield
7b97a70c22 Improved the setContextID doxygen comment. 2011-06-27 10:19:44 +00:00
Robert Osfield
c617ea0163 Fixed virtual method mismtaches between subclasses and parent classes. 2011-06-23 16:36:36 +00:00
Robert Osfield
8570c37ed5 From Ryan Pavlik, "I have successfully compiled OpenSceneGraph trunk using the Clang compiler (using a recent trunk build of llvm and clang, haven't tested an older release). The attached files contain the change shown in the diff below, which was required to finish the build with Clang. It fixes an issue with two-phase name lookup - there's more information here http://blog.llvm.org/2009/12/dreaded-two-phase-name-lookup.html
"
2011-06-23 09:26:27 +00:00
Robert Osfield
389c2e6407 Updated version to 3.1.0 in prep for the first developer release for 3.x series 2011-06-17 16:55:49 +00:00
Robert Osfield
f04e841933 Updated version number of 3.0.0-rc1 2011-06-17 09:02:22 +00:00
Robert Osfield
bfe4877b9a Updated version 2011-06-14 15:55:36 +00:00
Robert Osfield
b6a15b2ef8 Added support osg::State::drawQuad(..) for number of vertices in quads to uint range rather than just ushort range. 2011-06-14 15:48:27 +00:00
Robert Osfield
6a6c5bccda Added GLBufferObject::computeBufferAlignment(..) method to enable buffer entries to be aligned along specified buffer alignment boundaries, currently defaulting to 4. 2011-06-14 10:15:12 +00:00
Robert Osfield
18d08e706f Added handling of s/gUserValue() directly on a UserDataContainer. 2011-06-10 11:42:02 +00:00
Robert Osfield
22bc0391c7 Refactored the UserDataContainer so that the osg::UserDataContainer is now a pure virtual base class,
with a osg::DefaultUserDataContainer subclassed from this.  The user object access methods have now all
been moved from osg::Object into the UserDataContainer class, except for the set/getUserData() methods
that are left in osg::Object for backwards compatibility, and the description list access methods have
been moved back into osg::Node.

main UserObject access methods are now all def
2011-06-09 12:57:14 +00:00
Robert Osfield
86439123b4 Added support for creating a 3D Image from an image list.
Added support for reading a list of images in the Present3D <volume> tag.
2011-06-08 16:10:46 +00:00
Robert Osfield
4f7903f732 From Mathias Froehlich, build fixes for legacy unix systems 2011-06-07 14:26:13 +00:00
Robert Osfield
7f9a6aa49d Added ability to subclass from osg::Object to provide custom user data functionality. A new UserDataContainer provides the
default implementation of the user data functionality.
2011-06-07 13:02:20 +00:00
Robert Osfield
71a961ccc3 Added support for searching for user objects from a given startPosition in the UserDataContainer object. 2011-06-07 08:53:03 +00:00
Robert Osfield
c703f39459 Introduced new user object support into osg::Object that allows assignment of a list of user objects to an osg::Object.
Refactored original UserData and Descriptions strings to be managed alongside the new user object suppport within
a single osg::Object::UserDataContainer.
2011-06-02 22:04:08 +00:00
Robert Osfield
4103319059 Updated version 2011-06-02 21:32:03 +00:00
Robert Osfield
e3f7d802e4 Form Jorge Ciges, improved GL version detection code. 2011-05-26 16:52:08 +00:00
Robert Osfield
8b06c30691 Fixed Coverity issue.
CID 11666: Uninitialized pointer field (UNINIT_CTOR)
Non-static class member _glMultiTexCoord1dv is not initialized in this constructor nor in any functions that it calls.
Non-static class member _glVertexAttrib1dv is not initialized in this constructor nor in any functions that it calls.
2011-05-24 10:14:03 +00:00
Robert Osfield
d4be7a19eb Updated SO version as the osgText and osgQt libraries API have changed, albeit only by a small amount. 2011-05-13 19:19:00 +00:00
Robert Osfield
77057d06ab Warning and build fixes 2011-05-12 18:52:18 +00:00
Robert Osfield
f7699a3bfd Added newline to end of file 2011-05-12 18:40:18 +00:00
Robert Osfield
c9f5be090a Updated version number to 2.9.15 after dev release 2011-05-08 12:06:25 +00:00
Robert Osfield
cb5a8495a7 Updated SO version number for dev release 2011-05-06 09:26:14 +00:00
Robert Osfield
12b56726d2 Fixed Coverity reported issues.
CID 10392: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _maxIndex is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minIndex is not initialized in this constructor nor in any functions that it calls.

CID 10454: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _maxIndex is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minIndex is not initialized in this constructor nor in any functions that it calls.

CID 10505: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _maxIndex is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minIndex is not initialized in this constructor nor in any functions that it calls.

CID 10919: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _maxIndex is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minIndex is not initialized in this constructor nor in any functions that it calls.

CID 10920: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _maxIndex is not initialized in this constructor nor in any functions that it calls.
Non-static class member _minIndex is not initialized in this constructor nor in any functions that it calls.
2011-05-06 09:21:04 +00:00
Robert Osfield
41eb850578 Fixed Coverity reported issue.
CID 11447: Unchecked dynamic_cast (FORWARD_NULL)
Dynamic cast to pointer "dynamic_cast <struct osg::NodeCallback *>(nc->clone(this))" can return null.
Assigning null: "first" = "dynamic_cast <struct osg::NodeCallback *>(nc->clone(this))".

The clone() implementation is written using macro's so that it always returns the type of Object
being cloned so it's normally safe to assume that a dynamic_cast<> will always return a valid pointer as long
as the new T that involves creates a valid object.  However, if the class being cloned doesn't correctly
implement the clone() method then their potential for the dynamic_cast to fail and will return a NULL and will
result in a memory leak of the object of paraent class that the clone would have defaulted to.

I've tightened up the CopyOp.cpp code to check the return type and added better handling of the clone in the
osg::clone() methods so thay don't have any potential mememory leaks and report warnings to OSG_WARN when
problems are encountered.  It may be more apporpriate to throw an exception so will need to ponder this
issue further.
2011-04-28 16:33:14 +00:00
Robert Osfield
7c49e69042 Updated version after 2.9.13 dev release 2011-04-26 15:24:21 +00:00
Robert Osfield
a793958836 From Johannes Baeuerele, "I have extended the pvr reader plugin to support etc1 compression(GL_ETC1_RGB8_OES). The changes attached to this submission are based on today's trunk.
The pvr format which can be used as a wrapper for different compressed and uncompressed formats supports this compression algorithm. The original pvr compression uses the pvrtc format. The handling of pvrtc is already implemented in the pvr plugin. PVR provides wrapper functionality for some formats, e.g. etc or even dxt/dds.

Our target system (gles2) is able to use the etc compression format. With minor changes in the submitted files, there is no need to write a separate plugin. However the original pvr texture compression formats are not supported on our target, which is the reason for this extension.

The changes mainly consist in the definition on new enum values in the classes and headers of ReaderWriterPVR,Image and Texture. I also found some locations where the handling of the original pvr textures was not implemented. These are also part of this submission."
2011-04-21 17:04:50 +00:00
Robert Osfield
634344aef5 From Marius Heise, "here is a patch that implements Win32 HW-synced swapping using wglJoinSwapGroupNV, wglBindSwapBarrierNV and the existing traits. It was tested with multiple ATI FirePro S400 cards.
I also fixed the vsync implementation introduced with rev.11357 that was crashing with the Windows Error #170. So I removed your temporary /* */ around the vsync condition..."
2011-04-21 13:34:03 +00:00
Robert Osfield
478e0f3ebf From Jorge Ciges, "1rst - Changes in Cmake: They make possible "make install" with the android building.
2nd - Script to use a 3rd party directory with basic libraries: libjpeg,libpng,libtiff,giflib,freetype,curl,gdal.

3rd - Change in the GLES library loading for Android. That should make GLES2 work properly.

4rth- Included two defines RGB8_OES and RGBA8_OES as a substitute in GLES for RGB8 and RGBA8

5th - OpenGL and GLSL version identification changed to recognize GLES  versions properly
"
2011-04-21 12:53:22 +00:00
Robert Osfield
70aa087f6e Added releaseGLObjects(State*) support into osg::FrameBufferObject, osg::RenderBin and osg::RenderStage
to ensure proper clean up of FBO's on closing a graphics context.
2011-04-20 11:45:01 +00:00
Robert Osfield
581e6fb630 Ran svn propset -R svn:eol-style native . on the OpenSceneGraph 2011-04-19 11:40:22 +00:00
Robert Osfield
8ffa50a88e Added IncrementalCompileOperation::compileAllForNextFrame(uint) method and supporting
functionality that  tell the IncrementalCompileOperation to compile all pending objects during next draw traversal,
for specified number of frames.
2011-04-18 12:35:19 +00:00
Robert Osfield
e7e860b742 Added support for explitly requesting DXT1a and DXT1c compression 2011-04-11 19:11:25 +00:00
Robert Osfield
31926f3329 Added OSG_EXPORT to declaration of View::Slave. 2011-03-15 13:30:27 +00:00
Robert Osfield
5447e70b68 Updated versions for next OSG dev release 2011-03-09 11:06:36 +00:00
Robert Osfield
b24353b12c From Rafa Gaitan and Jorge Izquierdo, build support for Android NDK.
"- In order to build against GLES1 we execute:
$ mkdir build_android_gles1
$ cd build_android_gles1
$ cmake .. -DOSG_BUILD_PLATFORM_ANDROID=ON -DDYNAMIC_OPENTHREADS=OFF
-DDYNAMIC_OPENSCENEGRAPH=OFF -DANDROID_NDK=<path_to_android_ndk>/
-DOSG_GLES1_AVAILABLE=ON -DOSG_GL1_AVAILABLE=OFF
-DOSG_GL2_AVAILABLE=OFF -DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF -DJ=2
-DOSG_CPP_EXCEPTIONS_AVAILABLE=OFF
$ make
 If all is correct you will have and static OSG inside:
build_android_gles1/bin/ndk/local/armeabi.

- GLES2 is not tested/proved, but I think it could be possible build
it with the correct cmake flags.
- The flag -DJ=2 is used to pass to the ndk-build the number of
processors to speed up the building.
- make install is not yet supported."
2011-03-08 16:35:37 +00:00
Robert Osfield
1525f3cd4e Added support for an View::Slave::UpdateSlaveCallback 2011-03-01 14:48:48 +00:00
Robert Osfield
6f09acace9 Moved ProgramBinary into osg::Program scope 2011-02-14 15:01:56 +00:00
Robert Osfield
1d55efb721 From Michael Platings, I've added initial support to osg for glGetProgramBinary and glProgramBinary. This means that shader programs can now be cached to disk and later reloaded, which is much faster than linking shaders from source code. This should mean significantly shorter load times for people who use lots of combinations of shaders. 2011-02-14 12:54:21 +00:00
Robert Osfield
4b4754c3cf Implementated experimental reuse of PBO's after download 2011-02-07 14:19:58 +00:00
Robert Osfield
6496e35421 Moved GraphicsCostEstimator ref pointer into osg::State 2011-02-03 12:42:23 +00:00
Robert Osfield
88ce98b47d Moved GraphicsCostEstimator from osgUtil into core OSG library 2011-02-03 12:22:09 +00:00
Robert Osfield
abea92ee91 From Mathias Froehlich, build fixes 2011-01-24 21:12:25 +00:00
Robert Osfield
6d1944b9e2 From Matthew Johnson-Roberson, "Small fix for operation thread to protect the access to _operations vector by functions getNumOperationsInQueue() and empty(). It is simply an addition of OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_operationsMutex);
to protect against accessing while writing which was segfaulting in VPB
specifically in void ThreadPool::run(osg::Operation* op)
in the waiting loop

while (_operationQueue->getNumOperationsInQueue() >= _maxNumberOfOperationsInQueue)
"
2011-01-20 12:32:20 +00:00
Robert Osfield
45bd464942 Added getNum methods 2011-01-17 09:10:14 +00:00
Robert Osfield
7c30f204e8 Updated so version number 2011-01-13 18:49:12 +00:00
Robert Osfield
f61a6aa4e7 Refactored the way that the DatabasePager passes the Terrain decorator node onto the TerrainTile.
The DatabasePager now passes the Terrain pointer into the ReaderWriter's via osgDB::Options object,
rather than pushing a NodePath containing the Terrain onto NodeVisitor.  This
change means that the DatabasePager nolonger needs to observer the whole NodePath and
will be lighter and quicker for it.

The change also means that ReadFileCallback can now run custom NodeVisitor's on the scene graph without
having to worry about TerrainTile's constructing scene graphs prior to the Terrain being assigned.

Also changed is the NodeVisitor::DatabaseRequestHandler which now requires a NodePath to the node that you wish
to add to rather than just the pointer to the node you wish to add to.  This is more robust when handling scenes
with multiple parental paths, whereas previously errors could have occurred due to the default of picking the first
available parental path.  This change means that subclasses of DatabasePager will need to be updated to use this new
function entry point.
2011-01-12 19:29:24 +00:00
Robert Osfield
652c274d09 From Chris Hanson, "As an extension to this excellent work:
http://forum.openscenegraph.org/viewtopic.php?t=7285

 This file adds the same string API wrapper to the State object for other older apps that
track Uniforms by string. The original comment about performance is preserved."
2011-01-11 17:18:44 +00:00
Robert Osfield
d644a6dfe3 Added osg::Geometry::verifyArray(std::ostream&) method to enable checks to be done on osg::Geometry to see if the arrays
are big enough to handle the primitives used in the geometry.

Added usage of verifyArray into osgfilecache so that it reports any problems on reading files in paged database.
2011-01-03 19:41:06 +00:00
Robert Osfield
410b4fd109 Converted FrameStamp::g/setFrameNumber from int to uint 2010-12-22 20:11:05 +00:00
Robert Osfield
c9c329e7c4 Moved the GL3 include to within the code block that handles GL1/GL2 2010-12-20 12:17:40 +00:00
Robert Osfield
95feb34ffa Fixed the size computation 2010-12-15 19:44:29 +00:00
Robert Osfield
8b8dda86af Removed no longer used static member variables 2010-12-15 16:30:48 +00:00
Robert Osfield
65f95fe3fe Added methods for checking sizes of various buffer object/texture object pool sizes. 2010-12-14 19:29:01 +00:00
Robert Osfield
4b4b438d44 Removed redundent MinimumNumberOfTextureObjectsToRetainInCache static variable 2010-12-14 15:28:31 +00:00
Robert Osfield
543b2ee56e Added resizeGLObjectBuffers(uint) and relaseGLObjects(State*) to BufferData. 2010-12-13 17:09:31 +00:00
Robert Osfield
c959bab0a6 From Wojciech Lewandowski, "As suggested I have added missing method to PerContextProgram. Tested with our programs.
I see that we should expect some performance penalty for using this method.  It won’t be painful in my current case because I have only a few animated characters. But I suspect  some day I will have to fix osgCal to use int UniformIds natively for larger crowds."
2010-12-12 09:22:09 +00:00
Robert Osfield
08d21d8777 Introuced a local typedef of the index array type to keep the functor parameters consistent 2010-12-12 08:54:58 +00:00
Robert Osfield
067695bec4 Updated version number for 2.9.11 dev release 2010-12-08 11:01:37 +00:00
Robert Osfield
06509b9769 Introduced bool Texture2D::textureObjectValid(State) and bool SubloadCallback::textureObjectValid(Texture2D&,State&) method to make it tell Texture2D::apply() whether the texture object is still valid or whether it's no longed valid for the any changes to the image attached to the Texture 2010-12-03 14:18:16 +00:00
Robert Osfield
65aee287e7 From Mathias Froehlich, "Attached are most of the fixes that are required to build osg on solaris and
hpux. I have skipped irix this time as irix is too dead to keep osg building
there.

As usual, solaris does not like member templates in stl containers.
Some headers missing and link problems due to missing libraries."
2010-12-02 14:13:54 +00:00
Robert Osfield
60457486b0 From Wang Rui, Compile fixes 2010-11-30 08:12:06 +00:00
Robert Osfield
e5a9eaa711 From Tim Moore, "Here is initial support for uniform buffer objects. The binding between a buffer object and an indexed target is implemented as a new StateAttribute, UniformBufferBinding. I've included an example program based on the code in the ARB_uniform_buffer_object specification.
A few things remain to do:
* The binding between a uniform block in a shader program and a buffer indexed target number is fixed, like a vertex attribute binding. This is too restrictive because that binding can be changed without relinking the program. This mapping should be done by name in the same way that uniform values are handled i.e., like a pseudo state attribute;

* There's no direct way yet to query for the offset of uniforms in uniform block, so only the std140 layout is really usable. A helper class that implemented the std140 rules would be quite helpful for setting up uniform blocks without having to link a program first;

* There's no direct support for querying parameters such as the maximum block length, minimum offset alignment, etc. Having that information available outside of the draw thread would make certain instancing techniques easier to implement."
2010-11-29 17:43:27 +00:00
Robert Osfield
ebfcb17744 From Marin Platings and Robert Osfield, fix of Uniform unique ID by making osg::Object::setName() virtual. 2010-11-26 13:54:11 +00:00
Robert Osfield
d7b161078a From Thomas Hogarth and Stephan Huber, "attached you'll find part one of iphone-support. It includes
* support for NPOT-textures on IOS
* support for FBOs (only renderToTexture for now) on IOS (should work
for other OpenGL ES 1/2 targets, too)
* FileUtils-support for IOS"
2010-11-25 16:06:04 +00:00
Robert Osfield
cdfbb7a753 From Michael Platings, To address performance bottleneck that occurs when using large number of uniforms introduced a name to uniqued ID scheme for Uniforms so comparisons can be done on a uint rather than a string. 2010-11-25 12:30:38 +00:00
Robert Osfield
4b4e02e45b From Hartwig Wiesmann, "in the files Image, Observer and TerrainTechnique unused parameters exist resulting in a couple of compiler warnings (depending on the compiler settings though).
The attached patches comment out the unused parameter names.
"
2010-11-25 12:07:59 +00:00
Robert Osfield
043ae090a5 From Tim Moore, Fix for drivers that don't properly support timer extensions.
""
2010-11-24 10:38:28 +00:00
Robert Osfield
d7747685b3 From Holger Helmich, Tessellation shader support 2010-11-23 14:50:31 +00:00
Robert Osfield
9b70348ced Fixed typo of commercial 2010-11-22 11:22:03 +00:00
Robert Osfield
6b711582de From Sukender, fix for precision of Plane::asVec4() 2010-11-19 18:07:17 +00:00
Robert Osfield
ade360819e Updated SO version to reflect changes in API of osgText 2010-11-19 09:57:34 +00:00
Robert Osfield
be9003d90c From Wang Rui, "The latest modification of osg/State uses the GLuint64EXT type, which
belongs to GL_EXT_timer_query and should be decalared to avoid
compiling errors if the extension is not supported. I've attached this
small fix."
2010-11-11 10:53:23 +00:00
Robert Osfield
68f37c4dcb From Tim More and Robert Osfield, implementation of ARB_timer_query based GPU timing stats syncronization.
Initial email from Tim : "I've implemented using a timestamp, available with ARB_timer_query and OpenGL 3.3, to gather GPU stats. This is nice because it can accurately fix the GPU draw time with respect to the other times on the stats graph, rather than having to estimate the wall time of the end of GPU drawing. This also prevents anomalies like the GPU phase starting before the draw phase..."
Changes to Tim's submission by Robert:  Removal of need for swap buffer callback in ViewerBase.cpp, by
integrating a osg::State::frameCompleted() method that does the stats timing collection.  Introduction of a
GraphicsContext::swapBuffersCallbackOrImplementation() method that calls the State::frameCompleted() and
the swap buffers callback or the swapImplementation as required.
2010-11-10 16:58:58 +00:00
Robert Osfield
752a5e2a3c From Javier Taibo, "ere is the new code with Billboard "rotate around axis" functionality.
A new AutoRotateMode was added. I named it ROTATE_TO_AXIS to be
consistent with the other AutoRotateModes, even though it changes from
how is called in Billboard (AXIAL_ROT).

  Setters and getters for rotation axis and normal were also added to the
AutoTransform class interface.

  The implementation is mainly a copy-paste from Billboard code.
"
2010-11-05 17:24:50 +00:00
Robert Osfield
2aaf0ed297 From Fabien Lavingotte and Robert Osfield, Fixed handling of texture pool size when TextureObject::setAllocate(..) is called. 2010-11-04 17:53:58 +00:00
Robert Osfield
d2a9f48054 From Per Fahlberg, "I have added support for PowerVR texture compression. osg::Texture and osg::Image have been modified to support the texture formats and I have added a plugin to load pvr files. All modified files are in the attached zip. " 2010-11-04 11:02:37 +00:00
Robert Osfield
cc93824605 From Alexander Irion, "When a osg::Geometry node is loaded from a ".osgb" file, there is no element buffer object created for the primitives element indices, although _useVertexBufferObjects is enabled. This bug decreases the rendering performance." 2010-11-01 17:05:53 +00:00
Robert Osfield
862a0c68e3 From Mathias Goldau, "Added very brief documentation when to use the triangle mesh class. I
generated the make doc_openscenegraph target to verify that this change does
not break something.
"
2010-11-01 10:31:30 +00:00
Robert Osfield
b622a99178 Added handling of vertex buffer objects into osg::Geometry copy constructor. 2010-10-28 14:01:47 +00:00
Robert Osfield
1a292ad8e3 Integrated IncementalCompileOperation into DatabasePager.
Improved various facilities in IncrementalCompileOperation.
2010-10-21 16:29:23 +00:00
Robert Osfield
00fe3c0417 Introduced SubloadCallback::generatdTextureObject() method. 2010-10-14 13:35:36 +00:00
Robert Osfield
8640929a2e From Brad Christiansen, fix function entry points under Windows to address crash 2010-10-14 11:10:16 +00:00
Robert Osfield
a9dd08c3ba Removed redudent set up of GL_ cubemap defines as these are now also in include/osg/Texture 2010-10-09 11:27:45 +00:00
Robert Osfield
9984281553 Refactored the Texture3D extension setup in osg::Texture3D and gluBuild3DMipmaps and gluBuild3DMipmapLevels. 2010-10-08 11:20:56 +00:00
Robert Osfield
d23ce985a1 Introduced osg namespace to new local GLU functions 2010-10-07 11:53:28 +00:00
Robert Osfield
12e6a23451 Introduced new gluScaleImage function that uses a PixelStorageModes structure to pass in details on image packing,
rather than relying upon glGet's to get the values.
2010-10-07 10:51:22 +00:00
Robert Osfield
6a00d7d356 Added #define for Windows build 2010-10-06 18:29:23 +00:00
Robert Osfield
29bc5995e7 Added #define's and local include<osg/Image> to fix Windows GL 1.1 build against 2010-10-06 16:36:30 +00:00
Robert Osfield
8a6b0f0cef From Jean-Sebasien Guay, fix windows compile error 2010-10-06 16:29:16 +00:00
Robert Osfield
89f7726383 Copied libutil and libtess implementations in form Mesa 7.9/src/glu into the src/osg/glu,
changed extensions from .c to .cpp and got compiling as C files as part of the osg core library.

Updated and cleaned up the rest of the OSG to use the new internal GLU.
2010-10-06 14:44:52 +00:00
Robert Osfield
e5bc43f04c From Magnus Kessler, "After a closer look at this particular issue, I used some grep and sed magic
to fix all occurrences of "macro's" and "paramter".
"
2010-09-30 16:57:02 +00:00
Robert Osfield
0eded3efbe From WojciechLewandowski, Added DispaySettings::SwapMethod and support for it in GraphicsContext::Traits 2010-09-30 14:25:27 +00:00
Robert Osfield
f6517d2f8b From Alexander Wiebel, "I did some spell checking in my spare time. Here come 20 files." 2010-09-24 14:53:10 +00:00
Robert Osfield
73a4e775c0 From Jean-Sebastien Guay, "Changeset 10833 renames discardAllDeletedGLObjects() to discardAllGLObjects() in src/osg/GLObjects.cpp, but the declaration of the function in include/osg/GLObjects remained. So an app using an old version of OSG that called this function would now fail with a linker error instead of a compile error as it should.
Removed the declaration. Also fixed a small typo in the following doxygen comment."
2010-09-24 14:40:56 +00:00
Robert Osfield
eb3d76f291 From Mikhail Izmestev, "This patch fixes operator >> used with std::istream without std::ios::skipws flag. This allow using boost::lexical_cast with osg vectors types, because boost's lexical_cast disable std::ios::skipws flag of std::istream before using operator >>.
"
2010-09-24 14:38:01 +00:00
Robert Osfield
93ad63405f From Alexander Wiebel, "I came across some functions in Vec* that I thought could benefit from some
doxygen documentation. Additionally, I made the comment on value_type more
meaningful (in my opinion)."
2010-09-16 10:33:51 +00:00
Robert Osfield
c6a1b7e97f From Magnus Kessler, "I'm resubmitting a slightly different version of the changes you left out for
osg/Camera. The ::glName issue masked the fact that the "(..)" isn't handled
well in doxygen and leads to "(." in the generated files.

I'm also submitting a minor documentation fix to osgGA/DriveManipulator to get
it out of my patch queue ;)"
2010-09-16 09:49:22 +00:00
Robert Osfield
cc471b1103 From Magnus Kessler, "Attached are a number of files where I have tried to fix up some of the
documentation. I have accumulated them over some time, but rebased onto the
subversion trunk."
2010-09-15 12:00:12 +00:00
Robert Osfield
df7df0739a From Lukasz Izdebski, "I made some changes in OcclusionQueryNode file.
I move declaration of classes TestResult, QueryGeometry from cpp to header file and made a void createSupportNodes() a virtual method.

Now is possible to inherit from class OcclusionQueryNode."
2010-09-15 11:27:31 +00:00
Robert Osfield
d044d135f5 From Jan Peciva, "please, find attached improved Stencil and StencilTwoSided classes.
Goals:
- to handle INCR_WRAP values nicely if not supported by OpenGL (old hardware)
- to support two side stenciling of OpenGL 2.0. Current implementation does not work on ATI as it uses Nvidia extension.

Ready for commit:
- Stencil and Stencil.cpp - please, review them

Ready with "hack":
- StencilTwoSided.cpp: please, see the line 113 in apply():

      glEnable(GL_STENCIL_TEST_TWO_SIDE);

This line used to be in getModeUsage() as

      usage.usesMode(GL_STENCIL_TEST_TWO_SIDE);

but it produces OpenGL errors on ATI as it is unknown value there (it is Nvidia extension).
Problems with my "glEnable" solution:
- it enables two side stenciling forever, and it will disturb any other single-side stenciling in the scene graph.
"
2010-09-15 09:56:16 +00:00
Robert Osfield
551d2b6479 From Ulrich Hertlein, "not sure how severe this is but I believe there's a bug in
Texture.cpp:applyTexImage2D_subload:

<code>
unsigned char* data = = (unsigned char*)image->data();
if (needImageRescale) {
 // allocates rescale buffer
 data = new unsigned char[newTotalSize];

 // calls gluScaleImage into the data buffer
}

const unsigned char* dataPtr = image->data();
// subloads 'dataPtr'

// deletes 'data'
</code>

In effect, the scaled data would never be used.

I've also replaced bits of duplicate code in Texture1D/2D/2DArray/3D/Cubemap/Rectangle
that checks if the texture image can/should be unref'd with common functionality in
Texture.cpp.

"
2010-09-14 13:19:55 +00:00
Robert Osfield
d55ada3790 Moved GL_RED and associated GL defines that aren't defined by GLES into the include/osg/Image to aid portability. 2010-09-14 13:19:12 +00:00
Robert Osfield
a171c88cf1 From Lukasz Izdebski, "Texture: added support for GL_EXT_texture_compression_rgtc, I added support (read and write ) for BC4 BC5 Block Compression to dds file format." 2010-08-16 14:11:49 +00:00
Robert Osfield
5d48a68cba From Alexander Wiebel, "Documentation of PrimitiveSet" 2010-08-16 09:35:59 +00:00
Robert Osfield
74a9ccb49d From David Fries, merge from a series of related submission emails:
"enable thread locking in libavcodec

This is required for a multithreaded application using ffmpeg from
another thread."

"Prevent the audio from videos from hanging on exit if they are paused.
The video decoder already has similar logic."

"Add a way to retrieve the creation time for MPEG-4 files."

"fmpeg, improve wait for close logic

Both audio and video destructors have been succesfully using the logic,
if(isRunning())
{
  m_exit = true;
  join();
}
since it was introduced,

but the close routines are using,
m_exit = true;
if(isRunning() && waitForThreadToExit)
{
  while(isRunning()) { OpenThreads::Thread::YieldCurrentThread(); }
}
which not only is it doing an unnecessary busy wait, but it doesn't
guaranteed that the other thread has terminated, just that it has
progressed far enough that OpenThreads has set the thread status as
not running.  Like the destructor set the m_exit after checking
isRunning() to avoid the race condition of not getting to join()
because the thread was running, but isRunning() returns false.

Now that FFmpeg*close is fixed, call it from the destructor as well
to have that code in only one location."
2010-08-09 17:02:31 +00:00
Robert Osfield
534af3aeaf Removed the erroneous subclassing from osg::Observer 2010-08-08 15:44:03 +00:00
Robert Osfield
930f5ab620 From Jeremy Moles, "The version of GCC I use (4.4.3-4ubuntu5) gives the following warning
about the Observer header:

/home/cubicool/local/include/osg/Observer: In copy constructor
?osg::ObserverSet::ObserverSet(const osg::ObserverSet&)?:
/home/cubicool/local/include/osg/Observer:66: warning: base class ?class
osg::Referenced? should be explicitly initialized in the copy
constructor

I've been fixing this by hand by using the attached Observer header; it
does exactly what the warning requests. Purely cosmetic, I believe, but
other than that OSG seems to compile w/ -W -Wall just fine."
2010-07-31 10:22:37 +00:00
Robert Osfield
64b26ebeb5 Added debug State::print(std::ostream&) method and extra debug messages in ShaderComposer and ShaderAttribute.
Added better shader composition testing in the osgshadercomposition example.
2010-07-10 17:14:59 +00:00
Robert Osfield
46b221a832 Added compile/release and resize of GL objects to ShaderAttribute.
Removed the StateAttribute::compose() method.

Fixed the default type value in ShaderAttribute
2010-07-06 12:19:26 +00:00
Robert Osfield
74ae526bb5 Added support for passing on uniforms from StateAttribute 2010-07-06 10:55:54 +00:00
Robert Osfield
751b0498fe Added basic code injection fields to osg::Shader,
creation of main shader to ShaderComposer and
collection of ShaderComponent to osg::State.
Also added very basic shader set up in osgshadecomposition example.
2010-07-05 16:32:58 +00:00
Robert Osfield
9f8670f50d Implement basic cache in ShadeComposer 2010-07-02 14:18:59 +00:00
Robert Osfield
a55c4b7d70 Added basic ShaderComponent class and beginnings osgshadercomposition example 2010-07-02 12:04:20 +00:00
Robert Osfield
5cac233764 Added beginnings of shader composition with the shells of the ShaderComposer and ShaderAttribute classes. This aren't
functional yet, but a useful placeholders for future fucntionality.
2010-06-24 17:15:27 +00:00
Robert Osfield
4ae8eb607f Updated version number for next dev release 2010-06-21 10:33:46 +00:00
Robert Osfield
da60a3c615 From Jan Peciva, additional comments, and standarisation of throw and handling of mouse wheel. 2010-06-14 15:20:47 +00:00
Robert Osfield
7f7f1f7d0e Changed types from unsigned int to int's to address warnings, and changed the extension requirements so the GLES2 builds with FBO's where supported 2010-06-01 18:20:38 +00:00
Robert Osfield
656a1b6da5 From Frederic Bouvier, "here is my proposal. It is supposed to be used like this :
osg::Camera* c = createCamera();
   c->attach( osg::Camera::COLOR_BUFFER0, texture3d, 0,
osg::Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER );

it works also for cubemap textures and 2d texture arrays
"
2010-06-01 14:12:03 +00:00
Robert Osfield
4a047f2a82 From Michael Platings, introduced osg::State::applyModelViewMaitrx(const osg::Matrix& matrix) method and associated osg::State::_modelViewCache to enable osgText::Text3D to be refactored in away that avoids creating/destroying matrices 2010-06-01 13:33:58 +00:00
Robert Osfield
054d5606fb From Tim Moore, "This is a patch that allows a ref_ptr to be constructed using an observer_ptr argument, which is locked. This is shorthand for declaring the ref_ptr and then passing it to observer_ptr::lock().
"
2010-06-01 11:28:04 +00:00
Robert Osfield
6ba8341683 From Wang Rui, "The Notify header doesn't include the OSG_ALWAYS macro, which is used
in the quicktime plugin. The file attached is to fix that small
problem."
2010-06-01 09:23:21 +00:00
Robert Osfield
d8511fa5ca From Tim Moore, fixed typo and removed redundent include 2010-06-01 09:21:42 +00:00
Robert Osfield
975b95dd33 From Torben Dannhauer, "I added radial fog functionality be using the OpenGL extension 'GL_NV_fog_distance'." 2010-05-31 16:53:41 +00:00
Robert Osfield
6548e4a5a8 Added OSG_DEBUG_DP macro 2010-05-28 17:17:34 +00:00
Robert Osfield
d26a8474e7 Changed the ref_ptr<T> observer_ptr<>::lock() method to be
bool observer_ptr<>::lock(ref_ptr<T>&) to avoid the temporary ref_ptr<>'s
being created and destroyed on the stack along with the associated ref/unref() operations
2010-05-28 08:57:48 +00:00
Robert Osfield
e826bfeb3c Refactored osgQt so that QWebViewImage is now entirely implementated in the header, and osgQt itself no longer compiles it,
leaving it to only applications that require it to include the header and it's implementation and with ith the QWebKit dependency.
2010-05-22 15:45:02 +00:00
Robert Osfield
0d2723b984 From Hartwig Wiesmann, "I have added some doxygen documentation to the plane class.
"
2010-05-20 17:02:45 +00:00
Robert Osfield
9cf330d7ff Introduced a alternative implementation of observer_ptr<> that uses ObserverSet rather than an local WeakReference object. 2010-05-20 13:38:28 +00:00
Robert Osfield
b979b585f2 From Tim Moore, fix for deadlock 2010-05-19 13:14:57 +00:00
Robert Osfield
62d69c686f Fixed warning 2010-05-19 08:22:10 +00:00
Robert Osfield
b3ac6484c1 From Martin Naylor, "Please find attached the modified observer_ptr include for fixing a compiler
issue for Windows and VS2008."
2010-05-19 08:08:49 +00:00
Robert Osfield
7ed822fd79 From Tim Moore, typo fix. 2010-05-18 18:01:02 +00:00
Robert Osfield
61121daaab Updated wrappers 2010-05-17 18:37:32 +00:00
Robert Osfield
65c09c8e0d From Tim Moore, improved doxygen comments 2010-05-17 14:43:41 +00:00
Robert Osfield
ccd9f31309 Removed signalUnreffed interface 2010-05-17 14:21:53 +00:00
Robert Osfield
f832198128 From Tim Moore, refactore WeakReference/Referenced to avoid signalling the observers when do a unref_nodelete. 2010-05-17 09:03:44 +00:00
Robert Osfield
554adfc8e6 Refactored Observer/ObserverNodePath and DatabasePager to improve their robustness. 2010-05-14 12:24:13 +00:00
Robert Osfield
2b2ea4487a From Tim Moore, new more robust observer_ptr<> implementation 2010-05-14 12:14:14 +00:00
Robert Osfield
68a1ed2dcf Fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF.
Fixed copy and paste error in Camera::getImplicitBufferAttachmentResolveMask().
2010-05-12 11:37:27 +00:00
Robert Osfield
7ef776ec5f Fixed warnings 2010-04-30 19:41:24 +00:00
Robert Osfield
c2a59415ce Changed DisplaySetting::instance() to return a ref_ptr<>& rathern than a raw C pointer to enable apps to delete the singleton or assign their own. 2010-04-30 11:48:30 +00:00
Robert Osfield
a6c7fee246 From Alok Priyadarshi, "1. Replaced APIENTRY to GL_APIENTRY which is used by OpenGL ES
headers. For desktop GL GL_APIENTRY has been defined as APIENTRY."
2010-04-28 21:22:44 +00:00
Robert Osfield
c019e2f76d Fixed typo 2010-04-28 21:10:29 +00:00
Robert Osfield
5435f6cf50 From Wang Rui, "Two small bugs were just found when I was writing examples for my book
in process: a wrong definition of the OSG_FATAL macro, and wrong logic
inside the KeySwitchMatrixManipulator::getDistance() function. I
believe both were slips."
2010-04-28 20:33:40 +00:00
Robert Osfield
117d949d1f From Roland Smeenk and Robert Osfield, improvements to the indentation of comments. 2010-04-23 16:35:44 +00:00
Robert Osfield
5d0b84edd0 From Marcin Hajder, "This submission contains Texture2DMultisample osg implementation.
Texture2DMultismaple as name suggests provides means to directly access subsamples of rendered FBO target. (GLSL 1.5 texelFetch call).

Recently I was working on deferred renderer with OSG, during that I noticed there is no support for multisampled textures (GL_ARB_texture_multisample extension). After consultations with Paul Martz and Wojtek Lewandowski I added Texture2DMultisample class and made few necessary changes around osg::FrameBufferObject, osg::Texture and osgUtil::RenderStage classes."

and from follow email:

"Fixed. According to ARB_texture_multisample extension specification multisample textures  don't need TexParameters since they can only be fetched with  texelFetch."
2010-04-22 17:02:22 +00:00
Robert Osfield
a475da35e3 From Mourad Boufarguine, "When compiling the example on VS9, the compiler complain about undefined GL_DEPTH_COMPONENT32F and GL_DEPTH_COMPONENT32F_NV. So I added them to include/osg/FrameBufferObject. The example builds fine and is working for me without crashs unless it is ran whithout argument. I added couple of lines to check for arguments number and print the example usage when needed." 2010-04-21 16:37:28 +00:00
Robert Osfield
c0e9fcbb67 From Tim Moore, "This contains a couple of fixes to support changing FrameBufferObject configurations on the fly; the user changes the camera attachments and calls Renderer::setCameraRequiresSetUp(). The major part of this submission is a comprehensive example of setting up floating point depth buffers. The user can change the near plane value and cycle through the available combinations of depth format and multisample buffer formats." 2010-04-19 11:43:06 +00:00
Robert Osfield
c69ddd6bd5 Added BufferData::ModifiedCallback to provide a mechanism for tracking when a osg::Image::dirty() has been called to signify that an image has been modified. 2010-04-13 18:42:58 +00:00
Robert Osfield
51924431cd Fixed warnings 2010-04-13 09:42:53 +00:00
Robert Osfield
d10ce23e62 Fixed recursive call due to missing _ 2010-03-15 20:09:23 +00:00
Robert Osfield
9015ff7084 Refactored Texture::Extensions to simplify it and make it more efficient. 2010-03-15 10:32:03 +00:00
Robert Osfield
9ab856323d Added export for PerContextShader. 2010-03-11 14:48:54 +00:00
Robert Osfield
1e1c79f257 Updated version 2010-03-10 16:31:15 +00:00
Robert Osfield
86f491e649 Replaced use of unsigned int/enum mask combinations with int/enum mask combinations to avoid the need for casting enums to unsigned ints,
and to avoid associated warnings.

Update wrappers to reflect these changes.
2010-03-05 12:55:08 +00:00
Robert Osfield
273420bb1c Updated version and soversion numbers 2010-03-05 12:53:08 +00:00
Robert Osfield
5383297cbe Change Shader::getPCS(..) from protected to public scope to enable isCompiled() method to be accessible in applications.
Updated wrappers
2010-03-05 11:30:50 +00:00
Robert Osfield
bbca791251 From Michael Platings, "Here's the all-new, all-dancing DAE plugin, with support for reading
osgAnimation. It's been tested with the majority of the samples in the
COLLADA test repository and works with all of them either as well as, or
better than, the version of the plugin currently in SVN.

Known issue: vertex animation (AKA morphing) doesn't work at present,
but that's a relatively unpopular method of animating so it's not high
on my priority list."

Follow up email:
"I've been informed that the previous DAE submission didn't build on
unix, so here's the submission again with the fixes.  Thanks to Gregory Potdevin and Benjamin Bozou.
Also, my apologies to Roland for not crediting his part in making DAE
animation happen, my work was indeed built on top of his work. Thanks
also to Marius Heise and of course Cedric Pinson."

Changes by Robert Osfield, fixed compile issues when compile without C* automatic conversion enabled in ref_ptr<>
and constructor initialization fixes to address some warnings under gcc.
2010-02-26 14:41:50 +00:00
Robert Osfield
d50eacd07e From Paul Martz, "The changes are very similar to Magne's, except they now take the near plane into account. The changes are:
* Change OcclusionQueryNode::getPassed to take a NodeVisitor rather than the distance from BS center to the eye point. Change where CullVisitor calls this method to use the new parameters.
 * getPassed now exits early and returns true to avoid blinking / blink-in of geometry for the first frame or for out-of-range LOD children coming back into view.
 * getPassed now considers the distance from the near plane to the bounding sphere (rather than eye point to bounding sphere) when determining if the viewer is "inside" the bounding sphere or not."
2010-02-26 10:13:28 +00:00
Robert Osfield
8059c4a745 From Chris Hanson, comment fix. 2010-02-25 18:03:14 +00:00
Robert Osfield
9a45538db9 Added an empty() method 2010-02-22 17:41:35 +00:00
Robert Osfield
bb21136d92 Added missing _ptr = rp._ptr to constructor. 2010-02-22 08:39:33 +00:00
Robert Osfield
b1001c2a9c Moved implementation of Observer destructor and constructor from header into .cpp to avoid possible issues with imports/exports under Windows build. 2010-02-19 20:18:48 +00:00
Robert Osfield
8b67830f6e Added check against OSG_GL3_AVAILABLE to avoid issues with GL3 build under linux 2010-02-19 20:14:12 +00:00
Robert Osfield
eca4361c4a Clean up observer_ptr<> and removed the eronous casting of ptr in objectDeleted. 2010-02-19 19:50:55 +00:00
Robert Osfield
b807fc83fe Added mutex lock to destructor. 2010-02-19 16:04:33 +00:00
Robert Osfield
8f11af8d3e Replaced local mutex with getObserverMutex(). 2010-02-19 15:41:42 +00:00
Robert Osfield
530c947c94 Added an InitGlobalMutexes to enforce early construction and hence late destruction of singleton mutexes. 2010-02-19 09:02:24 +00:00
Robert Osfield
b5c5ae7185 Added newline. 2010-02-18 22:53:15 +00:00
Robert Osfield
b09757bdb8 Refactored the osg::Referenced observerset code so that it now uses a dedicated ObserverSet class,
which utilises a global recursive mutex that is dedicated to manage Observer and ObserverSet.

The new global mutex for observers avoids problems with deadlocks that were occurring previously when
an osg::Refenced object was being deleted at the same time as on osg::ObserverNodePath.
2010-02-18 21:21:12 +00:00
Robert Osfield
6196652ef0 Replaced use of observer_ptr<> with straight C pointer to avoid thrashing of an observer_ptr<> every frame.
Changed include to point to new Observer header
2010-02-18 21:18:49 +00:00
Robert Osfield
ab66740fb0 Added new setNodePathTo() method 2010-02-18 09:00:37 +00:00
Robert Osfield
26a9e499a4 Fixed crash 2010-02-16 14:05:49 +00:00
Robert Osfield
a8e26f3a0c Threads safety fixes based on suggestions from Tim Moore. 2010-02-16 11:10:49 +00:00
Robert Osfield
ff38da1290 Refactor various NodeTracker and MatrixManipulator classes to use the osg::ObserverNodePath and osg::oberserver_ptr<> classes 2010-02-15 20:15:32 +00:00
Robert Osfield
4a567d9954 Introduced new osg::ObserverNodePath class that robustly manages a NodePath in a thread safe manner,
making it easier for users to track a NodePath even when nodes in the path get deleted.
2010-02-15 20:14:32 +00:00
Robert Osfield
644b2e15d1 Refactored the osg::Observer to introduce a new bool Observer::objectUnreferenced(void*) method that adds
the extra capability of making it possible for Observers to assume ownership of a object that would otherwsie be deleted.

Added a thread safe ref_ptr<T> observer_ptr<T>::lock() method for robust access to an observed object.  This
makes observer_ptr<> more equivilant to boosts weak_ptr.
2010-02-15 20:12:53 +00:00
Robert Osfield
d6179e7eb5 Added osg:: qualifyer to OSG_NOTIFY macro 2010-02-15 11:36:05 +00:00
Robert Osfield
a673abac3d Introduced OSG_WARN, OSG_NOTICE, OSG_INFO, OSG_DEBUG convinience macros that map to OSG_NOTIFY(osg::WARN) etc.
Introduced the OSG_NOTIFY_DISABLE Cmake variable + include/osg/Config #define to control whether the OpenSceneGraph build
should disable the notification system completely.  By setting OSG_NOTIFY_DISABLE to ON in CMake and then rebuilding the
the OSG you can get a slightly smaller (~1%) and more slightly efficient library which can be good for shipping applications,
but with downside of reduced ability to detect runtime problems and their causes.
2010-02-12 11:45:00 +00:00
Robert Osfield
c5d0ff600b Fixed typo 2010-02-10 12:48:21 +00:00
Robert Osfield
f17e401347 Convert NOTIFY to OSG_NOTIFY to avoid problems with polution of users apps with the NOTIFY macro 2010-02-10 12:44:59 +00:00
Robert Osfield
5792bc6d99 Introduced NOTIFY macro to help out with avoiding using of streams with notification level is below the user defined cutoff. This addition has been introduced to help out with avoid threading performance issues with the Microsoft ostream implementation. 2010-02-09 17:39:43 +00:00
Robert Osfield
be46c61eb1 Added extra elaspedTime_*() methods to help with reporting times in milliseconds etc. 2010-02-09 17:38:02 +00:00
Robert Osfield
f3575e6a40 Added #defines for GL3 build 2010-02-03 09:35:05 +00:00
Robert Osfield
921d8b5a02 From Juan Hernando, fixed typo in handling of RGBA and BGRA data 2010-01-26 16:50:26 +00:00
Robert Osfield
144d3e7af3 From Lars Nilsson, "Attached is a small program doing intersection calculations, both with and without KdTree. The geometry is a TRIANGLE_STRIP consisting of five vertices, all with the same rather high Z-value. If the intersection calculation uses KdTree, it fails. When I changed osg::Vec3 to osg::Vec3d in a few places in osg::KdTree it finds the correct intersection point."
From Robert Osfield, I didn't merge the change of parameter type of IntersectKdTree::intersect() as the internal maths is all done in Vec3s. Keeping Vec3 here hasn't effected the test results.
2010-01-26 13:05:05 +00:00
Robert Osfield
6f3966038f From Serge Lages, "Here is a patch to allow setting an audio volume with the AudioSink interface, I've also modified the ffmpeg plugin code to implement the ImageStream's setVolume method with its AudioSink." 2010-01-18 12:43:02 +00:00
Robert Osfield
f53c3c1036 Updated so version 2010-01-14 15:15:08 +00:00
Robert Osfield
8541761fe7 For backwards compatiblity add a staic void BufferObject::deleteBufferObject(unsigned int contextID,GLuint globj) method. 2010-01-13 18:46:52 +00:00
Robert Osfield
d891a56e8d From Wang Rui, "Attached are two simple modifications of osg::Sequence and
osg::Texture1D classes, for the reason of implementing the I/O
serialization feature. In the Sequence header, I've added some more
convenient functions: setTimeList/getTimeList,
setLoopMode/getLoopMode, setBegin/getBegin, setEnd/getEnd,
setSpeed/getSpeed and setNumRepeats/getNumRepeats.

In the Texture1D header, fixed:

inline void setTextureWidth(int width) const ...

to:

inline void setTextureWidth(int width) ..."

Notes from Robert Osfield, have gone a little further with these changes and have removed some of the original get methods that were out of step with the way the rest of the OSG manages the set/get property pairs.
2010-01-13 13:30:14 +00:00
Robert Osfield
a31aa512d7 From Rob Radtke, "I recently ran into some issues trying to save/load a scene graph as a .ive file. The problems came about because the scene graph contained depth textures in it. I have attached a patch (against the current revision: 10919) that fixes the issues that I encountered. Both attachments contain the same patch--one is a .zip file that contains the modified files and the other is a text patch file. Here is a summary of the changes I made:
1) Add getShadowComparison() accessor function to osg::Texture class
2) Modify ReaderWriterTiff::writeTifStream() and _readColor() (in Image.cpp) to handle pixelFormat==GL_DEPTH_COMPONENT as if it were GL_LUMINANCE
3) Modify the Texture classes of the ive and osg plug-ins so that they save/load the following Texture members: _use_shadow_comparison, _shadow_compare_func and _shadow_texture_mode
"
2010-01-08 11:32:55 +00:00
Robert Osfield
248a0813db From Lilith Bryant, "As discussed previously on the users list. Fixes the redundant calls to
glActiveTexture on every State::apply after more than one texunits have been
used.

This is against 2.9.6 (I think SVN head is the same)

Quick Synopsis:

New functions:

State::applyModeOnTexUnit
State::applyAttributeOnTexUnit
State::applyModeMapOnTexUnit
State::applyAttributeMapOnTexUnit
State::applyModeListOnTexUnit
State::applyAttributeListOnTexUnit

All copies of the normal versions, but they also set the active tex unit if
absolutely necessary (i.e. only if they call something OpenGL).

State::apply (*2)
State::applyTextureAttribute

Changed to call the above functions and no longer call setActiveTextureUnit
themselves.

State::setActiveTextureUnit

Made inline, so the benefit of having applyModeOnTexUnit (etc) inline
is retained.
"
2010-01-07 16:49:12 +00:00