Commit Graph

10126 Commits

Author SHA1 Message Date
Robert Osfield
ba3971bb45 Added a ShadowTechnique::computeOrthogonalVector(const osg::Vec3& direction) const method for helping compute an appropriate
up vector to setViewMatrixAsLookAt(..) codes in osgShadow.  This will addresses previous issues that occured when look vectors
co-incided with the hard coded up vectors.
2010-03-01 13:00:04 +00:00
Robert Osfield
42a050e87c From Wojciech Lewandowski, "Here comes a list of small fixes in StandardShadowMap and derived classes affecting LispSM techniques. Changes made against SVN trunk.
Fixes in StandardShadowMap.cpp & MinimalShadowMap.cpp were made for spotlight issues. There were cases when further located spotlights were not shadowing properly.

Small tweak in DebugShadowMap & StandardShadowMap.cpp to not limit shadow maps to texture2D (which should also allow texture2D arrays and cube maps). I simply replaced ptr to osg::Texture2D with pointer to osg::Texture. Interpretation of this member could be now changed with change of shaders in derived classes. This may be useful for guys who override LispSM or MinimalBoundsShadowMaps techniques. Could be useful for implementation of PerspectiveCascadedShadowMaps technique for example.

ConvexPolyhedron.cpp & DebugShadowMap.cpp contain debug HUD tweaks.

Change in ConvexPolyhedron.cpp overcomes the regression problem with color per primitive binding which caused that shadow volume outlines stopped to draw. I simply changed PER_PRIMITIVE to PER_PRIMITIVE_SET and it works again.

Other adition is dump method I added to DebugShadowMap which can be used in shadow debugging mode to dump current frame shadow volumes & scene to osg file. It could be then loaded into viewer and freely examined from different angles (which is difficult inside the application if shadow adopts to view and projection). "
2010-03-01 11:52:44 +00:00
Robert Osfield
60dd9ad7d0 From Mourad Boufarguine, "With the present CMakeLists, the directory ${PROJECT_BINARY_DIR}/include is added to the include path before ${OpenSceneGraph_SOURCE_DIR}/include. This causes problems whenever a header file is changed when updating OSG, because cpp files are build against the old header files contained in ${PROJECT_BINARY_DIR}/include rather than the new ones in ${OpenSceneGraph_SOURCE_DIR}/include. Inverting the order of the two drectories in the include path solves the problem.
Attached is the modified CMakeLists.txt."
2010-03-01 11:29:19 +00:00
Robert Osfield
3d6b53b218 Updated wrappers 2010-02-26 21:31:13 +00:00
Robert Osfield
15947b4e6a updated wrappers 2010-02-26 16:02:20 +00:00
Robert Osfield
56c54958a3 Added spaces between < > template parts of macros to prevent compile problems when templates as use as macro parameters 2010-02-26 15:54:37 +00:00
Robert Osfield
3b43810c66 From Paul Martz, "Regarding the osg-users thread "mergeGeodes crash", I'm submitting this for consideration as a fix for the problem with the FlattenStaticTransformsVisitor. It seems that the additional nested loop over the Transform's parent was not needed. I'm not sure why it was there, and if it really was unnecessary, then it has probably been resulting in many redundant Nodes for quite some time. Perhaps this fix will result in a cull- and draw-time performance boost."
From Robert Osfield, added copying of the UserData and Descriptions from the transform to the new group.
2010-02-26 15:40:19 +00:00
Robert Osfield
dbe854e9b0 From Raymon de Vries, "I've made a small change to DirectShowTexture.cpp: in the options for the directshow plugin it is possible to specify the capture device by number. For instance:
options->setPluginStringData("captureVideoDevice", "0");

Lines added in getDevice() are:
      int deviceId = atoi(name.c_str());
      if(deviceId >= 0 && deviceId < (int)_listDevice.size())
        return _listDevice[deviceId];

