Commit Graph

248 Commits

Author SHA1 Message Date
Robert Osfield
41ba8ce585 From Christian Ehrlicher, "during profiling my program I found out that there's a lot of memory
(de)allocation going on in OverlayNode::cut().

So instead creating inner-loop variables 'distances' and 'newVertices'
every time, I moved the creation out of the loop and just do a clear() +
reserve() inside the loop. This allows std::vector<> to reuse the old
memory instead allocating new when the new size <= oldsize."
2009-11-27 16:47:38 +00:00
Robert Osfield
b7cabac990 From Mathias Froechlich, "Attached the collected fixes I needed to compile with all of them.
Most notable the __hpux define stuff. The __hpux__ variant seems to be not
defined which resulted in a compile error at this time. Consequently I have
replaced all occurances of __hpux__ with __hpux. And huge surprise: now osg
plugins are found and loaded correctly ...
The next notable one is the MSVC_IDE fix which makes the nmake Makefiles cmake
generator target behave like the ide one. Showed up because I started to do
scripted builds with nmake instead of devenv...
The rest is the usual bunch of stuff that just happens during normal
coding ..."
2009-11-18 12:15:29 +00:00
Robert Osfield
72ff1f40f9 From Paul Martz, changes for compiling against OpenGL 3.x 2009-11-03 16:34:54 +00:00
Robert Osfield
d17d7159a1 Ported osgUtil, osgDB, osgGA, NodeKits and plugins to compile against OpenGL ES 1.1 and OpenGL ES 2.0. 2009-10-28 20:31:57 +00:00
Robert Osfield
04ddb2dee5 Converted all glBegin/glEnd code across to using osg::GLBeginEndAdapter 2009-10-21 16:16:31 +00:00
Robert Osfield
773ae51a45 From Chris Hanson, typo and comment clean ups 2009-07-24 14:45:44 +00:00
Robert Osfield
24a8b2acd7 From Lionel Lagarde, "this correction makes the intensity interpolated in the correct direction when the angle is between _cosFadeAngle and _cosAngle." 2009-06-08 11:12:34 +00:00
Robert Osfield
aa69137fb8 Added collateReferencesToDependentCameras() and clearReferencesToDependentCameras() methods into RenderStage and SceneView, and use
of these methods in src/osgViewer/Renderer.cpp to make sure that the draw thread keeps references to all in scene graph Cameras
that are being used by the drawing threads, to keep the Camera's alive even when the main thread removes these Cameras from the scene graph.
2009-06-05 19:05:37 +00:00
Robert Osfield
39cecd2a72 From Philip Lowman, "Here's the promised cleanup of the OSG's CMakeLists.txt files for the src/ folder. I'll submit the others separately.
Also, there was also a small bug in osgDB's CMakeLists.txt that was causing an error when I tested with CMake 2.4.4.

IF(${OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX} STREQUAL "quicktime")
was changed to
IF(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX STREQUAL "quicktime")
"
2009-03-23 16:01:02 +00:00
Robert Osfield
f3166c2d96 From Sherman Wilcox, added VS versioning information into libs 2009-02-05 14:55:17 +00:00
Robert Osfield
1153ea5feb Warnings fixes for VS. 2009-02-02 20:35:19 +00:00
Robert Osfield
8a6e04b84d Introduce NodeVisitor::className and libraryName() 2008-12-17 12:13:15 +00:00
Robert Osfield
315aeeb557 Where possible moved redundent C header includes from headers to source files 2008-12-12 18:47:30 +00:00
Robert Osfield
33782a5177 From Marcin Prus, "some time ago there was an optimization fix including change in DirectionalSector::computeMatrix().
Rotation matrices were replaced with quaternions but incorrect contructor was used. There was a call to Quat(angle, xAxis, yAxis, zAxis ) but there is no such constructor in Quat class to create quaternion for rotation. As a result we got this values being written into quaternion directly.

I've replaced Quat contructor calls with the ones creating rotation quaternions Quat( angle, Vec3( axis ) )."
2008-12-10 10:10:45 +00:00
Robert Osfield
ff8c6aa32b From Mathias Froehlich, build fixes 2008-10-07 12:31:42 +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
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
ec9218ad1f Refactored OverlayData so that its possible to subclass OverlayNode/OverlayData. 2008-07-23 22:19:29 +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
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
e427d50d9a From Lars Nilson, bug fix to Sector::computeMatrix() 2008-05-27 17:32:26 +00:00
Robert Osfield
78964b4baa Reverted the changes for ill fated tweaks for Apple build 2008-04-24 11:34:43 +00:00
Robert Osfield
8ae30c9bfc Refactored the inclusion of the headers in the ADD_LIBRARY so that they aren't
added under OSX.
2008-04-23 20:50:53 +00:00
Robert Osfield
e74bb067fb Added ObjectRecordData to include list 2008-03-18 09:17:52 +00:00
Robert Osfield
55de8b03d9 From Wojciech Lewandowski, "----1----
Attached is a fixed version of OverlayNode.cpp. I fixed CustomPolytope::cut( osg::Plane ) method.  Bug was apparent in such scenario:
 
Let P1 be some random frustum polytope
Let P2 be the polytope that was created from P1 bounding box (P2 contains P1 entirely)
 
Then ignoring precision errors: P1.cut( P2 ) == P2.cut( P1 ) == P1.  But this condition was not always met. Cut failed when some of the polytope reference points happened to lie exactly on some intersecting planes in both P1 & P2  (plane distance was = 0).
 
