Commit Graph

2299 Commits

Author SHA1 Message Date
Robert Osfield
8ab27a20d2 Build fix for VS and installing Types
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15077 16af8721-9629-0410-8352-f15c8da7e697
2015-08-10 05:04:56 +00:00
Robert Osfield
0dd625f17e Added explicit initialization of osg::Referenced(true) to osg::Operation subclasses as it uses virtual inhertiance from osg::Referenced.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15025 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 15:46:47 +00:00
Robert Osfield
435a81a905 From Pjotr Svetachov, buid fixes for VS2015.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15021 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 14:37:17 +00:00
Robert Osfield
ec8779ca6f Moved GL_ALPHA_TEST from AlphaFunc header to GLDefines header
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15002 16af8721-9629-0410-8352-f15c8da7e697
2015-07-22 14:03:24 +00:00
Robert Osfield
36352031ef Fixed typo
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14997 16af8721-9629-0410-8352-f15c8da7e697
2015-07-21 13:42:35 +00:00
Robert Osfield
1859e27501 From Terry Welsh, "fThis fixes problem where new glClipControl feature would not compile for GLES2 profile"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14943 16af8721-9629-0410-8352-f15c8da7e697
2015-07-13 08:48:46 +00:00
Robert Osfield
08893c7fcc Moved the defination of GL_MAX_VARYING_COMPONENTS to GL_3_0 block to avoid warnings of redefinition.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14933 16af8721-9629-0410-8352-f15c8da7e697
2015-07-02 08:52:55 +00:00
Robert Osfield
b4cd40cf7c From Mathias Froehlich, "Attached a new state attribute implementing the glClipControl that appeared with GL4.5."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14928 16af8721-9629-0410-8352-f15c8da7e697
2015-06-30 09:11:00 +00:00
Robert Osfield
fe09ebfbdb From Christian Kehl, added Vec2::set(const Vec2) method
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14924 16af8721-9629-0410-8352-f15c8da7e697
2015-06-26 09:40:37 +00:00
Robert Osfield
824cc95518 Experiment with how to define GLsizeiptr.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14917 16af8721-9629-0410-8352-f15c8da7e697
2015-06-15 13:51:29 +00:00
Robert Osfield
fc9848ff19 Reverted the typdef GLfloat GLdouble for Andoid as this was causing conflicts.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14910 16af8721-9629-0410-8352-f15c8da7e697
2015-06-11 08:44:26 +00:00
Robert Osfield
bd9bd3f8b2 Added namespace around typedef to avoid conflict issues
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14903 16af8721-9629-0410-8352-f15c8da7e697
2015-06-09 12:51:38 +00:00
Robert Osfield
7e05d2fd54 Introduce osg::Object::asNode(), asNodeVisitor(), asStateAttribute() and asUniform() to replace dynamic_cast<> usage in Callback.cpp.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14902 16af8721-9629-0410-8352-f15c8da7e697
2015-06-09 10:49:34 +00:00
Robert Osfield
9222506a2c Added doxygen comment for typedef
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14888 16af8721-9629-0410-8352-f15c8da7e697
2015-06-03 09:06:44 +00:00
Robert Osfield
e3f0876e87 From Konstantin Matveyev, "I've changed osg::Uniform::Callback to osg::UniformCallback.
osg::UniformCallback inherits osg::Callback now.

I don't really now if this class should be inside osgWrappers/serializers
because StateAttributeCallback is not presented there, but i've included it in the patch.


Please see archive in the attachment.


PS
DEEP_COPY_UNIFORMS works for me.
"
Note from Robert Osfield, added typedef UniformCallback Callback for backwards compatibility.



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14885 16af8721-9629-0410-8352-f15c8da7e697
2015-06-02 09:33:22 +00:00
Robert Osfield
ba9dfb2ff6 From Albert Luaces, typo fixes.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14883 16af8721-9629-0410-8352-f15c8da7e697
2015-06-01 13:40:20 +00:00
Robert Osfield
d14a602a59 From Jannik Heller, typo fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14882 16af8721-9629-0410-8352-f15c8da7e697
2015-06-01 13:11:49 +00:00
Robert Osfield
78a01ce2a5 From Jannik Heller, "I have added new functions Texture::generateAndAssignTextureObject mirroring the Texture::generateTextureObject functions.
I have left the Texture::generateTextureObject functions intact as I'm not sure if/how it's used outside the core OSG. If you feel that compatibility isn't important in that area feel free to drop it.

While testing the build with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION=OFF I found a compile error in GlyphGeometry.cpp that was entirely unrelated to the changes I've made. The fix is included in the patch.

