Commit Graph

7874 Commits

Author SHA1 Message Date
Robert Osfield
1ee9b09e06 From Glenn Waldron, "I'm using an IntersectionVisitor with a PagedLOD database, employing a ReadCallback to allow the intersector to traverse the paged nodes. I discovered that if the visitor is unable (for any reason) to load a subtile via the ReadCallback, the intersection fails. However, I had the requirement to "fall back" on the lower-resolution parent tile and settle for that intersection.
This was easy to implement simply by overriding IntersectionVisitor::apply(PagedLOD). My question is: Are there any opinions on whether this should be the default behavior? If it makes sense, I will submit the change; if not, no worries."
2008-06-06 16:28:27 +00:00
Robert Osfield
01c284429b From Paul Melis, "Here's an updated include/osgText/Text3D that forces recomputation of the glyph repr when the character depth is updated, also when the rendering mode is set.
This caused a Text3D object read from a .osg file to not have the correct depth."
2008-06-06 16:25:14 +00:00
Robert Osfield
c2a4825afa From Mathieu Marache, "I have made the logo plugin work again (a simple copy and paste problem) and added the path of the logo file (if not empty) to the data file path in order to be able to find images relatively." 2008-06-06 14:59:17 +00:00
Robert Osfield
b6a0f3d8d0 Cleaned up implementation to only use simple structure 2008-06-06 14:10:20 +00:00
Robert Osfield
6fb62b9604 Renamed _rendergraph to _stateGraph to better reflect its function 2008-06-06 13:21:57 +00:00
Robert Osfield
ed45e32355 Introduce a lower overhead data structure for leaves. 2008-06-06 13:21:27 +00:00
Robert Osfield
aa73e1d1d4 Added update traversal to run prior to doing kdtree build to make sure that
costs in build osgTerrain databases isn't incurred during the build traversal.
2008-06-06 10:51:23 +00:00
Robert Osfield
238d482230 Quitened down the release context message 2008-06-06 09:08:16 +00:00
Robert Osfield
cf97035a45 Added OSGDB_EXPORT 2008-06-06 08:42:37 +00:00
Robert Osfield
ac068178aa Added timing code 2008-06-05 18:52:29 +00:00
Robert Osfield
a9b1ea660d Basic implementation of kdtree generation based on vertices 2008-06-05 17:28:06 +00:00
Robert Osfield
abfb5bbb8d Added accep(Shape&) 2008-06-05 13:46:19 +00:00
Robert Osfield
9212d4dd95 Further work on fleshing out basic classes 2008-06-04 17:59:39 +00:00
Robert Osfield
c57b288e54 Updated wrappers 2008-06-04 16:53:17 +00:00
Robert Osfield
282fa84789 Added support for optionally calling releaseContext at the end of each
renderinTraversals() to help with cases where uses are driving multiple
contexts from mulitple viewers in a single threaded frame loop.
2008-06-04 16:46:14 +00:00
Robert Osfield
338be0b926 Fleshed out some basic kd-tree data structures. 2008-06-03 17:29:27 +00:00
Robert Osfield
8d0c7890ce First cut of osgkdtree example, this will be used as a base of the development of
native kdtree support to help speed up intersection testing.
2008-06-03 16:13:49 +00:00
Robert Osfield
a32d336c90 Added missing updateBlock() 2008-06-03 15:49:59 +00:00
Robert Osfield
71187a2c56 From Mario Valle, fixed warnings 2008-06-03 13:07:40 +00:00
Robert Osfield
6873d4237c Ran merge to get rid of tabs 2008-06-03 13:06:54 +00:00
Robert Osfield
ef601e6add From Marco Lehmann and Robert Osfield, this fix was implemented by Robert but
is based on suggested fix from Marco for fixing a crash due to lack of
thread safety in std::ofstream("/dev/null");  The fix is to use a custom stream
buffer that just discards all data.  The implementation is also twice as fast
as the old /dev/null based approach.
2008-06-03 11:31:42 +00:00
Robert Osfield
5711964481 Added unit test to smoke out a thread issue with using ofstream("/dev/null") inside
osg::notify()
2008-06-03 11:28:16 +00:00
Robert Osfield
e09e07d45b Added support for assigning GraphicsContext to individual GUIEventAdapter events,
and use of this within osgViewer::View to better track the sources of events.
2008-06-02 17:34:47 +00:00
Robert Osfield
213a2d8d13 Changed FIND_PACKAGE(PkgConfig) to INCLUDE(FindPkgConfig OPTIONAL) as per
suggestion from Philip Lowman.
2008-05-31 08:47:15 +00:00
Robert Osfield
840eab0109 Updated authors and version file for 2.5.1 dev release 2008-05-30 21:23:49 +00:00
Robert Osfield
af974b2590 Updated ChangeLog 2008-05-30 21:12:44 +00:00
Robert Osfield
03d12b4b94 Added version check on FIND_PACKAGE(PkgConfig) to attempt to fix build with older versions of CMake 2008-05-30 21:08:28 +00:00
Robert Osfield
65772e451c Added applyMaskAction(CLEAR_COLOR) to Camera::setClearColor() to enable proper inheritance 2008-05-30 20:15:31 +00:00
Robert Osfield
c714e46ff6 Updated ChangeLog 2008-05-30 17:03:32 +00:00
Robert Osfield
5c30b98785 From Jean-Sebastien Guay, "This is a fix for the warning we've been discussing on osg-users. CMake 2.6.0 allows quotes to be unescaped in strings in ADD_DEFINITIONS statements, where we had to escape them before (CMake 2.4.x). Setting CMake policy CMP0005 to OLD removes the warning for 2.6.0, and the quotes are still escaped, so it still works with 2.4.x.
"
2008-05-30 16:53:45 +00:00
Robert Osfield
0a6b4d5709 From Luc Frauciel, Added support for osgTerrain::ValidDataOperator.
From Robert Osfield, added versioning to the above.
2008-05-30 12:59:49 +00:00
Robert Osfield
9cd56609db Updated packgage number for 2.5.1 developer release 2008-05-30 11:44:06 +00:00
Robert Osfield
0cc38108a5 Fixed cirular reference in DatabaseRequest 2008-05-30 11:43:04 +00:00
Robert Osfield
f07d106366 Moved enum to public scope and rebuilt wrappers to fix wrapper build error 2008-05-29 13:54:59 +00:00
Robert Osfield
7a2c403992 Added code to catch erroneous Dof axis settings 2008-05-29 11:45:31 +00:00
Robert Osfield
e1eeabcea0 Improved the NaN depth detection within CullVisitor and debug output. 2008-05-29 11:13:29 +00:00
Robert Osfield
2a11d25bbc Improved the NaN error detection and reporting. 2008-05-29 11:09:56 +00:00
Robert Osfield
4745ab040b Added catch for NaN depth values 2008-05-28 17:56:22 +00:00
Robert Osfield
7c23951ee1 From Wojiech Lewandowski, Workaround for wglMakeCurrent bug in NVidia drivers by
calling wglMakeCurrent twice.