I only use CustomPolytope for my shadowing stuff so I did not test how this affects rest of OverlayNode.cpp.
 
----2----
 
Also attached is a minor precision improvement for osg::Plane intersect method (double version). 
 
----3----
 
I have also one observation regarding osg::Plane - There are two intersect vertices methods (float and double flavour):
 
inline int intersect(const std::vector<Vec3>& vertices) const
inline int intersect(const std::vector<Vec3d>& vertices) const
 
I guess osg::Plane won't compile when someone changes default vec3 typedef to vec3d. Shouldn't the first method be changed to use vec3f explicitly ? Ie:
 
inline int intersect(const std::vector<Vec3f>& vertices) const"
2008-02-25 14:15:27 +00:00
Robert Osfield
53be383843 From Wojciech Lewandowski, "By complete coincidence I just have read an old OSG submission mail related
to bugfixes in osg::Polytope.setToUnitFrustum and setToBoundingBox  It was
sent at beginning of december. I read it when purging my Thrash emails and
found it there this because it was wrongly classified as SPAM.

What stroke me in this email was the fact that there was once an error in
Polytope class. Since I adopted CustomPolytope (osgSim OverlayNode.cpp) for
my minimal shadow area computations I checked my code for this error. And I
found it in CustomPolytope::setToUnitFrustum method.
CustomPolytope::setToBoundingBox seemed OK.

So I went back to the origin and fixed this error in OverlayNode.cpp as
well. I have not tested it in OverlayNode though (I don't know how) so
please look at this carefully. But it seems to work fine with my shadow
calculations."
2007-12-20 14:40:28 +00:00
Robert Osfield
b6f32a3ed0 Added copy operator to ShapeAttribute to prevent problems when assigned them or use within a vector 2007-12-13 12:30:31 +00:00
Robert Osfield
88f3a864ac Updated copyright notices 2007-12-12 16:56:28 +00:00
Robert Osfield
6bb7935dea From Andy Skinner, build fixes for Solaris. 2007-12-12 16:55:13 +00:00
Robert Osfield
f4afa427a7 From Roland Smeenk, "Attached you will find a large set of small typo fixes (mainly in the comments)." 2007-12-10 17:30:18 +00:00
Robert Osfield
457d3fd7e4 Removed redundent OpenFlightOptimizer 2007-12-09 16:23:19 +00:00
Robert Osfield
78c1fd4844 From David Callu, added DBase attribute support for shapefiles 2007-12-09 15:43:49 +00:00
Robert Osfield
0726624a86 From Jose Delport: "have been using the new VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY mode
of the OverlayNode.

I change the overlay subgraph dynamically and when I remove all the
subgraph nodes that is inside the current main camera FOV (others
outside still exist), the overlay texture does not update because of the
early return in the traversal. I then get a kind of ghost texture moving
around the terrain.

The attached file fixed the problem for me, but I'm not sure if it is
the best way to address the problem."
2007-09-24 09:35:59 +00:00
Robert Osfield
8bc8b6b5e9 Removed check for shaders/overlay_perspective_main.vert 2007-09-19 09:00:05 +00:00
Robert Osfield
8e7e6529be From David Callu, warning fixes 2007-09-07 15:03:56 +00:00
Robert Osfield
b20d542317 From David Callu, improved consistency of Version strings and add version support
for osgIntrospection and osgManipulator.
2007-09-05 17:12:24 +00:00
Robert Osfield
92b1e7d53f Changed tabs to four spaces to make merges more straight forward 2007-09-05 17:03:43 +00:00
Robert Osfield
4ba3f3c1a1 Changed RenderLeaf and StateGraph so that they use ref_ptr<> by default for Drawable and StateSet. 2007-08-31 16:05:24 +00:00
Robert Osfield
4328bdacc2 From Luigi Calori, introduction of versioning of dll's and placement of dll and plugins into bin directory during build. 2007-08-30 10:41:15 +00:00
Robert Osfield
4c443bf843 From Brad Christiansen, "I added the ability to set the render target implementaion on the
osgSim::OverlayNode. The attached changes were made against the 2.0
release."
2007-08-13 10:17:18 +00:00
Robert Osfield
81986f4387 Changed debug message to INFO level 2007-08-06 09:28:28 +00:00
Robert Osfield
59d3e0ceb7 From Andy Skinner, adding C includes to avoid issues when mixing C and C++ standard includes 2007-07-28 10:44:03 +00:00
Robert Osfield
5aa3db15a3 Improved the computation of the side vector 2007-07-05 18:30:57 +00:00
Robert Osfield
746d916fce Reverted to using non silhouette computation. 2007-06-26 11:31:39 +00:00
Robert Osfield
1a78eb8159 Changed the RTT Camera so that it doesn't automatically recompute the near and far planes 2007-06-25 13:48:57 +00:00
Robert Osfield
cff9188caf Fixed namespace 2007-06-15 16:08:33 +00:00
Robert Osfield
f423c7660f Fixed handling of cases when no matrix is attached to intersections 2007-06-15 13:12:46 +00:00
Robert Osfield
f61c6262f7 Included shaders directly into source, added support for toggle lighting on/off 2007-06-14 20:58:43 +00:00
Robert Osfield
8c727acddc Added new shader support 2007-06-13 19:53:48 +00:00
Robert Osfield
b8f9364cef Wired up new shaders 2007-06-13 14:05:21 +00:00