There is one thing left to fix and that is Texture2D::SubloadCallback:

        class OSG_EXPORT SubloadCallback : public Referenced
        {
            public:
                ....
                virtual TextureObject* generateTextureObject(const Texture2D& texture, State& state) const
                {
                    return osg::Texture::generateTextureObject(&texture, state.getContextID(), GL_TEXTURE_2D);
                }
                ...
         }"
         


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14879 16af8721-9629-0410-8352-f15c8da7e697
2015-06-01 10:50:44 +00:00
Robert Osfield
f72b62a065 From Jannik Heller, fix for race condition in orphanded BufferObject handling.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14877 16af8721-9629-0410-8352-f15c8da7e697
2015-05-29 07:52:27 +00:00
Robert Osfield
5380aebfc1 From Christian Kehl, changes for making osgAndroid working with GLES1 enabled
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14862 16af8721-9629-0410-8352-f15c8da7e697
2015-04-30 14:04:51 +00:00
Robert Osfield
e52b95e084 Renamed LineSegment::intersect(BoundingSphere/Box, double/float&, double/float&) methods to LineSegment::intersectAndComputeRations(..) to avoid confusion with the change in convention for
the old intersect(BoundingBox&, float/double&, float/double&) method as it was inconsitent with the rest of the OSG including the intersect(BoundingSphere) method in how the ratio for the
second intersection was measure from - original from the end point, but now made consistent with other places in the OSG so be based on ration from start to end of segment.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14859 16af8721-9629-0410-8352-f15c8da7e697
2015-04-27 19:31:13 +00:00
Robert Osfield
87122ca369 Fixed typo of SEPARATE enums
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14833 16af8721-9629-0410-8352-f15c8da7e697
2015-04-13 11:48:28 +00:00
Robert Osfield
0a1db3d6fc From Jannik Heller, typo fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14832 16af8721-9629-0410-8352-f15c8da7e697
2015-04-13 10:43:56 +00:00
Robert Osfield
70b5297575 From Jannik Heller, typo fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14826 16af8721-9629-0410-8352-f15c8da7e697
2015-04-07 18:01:12 +00:00
Robert Osfield
4c84742664 Improved the doxygen comment for the new createImageWithOrientationConversion(..) function.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14820 16af8721-9629-0410-8352-f15c8da7e697
2015-04-03 13:34:13 +00:00
Robert Osfield
40a7f903ec Implemented an osg::createImageWithOrientationConversion(...) method to aid for changing orientation of images.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14818 16af8721-9629-0410-8352-f15c8da7e697
2015-04-03 13:19:32 +00:00
Robert Osfield
a7ba138dc7 Introduced osg::Camera::resize(..) method and associated enum thus:
enum ResizeMask
        {
            RESIZE_VIEWPORT=1,
            RESIZE_ATTACHMENTS=2,
            RESIZE_PROJECTIONMATRIX=4,
            RESIZE_DEFAULT=RESIZE_VIEWPORT|RESIZE_ATTACHMENTS
        };

        /** Resize, to the specified width and height, the viewport, attachments and projection matrix according to the resizeMask provided.
          * Note, the adjustment of the projection matrix is done if the RESIZE_PROJECTIONMATRIX mask to set and according to the rules specified in the ProjectionResizePolicy. */
        void resize(int width, int height, int resizeMask=RESIZE_DEFAULT);



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14811 16af8721-9629-0410-8352-f15c8da7e697
2015-03-31 16:23:43 +00:00
Robert Osfield
99f7bfab3b Introduced Camera::resizeAttachments(int width, int height) to resize all the Texture and Image assigned the the Camera attachments.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14810 16af8721-9629-0410-8352-f15c8da7e697
2015-03-31 15:08:13 +00:00
Robert Osfield
307e70f13b Added Camera::dirtyAttachmentMap(), Camera::s/getAttachmentMapModified() value and usage of this in RenderStage as a new mechanism
for telling the rendering backend to update itself to reflect new values in the attachments such as new texture or image sizes.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14808 16af8721-9629-0410-8352-f15c8da7e697
2015-03-31 10:36:38 +00:00
Robert Osfield
75b9cd3627 Completed support for assigning 3D osg::Image to osg::Texture2DArray.
Improved the osgtexture2DArray example to add --mipmap and --packed command line options to help with testing.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14775 16af8721-9629-0410-8352-f15c8da7e697
2015-03-11 17:27:08 +00:00
Robert Osfield
c30be2355b Work in progress to allow osg::Texture2DArray to be set up with a single osg::Image containing 3D image data.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14773 16af8721-9629-0410-8352-f15c8da7e697
2015-03-10 18:15:02 +00:00
Robert Osfield
1d9e7f144b From Michael McDonnel, "The tessellation shader example has a small bug.The middle of the
geometry is clipped as soon as it is tessellated. The clipping is
probably caused by rounding errors because it is only in one spot. The
clipping disappears when the camera is moved, and reappears when it is
moved back. Expanding the the bounding box fixed the clipping bug."

Tweaked by Robert Osfield to expand it to a -1 to 1 unit box.
Actual clipping bug is not due to rounding errors but the shaders creating vertices outside the bounding box of the original input vertices


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14747 16af8721-9629-0410-8352-f15c8da7e697
2015-03-02 12:09:25 +00:00
Robert Osfield
77f662f9f7 From Julien Valentin and Alberto Luaces, added support for transform feedback extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14728 16af8721-9629-0410-8352-f15c8da7e697
2015-02-26 17:49:36 +00:00
Robert Osfield
afbf20eba9 First step of refactoring the osg::Program management in osgTerrain::GeometryPool for better performance by placing default osg::Program and shader defines on a single StateSet below the osgTerrain::Terrain
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14704 16af8721-9629-0410-8352-f15c8da7e697
2015-02-20 15:02:43 +00:00
Robert Osfield
53198f2e9b Cleaned up warning generated when compiling osgocculusviewer
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14695 16af8721-9629-0410-8352-f15c8da7e697
2015-02-17 10:36:41 +00:00
Robert Osfield
6bddbdf074 Improvements to the #pragma(tic) shader composition support
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14694 16af8721-9629-0410-8352-f15c8da7e697
2015-02-13 12:50:43 +00:00
Robert Osfield
4a9f4aae9d Added GL #define for Windows build
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14687 16af8721-9629-0410-8352-f15c8da7e697
2015-02-11 09:41:15 +00:00
Robert Osfield
a676d5d37b Windows build fix
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14686 16af8721-9629-0410-8352-f15c8da7e697
2015-02-10 21:13:16 +00:00
Robert Osfield
b90503fdf5 Introduced new shader composition approach that utilizes #pragma requires(), #pragma import_defines() and #ifdef in GLSL to enable multiple different versions of shaders based
on defines passed in from osg::StateSet::setDefine(..).



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14681 16af8721-9629-0410-8352-f15c8da7e697
2015-02-10 17:04:02 +00:00
Robert Osfield
1debc21bb2 Removed unncessary _EXT
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14679 16af8721-9629-0410-8352-f15c8da7e697
2015-02-03 16:36:19 +00:00
Robert Osfield
a9804d7e19 Replaced _EXT defines with GL-3.2 versions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14677 16af8721-9629-0410-8352-f15c8da7e697
2015-01-27 15:07:53 +00:00
Robert Osfield
f5faf615ef Added #define GL_SEPARATE_ATTRIBS and correcte GL_INTERLEAVED_ATTRIBS
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14673 16af8721-9629-0410-8352-f15c8da7e697
2015-01-22 16:49:00 +00:00
Robert Osfield
e330e9309c Added GL_INTERLEAVED_ATTRIBS for windows build
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14671 16af8721-9629-0410-8352-f15c8da7e697
2015-01-22 15:08:26 +00:00
Robert Osfield
d5f2c34f24 From Andreas Henne, OpenGL core profile fixes required for OSX.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14669 16af8721-9629-0410-8352-f15c8da7e697
2015-01-21 15:35:19 +00:00
Robert Osfield
ed57c8718c Added ability to populate a local vertex cache for when one computes final vertex position in a vertex shader but still want to the Primitive functors to work with the transformed positions.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14655 16af8721-9629-0410-8352-f15c8da7e697
2015-01-12 10:30:50 +00:00
Robert Osfield
134b2e506f Cleaned up GL_TEXTURE_BUFFER_*ARB usage as include/osg/GLDefines now provides the non ARB variants
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14652 16af8721-9629-0410-8352-f15c8da7e697
2015-01-06 17:23:26 +00:00
Robert Osfield
8b384baca9 From Julien Valentin, "To sum up changes, I had:
-some extensions in GLExtensions
  - GL_TEXTURE_BUFFER as target in osg::StateSet
  - a VBO based transform feed back example
