Commit Graph

3210 Commits

Author SHA1 Message Date
Robert Osfield
e0154c2d28 From Ulrich Hertlein, "attached is a stencil buffer-based constant-width outline f/x with example. I've also modified osgfxbrowser to setup the stencil buffer accordingly." 2009-12-08 17:41:44 +00:00
Robert Osfield
17b8ee1508 From Thomas Halgarth, mods for Iphone GL headers 2009-12-08 17:41:18 +00:00
Robert Osfield
248386861b From Sukender, "I experienced as some users before: I tried to rescale an image without a valid rendering context... And had problems to unserstand what the "GL_OUT_OF_MEMORY" meant! So I added a few comments for future users." 2009-12-08 17:25:45 +00:00
Robert Osfield
02d0f08eb1 Added virtual declaration for a range of osg::Image method to allow easier customization. 2009-12-08 15:38:50 +00:00
Robert Osfield
3a6a756d34 Converted tabs to four spaces 2009-12-07 12:35:33 +00:00
Robert Osfield
b4af14433f Removed unimplemented updateGraph method 2009-12-05 10:02:04 +00:00
Robert Osfield
b278660799 From Nico Kruithof, "Attached is a patch that makes the spherical manipulator frame rate independent. This is similar to what Lee did for the trackball manipulator a couple of months ago." 2009-12-02 14:21:13 +00:00
Robert Osfield
36b5e59019 From Paul Martz, "This change address the following issue: an app opens a Viewer on a multidisplay system, configured to setUpViewAcrossAllDisplays, with a non-default clear mask. In this case, OSG failed to propagate the clear mask to the slave Cameras, resulting in the clear mask being ignored. To fix this issue, this revision adds a new CullSettings::VariablesMask bit, CLEAR_MASK, to explicitly control inheritance of the clear mask. This bit is set by default, which means that the clear mask now inherits by default, whereas previously it did not." 2009-11-27 15:32:43 +00:00
Robert Osfield
6ebeff658a Implement deleteAllTextureObject/BufferObjects functionality.
Cleaned up warnings.
2009-11-27 11:43:18 +00:00
Robert Osfield
ab8d93a181 Introduced preliminary osg::deleteAllGLObjects() and osg::discardAllGLObjects() functions and associated support into Texture and BufferObjects 2009-11-26 12:33:07 +00:00
Robert Osfield
a3adc3d07c From Martin Scheffler, "osgParticle: method to set start and end tile for particle texture (for animated particles). I also updated examples/osgParticle to show the feature.
The texture in data/Images should be copied to osg-data. I created the texture myself with the help of an explosion generator, so no license issues there.
"
2009-11-24 15:00:11 +00:00
Robert Osfield
6d3e7f83e2 From Terry Welsh, "As I mentioned here
http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg33967.html
, interpolating through HSV space gives a rainbow color effect which
does not mimic the simple RGB color interpolation that OpenGL does.
It's overkill and causes unexpected visual artifacts.  In the attached
files I've removed the conversion to HSV so that interpolation happens
in RGB space."
2009-11-24 14:12:54 +00:00
Robert Osfield
383a5222bd Rewrote the Vec *= Vec and Vec /= Vec implementations using inline Vec componentMultiply(Vec,Vec) and Vec componentDivide(Vec,Vec) to avoid confusion about the what the operation does. 2009-11-24 13:28:07 +00:00
Robert Osfield
3599be9708 From Wojciech Lewandowski, "I have extended a list of texture targets that can be used with shadow comparison. These targets are avaialble in in OpenGL 3.x shadow sampler variants. Changes are based on current SVN." 2009-11-24 13:24:30 +00:00
Robert Osfield
d09323f93e From Chris Hanson, " Add support for requesting and setting the current directory (a la getcwd/chdir) via a
C++-friendly string-class API.

 Prevent osgDB::concatPaths from faulting if the supplied "left" path string is empty."
2009-11-23 10:19:37 +00:00
Robert Osfield
87452fe1b9 From Chris Hanson, " Adds support for Vec /= Vec and Vec *= Vec operators to Vec2/Vec3/Vec4 double and float
classes."
2009-11-23 10:01:44 +00:00
Robert Osfield
d81d71fd97 Updated version 2009-11-23 09:54:28 +00:00
Robert Osfield
71af49f934 Added missing createContextImplementation(). 2009-11-22 17:27:13 +00:00
Robert Osfield
4759cb951e From Colin MacDonald, "In my application I have a custom graphics context class, derived from
osg::GraphicsContext, in order to give good integration with the
application's GUI toolkit.  This works really well.

However, I need to share OpenGL texture resources with the standard
osgViewer GraphicsContext implementations, in particular the
PixelBuffers.  This is essential for my application to conserve graphics
memory on low-end hardware.  Currently the standard osg implementations
will not share resources with another derived osg::GraphicsContext,
other than the pre-defined osgViewer classes e.g. PixelBufferX11 is
hardcoded to only share resources with GraphicsWindowX11 and
PixelBufferX11 objects, and no other osg::GraphicsContext object.

To address this in the cleanest way I could think of, I have moved the
OpenGL handle variables for each platform into a small utility class,
e.g. GraphicsHandleX11 for unix.  Then GraphicsWindowX11, PixelBufferX11
and any other derived osg::GraphicsContext class can inherit from
GraphicsHandleX11 to share OpenGL resources.

