Commit Graph

1192 Commits

Author SHA1 Message Date
Robert Osfield
a3594bc653 Added new osg::ComputeBoundsVisitor 2007-02-16 17:34:34 +00:00
Robert Osfield
810e7291fc Added use of Mutex into osg::Stats to better handle multi-threaded usage 2007-02-14 16:24:49 +00:00
Robert Osfield
07411f3246 Introduced new osg::Object::DataVariance type of UNSPECIFIED, and changed the deafult
values of DataVariance to UNSPECIFIED to all types.
2007-02-14 13:18:58 +00:00
Robert Osfield
89c99a88fa Added computeDataVariance method into osg::Object and implementations in Drawable and StateSet,
and calling of osgUtil::StaticObjectDetectionVisitor in osgViewer::Viewer
2007-02-14 11:24:42 +00:00
Robert Osfield
fe177e42d5 Added osgViewer::HelpHandler 2007-02-12 13:39:18 +00:00
Robert Osfield
f1a82f35b2 From Vivek Rajan, MatrixDecomposition implementaion, adapted by Robert Osfield
to be part of osg::Matrixf and osg::Matrixd classes.
2007-02-10 18:01:37 +00:00
Robert Osfield
c52207b637 Added new Transform::ReferenceType enum ABSOLUTE_RF_INHERIT_VIEWPOINT to support
internal RTT cameras that wish to use the main cameras view/eye point for LOD and other
distance based tests.
2007-02-07 16:32:14 +00:00
Robert Osfield
945faf0133 Fixed bug in AutoTransform::accept() that was related to the accept() method
checking the nodemask as it should.
2007-02-07 14:53:58 +00:00
Robert Osfield
cfe737c552 Tweak API and updated wrappers to get wrappers to build 2007-02-05 14:56:41 +00:00
Robert Osfield
ebd68ba063 Added Camera's s/getCameraThread() and updated wrappers 2007-02-05 13:44:16 +00:00
Robert Osfield
69da91620f Convert GraphicsThread/GraphicsOperation to more generic OperationsThread/Operation.
This paves the way to running cull traversals in seperate threads.

Updated wrappers
2007-02-02 22:30:36 +00:00
Robert Osfield
6d9641a78b Added a concrete osg::DeleteHandler implementation which provides support for
retain objects for several frames before deleting them.  Also added RenderStageCache
into CullVistor.cpp that is used for handling RTT osg::Camera's that are being
used in double buffered SceneView usage.
2007-02-02 12:41:13 +00:00
Robert Osfield
f8213d1c53 Updated wrappers 2007-01-30 14:47:13 +00:00
Robert Osfield
b8d98a2cfe Added support for compute average stats attributes in inverse space to improve
the quality of frame rate reporting.
2007-01-30 13:48:04 +00:00
Robert Osfield
ecedc8d86a Added Stats::collectStats(string,bool) controls, getAveragedAttribute methods into osg::Stats class, and
related support into osgViewer::Viewer and osgViewer::StatsHandler.

Added lazy updating of text in StatsHandler HUD to minimize the impact of
slow text updating on observed frame rates.
2007-01-30 11:40:23 +00:00
Robert Osfield
fd0ea388c2 Began work on providing support for threading camera cull traversals in parallel with
the previous frames draw traversal.  Changes range from osg::State, through osgUtil::RenderBin, through to osgViewer
2007-01-29 22:44:29 +00:00
Robert Osfield
7232a831da Added osg::FrameStamp::set/getSimulationTime().
Added setting of osg_SimulationTime and osg_DeltaSimulationTime to the uniforms set by SceneView

Added frame(double simulationTime) and advance(double simulationTime) parameters to
osgViewer::SimpleViewer, Vewer and CompositeViewer.

