Commit Graph

5809 Commits

Author SHA1 Message Date
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
Robert Osfield
97b37cb117 Added support for finding DCMTK-3.5.4 installed lib/include placement 2008-09-17 11:43:14 +00:00
Robert Osfield
d57ad27fcc Added osgVolume to docs and wrappers 2008-09-16 18:41:13 +00:00
Robert Osfield
6ea2adf1f5 Introduced beginings of osgVolume NodeKit. 2008-09-16 15:32:23 +00:00
Robert Osfield
28af7882f5 Complted the first pass at the DCMTK based dicom loader 2008-09-16 15:31:47 +00:00
Robert Osfield
d07f3d5662 Added optional usage of DCMTK in the dicom plugin 2008-09-15 19:59:12 +00:00
Robert Osfield
d71a6f6cab Introduced Geometry::containsSharedArrays() and Geometry::duplicateSharedArrays() to
support a fix to the osgUtil::Simplifier that couldn't handle shared arrays
2008-09-14 10:31:27 +00:00
Robert Osfield
995ead176a Introduced TransferFunction1D::assign(ValueMap&). 2008-09-13 09:09:51 +00:00
Robert Osfield
f494bc5b8a Updated wrappers 2008-09-11 16:01:17 +00:00
Robert Osfield
e1930d127e Refinements to SwitchLayer and WhiteListTileLoadedCallback 2008-09-11 14:28:42 +00:00
Robert Osfield
2be243deda Added support for SwitchLayer into GeometryTechnique 2008-09-11 14:27:50 +00:00
Robert Osfield
ff299eb104 Introduced osgTerrain::WhiteListTileLoadedCallback for the management of options terrain layers 2008-09-11 13:21:58 +00:00
Robert Osfield
04a3f0da1c Changed the createGeodeFromImage code to use the non power of two extension, and disabled mipmapping 2008-09-11 09:26:14 +00:00
Robert Osfield
b4b5b5ea41 Introduced TerrainTile::TileLoadedCallback 2008-09-10 18:11:54 +00:00
Robert Osfield
ed4bd41574 Removed unneccessary compound name usage 2008-09-10 16:17:17 +00:00
Robert Osfield
898a0c11c2 Removed debugging output 2008-09-10 11:38:49 +00:00
Robert Osfield
f738ab8fe2 Changed the image reading so that it leverages the osgDB::Input::readImage() method
to ensure that it picks up on any local paths set on the Input object.
2008-09-10 11:28:47 +00:00
Robert Osfield
c266cef6b1 Changed the path management so that the node path is prepended on the database path list, rather than replacing it. 2008-09-10 11:27:45 +00:00
Robert Osfield
45ccf11161 Added osg::Image::set/getWriteHint() that allows images themselves to control how
they are written to disk, either inline or as an external file.  Added support for
this in the .ive plugin.  Default of WriteHint is NO_PREFERNCE, in which case it's
up to the reader/writer to decide.
2008-09-10 11:26:30 +00:00
Robert Osfield
c478ad08fc Fix for when looping is is disabled 2008-09-04 17:30:56 +00:00
Robert Osfield
d2e29efcd9 Added acceptance of .ogv extensions in xine-lib plugin 2008-09-02 16:13:54 +00:00
Robert Osfield
8759984f52 Replaced uint with unsigned int 2008-09-01 15:29:22 +00:00
Robert Osfield
d10d0137b9 Updated wrappers 2008-09-01 14:05:40 +00:00
Robert Osfield
13878d9a2e Changed curr and min to current and minimum respectively, to avoid compile problems under Windows 2008-09-01 14:03:41 +00:00
Robert Osfield
99a294ebae Implemented support for ShapeAttributeList, used John Vidar Larring's initial
submission as a base, but implementing the user data functionality in a different
way to facilitate more flexible user data support
2008-09-01 12:40:33 +00:00
Robert Osfield
befa2112f8 From John Vidar Larring, initial cut of .ive support for ShapeAttributeList user data 2008-09-01 12:39:19 +00:00
Robert Osfield
58f4290310 Updated wrappers 2008-09-01 10:49:22 +00:00
Robert Osfield
7945f94246 From He Sicong, "I found a bug here in VERTICAL_SPLIT stereo type:
The vertical separation not actually displayed as it is set.  So some
display the up and down stereo images style will not be correct.
Someone may forget to change the "Horizontal" to "Vertical" after
copying and pasting the code from above HORIZONTAL_SPLIT code segment.
I've attached the file. By replacing the incorrect "Horizontal" to
"Vertical", the bug is gone.
"
2008-09-01 10:22:06 +00:00
Robert Osfield
2ce8fbdcf9 From Wojciech Lewandowski, "Most recent changes to CameraPathEventHandler change path writing method. Now control points are written on the fly. But default stream precision is not adjusted as it used to and remains set to 6 digits (at least with VS 2008) so larger coordinates like positions on Earth Ellipsoid loose lots of fidelity. This patch fixes this issue.
"
2008-09-01 10:06:19 +00:00
Robert Osfield
bc747b0935 Added CompositeLayer::addLayer(setname,filename) convinience function 2008-08-29 09:28:28 +00:00
Robert Osfield
141296c323 From Michael Guerrero, "I've attached the files with the new addition of the "registered = true"
flag set."
2008-08-29 09:26:07 +00:00
Robert Osfield
ed617f87df Introduce the concept of layer set name, using the osg::Object::s/getName() to store
the setname, and using a compound string (set:setname:filename) in place of standard filename when reading and writing
files.
2008-08-28 16:15:57 +00:00
Robert Osfield
c8ef144532 Converted AutoTransform to use doubles. 2008-08-28 09:43:00 +00:00
Robert Osfield
95a359bdab Introduced SwitchLayer which will form the basis of provided support for varients 2008-08-27 10:13:30 +00:00
Robert Osfield
9499cfa420 Improved the GLSL implementation. 2008-08-26 17:40:04 +00:00
Robert Osfield
6af69a3615 Added wrapper build target for generating the osgWrappers 2008-08-26 12:05:24 +00:00
Robert Osfield
86d2eb1e4a Added provisional block in computePositions() 2008-08-26 09:39:45 +00:00
Robert Osfield
11bd5f39d4 From Ulrich Hertlein, attached is a small fix for a mismatched function signature 2008-08-26 08:41:30 +00:00
Robert Osfield
7f042b803a From Doug McCorkle, via Paul Martz who writes : "Summary: Some platforms/configurations cause application crashes if the
occlusion query result is not ready for retrieval when the app tries to
retrieve it. This fix adds an application-level wait loop to ensure the
result is ready for retrieval. This code is not compiled by default; add "-D
FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL" to get this code.

Full, gory details, to the best of my recollection:

The conditions under which we encountered this issue are as follows: 64-bit
processor, Mac/Linux OS, multiple NVIDIA GPUs, multiple concurrent draw
threads, VRJuggler/SceneView-based viewer, and a scene graph containing
OcclusionQueryNodes. Todd wrote a small test program that produces an almost
instant crash in this environment. We verified the crash does not occur in a
similar environment with a 32-bit processor, but we have not yet tested on
Windows and have not yet tested with osgViewer.