I have updated the X11, Win32 and Carbon implementations to use this.
The changes are minor.  I haven't touched the Cocoa implmentation as
I'm not familiar with it at all and couldn't test it - it will work
unchanged.

Without this I had some horrible hacks in my application, this greatly
simplifies things for me.  It also simplifies the osgViewer
implementations slightly.  Perhaps it may help with other users'
desires to share resources with external graphics contexts, as was
discussed on the user list recently."

Notes from Robert Osfield, adapted Colin's submission to work with the new EGL related changes.
2009-11-21 16:41:02 +00:00
Robert Osfield
40d46a8687 From Chris Hanson, " Remove vestigial (and because it was undocumented, potentially harmful) code to ignore
filenames starting with a dash "-" character from the (std::vector<std::string>&) version
of osgDB::readNodeFiles. Handling of argument strings is properly implemented in the
osgDB::readNodeFiles(osg::ArgumentParser& arguments,const Options* options)
variant, which most code uses. The (std::vector<std::string>&) version is only called by
the osgconv utility, which does its own argument handling and stripping prior to calling
readNodeFiles().

 Also, documented this behaviour in the header comments.

 I believe this code removal is a meritful change because leavign the code in causes an
unexpected and undocumented behaviour (ignoring any filename starting with a dash) that
could bite users in the future. This behaviour is not needed for existing functionality
because existing code uses other APIs to handle dash-prefixed arguments anyway.

"
2009-11-20 14:51:43 +00:00
Robert Osfield
5cd4faf05b From Jason Beverage, "I posted a question on osg users about resources not being properly released when using osgTerrain databases and multiple viewers are used a few weeks ago and I've found that at least part of the problem comes down to the fact that the nodes that are traversed by the GeometryTechnique are never actually added to the scene graph, and thus don't have releaseGLObjects called on them. I'm submitting a few changes that takes care of this by allowing the TerrainTechnique to provide a releaseGLObjects implementation. I've applied these changes in osgEarth and this example program no longer crashes on the second run, although I get corrupt geometry (see attached shot) which could be down to a driver issue. If I increment the context ID for the second viewer, I no longer get the corrupt geometry.
The attached changes are against OpenSceneGraph 2.8.2.

//Sample program.  Run against an osgEarth or VPB database based on osgTerrain.
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>

int main(int argc, char** argv)
{
   osg::ArgumentParser arguments(&argc,argv);

   osgViewer::Viewer* viewer = new osgViewer::Viewer();
   viewer->setUpViewInWindow(100,
100,500,500);
   osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFiles(arguments);
   viewer->setSceneData( loadedModel.get() );
   viewer->run();
   delete viewer;

   viewer = new osgViewer::Viewer();
   viewer->setUpViewInWindow(100,100,500,500);
   loadedModel = osgDB::readNodeFiles(arguments);
   viewer->setSceneData( loadedModel.get() );
   viewer->run();
   delete viewer;
}"
2009-11-20 11:08:40 +00:00
Robert Osfield
f45ae6a4d8 From David Fries, "I was trying to create a lot of threads under 32 bit Linux, but could
only create 376, then the program would hang.
376 * 8MB stack per thread = 3008 MB
The stack size allocated per thread blew the process address stack.
To get more threads you have to specify a smaller per thread stack,
but while the Thread::start says it will limit the stack size to the
smallest allowable stack size, it won't let it be smaller than the
default.  I included the limits.h header to use PTHREAD_STACK_MIN as
the minimum stack size.

As for the deadlock, if the pthread_create failed, the new thread
doesn't exist and doesn't call threadStartedBlock.release(), so the
existing thread deadlocks on threadStartedBlock.block().  Only block
if the thread was started."
2009-11-20 10:27:43 +00:00
Robert Osfield
5a0186555b From Lilin Xiong, added missing OSG_EXPORT 2009-11-19 17:27:21 +00:00
Robert Osfield
e9c406a303 Fixed spacing 2009-11-19 16:53:29 +00:00
Robert Osfield
b4a5edd82e From Jean-Sebastien Guay, "I've made a change to the ScreenCaptureHandler's addCallbackToViewer method, so that it iterates over GraphicsContexts instead of GraphicsWindows. When the viewer has a pbuffer (for offscreen rendering without a window) then it wouldn't add the WindowCaptureCallback to that context since it wasn't in the list returned by ViewerBase::getWindows(). And anyways, I originally wrote the code, and I didn't see any reason why I did it with windows instead of contexts...
I've needed to run a recorded simulation offscreen and save it to a sequence of images, and the ScreenCaptureHandler seemed to be the simplest way to do that, and with this change it's possible.


Another change: I've also added the ability to specify continuous capture of all frames, or a certain number of frames. ScreenCaptureHandler now has a setFramesToCapture(int) method. The argument will be interpreted as:

0  : don't capture
<0 : capture continuously
>0 : capture that number of frames then stop

I also added startCapture() and stopCapture() methods so that user code can start capturing (either continuously or the given number of frames) at a given point in their program. setFramesToCapture() won't start capturing, you have to call startCapture() afterwards. The handler also now has another key to toggle continuous capture (defaults to 'C').

