Commit Graph

4189 Commits

Author SHA1 Message Date
Robert Osfield
16b19a0c30 Refactored AntiSquish::computeUnSquishedMatrix() method to use the parent node path of the AntiSquish node
to compute the required matrix rather than using the NodePath provided by the NodeVistor. This is required
as in osg::computeLocalToWorld() usage case the NodeVisitor pointer is NULL, so the correct matrix isn't possible to compute.



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14828 16af8721-9629-0410-8352-f15c8da7e697
2015-04-09 18:42:08 +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
6cff8650f2 Cleaned up handling of Drawables so it utilizes the Node inheritance properly.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14822 16af8721-9629-0410-8352-f15c8da7e697
2015-04-07 15:49:06 +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
e2f208af54 Refactored how the callbacks for updating geometry are managed in MorphGeometry and RigGeometry to address bugs in serialization.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14784 16af8721-9629-0410-8352-f15c8da7e697
2015-03-12 17:11:11 +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
8c8b8f3305 Restructed the osgPresentation and present3D directories back to the structure that was present in OSG-3.2
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14759 16af8721-9629-0410-8352-f15c8da7e697
2015-03-04 18:36:44 +00:00
Robert Osfield
26d1679248 Removed the experiemental osgPresentation classes. These are only partially functional and not appropriate for the stable OSG-3.4 release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14758 16af8721-9629-0410-8352-f15c8da7e697
2015-03-04 17:42:30 +00:00
Robert Osfield
ec6edf535d From Miha Ravselj, "Regarding previous submission it was only partial solution. After further testing I found similar bug also in ClearNode serializer.
//GLbitfield mask = GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT;
This line was problematic since it produced incorrect result when let's say COLOR flag is serialized
it should be null as in Camera serializer or in a proposed BitFlagsSerializer


This line of code caused that whenever only GL_COLOR_BUFFER_BIT bit was written and on value read GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT was restored instead of GL_COLOR_BUFFER_BIT only.

//GLbitfield mask = 0; //this resolves the issue same as in camera
Also same bit-wise comparison bug was also present in write method.
-------------------------------------------------------------------------------------

As you can see there are total 3 bit mask serializers in OSG and all 3 had bugs so I decided to add ADD_BITFLAGS_SERIALIZER and replace USER serializers in osg::Camera, osg::ClearNode and osgText::TextBase. I have made sure that bitflags serializer does not break backwards-compatibility since it uses same code as user serializer does in all 3 cases. (see tester.cpp on how compatibility test was performed)"



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14752 16af8721-9629-0410-8352-f15c8da7e697
2015-03-03 12:03:23 +00:00
Robert Osfield
58edd10d04 From Johannes Scholz, "Attached you find a patch for osgDB::OutputStream and osgDB::InputStream to include osg::Image::data() using Base64 encoding inside the ASCII OSGT, if WriteImageHint=IncludeData is set, only."
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14748 16af8721-9629-0410-8352-f15c8da7e697
2015-03-02 12:11:43 +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
47db2da8b4 From Andreas Henne, Support for GL3 core profile in osgText
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14717 16af8721-9629-0410-8352-f15c8da7e697
2015-02-25 18:56:29 +00:00
Robert Osfield
e7d41377be Fixed handling of NULL entries in osg::Geometry TexCoordArrayList and VertexAttribArrayList.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14715 16af8721-9629-0410-8352-f15c8da7e697
2015-02-25 14:55:59 +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
5c023d1f76 Moved osgTerrain::GeometryPool from osgTerrain::DisplacementMappingTechnique to the osgTerrain::Terrain
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14703 16af8721-9629-0410-8352-f15c8da7e697
2015-02-18 10:52:52 +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
06f186dc07 Added GL_LINES_ADJACENCY_EXT variants back into ObjectWraper to enable backwards compatibility.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14685 16af8721-9629-0410-8352-f15c8da7e697
2015-02-10 18:01:02 +00:00
Robert Osfield
b38c6258bf Added support for new #pragam(atic) shader composition to new displacement mapping technique
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14683 16af8721-9629-0410-8352-f15c8da7e697
2015-02-10 17:20:26 +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
bb637e73f3 Fixed typo.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14680 16af8721-9629-0410-8352-f15c8da7e697
2015-02-04 15:11:00 +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
4bcf4cf7bb Changed osgFX::MultiTextureControl so that it uses an osg::FloatArray internally to enable sharing with osg::Uniform.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14675 16af8721-9629-0410-8352-f15c8da7e697
2015-01-23 13:51:09 +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
7fbeeefea8 Added TextureWeights uniform support and controls to osgFX::MultiTextureControl to support usage with shaders.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14668 16af8721-9629-0410-8352-f15c8da7e697
2015-01-21 11:09:29 +00:00
Robert Osfield
98f5fca9c2 Added key osgTerrain::GeometryPool methods virtual to make it easier to override the shaders
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14662 16af8721-9629-0410-8352-f15c8da7e697
2015-01-20 15:23:06 +00:00
Robert Osfield
3eca5765c9 Added GeometryPool::s/getUseGeometryShader() hint, and OSG_TERRAIN_USE_GEOMETRY_SHADER env var for setting the default value.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14660 16af8721-9629-0410-8352-f15c8da7e697
2015-01-19 11:29:55 +00:00
Robert Osfield
249c0ff208 Added support for using geometry shaders to align the quad diagonals with the local terrain
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14658 16af8721-9629-0410-8352-f15c8da7e697
2015-01-16 11:03:11 +00:00
Robert Osfield
3e3d7e4dc1 Added a local Vec3Array cache to the HeightFieldDrawable to facilitate efficient intersection testing
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14656 16af8721-9629-0410-8352-f15c8da7e697
2015-01-12 10:31:58 +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
a331680cec From Aurélien Chatelain, "the smoothing visitor did not handle shared arrays. It may leads to bad geometry arrays when a shared array is involved in the scene.
This submission adds shared array duplication (and moves the SharedArrayOptimizer declaration in MeshOptimizer to make it callable from the SmoothingVisitor)."

Submitted by Marc Helbling.
Edited by Robet Osfield to retain the usual OSG coding style.




git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14639 16af8721-9629-0410-8352-f15c8da7e697
2014-12-24 10:55:49 +00:00
Robert Osfield
c57e62e799 Added osgDB::readShaderFileWithFallback(..) convinience functions to make it easier to set up reading external shader files with a built in fallback.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14636 16af8721-9629-0410-8352-f15c8da7e697
2014-12-24 10:13:42 +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
117869d154 From Marc Helbling, "please find the mergeTriangleStrip code merged in osgUtil::TriStripVisitor.
I've removed the references to DrawArrays as we should no longer produce any.

Note that:
* as the name suggest, it only works for triangle strips but could probably be easily extended to quads
* the resulting primitive is not highly optimized; we could probably sort the strips in order to minimize the number of primitive restart
* as we may merge DrawElementsUInt and DrawElementUShort, the code will only generate DrawElementsUInt"


git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14602 16af8721-9629-0410-8352-f15c8da7e697
2014-12-15 17:15:21 +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