"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14651 16af8721-9629-0410-8352-f15c8da7e697
2015-01-06 17:12:51 +00:00
Robert Osfield
73221e8682 Added doxygen comment for ref_ptr<>::release().
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14630 16af8721-9629-0410-8352-f15c8da7e697
2014-12-22 09:50:10 +00:00
Robert Osfield
6f9ac83693 Added DisplaySettings::s/getNvOptimusEnablement() and OSG_NvOptimusEnablement env var control to control the setting of the NvOptimusEnablement variable
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14614 16af8721-9629-0410-8352-f15c8da7e697
2014-12-18 10:59:07 +00:00
Robert Osfield
58c47e9842 From Marc Helbling, "please find enclosed a submission that should improve the VertexAccessOrderVisitor (pre-transform) optimizer:
* it sorts primitives to keep "more complex" primitives first; maybe you'll prefer to have this as an option (but usually it should make more sense to pre-transform triangles before e.g. lines)
* currently, the visitor rely on TriangleIndexFunctor and does not take care of points and lines (see https://github.com/openscenegraph/osg/blob/master/include/osg/TriangleIndexFunctor#L124-130). This can lead to issues e.g. if you store the wireframe lines along with some triangles: the triangles will be reindexed but not the line. I've therefore added osg/include/TriangleLinePointIndexFunctor to index triangles, lines and points and derived VertexReorder from this class.
* to avoid issues, shared arrays are duplicated. However, in some cases (e.g. an UV channel shared in the geometry only) this is not required. I'm adding a SharedArrayOptimizer to optimize this: it looks for duplicated UVs before the array duplication and deduplicate arrays after.
"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14603 16af8721-9629-0410-8352-f15c8da7e697
2014-12-16 09:34:15 +00:00
Robert Osfield
49c48a5509 Added OpenGL Transform Feedback extensions.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14600 16af8721-9629-0410-8352-f15c8da7e697
2014-12-10 13:05:47 +00:00
Robert Osfield
1b6e50a2dd From Marcus Hein, Added support for OpenGL SSBO and SSBB via osg::ShaderStorageBufferObject and osg::ShaderStorageBufferBinding to core OSG library, and added new osgSSBO example
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14599 16af8721-9629-0410-8352-f15c8da7e697
2014-12-10 12:23:04 +00:00
Robert Osfield
92e2d849ed Added GLDefines header
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14597 16af8721-9629-0410-8352-f15c8da7e697
2014-12-10 11:44:16 +00:00
Robert Osfield
3c07921dee Removed old GL2Extensions class, replacing it with a typedef to GL2Extensions
Removed old includes to include/osg/GL2Extensions


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14594 16af8721-9629-0410-8352-f15c8da7e697
2014-12-10 10:44:58 +00:00
Robert Osfield
485709f708 Moved GL2Extensions functionality into the include/osg/GLExtensions header and new GLExtensions object.
Moved the #defines into new include/osg/GLDefines
Converted all GL2Extensions usage to GLExtensions usage


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14593 16af8721-9629-0410-8352-f15c8da7e697
2014-12-10 10:38:12 +00:00
Robert Osfield
09205544b7 Streamlined the extension functions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14592 16af8721-9629-0410-8352-f15c8da7e697
2014-12-10 09:11:17 +00:00
Robert Osfield
7629a5126a Added #ifdef's around GLsync typedef
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14591 16af8721-9629-0410-8352-f15c8da7e697
2014-12-09 21:33:12 +00:00
Robert Osfield
22e51c9902 Windows build fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14590 16af8721-9629-0410-8352-f15c8da7e697
2014-12-09 20:09:29 +00:00
Robert Osfield
43049ebcf1 Moved FBO Extensions into GL2Extensions.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14586 16af8721-9629-0410-8352-f15c8da7e697
2014-12-09 18:30:28 +00:00
Robert Osfield
d5fcdabfa1 Removed no longer used Extension definition
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14585 16af8721-9629-0410-8352-f15c8da7e697
2014-12-09 14:58:34 +00:00
Robert Osfield
e31f682451 Moved local Extensions structs into GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14584 16af8721-9629-0410-8352-f15c8da7e697
2014-12-09 14:57:25 +00:00
Robert Osfield
3f1e77d479 Moveved Stencil/StencilTwoSided::Extensions into GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14583 16af8721-9629-0410-8352-f15c8da7e697
2014-12-09 11:14:33 +00:00
Robert Osfield
ec4f898bce Moved local Extensions objects to GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14582 16af8721-9629-0410-8352-f15c8da7e697
2014-12-09 10:37:09 +00:00
Robert Osfield
cceee38727 Moved Texture*::Extensions functionality into GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14581 16af8721-9629-0410-8352-f15c8da7e697
2014-12-09 10:05:59 +00:00
Robert Osfield
a8804e2366 MOved VertexProgram and FragmentProgram::Extensions into GL2Extensions.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14580 16af8721-9629-0410-8352-f15c8da7e697
2014-12-08 16:08:44 +00:00
Robert Osfield
bc424bc54f MOved SampleMaski::Extensions into osg::GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14577 16af8721-9629-0410-8352-f15c8da7e697
2014-12-07 17:31:49 +00:00
Robert Osfield
9b03b3f8ce Moved TextureCubeMap::Extension functionality into GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14576 16af8721-9629-0410-8352-f15c8da7e697
2014-12-05 20:05:18 +00:00
Robert Osfield
f634152de0 Moved osg::Drawable::Extensions into osg::GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14575 16af8721-9629-0410-8352-f15c8da7e697
2014-12-05 17:26:42 +00:00
Robert Osfield
aa090f0f99 From the GLintptr + GLsizeiptr defintions to GL2Extensions header
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14572 16af8721-9629-0410-8352-f15c8da7e697
2014-12-05 08:58:23 +00:00
Robert Osfield
d83e641fad Moved osg::BlenFunc::Extensions into osg::GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14571 16af8721-9629-0410-8352-f15c8da7e697
2014-12-04 19:03:16 +00:00
Robert Osfield
d02c0bdc49 Moved GLBufferObject::Extensions structure into osg::GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14570 16af8721-9629-0410-8352-f15c8da7e697
2014-12-04 18:13:11 +00:00
Robert Osfield
1791ac08a8 Added glMemoryBarrier, glMapBufferRange and glBindBufferBase to GL2Extensions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14568 16af8721-9629-0410-8352-f15c8da7e697
2014-12-04 17:12:55 +00:00
Robert Osfield
66da1328f8 Ported GL2Extentions across to using the new GL extensions approach - cutting code count by 3000 lines!
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14566 16af8721-9629-0410-8352-f15c8da7e697
2014-12-04 16:22:31 +00:00
Robert Osfield
5efe60dcf5 Added osg::Capability and Cabibilityi base classes to wrap up glEnable/glDisable + glEnablei/glDisablei functionality, with osg::Enablei and osg::Disablei concrete implementations.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14564 16af8721-9629-0410-8352-f15c8da7e697
2014-12-03 17:31:16 +00:00
Robert Osfield
457d41d385 Added osg::BlendFunci, osg::BlendEquationi and osg::ColorMaski StateAttrirbutes that wrap the glBlendFunci, glBlendEquationi and glColorMaski functions
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14563 16af8721-9629-0410-8352-f15c8da7e697
2014-12-02 17:12:56 +00:00
Robert Osfield
a9cab19ddb Moved BlendEquation across to using the new GL extension setup approach.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14562 16af8721-9629-0410-8352-f15c8da7e697
2014-12-02 15:37:07 +00:00
Robert Osfield
ff73445bf3 Added a template get and get_exisiting method into osg::State that implements a new mechanism for managing OpenGL extensions.
Refactored the BendFunc::Extensions usage to simplify it utilizing the new osg::State extension mechanism.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14560 16af8721-9629-0410-8352-f15c8da7e697
2014-12-02 11:10:23 +00:00
Robert Osfield
e5f5c30e4d Removed include/osg/Version and include/OpenThreads/Version headers as these are autogenerated.
Changed the paths for the OpenThreads/osg Version headers to be placed in the PROJECT_BINARY_DIR.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14557 16af8721-9629-0410-8352-f15c8da7e697
2014-11-28 16:10:14 +00:00
Robert Osfield
d7c6bb1c4b Standardized on defined(__ANDROID__)
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14556 16af8721-9629-0410-8352-f15c8da7e697
2014-11-28 10:54:40 +00:00
Robert Osfield
4c5a1885d2 From PawelKsiezopolski, "This submission contains a new example for OSG : a geometry instancing rendering
algorithm consisting of two consequent phases :

- first phase is a GLSL shader performing object culling and LOD picking ( a culling shader ).
  Every culled object is represented as GL_POINT in the input osg::Geometry.
  The output of the culling shader is a set of object LODs that need to be rendered.
  The output is stored in texture buffer objects. No pixel is drawn to the screen
  because GL_RASTERIZER_DISCARD mode is used.

- second phase draws osg::Geometry containing merged LODs using glDrawArraysIndirect()
  function. Information about quantity of instances to render, its positions and other
  parameters is sourced from texture buffer objects filled in the first phase.

The example uses various OpenGL 4.2 features such as texture buffer objects,
atomic counters, image units and functions defined in GL_ARB_shader_image_load_store
extension to achieve its goal and thus will not work on graphic cards with older OpenGL
versions.

The example was tested on Linux and Windows with NVidia 570 and 580 cards.
The tests on AMD cards were not conducted ( due to lack of it ).
The tests were performed using OSG revision 14088.

The main advantages of this rendering method :
- instanced rendering capable of drawing thousands of different objects with
  almost no CPU intervention  ( cull and draw times are close to 0 ms ).
- input objects may be sourced from any OSG graph ( for example - information about
  object points may be stored in a PagedLOD graph. This way we may cover the whole
  countries with trees, buildings and other objects ).
  Furthermore if we create osgDB plugins that generate data on the fly, we may
  generate information for every grass blade for that country.
- every object may have its own parameters and thus may be distinct from other objects
  of the same type.
- relatively low memory footprint ( single object information is stored in a few
  vertex attributes ).
- no GPU->CPU roundtrip typical for such methods ( method uses atomic counters
  and glDrawArraysIndirect() function instead of OpenGL queries. This way
  information about quantity of rendered objects never goes back to CPU.
  The typical GPU->CPU roundtrip cost is about 2 ms ).
- this example also shows how to render dynamic objects ( objects that may change
  its position ) with moving parts ( like car wheels or airplane propellers ) .
  The obvious extension to that dynamic method would be the animated crowd rendering.
- rendered objects may be easily replaced ( there is no need to process the whole
  OSG graphs, because these graphs store only positional information ).

The main disadvantages of a method :
- the maximum quantity of objects to render must be known beforehand
  ( because texture buffer objects holding data between phases have constant size ).
- OSG statistics are flawed ( they don't know anymore how many objects are drawn ).
- osgUtil::Intersection does not work

Example application may be used to make some performance tests, so below you
will find some extended parameter description :
--skip-dynamic       - skip rendering of dynamic objects if you only want to
                       observe static object statistics
--skip-static        - the same for static objects
--dynamic-area-size  - size of the area for dynamic rendering. Default = 1000 meters
                       ( square 1000m x 1000m ). Along with density defines
                       how many dynamic objects is there in the example.
--static-area-size   - the same for static objects. Default = 2000 meters
                       ( square 2000m x 2000m ).

Example application defines some parameters (density, LOD ranges, object's triangle count).
You may manipulate its values using below described modifiers:
--density-modifier   - density modifier in percent. Default = 100%.
                       Density ( along with LOD ranges ) defines maximum
                       quantity of rendered objects. registerType() function
                       accepts maximum density ( in objects per square kilometer )
                       as its parameter.
--lod-modifier       - defines the LOD ranges. Default = 100%.
--triangle-modifier  - defines the number of triangles in finally rendered objects.
                       Default = 100 %.
--instances-per-cell - for static rendering the application builds OSG graph using
                       InstanceCell class ( this class is a modified version of Cell class
                       from osgforest example - it builds simple quadtree from a list
                       of static instances ). This parameter defines maximum number
                       of instances in a single osg::Group in quadtree.
                       If, for example, you modify it to value=100, you will see
                       really big cull time in OSG statistics ( because resulting
                       tree generated by InstanceCell will be very deep ).
                       Default value = 4096 .
--export-objects     - write object geometries and quadtree of instances to osgt files
                       for later analysis.
--use-multi-draw     - use glMultiDrawArraysIndirect() instead of glDrawArraysIndirect() in a
                       draw shader. Thanks to this we may render all ( different ) objects
                       using only one draw call. Requires OpenGL version 4.3 and some more
                       work from me, because now it does not work ( probably I implemented
                       it wrong, or Windows NVidia driver has errors, because it hangs
                       the apllication at the moment ).

This application is inspired by Daniel Rákos work : "GPU based dynamic geometry LOD" that
may be found under this address : http://rastergrid.com/blog/2010/10/gpu-based-dynamic-geometry-lod/
There are however some differences :
- Daniel Rákos uses GL queries to count objects to render, while this example
  uses atomic counters ( no GPU->CPU roundtrip )
- this example does not use transform feedback buffers to store intermediate data
  ( it uses texture buffer objects instead ).
- I use only the vertex shader to cull objects, whereas Daniel Rákos uses vertex shader
  and geometry shader ( because only geometry shader can send more than one primitive
  to transform feedback buffers ).
- objects in the example are drawn using glDrawArraysIndirect() function,
  instead of glDrawElementsInstanced().

Finally there are some things to consider/discuss  :
- the whole algorithm exploits nice OpenGL feature that any GL buffer
  may be bound as any type of buffer ( in our example a buffer is once bound
  as a texture buffer object, and later is bound as GL_DRAW_INDIRECT_BUFFER ).
  osg::TextureBuffer class has one handy method to do that trick ( bindBufferAs() ),
  and new primitive sets use osg::TextureBuffer as input.
  For now I added new primitive sets to example ( DrawArraysIndirect and
  MultiDrawArraysIndirect defined in examples/osggpucull/DrawIndirectPrimitiveSet.h ),
  but if Robert will accept its current implementations ( I mean - primitive
  sets that have osg::TextureBuffer in constructor ), I may add it to
  osg/include/PrimitiveSet header.
- I used BufferTemplate class writen and published by Aurelien in submission forum
  some time ago. For some reason this class never got into osg/include, but is
  really needed during creation of UBOs, TBOs, and possibly SSBOs in the future.
  I added std::vector specialization to that template class.
- I needed to create similar osg::Geometries with variable number of vertices
  ( to create different LODs in my example ). For this reason I've written
  some code allowing me to create osg::Geometries from osg::Shape descendants.
  This code may be found in ShapeToGeometry.* files. Examples of use are in
  osggpucull.cpp . The question is : should this code stay in example, or should
  it be moved to osgUtil ?
- this remark is important for NVidia cards on Linux and Windows : if
  you have "Sync to VBlank" turned ON in nvidia-settings and you want to see
  real GPU times in OSG statistics window, you must set the power management
  settings to "Prefer maximum performance", because when "Adaptive mode" is used,
  the graphic card's clock may be slowed down by the driver during program execution
  ( On Linux when OpenGL application starts in adaptive mode, clock should work
  as fast as possible, but after one minute of program execution, the clock slows down ).
  This happens when GPU time in OSG statistics window is shorter than 3 ms.
"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14531 16af8721-9629-0410-8352-f15c8da7e697
2014-11-25 10:58:23 +00:00
Robert Osfield
86ddca4edb Added VertexAttribDivisor class to wrap up glVertexAttribDivisor function
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14526 16af8721-9629-0410-8352-f15c8da7e697
2014-11-24 14:54:39 +00:00
Robert Osfield
fce7137525 Added numTextureUnits parameter to the osg::State::resetVertexAttributeAlias(bool, unit) method, and set the default to 8.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14523 16af8721-9629-0410-8352-f15c8da7e697
2014-11-24 14:01:05 +00:00
Robert Osfield
a97f104ab6 Added comment clarifying how Image::getColor(..) out of 0..1 range texcoords are handled - now clamped to edge.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14520 16af8721-9629-0410-8352-f15c8da7e697
2014-11-21 20:15:30 +00:00
Robert Osfield
e67466a74f From Sebastian Messerschmidt, "Added setColor function to modify an image based on texture coordinates, parallel to the getColor functionality."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14517 16af8721-9629-0410-8352-f15c8da7e697
2014-11-21 16:27:29 +00:00
Robert Osfield
c71016bd3c From Sebastian Messerschmidt, "Attached you find a change adding a getNumSamples() function to retrieve the value set via setNumSamples."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14515 16af8721-9629-0410-8352-f15c8da7e697
2014-11-21 10:44:01 +00:00
Robert Osfield
5da4e80e95 From Claus Steuer, "XCode 6, IOs 8.1 SDK Compile fix : There are some undefined texture formats when compiling osg for IOs 8.1 with XCode 6 and OpenGLES2 enabled."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14510 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 17:37:52 +00:00
Robert Osfield
f8c4ad4b90 From Pjotr Svetachov, "I was experimenting with VBO's to try to get them on par with display
lists when drawing lots of batches and noticed that my program
generated a lot of unneeded glClientActiveTexture calls. Digging
deeper I found out it came from State::disableTexCoordPointer where
the function would call glClientActiveTexture but not
glDisableClientState because the geometry didn't have texture
coordinates for that channel. This is because in our scene there are
some geometries that have move than one uv channels making
State::_texCoordArrayList grow. Then the method
State::applyDisablingOfVertexAttributes() will call
disableTexCoordPointer multiple times.

I rearrange the method a little to combat this. Now the logic has the
same ordering as disableTexCoordPointersAboveAndIncluding which
already combats this."


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14508 16af8721-9629-0410-8352-f15c8da7e697
2014-11-20 17:00:14 +00:00
Robert Osfield
a84df15c0a Introduced use of MarkerObject to IncrmentalCompileOperation/DatabasePager as a way of marking objects that have already been processed and compiled,
thus avoid potential threading conflicts when paged subgraphs are reused.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14470 16af8721-9629-0410-8352-f15c8da7e697
2014-11-06 10:40:54 +00:00
Robert Osfield
28a676e105 Replaced use of while(isRunning()) { YieldCurrentThread(); } style loops with use of join() to avoid false positives being reported by valgrind when using the helgrind tool for thread debugging.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14460 16af8721-9629-0410-8352-f15c8da7e697
2014-11-04 10:46:59 +00:00
Robert Osfield
4c1fd06252 Added osg::SyncSwapBuffersCallback to include/osg/GraphicsContext and support for enabling it to include/osg/DisplaySettings, and to the Viewer/CompositeViewer::realize() methods.
To enable the sync of swap buffers set the env var OSG_SYNC_SWAP_BUFFERS to ON or 1, to switch off set to OFF or 0.

One can also use the --sync command line option for application that pass on command line options to the osg::DisplaySettings::instance().


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14456 16af8721-9629-0410-8352-f15c8da7e697
2014-10-21 14:46:12 +00:00
Robert Osfield
6126379362 Changed StateSet::ParentList from vector<Object*> to vector<Node*> to reflect that Drawable is now a Node.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14420 16af8721-9629-0410-8352-f15c8da7e697
2014-08-25 13:43:11 +00:00
Robert Osfield
973ac76197 From Glen Waldron, "Node: patch for remove*Callback() methods to resolve a crash"
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14401 16af8721-9629-0410-8352-f15c8da7e697
2014-08-08 15:45:54 +00:00
Robert Osfield
99cbab1806 Changes to support building against ANDROID under OSX.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14399 16af8721-9629-0410-8352-f15c8da7e697
2014-08-08 09:28:26 +00:00
Robert Osfield
fdd9efe45a Implemented osgUI::Validator, IntValidator and DoubleValidator classes that manage validation/specialization of LineEdit widgets to work with just integer or double values.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14398 16af8721-9629-0410-8352-f15c8da7e697
2014-08-05 18:32:45 +00:00
Robert Osfield
e979f76156 Added NodeVisitor::INTERSECTION_VISITOR VisitorType
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14395 16af8721-9629-0410-8352-f15c8da7e697
2014-07-31 18:29:31 +00:00
Robert Osfield
0bdd7351f6 Added StateSet::RenderBinMode::PROTECTED_RENDERBIN_DETAILS and OVERRIDE_PROTECTED_RENDERBIN_DETAILS options.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14392 16af8721-9629-0410-8352-f15c8da7e697
2014-07-30 12:47:16 +00:00
Robert Osfield
e65d03bf27 Added handling of Drawables added directly to scene graph without Geode decorating them.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14386 16af8721-9629-0410-8352-f15c8da7e697
2014-07-28 16:19:44 +00:00
Robert Osfield
7dc3b34bfd Removed State::AppliedProgramObjectSet container and Obsever usage from osg::State to address threading bug crash.
The State::AppliedProgramObjectSet wasn't ever being used actively in the current rev of the OSG so populating and clearing was no longer neccessary, allowing the code to be removed completely.


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14377 16af8721-9629-0410-8352-f15c8da7e697
2014-07-22 16:02:33 +00:00
Robert Osfield
3b23b474dc Centralized the calling of #include <stdint.h> and VS fallback into include/osg/Types header
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14376 16af8721-9629-0410-8352-f15c8da7e697
2014-07-21 16:36:47 +00:00
Robert Osfield
93938439d9 Fixed indentation
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14369 16af8721-9629-0410-8352-f15c8da7e697
2014-07-21 12:18:43 +00:00
Robert Osfield
5a7a20d01e Renamed osgDB::PropertyInterface to osgDB::ClassInterface to better reflect it's functionality
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14365 16af8721-9629-0410-8352-f15c8da7e697
2014-07-14 14:09:08 +00:00
Robert Osfield
9d5a510441 Updated version number
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14331 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 08:56:08 +00:00
Robert Osfield
5fb078b4f1 From Pjotr Svetachov, "Here is a small fix for a overflow when editing large 3d volume data."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14329 16af8721-9629-0410-8352-f15c8da7e697
2014-06-30 08:46:54 +00:00
Robert Osfield
7a14b224ed Replaced using NodeCallback::run with explict run() implementation.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14322 16af8721-9629-0410-8352-f15c8da7e697
2014-06-28 06:22:47 +00:00
Robert Osfield
8d6bee6da9 Added a render order sort to the list of Cameras being tested by the *Viewer::generatePointerData(..) method to ensure that the highest Camera gets focus.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14309 16af8721-9629-0410-8352-f15c8da7e697
2014-06-27 15:30:56 +00:00
Robert Osfield
92d684de6b Revised KdTreeBuilder so that is used the new apply(osg::Geometry&) method rather than expanding an osg::Geode.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14303 16af8721-9629-0410-8352-f15c8da7e697
2014-06-26 14:16:11 +00:00
Robert Osfield
d22f62396c From Alexander Sinditskiy, "My changes added support for gltexstorrage2d for texture2d.
Initially I described issue in message:
http://forum.openscenegraph.org/viewtopic.php?t=13820
It solves issue with compiling texture using ico from image with mipmaps

I added enviroment variable OSG_GL_TEXTURE_STORAGE_ENABLE to control usage of glTexStorage2d. Initially it is disabled.

It used only if image have mipmaps.

Another issue is converting from internalFormat + type to sized internal format. I created sizedInternalFormats[] struct where sized internal formats are ordered from worse->best.
also this struct have commented lines. Commented formats are listed in
http://www.opengl.org/wiki/GLAPI/glTexStorage2D
but looks like not using in osg."

Note from Robert Osfield.  Changed the env var control to OSG_GL_TEXTURE_STORAGE and made it's value true by default when the feature is supported by the OpenGL driver.  To disable to
use of glTexStorage2D use OSG_GL_TEXTURE_STORAGE="OFF" or "DISABLE"



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14275 16af8721-9629-0410-8352-f15c8da7e697
2014-06-25 09:57:36 +00:00
Robert Osfield
71f7a74091 From Björn Blissing, "I found a minor error in documentation in include/osg/Math.
Function: absolute() had the same description as the function minimum()

I removed the erroneous text."


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14273 16af8721-9629-0410-8352-f15c8da7e697
2014-06-25 08:21:13 +00:00
Robert Osfield
89ca694684 Added using Callback::run() method to Drawable::CullCallback
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14249 16af8721-9629-0410-8352-f15c8da7e697
2014-06-10 08:50:42 +00:00
Robert Osfield
a316c30b4a Removed redudent NodeVisitor::s/getUserData() as osg::Object provide this.
Added using run entry to InteractiveImageHandler to quieten warning




git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14247 16af8721-9629-0410-8352-f15c8da7e697
2014-06-06 15:05:31 +00:00
Robert Osfield
1c699a3664 Added using NodeCallback::run() to avoid warnings
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14246 16af8721-9629-0410-8352-f15c8da7e697
2014-06-06 09:12:43 +00:00
Robert Osfield
d7b99b9062 Added missing OSG_EXPORT
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14245 16af8721-9629-0410-8352-f15c8da7e697
2014-06-06 09:01:25 +00:00
Robert Osfield
977ec20751 Refactored Callback system in osg::Node, osg::Drawable, osg::StateSet and osg::StateAttribute to use a new osg::Callback base class.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14244 16af8721-9629-0410-8352-f15c8da7e697
2014-06-05 16:26:13 +00:00
Robert Osfield
333a16a88d Reverted change of Node::ParentList from being a vector<Node*> back to a vector<Group*> 2014-06-03 09:52:55 +00:00
Robert Osfield
3dde165f14 Refactor osg::Geode to subclass from osg::Group and reuse the NodeList children container 2014-06-03 09:23:24 +00:00
Robert Osfield
2d41cbd0cf Removed OSG_USE_BOUND and associated osg::Bound adapter class to avoid problems with BoundingBox::expandBy/expandByRadius() implementation choosing a null BoundingBox from
the osg::Bound class causing crashes.
2014-06-02 16:20:39 +00:00
Robert Osfield
28c36d615b Added osg::runNamedCallbackObjects(..) convinience method for run all named osg::CallbackObjects attached to an osg::Object 2014-05-21 09:07:25 +00:00
Robert Osfield
9859f3110b Renamed callbacks to avoid overlap with Node callbacks 2014-05-21 09:06:17 +00:00
Robert Osfield
30b54e3af2 Moved the _boundingSphere set method into the update section of the Drawable::getBoundingBox() method
Added an UpdateVisitor::apply(Drawable&) implementation.
2014-05-20 16:09:34 +00:00
Robert Osfield
e70acf4c51 From Pjotr Svetachov, "I stumbled on a little bug with the new drawables. I was distributing points data into different drawables that I used in a LOD later. When simplifying the system to not use geodes anymore I came upon the following bug:
If Drawable::getBoundingBox would compute an invalid bounding box (if it was for example empty) it would make a bounding sphere with a infinite radius which counts as a valid sphere in osg.

Attached is a small fix."
2014-05-20 15:34:12 +00:00
Robert Osfield
4f199e36c9 Placed the #include<osg/Node> within #ifdef OSG_USE_BOUND to prevent unncessary inclusion of Node header when OSG_USE_BOUND is false. 2014-05-15 13:22:47 +00:00
Robert Osfield
20b9f3ff88 Added Node::asDrawable() and Node::asGeometry() methods to provide a low cost way of casting a node to Drawable and Geoemtry.
Changed the Group::computeBound() method so that it takes account of the a Drawable's BoundingBox.
2014-05-15 09:26:59 +00:00
Robert Osfield
afcf54b108 Fixed the bounding sphere computation and handling of Drawable as the root of the scene graph 2014-05-14 16:52:18 +00:00
Robert Osfield
74f91037a7 Further work on Bound class/Node::getBound() and Drawable::getBound() and usage in OSG codebase 2014-05-14 16:01:40 +00:00
Robert Osfield
4174d72a52 2014-05-14 10:19:43 +00:00
Robert Osfield
12a737ae02 Changed the Node::ParentList to be a list of osg::Node rather than osg::Group, and added addChild, removeChild, replaceChild virtual method to Node to enable code
to user code compile with minimal modifications to account for the new change to the Node ParentList.
2014-05-13 08:43:07 +00:00
Robert Osfield
b2c7bacfe9 From Farshid Lashkari, "As discussed, I've added the ability to handle Drawable objects within the NodeVisitor class. Here is an overview of the changes:
- Added apply(Drawable) and apply(Geometry) to NodeVisitor

- Added accept(NodeVisitor) method to Drawable/Geometry

- Added traverse(NodeVisitor) to Geode which calls accept(NodeVisitor) on all Drawables

- Updated CullVisitor to use new apply(Drawable) to handle drawables. The apply(Billboard) method still manually handles the drawables since it is depends on the billboard settings. I needed to disable the traverse within billboard to prevent duplicate traversal of drawables.

- Update other osgUtil node visitors (GLObjectsVisitor, IncrementalCompileOperation, ..) to use new apply(Drawable) method.
"
2014-05-12 12:10:35 +00:00
Robert Osfield
298f1c65b6 Renamed the new include/osg/OpenGL automatically configured header file to include/osg/GL replacing the original hand built GL header 2014-04-30 13:19:22 +00:00
Robert Osfield
ef76994c05 Removed header as this CMake generated configuration file is not required to be part of svn repository 2014-04-24 07:20:44 +00:00
Robert Osfield
a1342a6bf6 Added src/osg/OpenGL.in configuration file and include/osg/OpenGL header files 2014-04-23 19:30:33 +00:00
Robert Osfield
5597248895 Introduced new scheme for setting up which version of OpenGL/OpenGL ES the OSG is compiled for.
To select standard OpenGL 1/2 build with full backwards and forwards comtability use:

  ./configure
  make

OR

  ./configure -DOPENGL_PROFILE=GL2

To select OpenGL 3 core profile build using GL3/gl3.h header:

  ./configure -DOPENGL_PROFILE=GL3

To select OpenGL Arb core profile build using GL/glcorearb.h header:

  ./configure -DOPENGL_PROFILE=GLCORE

To select OpenGL ES 1.1 profile use:

  ./configure -DOPENGL_PROFILE=GLES1

To select OpenGL ES 2 profile use:

  ./configure -DOPENGL_PROFILE=GLES2


Using OPENGL_PROFILE will select all the appropriate features required so no other settings in cmake will need to be adjusted.
The new configuration options are stored in the include/osg/OpenGL header that deprecates the old include/osg/GL header.
2014-04-23 09:08:26 +00:00
Robert Osfield
efc493cfa0 Fixed build when using of double BoundingBox/BoundingSphere 2014-04-07 15:04:34 +00:00
Robert Osfield
ac380e03c4 From Paul Martz, "We discussed the issue of GL_RED_SNORM and GL_RG_SNORM some time ago, but the issue was never completely resolved. Please see the attached submission to fix the issue.
osg/GL2Extensions was incorrectly defining GL_RED_SNORM and GL_RG_SNORM as part of the definitions for OpenGL v3.1. However, a quick review of the 3.1 spec indicates that these are not part of the 3.1 standard.

My attached change moves these definitions out of the #ifndef GL_VERSION_3_1 conditional block, and defines them conditionally if not already defined. This allows the DDS plugin to build for GL3.
"
2014-04-07 13:48:15 +00:00
Robert Osfield
69e9f2c973 Added support for vector and map containers in osgDB::Serailizer's and lua plugin. 2014-02-26 08:26:51 +00:00
Robert Osfield
4ef5d9eb5f Added Vector serialization and support in lua plugin top enable script users to set/get vector properties such as osg::Array, osg::PrimitiveSet and children lists. 2014-02-24 10:19:48 +00:00
Robert Osfield
cb805d7be5 Added inital cut of PrimitiveSetSet wrappers to scripting 2014-02-13 11:01:36 +00:00
Robert Osfield
2797e8cb7c Improved support for setting/getting properties via the osg::UserDataContainer. 2014-02-11 18:07:37 +00:00
Robert Osfield
31e98b51df Added support for serailizing and scripting BoundingBox and BoundingSphere objects 2014-02-10 16:44:13 +00:00
Robert Osfield
5f8e2bda2f Added osg::CallbackObject to be used to extend C++ class from scripting languages by providing callback objects assigned to the osg::Object UserDataContainer, with the CallbackObject's Name used to map the "method" provided by the CallbackObject. The CallbackObject is implemented by the script engine to provide the neccessary glue to invoking the script with the appropriate input parameters and handling the output parameters.
To the Lua plugin added support for assigned lua functions to C++ osg::Objects via the new osg::CallbackObject mechanism.  To invoke the scripts function from C++ one must get the CallbackObject and call run on it.

Renamed ScriptCallback to ScriptNodeCallback to avoid possibly confusion between osg::CallbackObject and the ScriptNodeCallback.
2014-01-31 16:20:29 +00:00
Robert Osfield
15f44c8736 Added a getModeUsage() method that prevents any mode being automatically associated with these Texture types that are only usable using non fixed function pipeline. 2014-01-24 12:01:37 +00:00
Robert Osfield
d8482ef1ba From Kristofer Tingdahl,"we have a bunch of classes that inherit osg::Node, and they create their own, internal geometry which is passed into the render bucket at the cull-traversal. Last week, we realised that these classes are not accounted for when doing an ComputeBoundVisitor- traversal, as there is no specialization in ComputeBoundVisitor for them.
One solution is naturally to create a new class that would inherit the osg::ComputeBoundVisitor, and use that. I don't like that idea as the ComputeBoundVisitor does actually have what I need - it is only hidden in a protected function.

I am therefor suggesting a slight generalization of the ComputeBoundVisitor with the attached patch, which is tested.

The patch has two parts:
we add applyBBox() so that one can use that in a customized traverse-function and add a bbox to the visitor. I considered calling this function expandByBBox(), but I though  applyBBox was better.
The MatrixStack is made available to the outside world. That enables a traverse-function to do whatever it wishes.
I do actually only need one of the two, as I can implement what I wish either way, but adding getMatrixStack() will make more generic expansions possible.
"

From Robert Osfield, changed the name of the new applyBBox(..) method to applyBoundingBox(..) to keep it's naming more consistent with the rest of the OSG.
2014-01-23 16:48:29 +00:00
Robert Osfield
5cb305041d From Stephan Huber, "recent commits regarding GLuint64EXT broke the build for GLES1 and GLES2. Attached you’ll find a fix which hopefully work for every platform." 2014-01-20 15:10:49 +00:00
Robert Osfield
a30ec25067 From Paul Martz, build fix for Windows GL3 build 2014-01-09 11:13:09 +00:00
Robert Osfield
716cfbffa4 Refined the GLint64 definitions 2014-01-07 19:06:44 +00:00
Robert Osfield
0f2502c72d Removed duplicated instances of GLint64EXT declarations 2014-01-07 18:32:45 +00:00
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
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