Note that continuous capture will of course only work if the CaptureOperation writes to different files (for example, a WriteToFile with SEQUENTIAL_NUMBER mode) or does something different each time... Otherwise it will just overwrite of course. :-)

I've also taken the chance to refactor the addCallbackToViewer() method a bit too, since finding the right camera is needed in two places now.

I've tested all cases (I think). If you want to try, in osgviewer.cpp and replace the line

 // add the screen capture handler
 viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);

with

 // add the screen capture handler
 osgViewer::ScreenCaptureHandler* captureHandler = new
     osgViewer::ScreenCaptureHandler(
         new osgViewer::ScreenCaptureHandler::WriteToFile(
             "screenshot", "jpg",
     osgViewer::ScreenCaptureHandler::WriteToFile::SEQUENTIAL_NUMBER),
     -1);
 viewer.addEventHandler(captureHandler);
 captureHandler->startCapture();

And vary the "-1" (put 0, 10, 50) and then use the 'c' and 'C' keys and see how it reacts.
"
2009-11-19 12:01:49 +00:00
Robert Osfield
4f6be906b3 Fixed spaces at ends of lines 2009-11-19 11:54:15 +00:00
Robert Osfield
6cc2ce5e4a Form Roland Smeenk, "Attached is a small change to the osgWidget::EventInterface so it matches the NotifyWidget and NullWidget interface (added const). Due to this mismatch these widgets never received events.
I also changed the osgwidgetbox example so the ColorWidget is receiving events again."
2009-11-19 11:30:22 +00:00
Robert Osfield
c481f022e9 From Wojciech Lewandowski, "Building on earlier Paul's submission "[osg-users] Main branch MSFBO support change", I have added implicit buffer mask variables to DisplaySettings for setting global defaults for Camera FBOs. These mask variables are named after variables in Camera class. In Paul's submission they were named _renderBufferMask & _resolveBufferMask but I renamed them to _implicitBufferAttachmentRenderMask & _implicitBufferAttachmentResolveMask. DisplaySettings implementation includes reading of environment vars and command line options. Setters and getters follow typical OSG naming convention. I also updated names of ImplictBufferAttachment enum bits to match changed naming scheme.
DisplaySettings now define COLOR and DEPTH as defaults for implicit buffers. Consequently Camera by default uses the same defaults through USE_DISPLAY_SETTINGS_MASK. However, particular Camera mask can be easily overriden through Camera::setImplicitBufferAttachmentMask method. I hope, that in this way we can have global control over implicit buffer defaults, and we can still retain fine grained control at Camera level.

I have also replaced original unsigned ints used to store masks to signed ints because complier resolves enums as signed integer (I got a number of warnings with unsigned int)."
2009-11-19 10:10:50 +00:00
Robert Osfield
2191e6a48d Moved the set of include/osg/Version into Cmake 2009-11-18 16:24:01 +00:00
Robert Osfield
2f854d4978 Fixed primCount default value 2009-11-18 12:50:03 +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
4262d10217 Added osg::ShaderBinary::readShaderBinaryFile(..) static method 2009-11-18 11:25:28 +00:00
Robert Osfield
370deba546 <iterator>, <stdlib.h> and <ctype.h> includes required for QNX compiler 2009-11-17 14:06:07 +00:00
Robert Osfield
52fbe9723f Added new osg::ShaderBinary class, and support for it in osg::Shader. 2009-11-16 12:32:41 +00:00
Cedric Pinson
5842677662 From Cedric Pinson, Fix Skeleton to compute correctly bind matrix, fix compile issue on osganimationhardware after fixing Skeleton 2009-11-13 13:39:21 +00:00
Robert Osfield
6649f51ff2 From Paul Martz, osgViewer Win32 GL3 context creation support 2009-11-13 10:03:02 +00:00
Robert Osfield
8238396099 Added missing export 2009-11-13 09:56:47 +00:00
Robert Osfield
8b141567b9 Adapted GLBeginEndAdapter to use state.drawQuad(..) rather than use it's local GL_QUADS emulation.
Fixed to osg::Texture for GLES support.

Added automatic GLenum mode mappings in osg::PrimitiveSet to provide a fallback for non support glDrawArray/glDrawElement modes.

Added finer gained error checking during StateSet::compile().
2009-11-12 14:35:44 +00:00
Robert Osfield
4374ca23f9 Introduced new State::drawQuads(..) convinience method to help out with mapping GL 1.x style calls to GLES2.0 compatible calls. 2009-11-12 12:18:33 +00:00
Robert Osfield
95d54ba15c Added glContexVersion, glContextFlags and glContextProfileMask members to osg::GraphicsContext::Traits to support GL3 graphics context creation.
Moved the handling of DisplaySettings into Traits constructor.

Added support for s/getGLContextVersion(), s/getGLContextFlags() and s/getGLContextProfileMask() to osg::DisplaySettings.

Added command line and env var support for setting the GLContextVersion, GLContextFlags and GLContextProfileMask to osg::DisplaySettings.
2009-11-11 15:25:42 +00:00
Robert Osfield
b199a334d9 Introduced OSG_GL*_FEATURES macros defined in include/GL that are set to 0 or 1 according to what the assocoated version of GL is compiled against.
Removed EXT postfix of FrameBufferObject functions, and added support for checking non EXT versions frame buffer object GL functions.