Updated various examples and Nodes to use SimulationTime where appropriate.
2007-01-25 12:02:51 +00:00
Robert Osfield
13dd5acb63 From Gordon Tomlinson, fixes to BoundingSphere::expandBy(BoundingSphere&) 2007-01-25 10:02:20 +00:00
Robert Osfield
d6ecce6f5f Improvements to stats 2007-01-22 11:22:37 +00:00
Robert Osfield
b47ef11d74 Initial on screen stats support 2007-01-21 18:24:54 +00:00
Robert Osfield
f0e2404541 Added new osg::Stats class for collecting frame stats of different sorts.
Added s/getStats() to osg::View and osg::Camera.
Added population of View::getStats() with frame stats in osgViewer/Viewer.
Added Basic StatsHandler to osgviewer example.
2007-01-19 19:53:23 +00:00
Robert Osfield
a90206bcbb Added EXT_timer_query support 2007-01-19 14:41:29 +00:00
Robert Osfield
ccc8a922a6 Added osg::StencilTwoSided state attribute to wrap up the stencil_two_sided extension.
Added path in osgShadow work for using StencilTwoSided to accelerate shadow volume rendering.
2007-01-18 22:32:18 +00:00
Robert Osfield
d63b351137 From André Garneau, threading bug fixes - moving scoped statics out of scope to be global statics 2007-01-17 14:40:03 +00:00
Robert Osfield
09cef410ec Added releaseContext to end of GraphicsThread::run() 2007-01-14 20:23:47 +00:00
Robert Osfield
5c78d06dad Added a default StateSet to osg::View's master Camera. Wired up osgViewer::Viewer so
that the master Camera's StateSet is passed to osgUtil::SceneView to use as its global StateSet.
2007-01-12 12:10:06 +00:00
Robert Osfield
5ee30edbea Added support for setThreadSafeRefUnref into TexGenNode 2007-01-11 10:35:03 +00:00
Robert Osfield
16d1c00a3d Changed the return types of makeCurrent to bool, and added a bool GraphicsContext::releaseContext method
along with implementations in osgViewer.
2007-01-08 19:29:59 +00:00
Robert Osfield
4a5eda6522 Added GraphicsContext::ResizedCallback and GraphicsContext::resizedImplementation.
Added message on non implementation of GraphicsContext::valid().
Added prelimary GraphicsContext clean up support.
2007-01-08 16:20:10 +00:00
Robert Osfield
773fbd1b16 Added setThreadSafeRefUnref to LightSource 2007-01-07 10:00:50 +00:00
Robert Osfield
9fcace0e73 Added GraphicsContext support for clearing the graphis context. The clearing
is off by default (ClearMask is 0), but can be switched on when ClearMask is
non zero.  GraphicsContext::clear() is called after each swap buffers
2007-01-05 15:24:06 +00:00
Robert Osfield
73fffe1800 Made Refernced::setThreadSafeReferenceCounting(bool) a virtual then overrode
this in various scene graph classes to ensure that the scene graph gets
updated as well as the objects that the initialial call is made from.
2007-01-04 16:49:58 +00:00
Robert Osfield
ff195bddf5 Added Object::resizeGLObjectBuffers(uint) method to help improve the ability
to change the number of active graphics contexts on the fly during an applications
life.
2007-01-04 14:11:51 +00:00
Robert Osfield
1de65ddedc Added setting of default backgroud colour of View's master colour to be
consistent with the previous default colour used by SceneView
2007-01-03 17:26:24 +00:00
Robert Osfield
3eaa9ff05b Changed the View's master camera projection matrix setting so that it is
consistent with osgProducer::Viewer default setting.
2007-01-03 16:32:44 +00:00
Robert Osfield
4f87afdbf5 Improved the robustness of thread start and cancellation 2007-01-03 16:06:12 +00:00
Robert Osfield
740363133f Fixed the COPY_OP( Array, DEEP_COPY_ARRAYS); entry. 2007-01-02 20:26:49 +00:00
Robert Osfield
7155f7d1b0 Various work on osgViewer library, including warp point and graphics window resize support 2007-01-01 18:20:10 +00:00
Robert Osfield
93dbfa04b7 Aded new convinience methods to osg::Timer - s/getStartTick and time_s(), time_m() etc
to help get time reletive the new start tick.
2006-12-26 17:37:06 +00:00
Robert Osfield
39c0c2df76 Unified the osg::GraphicsThread::Operation and osg::GraphicsContext::Operation classes
as osg::GraphicsOperation.  Unpdated parts of OSG depending upon these.