The OpenGL spec states clearly that, if an occlusion query result is not yet
ready, an app can go ahead and attempt to retrieve it, and OpenGL will
simply block until the result is ready. Indeed, this is how
OcclusionQueryNode is written, and this has worked fine on several platforms
and configurations until Todd's test program.

By trial and error and dumb luck, we were able to workaround the crash by
inserting a wait loop that forces the app to only retrieve the query after
OpenGL says it is available. As this should not be required (OpenGL should
do this implicitly, and more efficiently), the wait loop code is not
compiled by default. Developers requiring this work around must explicitly
add "-D FORCE_QUERY_RESULT_AVAILABLE_BEFORE_RETRIEVAL" to the compile
options to include the wait loop."
2008-08-25 16:43:40 +00:00
Robert Osfield
38efb23901 From Liang Aibin, added support for :
osgFX::Effect
    osgFX::AnisotropicLighting
    osgFX::BumpMapping
    osgFX::Cartoon
    osgFX::Scribe
    osgFX::SpecularHighlights.
2008-08-25 15:57:17 +00:00
Robert Osfield
d3dda658a8 From Liang Aibin, removed redundent spaces 2008-08-25 15:37:48 +00:00
Robert Osfield
5c2a4b014e From Michael Guerrero, Fixed crash that occurred when openning an new movie file after all previous movie ImageStream had been closed. Also add a missing close of the movie file. 2008-08-25 15:20:42 +00:00
Robert Osfield
0c9214636f From Paul Martz, "This change fixes a problem with PAT nodes during FLT export."
Note, Paul Martz has merged this patch into OpenSceneGraph-2.6.
2008-08-25 15:03:31 +00:00
Robert Osfield
43d19c11cf From Guillaume Chouvenc, "I have added the file StateAttribute.cpp in src/osgPlugins/osg
to support the reading and writing of StateAttribute Callback
in osg files.
"
2008-08-25 14:59:06 +00:00
Robert Osfield
8d5bfeddee From Guillaume Chouvenc, "I have modified Uniform.cpp and StateSet.cpp in src/osgPlugins/osg
to support the reading and writing of Uniform Callback and
StateSet Callback in osg files."
2008-08-25 14:54:11 +00:00
Robert Osfield
a2c1dc85dc Removed debug info 2008-08-25 10:38:07 +00:00
Robert Osfield
ff35465a33 Moved _stateset = new StateSet instances to setStateSet(new StateSet) to make
sure the wiring up of the StateSet parents is done consistently
2008-08-25 10:20:20 +00:00
Robert Osfield
78e22f24c2 Introduced initial cut of a dicom loader, which uses ITK to do the loading. 2008-08-22 16:39:17 +00:00
Robert Osfield
8c8421e7a2 Added warning message 2008-08-22 16:37:56 +00:00
Robert Osfield
f930e707e8 Added checked against an empty _kdNodes list before commensing with intersection 2008-08-19 17:41:55 +00:00
Robert Osfield
8303f03b24 Added .ive support for BlendEquation 2008-08-18 15:06:41 +00:00
Robert Osfield
4adb68c802 Added BlendEquation .osg support 2008-08-18 14:49:16 +00:00
Robert Osfield
9bc5d7f000 Updated wrappers 2008-08-18 11:48:07 +00:00
Robert Osfield
8ecf508fda From Sergey Leontyev, "1. In StyleManager
when applying styles to a Label element the code below runs in a infinite loop.

The reason for this is that nothing increments the Reader "r" in the case when applying a style to label,

so I advance the reader when no match was found. 

( To replicate the error apply style to any label)

 

replaced this:

                while(!r.eof()) if(_styles[style]->applyStyle(t, r)) inc = true;

 

with this:

                while(!r.eof())

                 {

                                if(_styles[style]->applyStyle(t, r))

                                    inc = true;

                                else

                                    r.advanceOverCurrentFieldOrBlock();

                 }            

 

 

I tested it and it works well for me, I did not find any problems with it.

 

 

2.  Added style support for Canvas element, event though there is no styles to apply yet.

It is usefull for someone who inherits from Canvas class to develop another element.

 If applyStyle(Canvas) does not exist

there is no way to apply style to the  element that inherited from Canvas element.

 

Added virtual

     bool applyStyle(Canvas).

 

and in added call to apply style if the Object is of type Canvas:

StyleManager::_applyStyleToObject(osg::Object* obj, const std::string& style) {

...

 

else if(!std::string("Canvas").compare(c))

return _coerceAndApply<Canvas>(obj,style,c);

 "
2008-08-18 11:21:41 +00:00
Robert Osfield
0b39044666 Ran fixtabs to enforce four space tabs 2008-08-18 11:17:44 +00:00
Robert Osfield
9c8e44659f From Erik van Dekker,
"I made several modifications:

 

    * The cause of my errors was that my OSG source directory path contains spaces. To fix this issue I wrapped all paths with quotes, as stated in doxygen documentation.

 

    * I also received some warning messages about deprecated doxygen settings, which I fixed by updating the doxygen file, i.e. running \u2018doxygen \u2013u doxygen.cmake\u2018. By running this command deprecated doxygen options are removed, some option comments have changed and quite some options have been added (I kept their default settings unless mentioned).

 

    * I was surprised to find that the doxygen OUTPUT_DIRECTORY was set to \u201c${OpenSceneGraph_SOURCE_DIR}/doc\u201d, which does not seem appropriate for out of source builds; I changed this to \u201c${OpenSceneGraph_BINARY_DIR}/doc\u201d. (On the other hand, maybe a cmake selectable option should be given to the user?)

 

    * Fixed two warnings I received about unexpected end-of-list-markers in \u2018osg\AnimationPath and \u2018osgUtil\CullVisitor due to excess trailing points in comments.

 

    * Fixed a warning in osgWidget\StyleInterface due to an #include directive (strangely) placed inside a namespace.

 

    * Fixed a warning in osg\Camera due to the META_Object macro that confused doxygen. Adding a semi-colon fixed this.

 

    * Removed auto_Mainpage from the INCLUDE option, because I am positive that this file does not belong there; It never generated useful documentation anyway.

 

    * I added the OSG version number environment variable to the PROJECT_NUMBER option so that the version number is now shown on the main page of generated documentation (e.g. index.html).

 

    * Changed option FULL_PATH_NAMES to YES, but made sure STRIP_FROM_PATH stripped the absolute path until the include dir. This fixed an issue that created mangled names for identical filenames in different directories. E.g. osg/Export and osgDB/Export are now correctly named.

 

    * Changed option SHOW_DIRECTORIES to yes, which is a case of preference I guess.

 "
2008-08-18 11:00:40 +00:00
Robert Osfield
3de3b2dccc From Maceij Krol, "I have implement frame based expiration of PagedLOD children.
New attribute DatabasePager::_expiryFrames sets number of frames a PagedLOD child is kept in memory. The attribute is set with DatabasePager::setExpiryFrames method or OSG_EXPIRY_FRAMES environmental variable.

New attribute PagedLOD::PerRangeData::_
frameNumber contains frame number of last cull traversal.

Children of PagedLOD are expired when time _AND_ number of frames since last cull traversal exceed OSG_EXPIRY_DELAY _AND_ OSG_EXPIRY_FRAMES respectively. By default OSG_EXPIRY_FRAMES = 1 which means that nodes from last cull/rendering
traversal will not be expired even if last cull time exceeds OSG_EXPIRY_DELAY. Setting OSG_EXPIRY_FRAMES = 0 revokes previous behaviour of PagedLOD.

Setting OSG_EXPIRY_FRAMES > 0 fixes problems of children reloading in lazy rendering applications. Required behaviour is achieved by manipulating OSG_EXPIRY_DELAY and OSG_EXPIRY_FRAMES together.

Two interface changes are made:

DatabasePager::updateSceneGraph(double currentFrameTime) is replaced by DatabasePager::updateSceneGraph(const osg::FrameStamp &frameStamp). The previous method is in #if 0 clause in the header file. Robert, decide if You want to include it.

PagedLOD::removeExpiredChildren(double expiryTime, NodeList &removedChildren) is deprecated (warning is printed), when subclassing use PagedLOD::removeExpiredChildren(double expiryTime, int expiryFrame, NodeList &removedChildren) instead. "
2008-08-17 16:52:35 +00:00
Robert Osfield
0c234e7997 From Jason Beverage, "I've got a few machines that OSG incorrectly believes support FRAME_BUFFER_OBJECTS so I am manually trying to set the renderTargetImplementation to PIXEL_BUFFER or PIXEL_BUFFER_RTT. I noticed that this call wasn't setting the camera's overlay data properly because the setRenderTargetImplementation simply calls init() which only does anything for OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY. Any subsequent calls to getOverlayData will simply return the cached OverlayData instead of setting it up.
My fix updates the camera's render target implementation for all OverlayData objects in the OverlayDataMap."
2008-08-17 16:45:09 +00:00
Robert Osfield
f0c2b89fc5 From Paul Palumbo, "Fixes a typo in coverage antialiasing code... Without this fix, get incorrect antialiasing results. " 2008-08-15 17:35:04 +00:00
Robert Osfield
dceb3cbe88 From Jutta Sauer, "We added a raise window method to GraphicsWindow. And added two
implementations for Win32 and X11.

"
2008-08-15 17:32:26 +00:00
Robert Osfield
0448b31f93 From Frashid Larshkari, "I modified the vertical/horizontal interlace stereo modes so that they
use the osg::State::applyMode for enabling/disabling certain while
rendering the stencil mask. Previously some of these calls were
overriding the scene graph states because the global state was not
aware of this change.

"
2008-08-15 17:25:42 +00:00
Robert Osfield
5400e570c7 Added support for geometry shader attributes 2008-08-15 17:18:10 +00:00
Robert Osfield
7cd4641ece From Stephane Lamoliatte, "I added the osg::Program parameters support for the osg plug'in.
Now we could correctly configure geometry shaders in osg files."

Notes from Robert Osfield, renamed the names of the parameters to be less GL centric and more human readable.
2008-08-15 16:43:56 +00:00
Robert Osfield
38f6cddc2c Changed osg::ImageSequence::set/getDuration to set/getLength() to be in keeping with the
osg::ImageStream's getLength().
2008-08-15 16:21:44 +00:00
Robert Osfield
c6c5cdaf89 Updated wrappers 2008-08-15 13:06:18 +00:00
Robert Osfield
927942a0f8 Further work on osg::ImageSequence, improving pause functionality, and introducing new seek(double time) method 2008-08-15 12:45:20 +00:00
Robert Osfield
49e7358bf6 Added initial looping and pause play support 2008-08-14 16:29:12 +00:00
Robert Osfield
bcbd50af39 Implemented a reference eye point and associated methods in support of intersecting billboards 2008-08-14 14:22:39 +00:00
Robert Osfield
f17b307305 Added NullStream class that automatically creates and delete the NullStreamBuffer, thus fixing a memory leak 2008-08-05 15:11:47 +00:00
Robert Osfield
7a7ee85f69 From Eric Sokolowski, "Fixed the build of the osgViewer library to get GL/glx.h from the right place, when building on OSX with X11" 2008-08-05 15:06:22 +00:00
Robert Osfield
7f8183f64c Merged changes to OpenSceneGraph-2.6 into trunk using :
svn merge -r 8729:8734 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.6 .
2008-08-05 11:17:48 +00:00
Robert Osfield
384d2921fd Moved initial drawable setup to within the mutex locked section to avoid multi-threaded crash on startup. 2008-08-04 12:47:14 +00:00
Robert Osfield
6595562442 Removed debug info 2008-08-04 12:27:22 +00:00
Robert Osfield
c8001915f6 From Ulrich Hertlien, "attached is a patch to src/osgPlugins/quicktime/QTImportExport.cpp that fixes loading images using the quicktime loader. Also fixes some minor bugs like uninitialized variables and incorrect deletes.
I'm a bit puzzled why this didn't pop up for more people as it's quite severe: basically the filename was never set!""
2008-08-04 09:05:29 +00:00
Robert Osfield
fcc8426226 Added a small epsilon expansion of the bounding box being clipped/intersected against, to avoid numberic errors causing problems. 2008-08-04 08:45:08 +00:00
Robert Osfield
268b79d03f Improved the terrain intersection code so that it produces more stable terrain movements. 2008-08-03 20:35:45 +00:00
Robert Osfield
f81ff952a2 merged 2.6 branch changes back into trunk using : svn merge -r 8699:8706 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.6 . 2008-08-03 16:57:09 +00:00
Robert Osfield
ced418ccb5 Moved bb expansion out of loop. 2008-08-03 16:48:12 +00:00
Robert Osfield
bdd558af3b Updated wrappers 2008-07-25 20:50:59 +00:00
Robert Osfield
5cac386fa6 Renamed enums in osgWidget from ALLCAPITALS to normal OSG conventional of AllCapital 2008-07-25 20:50:42 +00:00
Robert Osfield
eed365aef4 Added PluginQuery function to wrappers 2008-07-25 20:49:17 +00:00
Robert Osfield
f4d74b66cf Added OSGPL Copyright notices 2008-07-25 20:04:41 +00:00
Robert Osfield
e525dd21bf Improved handling of PAGE_AND_RETAIN_IMAGES 2008-07-25 18:44:13 +00:00
Robert Osfield
65d5ef608d Reverted back to using std::list<std::String> 2008-07-25 17:42:37 +00:00
Robert Osfield
d137394169 Added Mode support 2008-07-25 16:23:00 +00:00
Robert Osfield
d0890ab250 Updated wrappers, and further refined the ImageSequence API 2008-07-25 16:11:51 +00:00
Robert Osfield
d8d2bc4193 From Ulrich Hertlein, "as I hinted at on osg-users in the "obj loader: map_* only reads last component" thread, this submission broke material/texture loading for some files I have that specify texture matrix scaling.
The following link shows a very comprehensive list of .mtl file options:
http://local.wasp.uwa.edu.au/~pbourke/dataformats/mtl/

Attached is a patch that should fix spacey filenames and optional texture scale/offset.  I have tested it with files I have that I modified to contain spaces in the texture filenames."
2008-07-25 15:45:40 +00:00
Robert Osfield
ec4d189b64 Added ImageSequence to .ive plugin, added support for multiple ImageThreads in osgDB::ImagePager 2008-07-25 13:45:07 +00:00
Robert Osfield
0d1656055c Moved PluginQuery from osgconv into osgDB 2008-07-25 10:18:36 +00:00
Robert Osfield
5cdb5c055c Added extension docs 2008-07-25 10:18:14 +00:00
Robert Osfield
7c6aba874b Added option docs 2008-07-25 09:46:05 +00:00
Robert Osfield
79fbab4a95 From Paul Martz, "Not sure about the descriptions, so I left those blank. But at least "osgconv --formats" will display the .ive options now." 2008-07-24 13:25:49 +00:00
Robert Osfield
c8d3e81e08 Updated wrappers 2008-07-24 12:48:25 +00:00
Robert Osfield
6915bce1a2 Added a getCurrentRenderStage() and getCurrentCamera() convninience methods, and
converted the CullVisitor::apply(OcclusionQueryNode&) implementation to use the
new getCurrentCamera method.
2008-07-24 12:18:49 +00:00
Robert Osfield
7dabdf5d7e Added supportOptions() entry docs 2008-07-24 12:01:45 +00:00
Robert Osfield
ea309e2677 From Bob Kuehne, "fix for filenames that have spaces within their name."
Note form Robert, changed std::cout to osg::notify(osg::INFO)
2008-07-24 11:22:43 +00:00
Robert Osfield
4fe8907748 Updated wrappers 2008-07-23 22:19:37 +00:00
Robert Osfield
ec9218ad1f Refactored OverlayData so that its possible to subclass OverlayNode/OverlayData. 2008-07-23 22:19:29 +00:00
Robert Osfield
820586a3d0 Added wrappers 2008-07-23 21:52:03 +00:00
Robert Osfield
dc05f2ef95 Moved helper classes into Protected section 2008-07-23 21:49:07 +00:00
Robert Osfield
86ca0860cc From Paul Martz, typo fixes 2008-07-23 21:25:09 +00:00
Robert Osfield
bfcc7473b8 Applied filename fix suggested by Andrew Bettison. 2008-07-23 19:06:14 +00:00
Robert Osfield
daa3d2381a Implemented ImagePager internals 2008-07-23 19:04:46 +00:00
Robert Osfield
6488ff23a5 Fixed unitialized variable 2008-07-23 15:42:02 +00:00
Robert Osfield
cc2af85c96 Further work on ImageSequence 2008-07-22 20:20:16 +00:00
Robert Osfield
c9dc578186 Added support for pruning old images, recording the Duration in the .osg file, and -o filename output support in osgimagesequence. 2008-07-22 16:44:49 +00:00
Robert Osfield
ec13321bd7 Updated wrappers 2008-07-22 15:21:24 +00:00
Robert Osfield
669d6be0b2 Fixed handling of TextureCubeMap's with mipmapped/ImageSequence/PBO's. 2008-07-22 14:47:59 +00:00
Robert Osfield
14771d3a4d Added ImageSequence IO support in Texture classes 2008-07-22 12:40:02 +00:00
Robert Osfield
5ab73e9f80 Added support for ImageSequence to all Texture classes 2008-07-22 12:28:46 +00:00
Robert Osfield
74a1b7881e Disabled the setting of Texture::setUnrefImageOnApply(true) when the imagery is
an ImageStream.
2008-07-22 10:13:57 +00:00
Robert Osfield
f513700450 From Mario Valle, "The attached osgWidget source solves three compilation warnings on VC 7.1 on WindowsXP (OSG 2.5.5).
BTW the construct is absolutely legal C++, but VC 7.1 has a different idea..."
2008-07-22 09:02:44 +00:00
Robert Osfield
19e3b1624d Moved osgViewer::ScreenCaptureHandler's WindowCaptureCallback from head into .cpp
to clean up headers and avoid wrapper build issues.

Updated wrappers
2008-07-21 23:42:59 +00:00
Robert Osfield
cad2f6d4fc From Jean-Sebastien Guay, "Changes attached so that the CaptureOperation is passed in the constructor of the ScreenCaptureHandler (default 0 = default CaptureOperation). This way, you can do:
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler(
   new osgViewer::WriteToFileCaptureOperation("filename", "jpg")));