Introduced usage of OSG_GL*_FEATURES to avoid some #if #else #endif code blocks.

Using a submissions from Paul Martz as a guide added perliminary GL3 support to a range of OSG classes
2009-11-10 17:01:08 +00:00
Robert Osfield
d0b021568e Added support for mapping GL_QUADS, GL_QUAD_STRIP and GL_POLYGONS to GL_TRIANGLE equivalents. 2009-11-10 11:36:07 +00:00
Robert Osfield
d7d6d2b215 Moved glColor/glNormal definitions for GLES1.x from include/osg/GL to src/osg/ArrayDispatchers.cpp to avoid import/export issues on functions.
Fixed typo of GLES1 in disabling the build of OpenGL1.x/2.x specific examples
2009-11-04 17:26:59 +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
a4639398e8 Fixed compile issue with Image.cpp and osgautocapture.cpp under GLES.
Fixed handling of EGLDisplay in EGL paths of GraphicsWindowX11
2009-11-01 09:04:41 +00:00
Robert Osfield
93d83010f8 Added EGL support into build system for GLES1 + GLES2.
Added EGL support into GraphicsWindowX11.
2009-10-30 15:17:38 +00:00
Cedric Pinson
7e0a6fa68a From Cedric Pinson, Fix warning in osgAnimation, UpdateCallback. Fix bug removing callback in Action. Fix warning Stats 2009-10-29 16:09:07 +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
e720a7a956 Fixed build on OpenGLES-1.1 and OpenGLES-2.0 targets 2009-10-27 18:07:12 +00:00
Cedric Pinson
8454d414a8 From Cedric Pinson, The following commit include:
* Refactore of RigGeometry to support hardware skinning
* Refactore of Timeline to split Action in differents files
* Add example how to use hardware skinning
2009-10-27 15:37:13 +00:00
Robert Osfield
37ee16403a Introduced usage of OSG_GLES*_AVAILABLE macros to headers and .cpp's to enable building against OpenGL ES 1.x and 2.x headers 2009-10-25 11:52:01 +00:00
Cedric Pinson
c837d34692 From Cedric Pinson, Simplify update callback api in osgAnimation, the decision to link is on the manager or user 2009-10-23 20:35:31 +00:00
Robert Osfield
a7cb28b166 Added includes for OpenGL ES1 and ES2. 2009-10-23 16:51:45 +00:00
Robert Osfield
327b67a305 Added CMake support for specifying what OpenGL target and features that the OpenSceneGraph build should use.
Added use of the new Cmake generated #define's for optionally compiling parts of the OpenSceneGraph's OpenGL support for the various OpenGL targets
2009-10-23 13:19:57 +00:00
Robert Osfield
bab4c272d5 Added support for Vec4ubArray colour arrays 2009-10-23 12:22:18 +00:00
Robert Osfield
d88531c099 Added #define for GL_TEXTURE0 as MS gl.h header is still stuck in the nineties.... 2009-10-22 14:40:35 +00:00
Robert Osfield
9b6e25cf62 Fixed typo and updated wrappers 2009-10-22 12:56:41 +00:00
Robert Osfield
0289e5e5a2 From Stephan Huber, compile fix to OSX. 2009-10-22 12:41:48 +00:00
Robert Osfield
b8f7310d50 Removed, now inappropriate, references to glBegin/glEnd. 2009-10-22 12:04:26 +00:00
Robert Osfield
d743412605 From Cedric Pinson, new StateAttributeCallback replacing StateAttribute::Callback 2009-10-22 12:01:06 +00:00
Robert Osfield
2d38e187fd From Cedric Pinson, "Here a patch to be able to clone stateattribute, in order to do that i
moved the StateAttribute::Callback structure to a file
StateAttributeCallback with the same behavior as NodeCallback.
"
2009-10-22 10:33:16 +00:00
Robert Osfield
cdf9c4363b Fixed type of GLBeginEndAdapter::MultiTexCoord*() and VertexAttrib*(), and fixed the internal offsets used in MultiTexCoord so it properly used the mapping texture_unit = target - GL_TEXTURE0 2009-10-22 08:51:51 +00:00
Robert Osfield
9b04a9379b Added Translatef, Scalef, Rotatef methods, and fixed Color4f method. 2009-10-21 16:42:12 +00:00
Robert Osfield
5e6415696f Removed remaining glBegin/glEnd usage 2009-10-21 16:40:45 +00:00
Cedric Pinson
4372ec3cba From Cedric Pinson, this commit contains the following change:
* Change ref_ptr to observer_ptr to avoid cross reference and leak in Skinning
* Set invalidate to true to re run the check visitor in Skeleton
* Shallow copy Sampler in channel copy constructor
* Add accessor in VertexInfluence
* Remove dead code in Timeline.cpp
* Dont force linking in Bone::UpdateBone, the decision is done by the user or the manager
* Add offset in timeline stats to display each manager on the screen
* Add a flag in animation manager base to enable or not automatic link when modifying the manager
2009-10-21 15:45:13 +00:00
Robert Osfield
2785ea4dfb Added support for automatic vertex aliasing to new ArrayDispatchers, and updated wrappers 2009-10-21 14:09:12 +00:00
Robert Osfield
9499b19b43 Moved the ArrayDispatchers management so that osg::State now has a ArrayDispatchers object that any osg::Geometry can reuse,
and optimized the implementation to reduce the CPU overhead.
2009-10-21 11:18:13 +00:00
Robert Osfield
6a56b6e6be Refactored osg::Geometry::drawImplementation(..) to use new osg::ArrayDispatchers that encapsulate the task
of dispatch osg::Array data as OpenGL attributes.
2009-10-20 19:34:24 +00:00
Robert Osfield
eb9ff0a311 Added support for multitexturing and vertex attributes to GLBeginEndAdapter 2009-10-17 19:22:14 +00:00
Robert Osfield
73ae1637c0 Fixed VS warning 2009-10-17 11:14:03 +00:00
Robert Osfield
aefd1513f4 Ported osg::Geometry across to supporting the aliasing of vertex, color and normal etc. calls to Vertex Attributes.
Added support for automatic aliasing of vertex, normal, color etc. arrays to Vertex Attribute equivelants.