Added a virtaul bool valid() method to osg::GraphicsContext to allow apps to
test whether a valid graphis context has been created or not.
2006-12-24 16:40:19 +00:00
Robert Osfield
76461b3ab2 Added support for sample and sampleBuffers to osg::GraphicsContext::Traits and
cleaned up the Traits naming
2006-12-22 21:53:44 +00:00
Robert Osfield
bd6b7d581e Implemented perliminary multi-threading support in osgViewer::Viewer 2006-12-22 17:46:21 +00:00
Robert Osfield
4fc9af7ea0 Moved rendering support into GraphisContext, osgViewer::Viewer/View, and
added frame stamp updating and update traversal to osgViewer::Scene/Viewer.

Updated osgcamera example to use new Viewer API calls instead of using local
rendering calls.
2006-12-21 16:56:20 +00:00
Robert Osfield
c9c2950759 Moved UnitTestFramework from core osg lib into osgunittests example 2006-12-19 17:06:59 +00:00
Robert Osfield
dcebe4daa0 Added initial GraphicsWindowX11 implementation, and fleshed out more of the
osgViewer and osg::GraphicsContext/osg::View infrastructure.
2006-12-19 16:00:51 +00:00
Robert Osfield
afc77f9b39 Added support WindowingSystemInterface for querring the number of screens, the screen size and creating GraphicsContexts. 2006-12-17 20:49:01 +00:00
Robert Osfield
982a4db9e2 Added ViewPoint support into NodeVistor/CullStack/CullVisitor/LOD/PagedLOD etc to facilate
management of LOD settings for RTT cameras.
2006-12-15 17:27:18 +00:00
Robert Osfield
693302574d From Rein Kadijk, "While displaying a certain scene, OsgEdit crashed in ProxyNode::traverse() in file OSG_OP_OT-1.2\OpenSceneGraph\src\osg\proxynode.cpp.
It turned out that nv.getDatabaseRequestHandler() returned NULL; using this pointer to call one of DatabaseRequestHandler's methods is of course illegal.
I patched it by adding: if (nv.getDatabaseRequestHandler())"

From Robert Osfield, reordered the addition of the nv.getDatabaseRequestHandler() check to allow the
default traverse() to be called when no database handling is attached to the visitor.
2006-12-05 16:45:27 +00:00
Robert Osfield
a9d18d01db Basic shadow volume alogirthm implemented in example. 2006-11-30 16:30:24 +00:00
Robert Osfield
345810ef22 Added support for float or double osg::Plane, and the default osg::Plane to double.
Performance tests on big models did not indicate any performance penalty in using doubles over floats,
so the move to doubles should mainly impact precision improvements for whole earth databases.

Also made improvements to osgUtil::PlaneIntersector and osgSim::ElevationSlice classes
2006-11-28 16:00:52 +00:00
Robert Osfield
fd2ffeb310 Renamed osg::CameraNode to osg::Camera, cleaned up osg::View.
Added beginnings of new osgViewer::Scene,View,Viewer,CompositeViewer and GraphicsWindowProxy files.
2006-11-27 14:52:07 +00:00
Robert Osfield
d0df2df7ad Replaced the setTextureUnit(0) call in State::reset() with code that just
sets the member variables without requiring a graphics context.
2006-11-21 16:59:04 +00:00
Robert Osfield
2151573ccd From Michael Platings, Fixed Geometry cloning of the texture
coordinates and vertex attributes.
2006-11-16 16:25:29 +00:00
Robert Osfield
d0cc014f1b Further migration to using RenderInfo 2006-11-14 12:51:31 +00:00
Robert Osfield
7cb1bcbd7d From Farshid Lashkari, "This patch adds a CoordOriginMode to the osg::PointSprite attribute.
The mode needs to be changed to LOWER_LEFT when rendering point
sprites to pbuffers or FBOs, otherwise the points will be transformed
on the CPU."
2006-11-14 12:29:54 +00:00
Robert Osfield
c3f3093ecc From John Kelso, add support for default frame time for children of a Sequence node 2006-11-10 15:25:04 +00:00
Robert Osfield
c5c4c5da1d From Edgar Ellis, "
method may not take the node into consideration when computing its bound.

