Commit Graph

3526 Commits

Author SHA1 Message Date
Robert Osfield
b4353c1a8e Added following methods to osgDB::Archive in support of work by Fradley Anderegg on .zip archive support:
/** Get the file name which represents the archived file.*/
       virtual std::string getArchiveFileName() const = 0;

       /** return type of file. */
       virtual FileType getFileType(const std::string& filename) const = 0;

       /** return the contents of a directory.
       * returns an empty array on any error.*/
       virtual DirectoryContents getDirectoryContents(const std::string& dirName) const = 0;

Added implementations of these new methods into src/osgPlugins/osga/OSGA_Archive.h src/osgPlugins/osga/OSGA_Archive.cpp
2011-04-29 16:34:26 +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
d416ebc78c From Craig Bosma,"Please find attached a fix for shared contexts on OS X, with the Cocoa backend. The NSOpenGLContext* _context member of GraphicsHandleCocoa was never set on successfully creation, so even if the dynamic_cast to GraphicsHandleCocoa succeeds, we get a bogus (NULL) pointer on retrieving the actual NSOpenGLContext* (line 1013).
This should fix the problem, as well as cause GraphicsWindowCocoa to report the correct name "GraphicsWindowCarbon" -> "GraphicsWindowCocoa".
"
2011-04-26 12:05:57 +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
9bfb043a16 From Tomas Hogarth, "Attached are the complete changed files GraphicsWindowIOS and GraphicsWindowIOS.mm. The change is in regard to the ability to adapt to device orientation. We did just have a bool indicating the window would adapt to all orientations. I have changed this to a bit mask allowing the user to specify individual orientations or combinations.
enum DeviceOrientation{

                    PORTRAIT_ORIENTATION = 1<<0,

                    PORTRAIT_UPSIDEDOWN_ORIENTATION  = 1<<1,

                    LANDSCAPE_LEFT_ORIENTATION  = 1<<2,

                    LANDSCAPE_RIGHT_ORIENTATION  = 1<<3,

                    ALL_ORIENTATIONS = PORTRAIT_ORIENTATION  | PORTRAIT_UPSIDEDOWN_ORIENTATION  | LANDSCAPE_LEFT_ORIENTATION  | LANDSCAPE_RIGHT_ORIENTATION

                };

                typedef unsigned int DeviceOrientationFlags;

The main motivation for this is to easily allow the user to specifiy that the device is in a horizontal orientation rather then having to rotate the view matrix. All flags have been tested individually as well as in combinations. The default is ALL_ORIENTATIONS to keep the exiting functionality for anyone who hasn't specified WindowData for their context traits.
"
2011-04-21 12:06:06 +00:00
Robert Osfield
4d0b96c074 From Sukender, Here is a tiny update to FileNameUtils. It brings getPathRoot() and isAbsolutePath() to the public side of the lib. 2011-04-20 19:20:28 +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
cfb19182e6 From Bradley Anderegg, "The first change just exposes the archive extension list so that
external applications can determine if an archive extension is valid.

The second change is a bug fix in Registry::read(const ReadFunctor&)
where if you pass in valid options they get wiped out after the archive
is loaded but before being passed along to the plugin."
2011-04-19 14:11:13 +00:00
Robert Osfield
c13b7d26b7 From Jan Peciva, "please find attached proposed fix for ON_DEMAND rendering. The biggest issue was
that the windows did not act on repaint request (WM_PAINT, EXPOSE,...)

Detailed explanation:
- I implemented requestRedraw using the push approach (not using
GraphicsWindow::_requestRedraw flag that I was considering) as there may be
multiple viewers reading the flag and fighting to reset it after the paint
request, while some viewers may not spot the request to redraw
- I made windows call GraphicsWindow::requestRedraw when they receive
appropriate message (WM_PAINT, EXPOSE, RESIZE,...)
- There were issues on Linux that windows did not want to close using x
button. Resolved by moving the test for DeleteWindow event from
swapBuffersImplementation() to GraphicsWindowX11::checkEvents(). The difficulty
was that DeleteWindow event is not coming using _eventDisplay, but through
_display.
- The last difficulty was that it is necessary to call
ViewerBase::checkWindowStatus() to set _done to true when all windows are
closed. This did not happened recently in ON_DEMAND run scheme. I put the call
to checkWindowStatus() to eventTraversal.
"
2011-04-19 12:01:38 +00:00
Robert Osfield
efec8a13a1 Removed spaces from end of lines 2011-04-19 11:46:05 +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
70dfd11531 From Tim Moore,
Fixes to race in DatabasePager where a parent PagedLOD
of newly loaded subgraph has been expired.

Clean up of visitor naming to make it clearer what role it has.
2011-03-30 15:15:07 +00:00
Robert Osfield
6b67320190 Added support for new SampleDensityWhenMovingProperty into .p3d format, with it default to 0.02.
One can override this value via the sampleDensityWhenMoving="value" property in the volume tag, i.e.

         <volume sampleDensityWhenMoving="0.01">CardiacCT</volume>

To switch the feature off set the value to 0, i.e.

         <volume sampleDensityWhenMoving="0">CardiacCT</volume>