Added new osg::GLBeginEndAdapter class for runtime conversion from glBegin/glEnd codes to vertex arrray equivelants.

Added automatic shader source conversion from gl_ to osg_ builtins.
2009-10-16 16:26:27 +00:00
Robert Osfield
9e2567cb88 Made the use of the new projection and modelview matrix uniforms optional 2009-10-11 06:05:19 +00:00
Robert Osfield
f479eb174c From Paul Martz, "A recent change to add the new geometry shader primitive types has broken the build on Windows. On Windows, those types are declared in the header GL2Extensions, but the PrimitiveSet header (which uses those types) fails to include that header, causing compile errors.
Attached is a version of PrimitiveSet that includes GL2Extensions."
2009-10-11 05:52:11 +00:00
Robert Osfield
3fce07e5e5 From Cesar L.B. Silveira, "I have written these few lines of code which allow setting the label
of an osgWidget::Label with an osgText::String. I had to do this on a
project I'm working on, because I needed UTF-8 strings on my labels,
and using setLabel with std::string was not working.
"
2009-10-10 11:06:30 +00:00
Robert Osfield
0ef684f6b5 To fix warning removed unncessary , from end to enum list. 2009-10-10 09:44:40 +00:00
Robert Osfield
10deffdc41 From Stephane Lamoliatte, "Here is a patch wich improves the support for geometry shaders in OpenSceneGraph.
It adds new PrimitiveSet constants for the specific geometry shader primitive types :
  - LINES_ADJACENCY
  - LINE_STRIP_ADJACENCY
  - TRIANGLES_ADJACENCY
  - TRIANGLE_STRIP_ADJACENCY
It also adds some missing features to the glsl reader plug'in.
"
2009-10-10 09:41:28 +00:00
Robert Osfield
f6166d1119 Introduced new uniforms for tracking the modelview and project matrices in shaders using non built-ins. 2009-10-09 13:39:11 +00:00
Robert Osfield
68b661c93b Cleaned up the #define's for when GLU is not available 2009-10-08 09:27:54 +00:00
Robert Osfield
2d26cbe7ab Introduced optional build against the GLU library, using optional compile paths to enable/disable GLU related function.
To toggle the use of the GLU library adjust the OSG_GLU_AVAILABLE variable via ccmake . or CMakeSetup.
2009-10-07 19:42:32 +00:00
Robert Osfield
ae7dfc5796 Fixed warnigns 2009-10-07 09:39:45 +00:00
Robert Osfield
69557c060b Fixed the TextureObject's + GLBufferObject reassignment to a new set.
Disabled the unref after apply for a Texture classes when the texture pool is enabled
2009-10-06 13:42:12 +00:00
Robert Osfield
5d3b8fe2b0 Added missing export 2009-10-04 08:52:01 +00:00
Robert Osfield
32b21dbb89 Introduced new GLBufferObject pool for managing the memory footprint taken up by VertexBufferObejct, ElementBufferObject and PixelBufferObject. 2009-10-03 09:25:23 +00:00
Robert Osfield
f75013d534 Introduced new BufferObject design + implementation in preperation of implementing a pool system for buffer objects 2009-10-01 20:19:42 +00:00
Cedric Pinson
cfac6a7809 From Michael Platings, In Target, the default constructor is explicitly called on _target. This is necessary for FloatTarget and DoubleTarget so that _target is initialised to 0, otherwise you get a junk value. In MorphGeometry.cpp, UpdateMorph::link now links channels of the same index to the same target. Previously a new FloatTarget was created for each channel, so multiple animations didn't work. 2009-10-01 17:08:16 +00:00
Robert Osfield
1fce3c0ad1 Added handling of resetting of the texture object format 2009-09-27 15:14:57 +00:00
Robert Osfield
4d75729650 Added stats collection to new Texture Pool code, and improved TexturePool implementation.
The Texture Pool can be enabled by setting the env var OSG_TEXTURE_POOL_SIZE=size_in_bytes.
Note, setting a size of 1 will result in the TexturePool allocating the minimum number of
textures it can without having to reuse TextureObjects from within the same frame.
2009-09-25 18:05:54 +00:00
Robert Osfield
6bc9c626f4 Fixed warning 2009-09-25 18:03:49 +00:00
Robert Osfield
216849f73a From Jean-Sebastien Guay, fixed Widows build and updated the SO version 2009-09-23 15:16:34 +00:00
Robert Osfield
d56499025b Introduced memory pool size management 2009-09-23 13:51:20 +00:00
Robert Osfield
3d75054e2c Preliminary work on support for a texture object pool that is designed to help manage resources down the GPU more tightly. 2009-09-22 18:45:24 +00:00
Cedric Pinson
2b3d76aade From Cedric Pinson, Fix createKeyframeContainerFromTargetValue to recreate its sampler from scratch to not change keyframe container of another sampler 2009-09-09 18:13:24 +00:00
Cedric Pinson
d28b052fb7 From Cedric Pinson, remove unsused files include/osgAnimation/AnimationManager and src/osgAnimation/AnimationManager.cpp 2009-09-09 09:54:29 +00:00
Cedric Pinson
9b95a78e5d From Michael Platings, I have removed Target::normalize() as calling it was incorrect - the interpolation is already done in such a way that the Target's value is always normalized.
Finally, I have fixed TemplateTarget<osg::Quat>::lerp() as it was giving incorrect results when interpolating between some small rotations.
From Cedric Pinson, i renamed the method in channel to be more general. Adjusted the CubicBezier key constructor to use a single value as input.
2009-09-09 09:52:54 +00:00
Robert Osfield
fa84f280f6 Renamed the osgVolume::Layer/ImageDetails parameters RescaleIntercept and RescaleSlope to more general TexelOffset and TexelScale, and changed type to Vec4.
Refactored the transfer function set up in RayTracedTechnique to prepare for new scale and offset uniforms.