This makes it easy to use a capture device without knowing it's name. Attached is the whole file against rev 11044"
2010-02-26 15:01:00 +00:00
Robert Osfield
bbca791251 From Michael Platings, "Here's the all-new, all-dancing DAE plugin, with support for reading
osgAnimation. It's been tested with the majority of the samples in the
COLLADA test repository and works with all of them either as well as, or
better than, the version of the plugin currently in SVN.

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

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

Changes by Robert Osfield, fixed compile issues when compile without C* automatic conversion enabled in ref_ptr<>
and constructor initialization fixes to address some warnings under gcc.
2010-02-26 14:41:50 +00:00
Robert Osfield
e9fa0bc5e3 Updated wrappers 2010-02-26 14:36:23 +00:00
Robert Osfield
d50eacd07e From Paul Martz, "The changes are very similar to Magne's, except they now take the near plane into account. The changes are:
* Change OcclusionQueryNode::getPassed to take a NodeVisitor rather than the distance from BS center to the eye point. Change where CullVisitor calls this method to use the new parameters.
 * getPassed now exits early and returns true to avoid blinking / blink-in of geometry for the first frame or for out-of-range LOD children coming back into view.
 * getPassed now considers the distance from the near plane to the bounding sphere (rather than eye point to bounding sphere) when determining if the viewer is "inside" the bounding sphere or not."
2010-02-26 10:13:28 +00:00
Robert Osfield
75527fd800 From Paul Martz, "Summary: GL3 deprecates "glGetString(GL_EXTENSIONS)". In GL3, individual extension strings are queried by looping over GL_NUM_EXTENSIONS and calling "glGetStringi(GL_EXTENSIONS,<index>)".
The fix is basically as follows:
 if( GL3 )
   Query indexed extension strings.
 else
   Query the old way.

The "else" branch is re-indented but otherwise shouldn't contain any changes."

From Robert Osfield, added #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) to new block to prevent it
being compiled under GLES where no glGetStringi exists.
2010-02-26 10:03:01 +00:00
Robert Osfield
0e29cd6971 From Paul Martz, "Summary: GL3 deprecates "glGetString(GL_EXTENSIONS)". In GL3, individual extension strings are queried by looping over GL_NUM_EXTENSIONS and calling "glGetStringi(GL_EXTENSIONS,<index>)".
The fix is basically as follows:
 if( GL3 )
   Query indexed extension strings.
 else
   Query the old way.

The "else" branch is re-indented but otherwise shouldn't contain any changes."
2010-02-26 09:48:22 +00:00
Robert Osfield
8a86f47276 From Chris Hanson, comment fix 2010-02-26 09:40:11 +00:00
Robert Osfield
eb23514478 From Sukender, "I tried a tiny change in is83() function and had no crash (under Windows). "osgconv cow.osg cow.3ds" exports a black cow and "osgconv lz.osg lz.3ds" exports tree(s) at (0,0,0)... I guess there are still things to do about non-zero-index textures and multiple instanciation of a node, but at least it doesn't crash." 2010-02-26 09:33:48 +00:00
Robert Osfield
2e154d5976 From Ryan Kawicki, "I guess I missed these during my testing, but if the database pager has outstanding requests while the application is shutting down, the archive can become invalidated through unsafe calls to ReaderWriterTXP::getArchive. I've made this function return a ref_ptr and change other locations to as needed to conform to the change. I've tested this and no more crashes.
Following files from revision 11057 have been attached."
2010-02-26 09:23:28 +00:00
Robert Osfield
8c4da68338 From Philip Lownman, "The libpng project decided to rename png_set_gray_1_2_4_to_8() to
png_set_expand_gray_1_2_4_to_8() with the 1.2.9 release.  This
submission fixes builds of the OSG against versions of libpng < 1.2.9
that don't have the new symbol available.  This affects platforms like
Red Hat Enterprise Linux 4 which come with libpng 1.2.7."
2010-02-26 08:55:50 +00:00
Robert Osfield
bc202cd4bb From Terry Welsh, "As discussed on the osg-users list, I have implemented these rules in
Text and Text3D:

1.  A new line should be started after a line's last hyphen or before
its last whitespace.
2.  If no suitable place to break a line is found, just start new line
after the last character that fits on the line.
3.  Whitespace should be removed from the beginning of the new line
(already worked in Text, but not in Text3D).

Line wrapping looks a lot better now with no more lone periods
appearing at the beginning of lines.

Also, right-justified text is more accurate now (slashes would hang
off the end of lines before).  With this new code I spotted one
instance where a hyphen stuck out too far, but in general it looks
better.  Centered text was not perfect before and still isn't, but I
can't see any significant increase or decrease in quality.  The casual
observer would probably never notice a problem.

Also fixed a whitespace problem in Text3D.  Not all whitespace was
being removed from the beginning of lines.  Now it is all being
removed in the same manner as in Text."
2010-02-25 18:17:20 +00:00
Robert Osfield
7ca071192e From Erik Johnson, "There is an issue on win32 if the application hides the cursor using GraphicsWindowWin32::useCursor(false). The cursor has a habit of re-showing itself.
To reproduce, on win32:

-Run osgViewer in a windowed mode, with the cursor off, as such:
    osgViewer::Viewer::Windows windows;
    viewer.getWindows(windows);
    for(osgViewer::Viewer::Windows::iterator itr = windows.begin();
       itr != windows.end();
       ++itr)
    {
       (*itr)->useCursor( false );
    }

-Quickly move the cursor into the window  (cursor it should be hidden)
-Resize the window by dragging the border (notice the cursor changes to "resize" cursor)
-Move the cursor back to the inside of the window (notice the cursor is not hidden anymore)

The attached SVN patch will set the cursor to a "NoCursor" during useCursor(false).  This correctly stores the no cursor state, so it can be rejuvenated after a future cursor change.  This patch also fixes a couple instances where a hidden cursor should show itself, like when it's on the title bar, or the window close button."
2010-02-25 18:05:59 +00:00
Robert Osfield
8059c4a745 From Chris Hanson, comment fix. 2010-02-25 18:03:14 +00:00
Robert Osfield
444361272f From Trajce Nikolov, "attached is some fix for the directshow plugin. Cleans up the build warnings as well makes the code a bit safer" 2010-02-25 18:01:25 +00:00
Robert Osfield
74687953be From Jeremy Moles, submitted by Cedric Pinson "Here an new example from Jeremy Moles that demonstrate EaseMotion from
osgAnimation, i have updated EaseMotion with new type, so for users of
EaseMotion just have look, it's a great example."
2010-02-25 17:58:50 +00:00
Robert Osfield
605ad76691 From Wang Rui, "Attached is the osgTerrain wrappers, based on the latest SVN version
of OSG. I modified the osgDB::InputStream and OutputStream and the
PagedLOD wrapper as well. Now all seems to work fine with paged
scenes. I've tested with the puget terrain data and the osgdem
application from VPB:
# osgdem --xx 10 --yy 10 -t ps_texture_4k.tif --xx 10 --yy 10 -d
ps_height_4k.tif -l 8 -v 0.1 -o puget.osgb