and the filename will be what you want. The WriteToFileCaptureOperation will add the context ID and the file number (if in SEQUENTIAL_NUMBER mode) to the file name.

(The attached also clarifies some notify messages, and corrects the comment when adding the handler in osgviewer.cpp)

I also remembered, the current architecture could allow a different CaptureOperation for each context, but currently the API only allows setting one CaptureOperation for all contexts. This could be improved if need be.

"
2008-07-21 21:28:48 +00:00
Robert Osfield
573044ceea From Mario Valle, signed/unsgined warning fix 2008-07-21 21:17:05 +00:00
Robert Osfield
041a06b89d Further work on osg::ImageSequence/osgDB::ImagePager 2008-07-21 21:00:57 +00:00
Robert Osfield
e4b22e44d2 Moved the ~Record body into the .cpp to avoid a MipsPro compile error (due to a compiler bug) 2008-07-21 19:23:03 +00:00
Robert Osfield
34a085a1bd Added call to OpenThreads::Thread::cancel(); 2008-07-21 17:45:28 +00:00
Robert Osfield
6796b4f70d Updated wrappers 2008-07-21 17:39:55 +00:00
Robert Osfield
acd7e65687 Added basic image sequencing 2008-07-21 17:28:22 +00:00
Robert Osfield
2125c9843b Moved the if (!buffer) check to infront of the memory initialization 2008-07-21 16:17:41 +00:00
Robert Osfield
ac61676368 Initial cut of osgimagesequence example 2008-07-21 10:57:06 +00:00
Robert Osfield
09e7bcdf4e Added ImagePager first cut, and updated wrappers 2008-07-21 10:10:01 +00:00
Robert Osfield
c2432b22da Added first cut of ImageStream IO wrapper 2008-07-21 09:55:15 +00:00
Robert Osfield
d12708e6f6 First cut of osgDB::ImagePager for updating osg::ImageSequence 2008-07-21 09:47:39 +00:00
Robert Osfield
d17a255d8e First cut of osg::ImageSequence class 2008-07-21 09:46:53 +00:00
Robert Osfield
3814731c27 From Adrain Elgi, added osgGA to link list 2008-07-18 21:17:35 +00:00
Robert Osfield
18e9d2d53b Introduce a custom atof function that always assumes data comes in form 10.10 with
the full stop used as a decimal place.
2008-07-18 11:39:06 +00:00
Robert Osfield
46796978fd From Jean-Sebastien Guay and Robert Osfiled, osgViewer::ScreenCaptureHandler for
taking screenshots
2008-07-17 16:12:39 +00:00
Robert Osfield
43e2c5fadf Updated wrappers 2008-07-17 14:13:13 +00:00
Robert Osfield
4aed0a7eac From Ulrich Hertlein, "attached are some minor tweaks:
- fixed typos in osgViewer/ViewerBase
- const-ness in include/osg/View findSlaveIndexForCamera
- supported options for STL reader, fixed return values to reflect proper errors
- supported options for DirectX reader, fixed return values
- normals pseudo-loader: scaling normals to a const (but variable) fraction of the bounding sphere radius
"
2008-07-17 13:51:14 +00:00
Robert Osfield
8751bdbc97 Updated wrappers 2008-07-17 12:26:42 +00:00
Robert Osfield
969884e6c2 Moved AuthenticalMap/AuthenticationDetails out in their own files 2008-07-17 12:13:04 +00:00
Robert Osfield
adaf71fa19 Added osgDB::AuthenticationMap/Details to osgDB and curl plugin to add the ability
to authenticate http transfers
2008-07-17 11:55:55 +00:00
Robert Osfield
cacb509f60 Moved .net plugin out into Deprecated section of osg svn repostitory 2008-07-16 16:19:54 +00:00
Robert Osfield
b0d1f419e3 Fixed path to font 2008-07-16 16:19:19 +00:00
Robert Osfield
2fefc911fd Set the default setting of LineWidth to 2.0 to ensure that old default behavior
is maintained.
2008-07-16 16:05:43 +00:00
Robert Osfield
c3a4237e3a From Vincent Bourdier, removed line with setWidth(2.0) as this code prevents
user settings of line with.
2008-07-16 16:04:27 +00:00
Robert Osfield
c33f7e5720 Cleaned up the updateStateSet code 2008-07-16 15:58:51 +00:00
Robert Osfield
270a671c75 Updated wrappers 2008-07-16 13:29:35 +00:00
Robert Osfield
5f0f80cab2 Changed int's to unsigned int's to avoid warnings 2008-07-16 13:26:06 +00:00
Robert Osfield
850034ab75 Moved the _textureObjectBuffer assignment to after the imagery has been download to avoid crashes under multi-threaded compile of texture objects (was causing a crash with 3D Textures, but is something that would happen with other Texture types as well.) 2008-07-16 13:23:58 +00:00
Robert Osfield
41bd615f3a Removed a division by precomputing the associated values 2008-07-16 11:40:01 +00:00
Robert Osfield
a8cb408213 Added osgWidget wrappers 2008-07-15 22:13:35 +00:00
Robert Osfield
e6c99b0434 Fixed typo 2008-07-15 21:28:22 +00:00
Robert Osfield
a383f7ee34 Fixed name of lib 2008-07-15 19:42:49 +00:00
Robert Osfield
47255490a9 Changed IMPORT to "Import option", and "EXPORT:" to "Export option:" in supportsOptions() docs make it a little more friendly and understandable 2008-07-15 19:28:30 +00:00
Robert Osfield
115787f8e9 From Paul Martz, "Here's documentation for the export options of the FLT plugin. I also labeled the import options as such." 2008-07-15 19:26:20 +00:00
Robert Osfield
abe16fa571 Changed the version setup code to be consistent with the rest of the OSG 2008-07-15 19:24:22 +00:00
Robert Osfield
c989b98f2e From Gino van den Bergen, "The VRML plugin in the current 2.5.4 release will not compile under VC8.0 when the project file is generated using CMake 2.6. The attached CMakeLists.txt will fix this problem. The file replaces the CMakeLists.txt file in src/osgPlugins/vrml.
NB: It is assumed that the antlr and regex libs are located in $(OPENVRML_DIR)/lib.
 "