Updated wrappers
2009-09-03 13:40:50 +00:00
Robert Osfield
43e3089417 Added support for recording the RescaleIntecept and RescaleSlope from the dicome files and passing these values onto osgVolume::ImageLayer 2009-09-01 10:48:32 +00:00
Cedric Pinson
641769a681 From Cedric Pinson, add missing files 2009-08-31 10:37:44 +00:00
Cedric Pinson
b6ab5bbe27 From Cedric Pinson, The following modification are
Update Timeline.cpp to add current layer to the ActionVisitor, use correctly the priority
Add accessors in Action.cpp to retrieve protected data
Split files and rename them to classname
Change de default color of UpdateMaterial to FFOOFF to detect unset value
Add accessors in LinkVisitor instead of accessing data directly
Update osganimationtimeline example to fit the api callback
2009-08-31 09:40:56 +00:00
Robert Osfield
ca78f3a6bc Added support to .p3d format's volume tag for the properties:
region="xmin ymin zmin xmax ymax zmax"
   alpha="float_value"
   cutoff="float_value"
   sampleDenstiy="float_value"
2009-08-27 16:42:47 +00:00
Cedric Pinson
3f9216800d From Michael Platings, I've moved the matrix updating from UpdateSkeleton to UpdateBone. UpdateSkeleton now merely checks that Bones appear before other children and issues a warning if this isn't the case 2009-08-27 16:21:01 +00:00
Cedric Pinson
729d5205ef From Michael Platings, I've just added a few simple accessors I found necessary 2009-08-26 16:39:53 +00:00
Cedric Pinson
3c45fb1e6c From Michael Platings,
- Animations with equal priority are now weighted correctly relative to each other
- (minor) Channels no longer store their weight as the only time it's used is in update() when Animation can pass in the weight directly
From Cedric Pinson,
- I adjusted the quaternion blending to keep the commutativy property
2009-08-26 09:24:02 +00:00
Robert Osfield
c56dd6faa5 From Michael Platings, "the DAE importer was crashing when calling osg::Object::setName with a null pointer argument. Rather than trying to fix all the places this might happen and probably missing a few, I thought it would be better to trivially validate the input in setName. With this fix if setName is called with a null pointer then the name is cleared." 2009-08-22 17:13:19 +00:00
Robert Osfield
fd299b5f65 From Magnus Kessler, "At the end of the void function
osg::Animation::TemplateStepInterpolator::getValue the code tries to return
the result rather than assigning it to the result parameter reference.

The following patch fixes this."
2009-08-21 11:31:10 +00:00
Robert Osfield
aa85f18bbc From Stephane Lamoliatte, "I just add the a missing getView() function to the WindowManager." 2009-08-21 09:54:45 +00:00
Robert Osfield
3f65f4f80b From Wojciech Lewandowski, support for FBO's without colour or depth attachments.
Note from Robert Osfield, I've temporarily re-enabled the old focing of of color and depth attachment to avoid regressions on some OpenGL driver.  We'll revist this once
we have a mechanism for controlling this override at runtime.

#define FORCE_COLOR_ATTACHMENT  1
#define FORCE_DEPTH_ATTACHMENT  1
2009-08-21 09:34:48 +00:00
Robert Osfield
65352c8533 From Magnus Kessler, "osgAnimation/Interpolator includes itself. The following patch removes the
superfluous include"
2009-08-20 16:39:14 +00:00
Robert Osfield
a2a2740a23 From Ronald van Maarseveen and Robert Osfield, changed compute of up vector and localToWorld transform so that it takes in to account the geographic latitude. 2009-08-20 14:19:10 +00:00
Robert Osfield
850ea3de9f Added support for trimming the contents of parsed Xml graph 2009-08-19 15:36:23 +00:00
Cedric Pinson
2916d9b7ea From Michael Platings,
Changes to allow osgAnimation::*CubicBezierChannel to be used
Added TemplateStepInterpolator class
2009-08-06 12:40:06 +00:00
Robert Osfield
589629cab8 Introduced TabBoxTrackballDragger 2009-08-05 16:02:44 +00:00
Robert Osfield
93996e6133 Added support for volume tags with properties:
dragger="box" or dragger="trackball"