As the ive plugin does, The PagedLOD wrapper now automatically add the
latest file path to PagedLODs' databasePath member, to help them find
correct child positions. I also changed the image storage strategy of
the OutputStream class, to store them inline by default. The osgt
extension should also work, in case the image files are also written
to the disk.
"
2010-02-25 17:53:51 +00:00
Robert Osfield
26e68926f7 From J.P. Delport: "by some strange circumstance I've stumbled across the following problem:
I create a compositeviewer with two views that share a context. One view is deleted. Texture::TextureObjectSet::discardAllTextureObjects is called, but this does not reset _tail. Now the texture object is again created and addToBack is called from Texture::TextureObjectSet::takeOrGenerate. In addToBack (line 612) _tail is now not 0 (although the list should be empty) and a loop is created from the texture object to itself. Then when the second view is deleted, Texture::TextureObjectSet::deleteAllTextureObjects loops forever. Setting _tail to 0 fixes it for me (see attached)."
2010-02-25 17:18:46 +00:00
Robert Osfield
e3ad12c4f2 From Simon Buckley, "Attached is a small change to the file src\osgPlugins\dxf\dxfFile.cpp that allows the dxf reader to skip comments in a dxf file. I found with the existing version and a test file I had that the loader failed when comments were present. I made a very minor change to allow "999" comment codes to be skipped rather than causing load failure." 2010-02-25 17:13:15 +00:00
Robert Osfield
590bf9070d From Michael Platings, "There is a function, convertStringFromCurrentCodePageToUTF8() that would be useful outside the FBX plugin so it belongs in osgDB. I've attached ConvertUTF and ConvertUTF.cpp with the function added for you to commit at your convenience.
"
2010-02-25 17:07:34 +00:00
Michael PLATINGS
440bd7c3e3 2010-02-24 10:52:51 +00:00
Michael PLATINGS
6ec0e11b2a 2010-02-24 10:25:50 +00:00
Michael PLATINGS
4f72d66cbe 2010-02-24 10:12:11 +00:00
Michael PLATINGS
14ef0fa930 2010-02-24 10:02:14 +00:00
Robert Osfield
9a45538db9 Added an empty() method 2010-02-22 17:41:35 +00:00
Robert Osfield
bb35fcc980 Updated authors file 2010-02-22 10:43:22 +00:00
Robert Osfield
3169f44548 Updated wrappers 2010-02-22 10:36:55 +00:00
Robert Osfield
d2ecd34d66 Fixed STDINT_INCLUDE path 2010-02-22 10:10:08 +00:00
Robert Osfield
c16d55fa9b From Trajce Nicklov, fixes to warnings 2010-02-22 09:50:37 +00:00
Robert Osfield
e3a1f664b9 Seperated out the #define of GL_PERSPECTIVE_CORRECTION_HINT to fix GL3 build 2010-02-22 08:48:02 +00:00
Robert Osfield
bb21136d92 Added missing _ptr = rp._ptr to constructor. 2010-02-22 08:39:33 +00:00
Robert Osfield
7f454bef3e Converted View across to use ObserverNodePath. 2010-02-20 17:36:55 +00:00
Robert Osfield
4acaaa3274 Build fixes for GLES2 2010-02-19 21:03:33 +00:00
Robert Osfield
c2d55fdb37 Fixed GLES1/GLES2 build 2010-02-19 20:58:46 +00:00
Robert Osfield
46f9e760ee Added include of osg/FrameBufferObject to fix GLES1/GLES2 build issue 2010-02-19 20:43:58 +00:00
Robert Osfield
521ad875cb Build fix for GLES1 and GLES2 2010-02-19 20:40:41 +00:00
Robert Osfield
b1001c2a9c Moved implementation of Observer destructor and constructor from header into .cpp to avoid possible issues with imports/exports under Windows build. 2010-02-19 20:18:48 +00:00
Robert Osfield
8b67830f6e Added check against OSG_GL3_AVAILABLE to avoid issues with GL3 build under linux 2010-02-19 20:14:12 +00:00
Robert Osfield
1924350e1c Added #include <osg/Notify>, convert osg::notify usage to OSG_NOTICE 2010-02-19 20:11:14 +00:00
Robert Osfield
eca4361c4a Clean up observer_ptr<> and removed the eronous casting of ptr in objectDeleted. 2010-02-19 19:50:55 +00:00
Robert Osfield
657c5c4e71 Updated wrappers 2010-02-19 19:00:48 +00:00
Robert Osfield
43f9b13199 Removed the uncessary subclassing from osg::Object as this base class is already pullled via ViewerBase 2010-02-19 18:56:21 +00:00
Robert Osfield
b807fc83fe Added mutex lock to destructor. 2010-02-19 16:04:33 +00:00
Robert Osfield
8f11af8d3e Replaced local mutex with getObserverMutex(). 2010-02-19 15:41:42 +00:00