2011-03-17 17:33:02 +00:00
Robert Osfield
89eadcfe82 Added SampleDensityWhenMovingProperty to control LOD property of osgVolume. 2011-03-17 15:37:39 +00:00
Robert Osfield
79cb22eb06 Changed the view movement detection code so that it uses the
new CullVisitor::Identifier to indentifier cull traversals,
this enables the code to properly detect movement when
osgViewer::Renderer uses double buffering of SceneView.
2011-03-17 13:56:27 +00:00
Robert Osfield
e28f9a7d32 Added CullVisitor::Identifier to help with cull operations that require a consistent identifier for
cull traveresals when osgViewer::Renderer uses double buffering.
2011-03-17 13:54:14 +00:00
Robert Osfield
307bf7002f First cut at LOD support in RayTracedTechnique, which lowers the number of samples taken when the view of the volume is changing. 2011-03-17 11:49:22 +00:00
Robert Osfield
256da4879e Added hud and billboard support to image, stereo_image, pdf, browser and vnc image placement 2011-03-16 10:51:42 +00:00
Robert Osfield
f2ce2f19a9 Added support hud property for title, bullets and paragraph tags 2011-03-15 19:54:57 +00:00
Robert Osfield
31926f3329 Added OSG_EXPORT to declaration of View::Slave. 2011-03-15 13:30:27 +00:00
Robert Osfield
52ff51e0eb Implemented billboard="on" option for image, bullet and paragraph tags 2011-03-14 21:36:32 +00:00
Robert Osfield
7cd74f0282 From Farshid Lashkari, "Another update. I added a LIMIT_NEAREST enum which implements your previous suggestion of rejecting bounding volumes further from the nearest existing intersection. I only implemented this for LineSegmentIntersector. I'd appreciate it if you could double check the math I added to LineSegmentIntersector::intersects() for checking if the bounding sphere is further away. The results of this are promising. I'm getting noticeable performance increase for line intersections with scenes containing many drawables.
"
2011-03-14 10:07:15 +00:00
Robert Osfield
f7718d2b7b From Farshid Lashkari, removal of redundent spaces at the end of lines. 2011-03-11 17:20:24 +00:00
Robert Osfield
d3d0859b4c From Piotr Gwiazdowski, "So there's config setting OSG_DISABLE_MSVC_WARNINGS which should
disable pragmas that turn off specific warnings for MSVC.
Unfortunately it's presence is only checked in osg/Export header,
making other Export headers disable warnings no matter what, which is
kind of incoherent.

My fix adds #include <osg/Config> to every Export header. I've also
unified checking whether to disable warnings to current osg/Export
way:
#if defined(_MSC_VER) && defined(OSG_DISABLE_MSVC_WARNINGS).

Attachment contains all changed Export files in their original locations."
2011-03-09 14:15:04 +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
215fca84f7 Enabled the settng/getting of the Text3D's WallStateSet and BackStateSet along with use of these in the rendering implementation
to allow separate colour and other state to be assigned to the front, wall and back faces.
2011-03-07 12:33:11 +00:00
Robert Osfield
afecdbb46b Moved intial cut of depth partition support into osgViewer::View via two new methods:
/** Convenience method for setting up multiple slave cameras that depth partition the specified camera.*/
        bool setUpDepthPartitionForCamera(osg::Camera* cameraToPartition, DepthPartitionSettings* dps=0);

        /** Convenience method for setting up multiple slave cameras that depth partition each of the view's active cameras.*/
        bool setUpDepthPartition(DepthPartitionSettings* dsp=0);
2011-03-03 15:52:19 +00:00
Robert Osfield
1525f3cd4e Added support for an View::Slave::UpdateSlaveCallback 2011-03-01 14:48:48 +00:00
Robert Osfield
a7fd352b40 Removed TrapezoidalShadowMap due to discovery of patent on algorithm. 2011-02-24 11:54:44 +00:00
Robert Osfield
a25c4e4ab2 From Wojciech Lewandowski, intial cut at new TrapezoidalShadowMap ShadowTechnique 2011-02-23 16:46:34 +00:00
Robert Osfield
9cfb248b46 From Wojciech Lewandowski, various tweaks to osgShadow shadow mapping classes to improve consistency and enable more debug info output 2011-02-23 16:45:44 +00:00
Robert Osfield
98b1f15a45 Added copyop parameter to cloneOptions() method 2011-02-14 16:05:33 +00:00
Robert Osfield
37cc59fe07 From Tim Moore, "The non-virtual cloneOptions() method, which is now used by DatabasePager, breaks derived classes of osgDB::Options. This patch uses the clone() method to clone Options." 2011-02-14 15:59:49 +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
e0924886bd Added support for enabling the assignment of PixelBufferObjects to loaded Images to aid the download of images to the GPU.
Feature can be enabled/disabled (default) by setting the env :

   OSG_ASSIGN_PBO_TO_IMAGES  to ON or OFF
2011-02-04 12:43:00 +00:00
Robert Osfield
bd6009f9f2 Refactored NodeTrackerManipulator to use osg::ObserverNodePath rather than it's only local equivilant. 2011-02-03 17:07:01 +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
99fc347212 Added experimental timing and PBO usage into ICO+GCE classes 2011-02-01 12:18:22 +00:00
Robert Osfield
45c933daf2 Ran:
svn propset svn:eol-style native include/*/*
 svn propset svn:keywords "Author Date Id Revision" include/*/*
2011-01-31 11:40:35 +00:00
Robert Osfield
ac65e37ed3 From Mourad Boufarguine, "This is a tiny fix for some typos in osg code." 2011-01-28 10:50:24 +00:00
Robert Osfield
67ae23f2cf From Alexander Sinditskiy, "reason of this changes described in http://forum.openscenegraph.org/viewtopic.php?t=7596
and another problem is:
example osgkeyboard is not work (keys not highlight) if user have 2 keyboard layout native and english and current user layout is native

I try to explain my changes

we need something that is identify key without modifier keys and layout  -> this is UnmodifedKey

I think osg must have its own UnmodifiedKeys table. Code must be run same on different platforms. This can de guaranteed by UnmodifiedKeys table.

Mikhail Izmestev helped me. He implemented VirtualKey changes in GraphicsWindowX11"
2011-01-27 16:23:48 +00:00