Commit Graph

5659 Commits

Author SHA1 Message Date
Robert Osfield
10186190f6 Introduced support for controlling mipmapping of osgTerrain::ImageLayer and compression of osgTerrain::HeightFieldLayer. 2008-10-20 08:43:25 +00:00
Robert Osfield
61bd2b825f From Chris Denham, "I noticed that UFOManipulator _matrix and _inverseMatrix may be inconsistently set due to typo in
UFOManipulator::home().
I assume the intention is that _matrix and _inverseMatrix are kept consistent, so corrected file attached.

///////////// OSG 2.6 //////////////////
  _inverseMatrix.makeLookAt( _homeEye, _homeCenter, _homeUp );
  _matrix.invert( _matrix );
///////////// after typo correction /////////////////
 _inverseMatrix.makeLookAt( _homeEye, _homeCenter, _homeUp );
  _matrix.invert( _inverseMatrix );
///////////////////////////////////////"
2008-10-15 10:07:21 +00:00
Robert Osfield
f66a285b01 Changed erroneous ZLIB_INCLUDE_DIRS to ZLIB_INCLUDE_DIR 2008-10-14 17:20:58 +00:00
Robert Osfield
1bbab1fcc7 From Jason Beverage, "Here is a small change to the CURL plugin to distinguish between a 400 level error and a 500 level error.
If a 400 level error occurs, a FILE_NOT_FOUND ReadResult is appropriate.

If a 500 level error occurs (such a 503, Service unavailable), the application might want to try to load the file again in a few seconds/minutes.  This submission returns ERROR_IN_READING_FILE if a 500 level error occurs so that clients can easily distinguish between the errors.

The actual error code is also added to the "message" of the ReadResult so if a client needs more information, they can just parse the message to retrieve the error code."
2008-10-14 16:57:37 +00:00
Robert Osfield
ec797b3a81 From Ricard Schmidt, dot writer plugin. 2008-10-14 16:35:03 +00:00
Robert Osfield
78d731a316 Added zlib support to curl and ive plugins 2008-10-14 14:37:11 +00:00
Robert Osfield
ad78c21e07 Added debug timing code 2008-10-14 14:36:24 +00:00
Robert Osfield
ac975bf79a Added a Refrenced::getGlobalReferencedMutex, and OpenThreads::ScopedPointerLock() and use of this in add/removeParent() codes
to avoid threading problems when using atomic ref counting.
2008-10-14 14:27:41 +00:00
Robert Osfield
d8525815fd Moved compress/uncompress code across to using gzip compatible methods 2008-10-10 12:01:54 +00:00
Robert Osfield
46172c931e Added initial cut of gz compress/uncompress plugin 2008-10-09 18:46:49 +00:00
Robert Osfield
ab3ecd129d Initial cut of zlib based compress/uncompress plugin 2008-10-09 17:02:16 +00:00
Robert Osfield
c3af8b1c8e Fixed the frame rate reporting so that it handles the case when animation is slowed or speeded up 2008-10-09 08:52:14 +00:00
Robert Osfield
9cd739d45c Updated wrappers 2008-10-08 12:54:45 +00:00
Robert Osfield
5e95d6e3b5 Added Texture1D(Image*) and Texture3D(Image*) constructors 2008-10-08 11:30:18 +00:00
Robert Osfield
a4aa8fbcd2 Replaced std::vector::insert with std::copy + back_inserter to avoid member template problems with sunos. 2008-10-08 10:55:20 +00:00
Robert Osfield
29c0e913d7 From Mathias Froehlich, fixes for HP-UX, SGI and Solaris build 2008-10-08 10:10:34 +00:00
Robert Osfield
91d20fb3ec Moved OSG_FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL into src/osg/CMakeLists.txt 2008-10-07 15:59:10 +00:00
Robert Osfield
9b83cad247 Made line graph solid (alpha = 1.0) 2008-10-07 15:58:07 +00:00
Robert Osfield
4f684d16f2 From Jean-Sebastien Guay and Robert Osfield, added setDataVariance(osg::DYNAMIC) to avoid problems to optimization. 2008-10-07 15:41:47 +00:00
Robert Osfield
8ea9fad93a Added osgText to link line 2008-10-07 15:21:12 +00:00
Robert Osfield
c569b8a1f3 Restoring Roger's original 2.0 factor as on review the later orthographic projection code
doesn't require the position to be far out from the center to simulate an infinite light.
2008-10-07 15:19:48 +00:00
Robert Osfield
ad72dc66ce From Roger James, "The light position is incorrectly calculated for shadow casting scenes whose bounding box centre is not the origin. This is a one line fix.
"
2008-10-07 15:16:37 +00:00
Robert Osfield
09e6261e9a From Wojciech Lewandowski and Robert Osfield, add CMake build option for controlling the Windows/NVidia multi-monitor workaround. 2008-10-07 14:36:46 +00:00
Robert Osfield
0daf1f007a Updated wrappers 2008-10-07 14:25:09 +00:00
Robert Osfield
b7fa3f6f3c Replaced IntersectVisitor usage with IntersectionVisitor 2008-10-07 14:19:28 +00:00
Robert Osfield
ed2bbbf23b From Jean-Sebastirn Guay, "Inspired by the latest additions to the StatsHandler, here is my own addition. It's a graph that helps show the variation of the various stats over time. It's clearer than just having bars for the last 10 frames or so, IMHO, since 10 frames go by pretty fast...
The graph is displayed "under" (behind) the normal bar chart you get when you press 's' twice. It doesn't hide the normal stats, you can still read them without any trouble, and that way, it doesn't take any more screen space. It starts from the left, and will scroll left when there is enough data to fill the screen width. The graph lines have the same colors we're used to (except I made the event color a bit bluer, so it's not exactly the same as the update color). A screen shot is attached.