2008-07-15 19:02:20 +00:00
Robert Osfield
c2b77aa08e From Jeremy Moles, import of the osgWidget NodeKit, sourced from the original http://osgwidget.googlecode.com/svn/trunk
Notes from Robert Osfield, I've merged osgWidget trunk, and added/changed CMakeLists.txt file to make it suitable for inclusion in the core OSG, and moved imagery/scripts/shaders out into OpenSceneGraph-Data
2008-07-15 17:21:25 +00:00
Robert Osfield
0c3d119cea Updated wrappers 2008-07-15 14:24:46 +00:00
Robert Osfield
35bc9c7dd2 From Art Trevs, Removed GLeunm version setAttachment() to avoid ambigiuity with
whether to enable MRT.
2008-07-15 14:24:21 +00:00
Robert Osfield
c88d34ee97 Renamed Archive::ArchiveStatus to ReaderWriter::ArchiveStatus 2008-07-15 14:15:42 +00:00
Robert Osfield
59f6e0cdcf Updated wrappers 2008-07-15 10:45:07 +00:00
Robert Osfield
3e96a9d448 Missing check-ins 2008-07-15 09:55:33 +00:00
Robert Osfield
5ab4af80c5 Added missing ac3d supportsExtensions() constructor 2008-07-14 20:11:37 +00:00
Robert Osfield
02b456bcfa Converted plugins to use the new supportsExtension()/supportsOptions/supportsProtocl() methods
to help enable better querying of supported features
2008-07-13 22:18:59 +00:00
Robert Osfield
cb98cddc31 Added new ReaderWriter methods for recording what protocols, extensions and options are
support by ReaderWriters
2008-07-13 15:24:45 +00:00
Robert Osfield
6aa604f31a From Paul Martz, removed uneccessary libraries from link line 2008-07-13 12:34:06 +00:00
Robert Osfield
4ca61c38f0 From Doug McCorkle, "Attached is patch that corrects/improves the following issues with the OBJ loader:
1. Added options to control wether the osgUtil::Tessellator or osgUtil::TriStripVisitor are run. By default they still run just as before.
2. Added support for the Emissive material. The data was being read from the mtl file but was never being applied to the model.
3. This is the main bug addressed, when a model is read in with an alpha value specified like:

newmtl Material__8
       Ns 24
       d 0.33
       illum 2
       Kd 0.204 0.204 0.204
       Ks 0 0 0
       Ka 0.153 0.153 0.153

where the alpha value is d. The loader would then overwrite the alpha value when reading the diffuse, specular, and ambient colors. I have changed all the material color readers to only set the values they read and to use the default colors specified in the constructor of the obj class. With these changes, the obj reader now handles opacity correctly if the alpha value is specified before the material colo"
2008-07-12 12:00:58 +00:00
Robert Osfield
360e7629d0 From Christophe Loustaunau, "For our application, we need to write tiff file in floats. I have change a little bit the readerWritterTiff :
It check the data type of the image ( img.getDataType() ) and if it's GL_FLOAT :It save the tiff with float values.
Otherwise it does the same thing as before."
2008-07-11 19:43:01 +00:00
Robert Osfield
0e2dea9a39 From Liang Aibin, " In lastest svn version of OSG, the .ive plugin missing osg::Light, it
does not process I/O for osg::Light. Now I have fixed it as follows:
 
2. In DataInputStream.cpp, I add support code in DataInputStream::readStateAttribute
    for osg::Light.
 
3. In DataOutputStream.cpp, I add support code in DataOutputStream::writeStateAttribute
    for osg::Light.
 "
2008-07-11 19:23:49 +00:00
Robert Osfield
ef1ee63f03 From Joakim Simmonson,
"Opcodes.h:
* Added INVALID_OP as -1 in the Opcodes enum. Note that INVALID_OP is not an actual opcode defined in the OpenFlight format. The purpose of INVALID_OP is to mark an opcode variable as invalid or uninitialized.