In this case of:
switch->insertChild(0, child, false);
switch->insertChild(1, child, true);

child will not be used in computeBound, but will be drawn.

Solution:
Changed compute bound to loop over children using an index instead of an
iterator. This behaviour matches that of the traverse method."

-----------------------------------------------
2006-10-30 12:14:00 +00:00
Robert Osfield
f257285efc From Chuck Seberion, added support reading ARB float format textures. 2006-10-14 21:50:29 +00:00
Robert Osfield
660cda57c8 From Terry Welsh, mplemented POINT_ROT_EYE. 2006-10-14 21:47:13 +00:00
Robert Osfield
97fc2dfa21 Fixed texture coordinates of cylinder ends. 2006-10-14 10:07:21 +00:00
Robert Osfield
842b96bbc9 From Colin McDonald, "I've included render bin checks in the StateSet::compare function, because
without them the Optimizer can incorrectly eliminate (otherwise identical)
StateSets from different render bins."
2006-10-02 15:59:43 +00:00
Robert Osfield
e0599f652e Added releaseGLObjects to NodeCallbacks, Drawable::DrawCallbacks and wired up
osgProducer to use it when doing cleanup_frame.
2006-10-02 15:38:31 +00:00
Robert Osfield
eb68735ff9 From Farshid Lashkari, "The ColorControl of osg::LightModel is never applied because it
incorrectly checks for a valid OpenGL version. Instead of checking if
the current version is exactly 1.2, it will check if the version is
greater than 1.2."
2006-10-02 13:40:58 +00:00
Robert Osfield
35d134f712 From Farshid Lashkari, added function for querring whether a mode is a texture related mode or not. 2006-09-21 10:01:27 +00:00
Robert Osfield
0dcf5271f1 Added missining initialization of _radius in constructors 2006-09-20 13:41:33 +00:00
Robert Osfield
cc202c1b6d Updates for fade text to work properly, but only in perspetive views at present. 2006-09-20 10:36:21 +00:00
Robert Osfield
def74d3471 Introduced new osg::View, and osg::RenderInfo classes into the core OSG to help
handle scenes with multiple views with elements that need coordinating on a per view basis.

Added beginings of new osgText::FadeText class (not functionality yet).
2006-09-18 20:54:48 +00:00
Robert Osfield
c7906d5412 Added a check for zero length line segment in bool LineSegment::intersect(const BoundingSphere& bs,float& r1,float& r2) const. 2006-09-12 12:35:20 +00:00
Robert Osfield
5915584b37 Revised the osg::ClampColor API to allow vertex, fragment and read color clamping to
be applied together.
2006-09-12 09:26:42 +00:00
Robert Osfield
daa54a3b09 From Farshid Lashkari,
"I've made some changes to osg which I think make it easier to control
the render order of CameraNode's. Instead of using the built-in orders
(PRE_RENDER, POST_RENDER, NESTED_RENDER), you can specify an integer
order. Values less than zero are pre rendered in order. Values greater
than zero are post rendered in order. And a value of 0 is equivalent
to NESTED_RENDER.

The changes should be fully backward compatible. Also, I changed the
RenderStageList type from a vector to a list because I needed to be
able to insert values anywhere in the list.

The reason I made these changes was because I wanted to be able to set
the render order of a CameraNode at runtime without having to reorder
it in the scenegraph."

and later in the final submission message (relating to what has been finally been merged)    :

"I've rethought my implementation and came up with something a little
better. The setRenderOrder will continue to take an enum, but will
have an optional orderNum parameter which can be both positive and
negative. I think this method is more intuitive and flexible."
2006-09-04 13:15:08 +00:00
Robert Osfield
f0277df858 Added osg::TexMat::s/getScaleByTextureRectangleSize feature that allows
one to use the osg::TexMat to automatically scale non dimensional tex coordinats to
the size of the last texture rectangle applied.
2006-09-04 12:46:49 +00:00
Robert Osfield
87a221445e Updated version numbers of the up comming 1.2 release 2006-08-31 20:54:28 +00:00
Robert Osfield
113c1dfc3e From Eric Wing, "Attached is a change for GLExtensions.cpp that allows OS X to use
dlopen/dlsym instead of NS*Symbol* functions for 10.3 or later. The
latter is now deprecated.