The lines get a bit confused when they're all overlapping at the bottom of the graph, but I think that's the least of our concerns (if they're all at the bottom of the graph - except FPS of course - then great!).

The only thing I'm not very keen about is that to make things simple, I clamp the values to a given maximum. Right now, the maximums I have set are:

* Frame rate: 100 fps (people have 60, 75, 85Hz refresh rates, so there's no one right value, but I think 100 is OK)
* Stats: 0.016 seconds (what you need to get 60Hz minimum)

This could be changed so that the scale of the graph changes according to the maximum value in the last screenful of the graph instead of clamping values. We would then need to display the scale for each value on the side of the graph, because if the scale changes, you need to know what it is at this moment.

I tried to make things easy to change, so for example if you don't like that the graph is in the same space as the normal stats bars, it's easy to move it anywhere else, and make it have other dimensions. The maximums and colors are also easy to change.

The impact on performance should be minimal, since it's one vertex per graph line that's added per frame, and vertices are removed when they scroll off the screen, so you'll never have more than say 1280 * (3 + ncameras) vertices on the screen at one time. No polygons, I used line strips. The scrolling is done with a MatrixTransform."
2008-10-07 13:37:04 +00:00
Robert Osfield
af30f0769a From Colin McDonald, "Attached is an update to the dxf plugin which adds rudimentary support for
text entities.
"
2008-10-07 13:06:53 +00:00
Robert Osfield
ff8c6aa32b From Mathias Froehlich, build fixes 2008-10-07 12:31:42 +00:00
Robert Osfield
8c98220878 Added the ability to release OpenGL objects in PagedLOD subgrphs that are no longer being rendered. 2008-10-07 11:35:41 +00:00
Robert Osfield
6ec4c64914 Updated wrappers 2008-10-06 17:15:16 +00:00
Robert Osfield
400e6eb09a Updated to reflect changes in NodeVistor::ImageRequestHandler. 2008-10-06 17:02:56 +00:00
Robert Osfield
8147bd4df8 Refactored ImageSequence to provided a cleaner and more robust implementation 2008-10-06 17:02:20 +00:00
Robert Osfield
7e43decf4c From Wojciech Lewandowski, build fixes for handling Matrix::value_type == float 2008-10-06 14:18:27 +00:00
Robert Osfield
9cce90e920 From Glenn Waldron, "osgTerrain::Locator::setTransformAsExtents() does not update the _inverse member. Fix attached.
"
2008-10-06 09:39:43 +00:00
Robert Osfield
45085f3eea Converted tabs to four spaces 2008-10-06 08:58:50 +00:00
Robert Osfield
87e8f06522 Ran dos2unix on new shadow implemenations 2008-10-06 08:53:25 +00:00
Robert Osfield
5fe30854dd From Jason Beverage, "Attached is a fix for getTile in the Terrain class. It should be checking for itr == _terrainTileMap.end() instead of itr != _terrainTileMap.end()." 2008-10-06 08:48:44 +00:00
Robert Osfield
7c6dbe0ed8 Moved the OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION definition into the Config.in rather use of -D define 2008-10-03 15:36:34 +00:00
Robert Osfield
3c52c2578f Updated wrappers 2008-10-03 15:15:33 +00:00
Robert Osfield
56bc3ae194 Compile fix required when using ref_ptr<> implicit output conversion 2008-10-03 13:38:55 +00:00
Robert Osfield
281f55a55c From Bryan Thrall, fixed typos in exception strings. 2008-10-03 11:04:23 +00:00
Robert Osfield
7a6ec46535 From Paul Martz, "I had to make Yet Another tweak to the workaround for the occlusion query issue on NVIDIA cards. Testing indicates that this produces stable results. I checked this in to the 2.6 branch as revision 8965. Please include this on the trunk" 2008-10-03 11:02:13 +00:00
Robert Osfield
830bb21a32 From Tatsuhiro Nishioka, submissions posted by Stephan Huber, "attached you'll find a modified ReaderWriterQT.cpp-file where I removed the support for rgb(a)-files.
Quicktime supports only files with 3/4-channels rgba-files and not 1/2-channels rgb-files.

This submission is from Tatsuhiro Nishioka, here's his original quote:

    When FlightGear crashes, the error message
    "GraphicsImportGetNaturalBounds failed" shows up. By adding printf
    debug, I found the error was -8969: codecBadDataErr when loading a
    gray-scaled (2 channels) rgba files even though the file can be loaded
    with Gimp and osgViewer properly.

    So I made an investigation on this problem and found an interesting
    thing. This error occurs only when non-rgb files are loaded before rgb
    files. The reason is that rgba files can be handled by both
    osgdb_rgb.so and osgdb_qt.so, but the error happens only when
    osgdb_qt.so try to load a gray-scaled rgba file.

    When a program is about to load an rgba file, osgdb_rgb.so is loaded
    and it handles the rgba file properly. In contrast, when a gray-scaled
    rgb file is being loaded after a non-rgb file (say png) is already
    loaded by osgdb_qt.so, osgdb_qt.so tries to load the file instead of
    osgdb_rgb, which causes the error above.

    Anyway, the bad thing is that QuickTime cannot handle gray-scaled rgb
    files properly. The solution for this is not to let osgdb_qt handle
    rgb files since osgdb_rgb can handle these properly.

"
2008-10-03 09:22:40 +00:00
Robert Osfield
4bde492d8c From Stephan Huber, removed now redundent setEventQueue method 2008-10-03 09:19:53 +00:00
Robert Osfield
fb9181ff17 From Roland Smeenk, A year ago Stephan Maximilian Huber sent in a submission with enhanced statistics. Because I was interested in the scene statistics of his submission I tried to merge his changes with the current CVS head. I made a few changes to the way the statistics are displayed. Attached you will find the new StatsHandler and a screenshot of the statistics in the compositeviewer example.
This code will add two extra statistics options:
-Camera scene statistics, stats for the scene after culling (updated at 10 Hz)
-View scene statistics, stats for the complete scene (updated at 5 Hz)
 
Each camera and each view will expand the statistics to the right.
 
I also added the requests and objects to compile of the databasepager to the databasepager statistics.""
2008-10-03 09:02:23 +00:00
Robert Osfield
03cec07df8 From Mathias Froehlich, Wr.t AC3D Texture clamping "I had a quick look at the problem.
Attached is a change that is able to provide shared textures for the clamp and
the repeat case.
So this appears to be the best fix I guess ...

Also it additionaly shares the TexEnv StateAttribute in a whole ac3d model."
2008-10-03 08:35:59 +00:00
Robert Osfield
3b4184295e Various improvements to the dicom loader to be able to handle a broader range of dicom files 2008-10-02 15:45:08 +00:00
Robert Osfield
c03b64731b Improved the dicom plugins handling of different slice positions 2008-09-29 17:00:38 +00:00
Robert Osfield
723ebd3334 Turned off the yaw mode on the FlightManipilator to make it easier to navigate in volumes 2008-09-29 13:22:12 +00:00
Robert Osfield
34044c5989 From Erik den Dekker, "I received a compiler warning in osgDB::registry::readObjectOfType while compiling SVN trunk with MSVC 2008.
..\..\..\..\src\osgDB\Registry.cpp(910) : warning C4806: '==' : unsafe operation: no value of type 'bool' promoted to type 'osgDB::Registry::LoadStatus' can equal the given constant

A quick review of the code revealed a piece of code that was clearly wrong, possibly due to a copy-and-paste error.

 "
2008-09-29 10:59:54 +00:00
Robert Osfield
0fdb54d8bb Changed loadLibrary so that it retusn a LoadStatus variable to enable calling
codes to differentiate between whether a library is already loaded, or is newly loaded
2008-09-26 13:51:18 +00:00
Robert Osfield
195ad58494 From Lionel Lagarde, "Here is a correction on DatabasePager::FindCompileableGLObjectsVisitor
The apply(osg::Drawable *) method doesn't update the _drawableSet and
the isCompiled test was inversed."
2008-09-26 10:59:28 +00:00
Robert Osfield
bce664dcab From Fabio Mierlo, "n the lines 428 and 430 of obj.cpp file from release 2.6.0, the parser
use only the first 7 characters to compare the string "map_opacity "
and to copy the followed parameter, but the string have 12 characters."
2008-09-26 10:43:18 +00:00
Robert Osfield
57150bb86a Updated wrappers 2008-09-25 15:04:05 +00:00
Robert Osfield
36409f8597 Added .vert and .frag to list of accepted extension in the GLSL plugin 2008-09-25 10:21:44 +00:00
Robert Osfield
306a9dd6db From Riccardo Corsi, Added 3gp file extension to supported list in quicktime plugin 2008-09-24 16:00:45 +00:00
Robert Osfield
5a87473444 Added 3gp extension alias for quicktime 2008-09-24 15:59:55 +00:00
Robert Osfield
5c264c7c74 Added mutex usage to protect access to plugin and readerwriter containers 2008-09-23 17:29:28 +00:00
Robert Osfield
71af4851c7 Fixed typo 2008-09-22 16:17:28 +00:00
Robert Osfield
976df65bcc From Ulrich Hertlein, fixes for OSX build 2008-09-22 15:01:25 +00:00
Robert Osfield
8f4335825b From Ralf Habacker and Robert Osfield, added search for plugins with OS specific file plugin extensions 2008-09-22 14:55:19 +00:00
Robert Osfield
48fe06fec3 Added getExtensionIncludingDot to provide more efficient handling of extensions 2008-09-22 14:46:54 +00:00
Robert Osfield
922b85b386 Changed the macro usage so that the quotes are now added inside the .cpp 2008-09-22 13:16:29 +00:00
Robert Osfield
fa77f50260 Added readNode implementation that creates an osgVolume::Volume for the specified dicom file. 2008-09-22 11:13:50 +00:00
Robert Osfield
3ec2c22ad4 Added Volume wrappers, and updated terrain wrappers 2008-09-21 11:12:31 +00:00
Robert Osfield
00f6622ac8 Create initial class placeholders for main volume rendering classes 2008-09-21 11:05:03 +00:00
Robert Osfield
ae08a5b261 Change TileID::layer to TileID::level 2008-09-20 15:43:38 +00:00
Robert Osfield
c35159fdde From Chris Denham, changed gluGetErrorString to using osg::State::checkGLErrors() to avoid null pointer dereference 2008-09-20 10:34:47 +00:00
Robert Osfield
4aaf24b5d8 From Mathias Froehlich, added catch for GL_COLOR_MATERIAL mode being set. 2008-09-20 10:09:56 +00:00
Robert Osfield
8552faf774 From John Vida Larring, "If an application initializes osgViewer::GraphicsWindowEmbedded() but never gets around to do any rendering before the application is closed, the result with be a crash (SIGABRT/std::logic_error) in osg::getGLVersionNumber().
The fix was to check whether glGetString( GL_VERSION ) returned a null pointer (Ref. svn diff below). The altered src/osg/GLExtensions.cpp is zipped and attached to this email."
2008-09-20 10:05:31 +00:00
Robert Osfield
0b5852948d Added wrapper support for new osgShadow classes 2008-09-19 19:51:57 +00:00
Robert Osfield
bf15614df6 From Wojciech Lewandowski, a range of new ShadowMap implementations include View Dependent Shadow Maps - LispSM
From Robert Osfield, refactored Wojciech's submission to integrated with osgShadow and use coding sytle more consistent with rest of OSG.
2008-09-19 19:51:27 +00:00
Robert Osfield
f388d6a938 From Mathias Froehlich, added support for search in the installed directories for plugins 2008-09-19 12:49:22 +00:00
Robert Osfield
a961b880bb From Richard Schmidt, fixed the handling of user data so that it uses ref_ptr<> to avoid data getting deleted. 2008-09-19 08:16:41 +00:00
Robert Osfield
44113cfa14 Added Serializer wrappers 2008-09-18 16:03:34 +00:00
Robert Osfield
90d5c9d0c6 Moved Serializer header from VPB into osgDB. 2008-09-18 15:50:22 +00:00
Robert Osfield
7615c7073c Updated wrappers 2008-09-18 15:44:21 +00:00
Robert Osfield
91f7895735 refactored the getWindows(..) and getContexts(..) methods so that they produce
consistent ordering based on the order Camera/slave camera ordering.
2008-09-18 15:18:59 +00:00
Robert Osfield
8bdb22c22e From Mathias Froehlich, "Attached one namespace/scope lookup problem which shows up on irix." 2008-09-18 15:16:57 +00:00
Robert Osfield
1d328ba0d4 From Christopher Blaesius,
"Soft shadow mapping is basically the same as hard shadow mapping beside that
it uses a different fragment shader.
So for me it makes sense that osgShadow::SoftShadowMap is derived from
osgShadow::ShadowMap, this makes it easier to maintain the two classes.
Additional SoftShadowMap also provides the same Debug methods as ShadowMap."
2008-09-18 14:48:28 +00:00
Robert Osfield
47e07244b9 Updated wrappers 2008-09-18 13:54:22 +00:00
Robert Osfield
95a822b70d From John Argentieri, added missing _stripTextureFilePath( false ) initializer. 2008-09-18 13:18:12 +00:00
Robert Osfield
9cca510d6c From Chris Denham, added missing ccopy of polyOffset in copy constructor 2008-09-18 13:09:21 +00:00
Robert Osfield
40723ca8ac From Chris Denham, "
I think I may have discovered a bug in osgShadow/ShadowMap.cpp that results in incomplete shadows being generated.
The problem seems to caused by an incorrect interpretation of the spot light cutoff angle. The valid ranges for spot cutoff are 0-90 and 180, i.e half the 'field of view' for the spotlight. Whereas the shadow map code seems to assume the the spot cutoff is equal to the field of view. This results in the shadows generated by the spotlight getting clipped at half the spot cutoff angle.

I have fixed this in my copy of ShadowMap.cpp:
===============================
//Original code from OSG 2.6:
      if(selectLight->getSpotCutoff() < 180.0f)   // spotlight, then we don't need the bounding box
      {
          osg::Vec3 position(lightpos.x(), lightpos.y(), lightpos.z());
          float spotAngle = selectLight->getSpotCutoff();
          _camera->setProjectionMatrixAsPerspective(spotAngle, 1.0, 0.1, 1000.0);

_camera->setViewMatrixAsLookAt(position,position+lightDir,osg::Vec3(0.0f,1.0f,0.0f));
      }
===============================
// My modifications:
      float fov = selectLight->getSpotCutoff() * 2;
      if(fov < 180.0f)   // spotlight, then we don't need the bounding box
      {
          osg::Vec3 position(lightpos.x(), lightpos.y(), lightpos.z());
          _camera->setProjectionMatrixAsPerspective(fov, 1.0, 0.1, 1000.0);

_camera->setViewMatrixAsLookAt(position,position+lightDir,osg::Vec3(0.0f,1.0f,0.0f));
      }

This change seems correct for spot cutoff in the range 0, 90, but since OpenGL doesn't claim to support cutoffs >90 && <180, I'm not sure how shadow map should deal with those cases, but ignoring spot cut off greater than 90 here seems reasonable to me.
"
2008-09-18 13:05:24 +00:00
Robert Osfield
4923c88bd0 From Ralf Habacker, "the appended patch fixes the problem reported on http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2008-January/006110.html. "
> Using QOSGWidget - QWidget + osgViewer creating the graphics context.
>
> Windows Error #2000: [Screen #0] GraphicsWindowWin32::setWindow() - Unable
> to create OpenGL rendering context. Reason: The pixel format is invalid.
>
>
>
> And then the following fate error pops up:
>
>
>
> The instruction at "0x014c7ef1" referenced memory at "0x000000a4", The
> memory could not be "read".
>
> Click on Ok to terminate the program
>
> Click on CANCEL to debug the program
>
>
2008-09-18 12:57:15 +00:00
Robert Osfield
8dd9c54229 From Robert Osfield and Christophe Loustaunau, fixes for support for 16bit and 32bit tiff images 2008-09-18 12:50:20 +00:00
Robert Osfield
21686c27af From Mathias Froehlich, "I did some performance test runs with the development gcc-4.4 version.
To make it compiel with future gcc's we sppear to need the attached missing
includes ..."
2008-09-18 10:52:35 +00:00
Robert Osfield
9e47480bc7 From Mathieu Marache, "This is an addition for osgSim reader/writer for the osg ascii file format adding osgSim::OverlayNode support. " 2008-09-18 10:49:18 +00:00
Robert Osfield
0d74d508df From Tim Moore, "his submission fixes a bug when the ModularEmitter and ParticleSystem are in different frames of reference. Specifically, it supports the case where the ParticleSystem is not in the world frame. One way this can come up is if your world coordinate system is Earth-centric; the float coordinates of particles don't have enough precision to avoid terrible jitter and other rendering artifacts, so it's convenient to root the particle systems in a local Z-up coordinate system that gets moved around from time to time.
"

Tweak from Robert Osfield, converted code to use new Drawable::getWorldMatrices method
2008-09-18 10:39:37 +00:00
Robert Osfield
0969a5384b Improved the constness of parameters the Node::getWorldMatrices(..) method.
Added Drawable::getWorldMatrices(const Node*) method.
2008-09-18 10:38:18 +00:00
Robert Osfield
93d4090169 From Rob Bloemkool, "This is a submission for src/osgPlugins/ogr/ReaderWriterOGR.cpp
- adds display of options when using osgconv --formats.
- adds useGroupPerFeature option to have each feature in a separate group. Usage: OSG_OPTIMIZER=OFF osgconv -e ogr -O addGroupPerFeature <infile> <outfile>
"
2008-09-17 20:02:39 +00:00
Robert Osfield
17161a9363 From Ewe Woessner, "I looked at the Anaglyphic stereo implementation in SceneView.cpp and think I spotted some copy-paste bugs.
osg::ColorMask* leftColorMask = _renderStageLeft->getColorMask();
if (!leftColorMask)
{
   leftColorMask = new osg::ColorMask();
   _renderStageLeft->setColorMask(leftColorMask);
               ^^^^ here it said right, I think this should be Left.
}


// ensure that right eye color planes are active.
osg::ColorMask* rightColorMask = _renderStageRight->getColorMask();
                                             ^^^^ similar here, I think this should be right
if (!rightColorMask)
{
   rightColorMask = new osg::ColorMask();
   _renderStageRight->setColorMask(rightColorMask);
}

and i further removed an unnecessary setColorMask."
2008-09-17 19:51:35 +00:00
Robert Osfield
377a553295 From Alberto Luaces, "Cygwin's cmake build adds a "d" postfix to the plugins installed in debug
mode. Nevertheless, the code doesn't acknowledge that, so I had problems with
debug versions of the library not being able to open their plugins whereas
the release versions worked fine.

I have made the same changes in Registry.cpp that are available for the rest
of platforms appending that "d" to their plugins. I have also updated the
CMakeLists.txt file to get "_DEBUG" defined at compilation time. I have
copied the already existent conditional block because of cmake's bizarre
operator precedence. Since Cygwin defines both CYGWIN and WIN32, the
following would suffice:

IF(CYGWIN OR UNIX AND NOT WIN32 AND NOT APPLE)

Sadly, it actually doesn't work, so I wrote a new conditional block just for
Cygwin. I could join the two blocks when the parentheses support is added in
newer versions of cmake."
2008-09-17 18:56:59 +00:00
Robert Osfield
ff119b78cd From Adrian Egli, "i came around reviewing my code, and found now finally a solution to remove the polygon offset issue. as we all know the polygon offset has a different behaviour on different GPU system (ATI, NVidia) and this make the use of
polygon offset complicate. so i looked for a solution to remove this offset.

i changed the shader, also the filtering (default: on) use now a correct 3x3 filter:
 1 0 1
 0 2 0
 1 0 1

div: 6

of course a better one would be
 1 2 1
 2 4 2
 1 2 1

div: 16
but this isn't as performant as the simple filter above is. because we need only 5 texture lookups instead of 9, and the result is still good, if you wish we can add a enum to change the pcf filter type once, if there is a need.


testet on NVidia Quatro 570M and on ATI Radeon X1600

"
2008-09-17 18:54:23 +00:00
Robert Osfield
19d02d8c78 From Adrian Egli, "I changed the PSSM shadow map implementation, if we have filtered turned on, it should be now correct. The implementation is more robut on different scene. i tested it on NVIDIA card against a park scene, a chess board and a terrain.
unfort. i couldn't test it on any ATI system. may there will be still another problem there. if there are still some artefacts. we should try out better fZOffSet value
"
2008-09-17 18:51:17 +00:00
Robert Osfield
7f39dc3499 From Bill Prendergast, "Found a typo in CameraRenderOrderSortOp in osg/GraphicsContext.cpp
(V2.6.0 and prior) as noted below:

struct CameraRenderOrderSortOp
{
   inline bool operator() (const Camera* lhs,const Camera* rhs) const
   {
       if (lhs->getRenderOrder()<rhs->getRenderOrder()) return true;
       if (rhs->getRenderOrder()<lhs->getRenderOrder()) return false;
--->    return lhs->getRenderOrderNum()<lhs->getRenderOrderNum();
              ^^^                      ^^^
   }
};

Corrected code attached."
2008-09-17 18:42:52 +00:00
Robert Osfield
5209b33c31 From Max Bandazian, "Lines 302-305 of WindowManager.cpp seem to have a parenthesizing error - the code is
if(
                (!win || win->getVisibilityMode() == Window::VM_PARTIAL) &&
                !win->isPointerXYWithinVisible(x, y)
            ) continue;

But it probably should be

if (!win || (win->getVisibilityMode() == Window::VM_PARTIAL) && !win->isPointerXYWithinVisible(x, y)))
   continue;

The effect of the bug is to segfault if a non-osgWidgets::Window node hasn't been excluded from picking via NodeMask."
2008-09-17 17:13:13 +00:00
Robert Osfield
5052432cc7 Updated wrappers 2008-09-17 17:07:52 +00:00
Robert Osfield
22eae68e48 From Mathias Froehlich, "This is a generic optimization that does not depend on any cpu or instruction
set.

The optimization is based on the observation that matrix matrix multiplication
with a dense matrix 4x4 is 4^3 Operations whereas multiplication with a
transform, or scale matrix is only 4^2 operations. Which is a gain of a
*FACTOR*4* for these special cases.
The change implements these special cases, provides a unit test for these
implementation and converts uses of the expensiver dense matrix matrix
routine with the specialized versions.

Depending on the transform nodes in the scenegraph this change gives a
noticable improovement.
For example the osgforest code using the MatrixTransform is about 20% slower
than the same codepath using the PositionAttitudeTransform instead of the
MatrixTransform with this patch applied.

If I remember right, the sse type optimizations did *not* provide a factor 4
improovement. Also these changes are totally independent of any cpu or
instruction set architecture. So I would prefer to have this current kind of
change instead of some hand coded and cpu dependent assembly stuff. If we
need that hand tuned stuff, these can go on top of this changes which must
provide than hand optimized additional variants for the specialized versions
to give a even better result in the end.

An other change included here is a change to rotation matrix from quaterion
code. There is a sqrt call which couold be optimized away. Since we divide in
effect by sqrt(length)*sqrt(length) which is just length ...
"
2008-09-17 16:14:28 +00:00
Robert Osfield
fbeabc23e0 Updated wrappers of osgWidget 2008-09-17 14:23:05 +00:00