ReaderWriterFLT.cpp:
* The header node is returned if it exists, even if the file does not contain a node hierarchy. The old behaviour returned a ERROR_IN_READING_FILE error.
* Changed opcodes initialized to -1 to the new enum value INVALID_OP."
2008-07-11 17:46:30 +00:00
Robert Osfield
1489eeb228 From Joakim Simmonsson, fixed various spelling typos in comments 2008-07-11 17:41:50 +00:00
Robert Osfield
161e01dc5d From Mathias Froehlich, "Due to the recent data variance changes/discussion:
Change the ac3d loader that can as such only deliver static models to set the
data variance to static for the returned model.
"
2008-07-11 17:35:13 +00:00
Robert Osfield
45b2fb8db7 Increased the buffer and fixed the buffer calculation when moving backwards into objects 2008-07-11 17:07:05 +00:00
Robert Osfield
61a81d8e06 Updated KdTree code to refect new cleaned up API 2008-07-11 16:51:11 +00:00
Robert Osfield
9866eb93f8 Tweaked the KdTree intersection performance testing code block 2008-07-11 16:50:43 +00:00
Robert Osfield
8a6c25425e Updated wrappers 2008-07-11 16:48:55 +00:00
Robert Osfield
a856459a86 Moved the building and intersecting of the KdTree into the .cpp, and cleaned up
the header to ready it for wider usage
2008-07-11 16:48:39 +00:00
Robert Osfield
d3fd43cc6f Streamlined KdTree implementation 2008-07-10 15:50:10 +00:00
Robert Osfield
29d66125e2 Updated wrappers 2008-07-09 19:43:02 +00:00
Robert Osfield
8edee96275 Cleaned up KdTree implementation 2008-07-09 19:42:15 +00:00
Robert Osfield
c41ca3d6a0 Introduced code for doing dummy test traversals - used for benchmarking KdTree code. 2008-07-09 19:40:10 +00:00
Robert Osfield
cbf5429c19 Introduce a intersecion performance testing code path, #if def'd out for now. 2008-07-09 19:26:40 +00:00
Robert Osfield
a00f94ac18 Updated wrappers 2008-07-09 12:37:59 +00:00
Robert Osfield
2851429333 Added optional control of whether to use KdTrees for intersections 2008-07-08 17:35:10 +00:00
Robert Osfield
134c86c2d5 Implement hierachy culling in KdTree::intersect(..) 2008-07-07 20:27:56 +00:00
Robert Osfield
f1db402f2b Improved the handling of KdTree intersections 2008-07-07 14:27:58 +00:00
Robert Osfield
d05236bfb4 Implemented intial KdTree triangle intersection code, but without culling implemented 2008-07-07 13:21:37 +00:00
Robert Osfield
e8487b8830 Added KdTreeBuilder calls into FindCompileableGLObjectsVisitor, and an alternative
path that explictly calls the KdTreeBuilde when required in cases when no pre compile of GL objects is required.
2008-07-07 10:46:22 +00:00
Robert Osfield
682be50e2a Changed types to avoid warnings under Windows 2008-07-07 09:40:30 +00:00
Robert Osfield
c4e8d6ee42 Changed the DatabasePager so that it bypasses the Registry::readNode() method and calls
readNodeImplementation() directly to avoid calling the KdTreeBuilder.   