I'm not completely sure how to test the changes. But I compiled these
new changes in and ran the osgvertexprogram and osgshaders examples
and they seemed to display the same results as before.

With respect to the use of dlopen and dlsym, I was uncertain if the
usage should look like Sun or FreeBSD (or something else). Apple's man
pages discourage the use of RTLD_DEFAULT so I avoided the FreeBSD
implementation and copied the Sun implementation. I'm not sure if this
is correct/ideal or not."
2006-08-31 20:48:49 +00:00
Robert Osfield
179f6100a0 Added missing setDataType and setPacking functions 2006-08-25 15:49:29 +00:00
Robert Osfield
0900857333 From Farshid Lashkari,
"I was experiencing hard crashes of my application when using PBO's on
machines that don't support PBO's. I think osg incorrectly checks if
PBO's are supported.

I added a new method to the BufferObject::Extensions class which
returns if the "GL_ARB_pixel_buffer_object" string is supported. This
fixes the problem on my end. Machines without PBO support will
continue to work and machines with PBO support will still be able to
use it."
2006-08-25 08:48:16 +00:00
Robert Osfield
1413eea52c Add error message report to catch attempts to flip mipmap images. 2006-08-24 16:33:23 +00:00
Robert Osfield
be60b32add Fixed texture optimization problem associated with mixing already compiled scene graphs - resulting
in incorrect texture assignment.  Solution was to a compareTextureObjects() test to the Texture*::compare(..) method that
the osgUtil::Optimizer::StateSetVisitor uses to determine uniqueness.
2006-08-14 19:42:22 +00:00
Robert Osfield
a16568254c Moved reset to 0 of _createReuseMatrixIndex from CullVistor.cpp to CullStack.cpp so that
CullStack::reset works correctly for all subclasses - fixing a memory consumption issue with occluders
2006-08-12 18:19:43 +00:00
Robert Osfield
132f9ead45 Updated version number for 1.1.1 release 2006-08-12 08:29:16 +00:00
Robert Osfield
306743c903 Fixed bug in Group::setChild relating to the accounting for OccluderNode. 2006-08-11 12:53:57 +00:00
Robert Osfield
b832453c10 From Uwe Woessner, implementated by Robert Osfield, Fixed vertex attribute bug, changed _vertexAttribList[unit] -> _vertexAttribList[index] 2006-08-04 13:17:56 +00:00
Robert Osfield
7ef12b37b5 Changed:
static TextureGLModeSet s_textureGLModeSet;

To:

  static TextureGLModeSet& getTextureGLModeSet()
  {
      static TextureGLModeSet s_textureGLModeSet;
      return s_textureGLModeSet;
  }

to prevent static initialization problems under static builds.
2006-08-03 13:35:21 +00:00
Robert Osfield
0336231321 Moved extension function pointer initilization into a method, and the pointers from
being static to be local member variables.  This should avoid issues under Windows
with multiple graphics contexts have seperate entry points.
2006-08-02 16:14:17 +00:00
Robert Osfield
4d556c0ec4 Reworked the TextureObjectManager singleton so that it no longer reconstructed itself once deleted, and added checks to against a null manager to prevent calling code crashing. 2006-08-02 15:41:47 +00:00
Robert Osfield
564ee34f76 Added Matrix*::getRotate()/setRotate(Quat), deprecating Matrix*::get(Quat&), Matrix*::set(Quat&) 2006-07-31 17:31:21 +00:00
Robert Osfield
f977d7c606 Updated osgunittests with a matrix invert unit test, and added a conditional
calling of invert_4x4 or invert_4x3 depending on the the right hand column of the matrix.