and

    technique="light" or technique="isosurface" or technique="iso" or technique="mip"

and

    tf="transferfunctionfile.tf"

i.e.

         <volume dragger="box">CardiacCT</volume>
         <volume tf="colour.tf">CardiacCT</volume>
         <volume technique="isosurface">CardiacCT</volume>
2009-08-05 14:37:56 +00:00
Robert Osfield
df9385ac19 Moved the updating and expiry of the Registry object cache from DatabasePager into osgViewer::Viewer/CompositeViewer. 2009-08-05 11:06:53 +00:00
Cedric Pinson
d2af7efc61 From Cedric Pinson, Add UpdateMaterial callback to animate material\nUpdate LinkVisitor to traverse stateset\nUpdate ReaderWriter to read osgAnimation::UpdateMaterial Callback\nUpdate nathan.osg data file to demonstrate the MaterialAnimation 2009-08-03 09:48:12 +00:00
Robert Osfield
239aed9a88 Tweak of NodeMask docs 2009-07-28 06:00:23 +00:00
Robert Osfield
35962ab099 From Lee Butler and Robert Osfield, doxygen comment explaining role of NodeMask 2009-07-24 15:30:13 +00:00
Robert Osfield
31a947fda6 From Terry Welsh, "Okay, here are the mods I wrote for drawing a filled bounding box
behind osgText::Text.  I made it so the box would get drawn using
whichever BackdropImplementation was selected.  However, I did not
implement STENCIL_BUFFER.  In that case it defaults to drawing the
bounding box using POLYGON_OFFSET instead.

Also made it so the BOUNDINGBOX and FILLEDBOUNDINGBOX are drawn with a
settable color and margin size.

While I was at it I tightened up the values applied with DEPTH_RANGE
and POLYGON_OFFSET, not just for drawing the bounding box but also for
drawing backdrop text (these values must be coupled since the bounding
box has to be drawn deeper in Z than the backdrop text).  The values
in use before seemed like overkill and I was seeing some z-clipping
with my background scenery in the case of DEPTH_RANGE.  If there was a
good reason for the large values please let me know...."
2009-07-24 14:59:51 +00:00
Robert Osfield
773ae51a45 From Chris Hanson, typo and comment clean ups 2009-07-24 14:45:44 +00:00
Robert Osfield
2e0f1dc0d1 From Chris Hanson, added EllipsoidModel::isWGS84() method and clean up on comments. 2009-07-24 14:25:34 +00:00
Cedric Pinson
5a73834cbe From Cedric Pinson, Store the linkvisitor to be able to configure it by user, like changing the nodemaskoverride, or use a custom LinkVisitor 2009-07-23 12:42:01 +00:00
Robert Osfield
5496e91f87 Added the ability to turn off the external paging in of PagedLOD children. 2009-07-16 10:13:41 +00:00
Cedric Pinson
a13b32a124 From Cedric Pinson, add accessors to osgAnimation ActionCallback 2009-07-15 20:52:51 +00:00
Robert Osfield
c47c0c2a26 From Stephan Huber, "ttached you'll find a small fix for the
GraphicsWindowCocoa-implementation, which enhances multithreaded
stability, it ensures that modifications to the size of an openglcontext
is done only from one thread.
"
2009-07-13 08:30:20 +00:00
Robert Osfield
6e6a7c960e Added Dragger::s/getActivationModKeyMask(..) and Dragger::s/getActivationKeyEvent(...) methods to make it possible to have draggers that only respond when you press a specified modified key or standard key.
Changed the optional dragger in osgvolume to require the shift key to be pressed for the dragger to become active.
2009-07-03 19:16:53 +00:00
Robert Osfield
11d7d98e79 Updated version numbers for 2.9.6 release 2009-07-03 10:33:51 +00:00
Robert Osfield
b37e871cec Added callback to locator in support of interactive updating of the volume extents 2009-07-03 05:54:02 +00:00
Robert Osfield
78229df14a Added setUpGeometry to Dragger base class to make it easier to use draggers interchangably. 2009-07-03 05:52:52 +00:00
Robert Osfield
a4dedc227b Refactored RayTracedTechnique to allow the position of the rendered part of the volume to be decoupled from the image data. 2009-07-02 18:49:59 +00:00
Robert Osfield
a7f0f3f49d Added constructor and destructor body 2009-07-01 14:49:30 +00:00
Robert Osfield
2525bb5d06 Completed refactor of osgManipulator, key changes are:
Selection is now just a typedef of osg::MatrixTransform, and is deprecated

   CommandManager is shell class that just sets values directly on Dragger, and is deprecated

   Dragger now has list of DraggerCallback that takes over the roll of tracking changes to the Dragger, and
   allows users to track the dragger in any way they wish.

   Dragger now has a convinience method making MatrixTransforms track a dragger.

   Selection and CommandManager are no longer required for use of osgManipulator and are kept around for backwards compatibility.