This bug has been reported to NVidia, confirmed and fixed by NVidia but awaits verifiaction and release if a driver which fixes this bug.
2008-05-28 16:14:08 +00:00
Robert Osfield
3ca777f31e Updated wrappers 2008-05-28 14:37:50 +00:00
Robert Osfield
1047f970bb From Adrian Egli, improvements to ParallelSplitShadowMap implementation 2008-05-28 14:11:22 +00:00
Robert Osfield
8e91926ca5 From Thibault Genessay, "The PNG plugin crashes when you try to read a malformed file (attached
is an example). This can happen in circumstances that are not
manageable by the OSG itself (e.g. 3rd party buggy program) but one
would expect the plugin to be able to recover by returning
ReadResult::ERROR_IN_READING_FILE.

libpng provides two callbacks for warnings and errors - those are
currently unused. By default, they point to function that call exit()
or something similar (the default error callback never returns). This
patch registers the callbacks using libpng's mechanisms, makes the
warning callback emit an osg::notify(osg::WARN) message and the error
callback throw an error. The reading process is enclosed in a
try...catch block. Upon error, the memory is freed and
ReadResult::ERROR_IN_READING_FILE is returned.
"
2008-05-28 13:51:56 +00:00
Robert Osfield
7e0184f080 From Thibault Genessay, "On Windows, when setting a cursor through
osgViewer::GraphicsWindow::setCursor() the new cursor type is recorded
but not applied until windows sends another WM_SETCURSOR message. This
delays the application of the cursor to the next mouse event.

The attached file fixes this by setting the new cursor with a call to
::SetCursor() immediately.
"
2008-05-28 13:45:40 +00:00
Robert Osfield
8573194aa0 From Michael Platings, "Yes it's definitely a driver problem - I submitted a bug report to
nvidia 6 months ago and the issue is still "in progress". I've given up
waiting for them!

Platform - various Intel Windows XP SP2 PCs with various nvidia cards
including GeForce 8800 GTS and Quadro FX 4500, and various driver
versions including the latest WHQL 175.16.

I investigated your concerns about glGenerateMipmapEXT being slower than
GL_GENERATE_MIPMAP_SGIS, and for power-of-two textures, to my surprise
it is. For a 512*512 texture, glGenerateMipmapEXT takes on average 10ms,
while GL_GENERATE_MIPMAP_SGIS takes on average 6ms. Therefore I have
modified the code to only use glGenerateMipmapEXT if the texture has a
non-power-of-two width or height. I am resubmitting all the files
previously submitted (only "Texture.cpp" has significant changes since
my previous submission, I've also replaced tabs with spaces in
"Texture").
"
2008-05-28 13:01:44 +00:00
Robert Osfield
712b6cb2d9 From Mathieu Marache,
first post:

"I had the problem that debug and release version of the plugins had the same name under linux. These minors modification to Registry and the CMake support files enable to have both Release and Debug version of the plugins to coexist and be found by there respective runtimes."

follow up post:

"I've gone ahead and added a preprocessor directive with the editable CMAKE_DEBUG_POSTFIX. I modified Registry.cpp to take this new preprocessor directive called OSG_DEBUG_POSTFIX while looking for libraries in Debug mode for the windows (msvc) and the linux platforms.

MinGW, cygwin and Apple are still left out this proposal."


Notes from Robert Osfield, completed the work in change d entries to use OSG_DEBUG_POSTFIX
2008-05-28 12:49:47 +00:00
Robert Osfield
e68e474c90 Updated wrappers 2008-05-28 11:58:46 +00:00
Robert Osfield
8677c4d6d6 From Michael Platings, "On nvidia cards mipmap generation for non-power-of-two textures with
GL_GENERATE_MIPMAP_SGIS is very slow (over half a second for a 720*576
texture). However, glGenerateMipmapEXT() performs well (16ms for the
same texture), so I have modified the attached files to use
Texture::generateMipmap() if glGenerateMipmapEXT is supported, instead
of enabling & disabling GL_GENERATE_MIPMAP_SGIS."

Notes, from Robert Osfield, I've tested the out of the previous path using
GL_GENERATE_MIPMAP_SGIS and non power of two textures on NVidia 7800GT and
Nvidia linux drivers with the image size 720x576 and only get compile times
of 56ms, so the above half second speed looks to be a driver bug.  With
Muchael's changes the cost goes done to less than 5ms, so it's certainly 
an effective change, even given that Michael's poor expereiences with
GL_GENERATE_MIP_SGIS do look to be a driver bug.
2008-05-28 11:19:41 +00:00
Robert Osfield
20f3e74643 From Brad Anderegg, "This submission fixes two bugs and helps some performance problems we have been having with txp databases.
The first bug is that the terrain tiles will page out to a lower LOD when they are right in front of you.  The issue appears to be with the blacklisting heuristic which forces a tile to LOD 1, commenting out the usage of blacklisting with the LOD Nodes fixes our problem.  This code change was made to line 29 of TXPPageLOD.cpp.

 

The second bug we were experiencing is that the database reader options never make it through to the archive loader.  The use case for us appeared when the FID codes for the terrain were no longer on the materials.  As it turns out the archive was being created twice, once by TXPNode and once by the ReaderWriterTXP on getArchive() so the options never actually got set on the archive that was being loaded.  The fix is to first create the archive by calling getArchive on the ReaderWriterTXP, which stores it in a map for reference later, and then passing that archive into the TXPNode for it to set its internal member.  With this code change we only create one archive (not sure what creating two did) and our options flags get set properly on the database.

 

The changes made are in TXPNode.h line 72 where the TXPArchive is now passed in.  In the TXPNode.cpp the loadArchive(TXPArchive*) was changed to have the default behavior if NULL is passed in, if an archive is passed in then it does not load it since all the loading is done in the ReaderWriterTXP::getArchive().  The only other place that loadArchive is called is in TXPIO.cpp where a modification was made to pass in NULL which will have the same behavior as it used to.  The last change is the little block of code starting on line 57 of ReaderWriterTXP.cpp, this was changed so that it first calls getArchive() which caches the archives in a map does some loading stuff and returns a pointer to it which is then passed in as a parameter to TXPNode::loadArchive().

 

The performance changes were made to TXPParser.cpp line 163 where we use to osgUtil::Optimizer on the node before passing it off, and on line 1456 we changed the geometry to use display lists.  These small changes actually made drastic performance increases for us, as much as 1000% on certain laptops.

 

As far as testing goes, we have tested these changes with at least 5 txp databases on a variety of different computers including Mac OS and Linux.  The base version used is 2.4."
2008-05-27 20:53:43 +00:00
Robert Osfield
6877a814fb From Cedric Pinson, "By default it's the normal behaviour, it means it's "d" extension for debug library and executable. But if you want to change that you can.
The reason is if you want to build an application that use a library that use openscenegraph you have to build the full chain in debug or in release.
On windows you have no choice, but on linux you can link with both version without rebuilding everything ...

The patch consist only to change the line on one line
SET(CMAKE_DEBUG_POSTFIX "d")
with
SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d on windows")"
2008-05-27 17:42:56 +00:00
Robert Osfield
e427d50d9a From Lars Nilson, bug fix to Sector::computeMatrix() 2008-05-27 17:32:26 +00:00