Updated wrappers
2006-07-28 13:48:08 +00:00
Robert Osfield
a5ea4e0b33 From David Spilling, "Matrix_implementation.cpp modified as requested. I ran a version of it through a local version of osgunittests.cpp and it passes.
Note that firstly it always returns the positive real quaternion (positive w)

Note also that it will sometimes slightly differ from the results of the other methods because it assumes that the input matrix really is a rotation matrix - if it isn't, e.g. because of rounding error, then the output quaternion will be very slightly different. For example, the test matrix

0 1 0 0
1 0 0 0
0 0 0.999999 0
0 0 0 1

will return 0.707107 0.707107 0.0005033 0.0005033

whereas the previous methods return 0.707107 0.707107 0.0 0.0

However, since quaternions are rotations, the meaning of how to convert a matrix that isn't a rotation is a little unclear..."
2006-07-27 15:23:50 +00:00
Robert Osfield
3e8af92da1 From David Spilling, fix to Matrix::get(Quat&) 2006-07-27 11:14:28 +00:00
Robert Osfield
d9b6d87d5a Cleaned up per context buffers support 2006-07-26 15:29:26 +00:00
Robert Osfield
f1c2694c17 Updated copyright years. 2006-07-18 15:21:48 +00:00
Robert Osfield
419e185895 From Eric Wing, add alternate backdrop implementations.
From Robert Osfield, updated naming  and copy constructor methods.
2006-07-18 12:24:04 +00:00
Robert Osfield
a74801a0ee Added Optimizer::FlattenBillboardsVisitor. 2006-07-18 11:03:46 +00:00
Robert Osfield
2ef59b73e9 Change Unit to Units to keep consistent with OpenGL naming. 2006-07-17 11:43:26 +00:00
Robert Osfield
e8235f6967 Changed the Radeon defaults to 1, 128 for the factor and unit mulitpliers respectively. 2006-07-17 10:24:31 +00:00
Robert Osfield
9f81ef8561 Implemented Radeon workaround for polygonoffset 2006-07-14 14:38:55 +00:00
Robert Osfield
4bae225d39 Added s/getFactorMultiplier(), s/getUnitMultiplier(), areUnitAndMultipliersSet() and
setFactorAndUnitMultipliersUsingBestGuessForDriver() static methods to
osg::PolygonOffset to help implement workarounds for lack of portablity of
settings between different hardware.
2006-07-14 14:08:33 +00:00
Robert Osfield
0b32213394 From Eric Sokolowsky,
"If a texture is used that is not a multiple of four, and compression
was requested through the texture's internal format, the texture's
internal format reverts to a non-compressed type and a NOTICE is given.
At present, compressed textures must have a multiple of four in each
dimension."
2006-07-06 14:14:19 +00:00
Robert Osfield
865ee4429c From Eric Sokolowsky,
"Attached is some fixes for Image::readImageFromCurrentTexture. It was
failing when used with a new Image object (some of the fields were
not set before they were used, and some were set to the wrong values).
A new optional parameter was added to give the desired data type, which
defaults to GL_UNSIGNED_BYTE, so programs should only need a recompile
to work properly."
2006-07-06 14:02:14 +00:00
Robert Osfield
88609a5eee Updated version numbers for 1.1 release 2006-07-06 10:28:12 +00:00
Robert Osfield
d7f1c34df8 From Eric Sokolowsky, "The attached Texture.cpp fixes a problem when subloading compressed
textures.  Near the top of the function that implements texture
subloading, osg::Texture::applyTexImage2D_subload(), the local variable
compressed_image examines the _image's_ pixel format to see if it is
compressed. However, further on, in calls to getCompressedSize() the
_texture's_ pixel format is used. In my application's Texture2D class,
I use osg::Texture::USE_ARB_COMPRESSION to
osg::Texture2D::setInternalFormatMode(), which causes the internal format
to become one of the generic ARB_COMPRESSED types, which do not have a
specific size. Thus the recent warning message added to
osg::Texture::getCompressedSize() is triggered. The correct behavior is
to use the format mode from the Image class instead of the Texture class
within the subload implementation, and then the size is calculated
correctly."
2006-07-05 21:52:36 +00:00