Commit Graph

8463 Commits

Author SHA1 Message Date
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
cc079453da From Mattias Helsing,
CMakeLists.txt changes: "I installed latest Cmake(2.6.1) on a new machine and got a CMP008
warning from cmake. This fix set up osg to use the old behaviour which
have worked before. We might set this to NEW but I need to do more
testing first. I'l be able to test this on winxp with msvc80/90 and
ubuntu hardy with gcc-4.2.

quote from cmake cvs log
policy CMP0008 to decides how to treat full path libraries that do not
appear to be valid library file names.  Such libraries worked by
accident in the VS IDE and Xcode generators with CMake 2.4 and below."


OsgMarcroUtils.cmake changes: "On Philips suggestion truncated a redundant if/else construction in
OsgMacroUtils to avoid developer warnings in cmake-2.6.1 concerning
cmake policy CMP0008 which allows full paths to libraries only with
valid library names
"
2008-09-17 19:25:40 +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
274aa49f8a From Christophe Loustaunau,"
I have found some errors on the example osgGeometryShaders. It's about the varying in the geometry shader.
take a look at the varying vec4 v_color.
In the vertex shader, v_color is initialized to gl_vertex
then in the geometry shader v_color is initialized to gl_PositionIn[0]
and in the fragment shader v_color is used as the fragment color.

Try to initialized v_color to vec4(1.0, 0.0, 0.0, 1.0) in the vertex shader and comment the line :
"    v_color = v;\n"  in the geometry shader, and you will see the lines as black !

It's because you have to use keywords in and out.

extract from : http://www.opengl.org/registry/specs/EXT/geometry_shader4.txt :

in - for function parameters passed into a function or for input varying
variables (geometry only)

out - for function parameters passed back out of a function, but not
initialized for use when passed in. Also for output varying variables
(geometry only).

Then for a geometry shader, a varying must be an array :
extract from : http://www.opengl.org/registry/specs/EXT/geometry_shader4.txt :

Since a geometry shader operates on primitives, each input varying variable needs to be
declared as an array. Each element of such an array corresponds to a
vertex of the primitive being processed. If the varying variable is
declared as a scalar or matrix in the vertex shader, it will be a
one-dimensional array in the geometry shader. Each array can optionally
have a size declared. If a size is not specified, it inferred by the
linker and depends on the value of the input primitive type.


Here is a patch based on the svn version of osg that correct that.
"
2008-09-17 17:25:39 +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
0598ac3b69 Updated osgwidget examples to use the new osg::clone() methods 2008-09-17 14:23:25 +00:00
Robert Osfield
fbeabc23e0 Updated wrappers of osgWidget 2008-09-17 14:23:05 +00:00
Robert Osfield
5c5ab84420 Tweaks to facilitate osgWrapper build 2008-09-17 14:21:47 +00:00
Robert Osfield
7ec5632bcc Introduce new templated clone(..) methods that return the correct type of object cloned. 2008-09-17 14:21:19 +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
b5474780c3 Change the GLSL textureRec and texture2D parameters to use .st to make sure they only use 2D coords.
Add setResizeNonPowerOfTwoHint to false for Texture2D.
2008-09-16 09:31:29 +00:00
Robert Osfield
d07f3d5662 Added optional usage of DCMTK in the dicom plugin 2008-09-15 19:59:12 +00:00
Robert Osfield
c7b66322be From Ralf Habacker, removed redundent SwitchLayer::clear() 2008-09-15 11:27:30 +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
b55ed0c56b Added reading of whole directories of images 2008-09-13 13:38:06 +00:00
Robert Osfield
995ead176a Introduced TransferFunction1D::assign(ValueMap&). 2008-09-13 09:09:51 +00:00
Robert Osfield
b000198cc4 Removed use of ints and reading from gl_FragColor in shader 2008-09-12 15:41:30 +00:00
Robert Osfield
dc1b52aa7c Updated version numbers in prep for up comming dev release 2008-09-11 16:11:51 +00:00
Robert Osfield
9c97895116 Added an svn update into the make ChangeLog entry. 2008-09-11 16:06:37 +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
a214a677f8 First cut of WhiteListTileLoadedCallback 2008-09-11 10:40:48 +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
4f6b405edf Added support for reading source image file names from the command line. 2008-09-11 09:05:16 +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
b0cf7823a7 Added playing of the imagesequence on creation of the imagesequence 2008-09-10 11:27:00 +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
Stephan Maximilian HUBER
db83ee7add From Stephan Huber: updated XCode-project 2008-09-04 14:23:29 +00:00
Robert Osfield
d2e29efcd9 Added acceptance of .ogv extensions in xine-lib plugin 2008-09-02 16:13:54 +00:00
Robert Osfield
08883dbf6c Added setSetName/getSetName() methods 2008-09-02 12:55:26 +00:00
Robert Osfield
0a5a91f5a1 Update ChangeLog 2008-09-01 16:28:02 +00:00
Robert Osfield
8759984f52 Replaced uint with unsigned int 2008-09-01 15:29:22 +00:00
Robert Osfield
8044188457 Introduced a OSG_MAINTAINER section of cmake build to help support making tags and branches 2008-09-01 15:27:35 +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