Updated wrappers.
2008-07-06 18:27:10 +00:00
Robert Osfield
3965fe357b Moved KdTree build code into osg::KdTree 2008-07-06 12:14:19 +00:00
Robert Osfield
10595e49e3 Added handling of co-incident start and end points. 2008-07-05 17:29:07 +00:00
Robert Osfield
9a9c543ffa Ported intersection code to use new osgUtil::LineSegmentIntersector/IntersectionVisitor. 2008-07-05 16:39:28 +00:00
Robert Osfield
e70e3a6d5d Converted TerrainManipulator to use osgUtil::InterectionVisitor rather than the
old IntersectVisitor
2008-07-04 19:16:19 +00:00
Robert Osfield
db57d2504e Added KdTree intersection support into LineSegmentIntersector 2008-07-04 17:02:02 +00:00
Robert Osfield
44d144997e Added prelimnary KdTree data structure and automatic kdtree build support
into osgDB::Registry/osgTerrain so that newly created subgraphs can have 
KdTree built on all osg::Geometry automatically on load/creation.
2008-07-04 15:57:48 +00:00
Robert Osfield
3f025bec5d From Mario Valle, "xed the following warning on Linux 64 bits Athlon:
/users/mvalle/OSG/OpenSceneGraph/src/osg/BufferObject.cpp: In member function `virtual void osg::ElementBufferObject::compileBuffer(osg::State&) const':
/users/mvalle/OSG/OpenSceneGraph/src/osg/BufferObject.cpp:600: warning: cast to pointer from integer of different size"
2008-07-03 15:01:04 +00:00
Robert Osfield
14c86a5389 From Mario Valle, removed extraneous spaces 2008-07-03 14:59:07 +00:00
Robert Osfield
45d5376503 Set the DataVariance on FadeText to DYNAMIC to reflect their nature 2008-07-03 10:03:06 +00:00
Robert Osfield
a65b74d287 Updated wrappers 2008-07-02 10:00:09 +00:00
Robert Osfield
201522feb3 Introduced support for UNSCPECIFIED and STATIC DataVariance of StateSet/Textures 2008-07-02 09:25:08 +00:00
Robert Osfield
aa593fcd2d From Colin McDonald, "There is a problem reading bmp files containing a colour palette,
due to an incorrect scan line length calculation.  Attached is a fix,
and a little bmp file which demonstrates the problem."
2008-07-01 19:04:29 +00:00
Robert Osfield
dba344feba From Lilin Xiong, "I change ive plugin a little for osgText inout, so the ive plugin supports backdrop setting,
and Text3D, FadeText inout :

1. in DataInputStream.cpp, add 1286--1293 lines;
2. in Text.cpp, add some code for text's Backdrop setting;
3. in IveVersion.h, add line 39,  increase the VERSION to VERSION_028(line 41)
4. in ReadWrite.h,  add line 146,147
5. add file FadeText.h, FadeText.cpp, Text3D.h, Text3D.cpp."
2008-07-01 18:37:13 +00:00
Robert Osfield
c6ba70e3ad From Mathias Froehlich, "It appears not to be sufficient to set a cmake variable to get a define in
such a config file. Instead set that variable to 1. Also included a small compile fix, that appears to be required  than ..."
2008-07-01 09:40:06 +00:00
Robert Osfield
bec0fc9c32 Added guards against FBO not being supported/setup 2008-06-30 16:53:06 +00:00
Robert Osfield
5e0169f664 Changed the Optimizer::StateVisitor so that it can individually decide whether
to optimize away duplicate state with dynamic, static and unspecified DataVarience.  By default
the code now optimizes away duplicate state with either static and unspecied state, previously 
it was just handling static state.
2008-06-29 12:22:50 +00:00
Robert Osfield
8820d0bb1d Added realize of new graphics contexts to handle new views being added with
unrealized windows
2008-06-28 16:59:26 +00:00
Robert Osfield
fec2a8fabe Changed back to use an std::vector<> rather than a std::list for RequestQueue to
avoid member template problems under Solaris.
2008-06-27 19:40:52 +00:00
Robert Osfield
a9b05e0815 Refactored the sort of the requestQueue so that there is single code path for doing the sort. 2008-06-27 18:59:27 +00:00
Robert Osfield
214491dd94 From Mathias Froehlich, "Update to the configure check for msvc 7.1.
MemoryBarrier() is used in the implementation, so it should be checked.
This in effect disables the faster atomic ops on msvc 7.1 and older, even if
only the MemoryBarrier() call is missing. But it ensures for the fist cut
that it will build everywhere. If somebody cares for msvc 7.1 enough and has
one for testing installed, he might provide the apropriate defines to guard
that MemoryBarrier() call.

I tested that msvc8 32/64bit still passes the configure tests and compiles.
"
2008-06-27 16:47:43 +00:00
Robert Osfield
34f58482e6 Moved the apply(&) default implementations from the header into the NodeVisitor.cpp,
and changed the casts to use static_cast<>.
2008-06-27 12:35:56 +00:00
Robert Osfield
6d53566654 Updated wrappers 2008-06-26 19:21:54 +00:00
Robert Osfield
8dc1143263 From Paul Martz, "The method IntersectionVisitor::apply(osg::PagedLOD&) appears to attempt to identify a "highest res" child of the PagedLOD and only allow intersection on that child. The implementation appears to be flawed in two cases:
1) The "highest res" child is assumed to be the child with index "getNumFileNames()-1" or "getNumChildren()-1". As a result, PagedLODs that do not sort children from furthest to nearest will intersect with the wrong child. (see attached "case1.osg" to reproduce this problem.)
 
2) The code assumes there is only one highest res child. As a result. PagedLODs with multiple children at the same highest res range can only intersect one of those children. ("case2.osg" demonstrates this issue; you can only pick the quad on the right.)
 
I've attached a modified IntersectionVisitor.cpp that attempts to resolve these issues. It identifies a highest res range based on the range mode, then continues traversal on all valid children corresponding to that range description. Only in the case of a malformed PagedLOD does the code fall back to getting the last child in the list.
 "
2008-06-26 18:34:01 +00:00
Robert Osfield
f523515aed From Morten Haukness, "When cloning effects osg crashes because the copy constructur tries to run av pure virtual method (setUpEmitterAndProgram). The right thing to do when cloning an effect is to run the inherited version og buildEffect and setUpEmitterAndProgram.
"
2008-06-26 18:06:24 +00:00
Robert Osfield
44c125a801 Changed the removeCamera() method so that it now actively calls releaseGLObjects()
on all children of a camera that aren't shared with other cameras on that context.

This change fixes problems with allocating and deleting views.
2008-06-26 16:45:50 +00:00
Robert Osfield
53636db5bc From Mathias Froehlich, updated CMakeLists.txt to build the Atomic.cpp 2008-06-26 15:06:44 +00:00
Robert Osfield
260d0d384f From Mathias Froehlich, build fixes for various unices 2008-06-26 12:08:37 +00:00
Robert Osfield
c32ee85d3d From Mathias Froehlich, added do not edit comments to Config.in so that the autogenerated
Config files have an appropriate warning notice
2008-06-26 10:33:47 +00:00
Robert Osfield
5a4ce5a387 From Mathias Froechlich, "Attached is a change to that atomic stuff to move the win32, msvc
implementation of the atomic increment and decrement into a implementation
file.
This way inlining and compiler optimization can no longer happen for these
implementations, but it fixes compilation on win32 msvc targets. I expect
that this is still faster than with with mutexes.

Also the i386 gcc target gets atomic operations with this patch. By using an
implementation file we can guarantee that we have the right compiler flags
available."
2008-06-26 10:27:16 +00:00
Robert Osfield
87b74c1f54 Commented out the explict install of the Config files as including these files into
the header list allows the normal Cmake install support to install them.
2008-06-23 10:18:04 +00:00
Robert Osfield
275811d02a From Eric Sokolowsky, "I have made a number of changes intended to get a few things working better on OSX. However, since I'm still pretty new at Mac development and cmake I'm not entirely certain that the changes I have made are benign on other platforms. I have tested these changes on Leopard with CMake 2.6 generating Xcode 3.0 projects, compiling on ppc and i386 for 10.5 and 10.4, and on Linux (CentOS) and everything still seems to work ok. Here are the changes I made (against OSG svn as of this afternoon):
- Added osgviewerCocoa example to APPLE builds
- Fixed corrupt Xcode project generation with CMake 2.6 dealing with ADD_DEFINITIONS and CMake Policy CMP0005 on Leopard
- Resolved CMP0006 warning for examples and programs by setting BUNDLE DESTINATION to same as RUNTIME DESTINATION with CMake 2.6
- Fixed freetype plugin on Leopard to avoid OpenGL linking problem
- Figured out how to use a custom Info.plist included in the project (see osgviewerCocoa application CMakeLists.txt)"
2008-06-23 09:57:45 +00:00
Robert Osfield
1e3183a355 Quietened down debug info 2008-06-21 17:56:38 +00:00
Robert Osfield
af271f99ec Added support for X11's overrideRedirect functionality 2008-06-21 17:50:58 +00:00
Robert Osfield
415d45525c Changed the include/osg/Config and include/OpenThreads/Config references to use the assocaited CMake variable for these headers 2008-06-20 19:52:14 +00:00
Robert Osfield
ff811736fc From Terry Welsh, added missing MixinVector header 2008-06-20 17:32:27 +00:00
Robert Osfield
779a7c46ac Added OSG_WINDOWING_SYSTEM cmake option string to allow toggling between X11 and Carbon under OSX. 2008-06-20 16:57:22 +00:00
Robert Osfield
a71939c5bb From Mathias Froehlich, moved optional config variables into include/osg/Config file that
is automatically created by cmake according to its own settings.
2008-06-20 15:50:53 +00:00
Robert Osfield
8aa7c330f8 Changed const double* to const Matrix::value_type* to ensure changes in Matrix type don't break the build 2008-06-20 15:28:38 +00:00
Robert Osfield
be185cb3af From Terry Welsh, new flatten static transforms visitor that duplicates subgraphs that are shared beneath differnt static transforms
From Robert Osfield, made a range of changes to Terry's visitor integrating it into osgUtil::Optimizer and 
changing the code to use a style more like the rest of the OSG.
2008-06-20 13:16:35 +00:00
Robert Osfield
bc6e5b5da2 Updated version numbers for dev releases 2008-06-20 11:11:47 +00:00
Robert Osfield
0e7920f144 From Mathias Froehlich, "Fixes a compile of src/osgSim/ShapeAttribute.cpp on suse 10.2." 2008-06-20 10:46:33 +00:00
Robert Osfield
96a80666c9 Updated wrappers 2008-06-19 20:42:10 +00:00
Robert Osfield
d6469b87c1 From Mathieu Marache, "submission for inclusion to support mpg and avi files when using the quicktime plugin on windows" 2008-06-19 17:35:45 +00:00
Robert Osfield
936edacc92 From Mathias Froehlich, added support for using OpenThreads::Atomic for thread safe ref/unref. 2008-06-19 17:30:38 +00:00
Robert Osfield
2ba5f002d2 from Andrew Bettison, LineStipple support for .ive 2008-06-19 14:57:36 +00:00
Robert Osfield
0faaf93dc2 From Adrian Egli, "Improvements to the PSSM implementation" 2008-06-19 14:45:54 +00:00
Robert Osfield
cc9d12f34f From Rudolf Weidemann, "in the OpenFlight format materials can have editable names.
In the OSG OpenFlight plugin these names are ignored when reading, and
empty strings are written.

As we need these names in the OSG scene graph by our application, I
changed the plugin code, so the names are now stored in class
"osg::Material" (derived from "osg::Object") by
 material->setName();
(see "PaletteRecords.cpp, line 195) when reading the file, and written
to file by
 dos.writeString( m.Material->getName(), 12 );
(see MaterialPaletteManager.cpp, line 80).

As these names otherwise get lost when reading an OpenFlight file and
writing it again e.g. by
 osgconv example.flt converted_example.flt
these changes make the plugin more complete.

The changes were made to OSG revision 8425, and were tested by
 osgconv example.flt converted_example.flt
comparing the material palettes of both files inside Multigen Creator."
2008-06-19 14:35:18 +00:00
Robert Osfield
dd13893861 From Farshid Lashkari, "I noticed some problems when setting up CameraNodes that inherit
viewport settings in stereo mode. It seems that the SceneView::cull()
method will pass the full size viewport to the left/right
cullvisitors, instead of the modified stereo viewport. I made quite a
few changes to SceneView to fix the issue. The SceneView::cullStage()
method will now receive the viewport as an argument, instead of using
the global viewport. The SceneView::cull() method will pass the
modifed viewport to cullStage when rendering in stereo.

There are 2 new private methods computeLeftEyeViewport() and
computeRightEyeViewport() that will compute the stereo viewports. I
also modified the draw() function so it applies the correct viewport
to the prerender stages. These changes are only necessary for
horizontal/vertical split stereo."
2008-06-19 14:29:38 +00:00
Robert Osfield
c3c727b822 From Andrew Bettison, "Attached are changes for src/osgPlugins/ive (version 2.4.0) that implement LineStipple read/write support for the ive file format." 2008-06-19 14:14:20 +00:00
Robert Osfield
4c9b3de4a1 Updated wrappers to fix OpenThreads::Atomic build issues. 2008-06-19 13:28:33 +00:00
Robert Osfield
174f9bbfe0 From Michael Platings and Robert Osfield, added support for controlling,
via StateSet::setNestedRenderBin(bool) whether the new RenderBin should be nested
with the existing RenderBin, or be nested with the enclosing RenderStage.
2008-06-19 11:09:20 +00:00
Robert Osfield
0abf539b60 Updated wrappers 2008-06-18 20:27:06 +00:00
Robert Osfield
f06d50a7eb From Michael Platings, implemented check against max number of supported samples to ensure that the number of samples is safely capped to what the hardware is capable of, avoiding GL errors and graceful fallback 2008-06-18 20:24:12 +00:00
Robert Osfield
45fcb25765 From Liang Aibin:
"1. Location: <OSG_SOURCE_ROOT>\src\osgPlugins\osg\Fog.cpp
   Reason: ".osg" writter plugins output incorrected string for osg::Fog's Mode.
   How to Fix:
     Line 138 in Fog.cpp: case(Fog::LINEAR): return "NERVER";
     Change to:           case(Fog::LINEAR): return "LINEAR";
2. Location: <OSG_SOURCE_ROOT>\src\osgPlugins\ive\
   Reason: ".ive" writter plugins missing to process "osg::Fog".
   How to Fix:
   (1). Line 86 in ReadWrite.h:
        Add: #define IVEFOG                          0x00001133
   (2). In CMakeLists.txt
        "SET(TARGET_SRC" section Add: Fog.cpp
        "SET(TARGET_H" section Add: Fog.h
   (3). In DataInputStream.cpp
        Line 54,Add:    #include "Fog.h"
        Line 1185,Add:  else if(attributeID == IVEFOG){
                            attribute = new osg::Fog();
                            ((ive::Fog*)(attribute))->read(this);
                        }
   (4). In DataOutputStream.cpp
        Line 57,Add:    #include "Fog.h"
        Line 832,Add:   // This is a Fog
                        else if(dynamic_cast<const osg::Fog*>(attribute)){
                            ((ive::Fog*)(attribute))->write(this);
                        }
   (5). Add newly created ive::Fog Object in Fog.h and Fog.cpp.
"
2008-06-18 20:17:13 +00:00
Robert Osfield
0a0034aebb Updated wrappers 2008-06-18 16:46:38 +00:00
Robert Osfield
1e5783ece7 Added a wrapString(const char*) which automatically handles null strings. 2008-06-18 16:45:21 +00:00
Robert Osfield
959c01557c Convert string handling to use strdup and free rather then awkward new char[]
code paths
2008-06-18 16:28:52 +00:00
Robert Osfield
90ea0bd95f From Michael Platings and Paul Palumbo, multi-sample FBO support 2008-06-18 14:09:11 +00:00
Robert Osfield
7bef1bd16a From Jean-Sebastien Guay, "When copying a node that had uniforms on it, the copy constructor of osg::Uniform would not copy the array of the original uniform (either _intArray or _floatArray) because none had been allocated and the copy constructor checks that *both* this's array and rhs's array are valid.
I added a call to allocateDataArray() if rhs has (at least) one valid array, which should allocate the right array according to the type. Since the type was copied from rhs, it should create the same array as rhs has, so then it should copy the data in the following lines.
"
2008-06-18 12:01:52 +00:00
Robert Osfield
df87106d4b From Bob Kuehne, "added multi-texture support (alpha/trans images)" 2008-06-18 11:56:50 +00:00
Robert Osfield
b82e24b08d Updated wrappers 2008-06-18 11:51:22 +00:00
Robert Osfield
dd137c2442 From Bob Kuehne, "this submission extends the osgViewer::RecordCameraPathHandler to have an optionally-enabled auto-incrementing filename. default behavior is still the same, but there's one new method to enable autoincrementing filenames."
From Robert Osfield, modified the above so that the number increments come after the filename rather than before.
2008-06-18 11:13:51 +00:00
Robert Osfield
bc79df7cd8 From Gino van den Bergen, "Added support for vrml primitive caching" 2008-06-18 10:51:02 +00:00
Robert Osfield
7dc3ad4b5e From David Callu, "fixed bounding box bug" 2008-06-18 10:46:05 +00:00
Robert Osfield
d7e9e5e495 From Mathias Froehlich, OpenThreads::Atomic support 2008-06-17 17:43:59 +00:00
Robert Osfield
7cfe00d3d9 Added overriding of CullSettings::inheritCullSettings() into osg::Camera to
properly inherit the clear colour.
2008-06-16 20:22:16 +00:00
Robert Osfield
f10cb3c388 Added mutex to serialize access to the trpager 2008-06-16 13:20:51 +00:00