2009-07-01 14:01:09 +00:00
Robert Osfield
7904fe71a5 Simplified Command and CommandManager 2009-06-30 13:00:58 +00:00
Cedric Pinson
2c012faee4 From Cedric Pinson, Traverse StripAction instead of applying, this fix the execution of FrameCallback in BlendIn, BlendOut and AnimationAction\nFix warning of osgAnimation::StatsHandler\nFix crash when running example osganimationtimeline without nathan.osg in OSG_FILE_PATH or with bad file 2009-06-30 11:55:49 +00:00
Robert Osfield
a2ae370c8e Refactored osgManipulator so that CommandManager is no longer required, instead Dragger directly manages Constaints and associate Selections. 2009-06-30 11:39:39 +00:00
Robert Osfield
e30e4df30c Introduced event handling directly into osgManipulator::Dragger to allow it be used with a global event handler passing in events. 2009-06-29 21:32:10 +00:00
Robert Osfield
214e1b81ed Simplified throw rate code, and add throw rate compensation into zoom in/out code. 2009-06-25 18:31:43 +00:00
Robert Osfield
b1a99ba25f From Lee Bulter, "I noticed that when "throwing" things the rate of motion once thrown was
dependent on the complexity of the geometry. For complex scenes this
meant that it looked like you were "throwing" the display into molasses.
For simple geometry things get over-excited once thrown.

The fix is to factor in the frame rendering time to the caluclated
motion. I've implemented this for rotation and panning.

Now when things are thrown they maintain a rate very close to what was
happening when the mouse button was released."
2009-06-25 18:11:29 +00:00
Robert Osfield
b1f4a81606 From Mathias Froehlich, "Fix possible problem with aliasing rules.. and fix a gcc warning :)Use a union to determine if we are on a little endian or big endian machine." 2009-06-25 13:26:26 +00:00
Robert Osfield
3aded84015 From Cory Riddell, "I added an _allowThrow boolean along with a getter and setter to the
spherical manipulator. The default value is true.

This is very similar to the flag in trackball."
2009-06-25 09:14:47 +00:00
Robert Osfield
5eed82e32e Added export 2009-06-25 08:23:21 +00:00
Robert Osfield
95355c2a49 Refactored preset3D/p3d plugin so that common scene graph extensions and classes now live in a separate osgPresenttation NodeKit. 2009-06-24 16:03:49 +00:00
Cedric Pinson
51579cf436 From Cedric Pinson, Fix the drop of the first frame of action when adding action with addActionNow\nReport stats only for active animations\nAdd priority to RunAction callback 2009-06-24 10:10:09 +00:00
Cedric Pinson
658d96aa64 From Cedric Pinson, fix constructors for cloning osgAnimation objects 2009-06-22 14:24:59 +00:00
Robert Osfield
79b0060703 From Tom Jolly, "A new compiler and a new warning.
Enclosed is include/osgParticle/Particle.  I removed the const from the
return type of getSTexCoord.  I also changed the name on the next
function to getTTexCoord so it is consistent with getSTexCoord.  If you
prefer to change getSTexCoord to getSCoord you will need to change it in
ConnectedParticleSystem.cpp."
2009-06-19 13:09:31 +00:00
Robert Osfield
85bb6b327d From Wojciech Lewandowski, "Here are my changes:
- osg::Texture sets GL_MAX_TEXTURE_LEVEL if image uses fewer mipmaps than
number from computeNumberOfMipmaps (and it works!)
- DDS fix to read only available mipmaps
- DDS fixes to read / save 3D textures with mipmaps ( packing == 1 is
required)
- Few cosmetic DDS modifications and comments to make code cleaner (I hope)

Added _isTextureMaxLevelSupported variable to texture extensions. It
could be removed if OSG requires OpenGL version 1.2 by default.

Added simple ComputeImageSizeInBytes function in DDSReaderWrites. In
my opinion it would be better if similar static method was defined for
Image. Then it could be used not only in DDS but other modules as well (I
noticed that Texture/Texture2D do similar computations).

Also attached is an example test.osg model with DDS without last mipmaps to
demonstrate the problem. When loaded into Viewer with current code and moved
far away, so that cube occupies 4 pixels, cube becomes red due to the issue
I described in earlier post. When you patch DDS reader writer with attched
code but no osg::Texture yet, cube becomes blank (at least on my
Windows/NVidia)  When you also merge osg::Texture patch cube will look right
and mipmaps will be correct."
2009-06-19 11:55:52 +00:00
Robert Osfield
82b329b0a7 Added append() method 2009-06-19 11:04:48 +00:00
Robert Osfield
1523032d2b From Cedric Pinson and Robert Osfield, addition of NodeCallbacks to osg::CopyOp and osg::Node copy constructor. 2009-06-18 10:01:39 +00:00
Robert Osfield
1e45b24a7f Added exports 2009-06-18 08:29:20 +00:00
Robert Osfield
73b423ad85 Replaced forward declarations 2009-06-17 16:54:39 +00:00
Robert Osfield
acf07b5b22 Made method names consistent with each other 2009-06-17 15:12:50 +00:00
Robert Osfield
ad8f2d8974 Changed build OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION to ON and then fixed all the resulting build errors. 2009-06-17 10:39:39 +00:00