Commit Graph

1501 Commits

Author SHA1 Message Date
Robert Osfield
4511281f04 From Sukender and Robert Osfield, introduced GraphicsContext::ScreenSettings & WindowingSystemInterface::enumerateScreenSettings. 2008-12-16 15:08:04 +00:00
Robert Osfield
528fdbb75c Aded osg::isGLExtensionOrVersionSupported(uint contextID, char* extensionName, float minVersionRequired) method that
returns true if (the extension string is supported or GL version is greater than or equal to a specified version) and 
non extension disable is used.   This makes it possible to disable extensions that are now
available as parts of the core OpenGL spec.

Updated Texture.cpp is use this method.
2008-12-15 19:37:14 +00:00
Robert Osfield
7d719d998e Removed buildMipmaps method that had no implementation. 2008-12-15 12:16:31 +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
b038baf676 Updated version number for 2.7.7 release 2008-12-12 10:19:19 +00:00
Robert Osfield
905f3673d5 From Sukender, added missing inline keywords 2008-12-09 16:43:38 +00:00
Robert Osfield
6b3704ce09 Added asSwitch and asGeode convinience methods to Node 2008-12-09 09:24:47 +00:00
Robert Osfield
6f356aeb97 Intoduce new osgWidget::PdfReader and osgWidget::VncClient front ends to osgWidget,
with new pdf plugin and updated vnc plugin that now support these front ends.

Updated osgpdf and osgvnc examples to new these new interfaces.
2008-12-07 17:02:30 +00:00
Robert Osfield
bad3a92fc3 Added GL_ABGR_EXT to fix windows build 2008-12-05 16:41:12 +00:00
Robert Osfield
fe439b3707 From Sukender, (Benoit Neil) "adding a few convinience methods to osg::Node (ouch!). Just tell me if you find them useful:
/** Convinience method that sets the update callback of the node if it doesn't exist, or nest it into the existing one. */
void addUpdateCallback(NodeCallback* nc);

/** Convinience method that removes a given callback from a node, even if that callback is nested. There is no error return in case the given callback is not found. */
void removeUpdateCallback(NodeCallback* nc);

... and the same for Event and Cull callbacks methods."
2008-12-03 14:13:59 +00:00
Robert Osfield
1ff5d3c53d Fixed wrappers 2008-12-01 15:46:50 +00:00
Robert Osfield
f2c1a3ea8a From Art Tevs, "here is a submission of an additional class of PixelBufferObejct, which implements more general way of handling with PBOs. Current osg implementation of PBO does use an attached osg::Image to copy data from. This is somehow only one way of using it and doesn't provide full functionality of PBOs.
--------------------------------------------
Descripton:

The patch does provide a new class PixelDataBufferObject which is capable of allocating memory on the GPU side (PBO memory) of arbitrary size. The memory can then further be used to be enabled into read mode (GL_PIXEL_UNPACK_BUFFER_ARB) or in write mode (GL_PIXEL_PACK_BUFFER_ARB). Enabling the buffer into write mode will force the driver to write data from bounded textures into that buffer (i.e. glGetTexImage). Using buffer in read mode give you the possibility to read data from the buffer into a texture with e.g. glTexSubImage or other instuctions. Hence no data is copied over the CPU (host memory), all the operations are done in the GPU memory.


--------------------------------------------
Compatibility:

The new class require the unbindBuffer method from the base class BufferObject to be virtual, which shouldn't break any functionality of already existing classes. Except of this the new class is fully orthogonal to existing one, hence can be safely added into already existing osg system.

--------------------------------------------
Testing:

The new class was tested in the current svn version of osgPPU. I am using the new class to copy data from textures into the PBO and hence provide them to CUDA kernels. Also reading the results back from CUDA is implemented using the provided patch. The given patch gives a possibility of easy interoperability between CUDA and osg (osgPPU ;) )


--------------------------------------------
I think in general it is a better way to derive the PixelBufferObject class from PixelDataBufferObject, since the second one is a generalization of the first one. However this could break the current functionality, hence I haven't implemented it in such a way. However I would push that on a stack of wished osg 3.x features, since this will reflect the OpenGL PBO functionality through the classes better.
"
2008-12-01 13:28:13 +00:00
Robert Osfield
47f518d1c7 From Art Tevs, "here are a small extension to the osg::Image class, which do computes data type from the given format, i.e. (GL_RGB32F_ARB -> GL_FLOAT). The method is very usefull to find out which data type a texture or an image have based on the internal/pixel format." 2008-11-30 15:56:47 +00:00
Robert Osfield
e9a18a7466 Updated SO version number for 2.5.6 release 2008-11-27 17:30:14 +00:00
Robert Osfield
d952172559 From Tim Moore, "Double precision versions of BoundingBox and BoundingSphere are useful for doing computations in world coordinates, especially when working with a geocentric scene. By default, these classes are built using floats, so templated versions fill a need. I've used the double precision templates to fix some problems with ViewDependentShadow, which will follow shortly.
"
2008-11-26 16:39:52 +00:00
Robert Osfield
e3d1c4ba04 From Piotr Rak, "added bool conversion for ref_ptr, when no implicit conversion to T* is used." 2008-11-25 16:24:50 +00:00
Robert Osfield
0d8ae3bd66 From Ferdi Smit, added support for unsigned int typed uniforms 2008-11-25 14:15:35 +00:00
Robert Osfield
d08d778608 From Jaromir Vitek, "In attachment are another fixes for using packed depth+stencil (PDS).
* When used PDS RenderStage::runCameraSetUp sets flag that FBO has already stencil,depth buffer attached. Prevents adding next depth buffer.
* Sets correct traits for p-buffer if used PDS and something goes wrong with FBO setup or p-buffer is used directly.
* Adds warning to camera if user add depth/stencil already attached through PDS.
* Sets blitMask when use blit to resolve buffer.

There is also new example with using multisampled FBO."
2008-11-25 10:57:14 +00:00
Robert Osfield
410b90334a From Wojciech Lewandowski, "I have restored MSVC disabled warnings in osg/Export. Difference is they are now disabled only when OSG_DISABLE_MSVC_WARNINGS macro is defined. This macro is set through CMake options and autogenerated in osg/Config. Simon suggested that it would be cool if we had more control over selected warnings. I tried to learn how to make selection of individual warning numbers possible, but had to gave up as my cmake skills were not sufficient. The only way I saw this possible would be adding one define for each MSVC warning number. But many definitions seemed too be to much clutter for osg/Config file so I rejected thar idea. For this it would be cool if autogenerated Config entries could more powerful than simple #define/#undef flags. Maybe Cmake gurus know how to do it.
I have not reverted added Compiler options. I assume that one may want to have warnings enabled for the application but may not want to see them while OSG libraries and examples compile.

Modified files:

osg/Export   - now explicitly includes osg/Config to make sure OSG_DISABLE_MSVC_WARNINGS is read
osg/Config.in  - declares OSG_DISABLE_MSVC_WARNINGS flag to be added to autogenerated osg/Config
CMakeLists.txt - declares OSG_DISABLE_MSVC_WARNINGS as option with default ON setting
"
2008-11-24 16:32:52 +00:00
Robert Osfield
5b15436935 Added mechanism for tracking when interactive images are being rendered to
enable their backends to only rendered them when they are actively being rendered
in the OpenGL window.
2008-11-23 15:51:43 +00:00
Robert Osfield
8264b31fa1 Introduce osg::asciiToDouble/asciiToFloat function. 2008-11-23 11:35:43 +00:00
Robert Osfield
98df67c918 Added DisplaySettings::s/getApplication() to help with gecko plugin initialization when it requires the application name 2008-11-20 12:03:21 +00:00
Robert Osfield
cac16cb590 Added optional bool keep to BarrierOperation to make it more resuable 2008-11-18 15:18:34 +00:00
Robert Osfield
453bbc8608 From Simon Hammett, moved VS #prgama warning disabling from include/osg/Export to CMakeList.txt. 2008-11-14 18:22:01 +00:00
Robert Osfield
11388f3519 Updated version number in prep for 2.5.6 dev release 2008-11-13 10:49:33 +00:00
Robert Osfield
2090fb1450 From Jaromir Vitek, "patch contains extension to fbo and camera. Camera can attach new render buffer for depth and stencil logical buffer in packed form." 2008-11-09 11:55:11 +00:00
Robert Osfield
3455431129 From Tim Moore, removed redundent forward declartion of BoundingBox and BoundingSphere 2008-11-07 13:18:40 +00:00
Robert Osfield
7b9474e33e Fixed constness of getTexture/getRenderBuffer() const and added non cost version. 2008-11-06 14:46:11 +00:00
Robert Osfield
b5aa966d12 From Michael Platings, "I've added functions to get the
texture, renderbuffer and other properties from a FrameBufferAttachment."
2008-11-06 14:29:35 +00:00
Robert Osfield
70e1c60819 Added sendPointerEvent and sendKeyEvent virtual methods to osg::Image to
facilitate the subclassing of Image providing interactive behaviours so as
used in the vnc interactive VncImage class.

osgViewer::InteractiveImageHandler provides an event handler that convertes osgGA 
mouse and keyboard events into the coordinate frame of an image based on ray intersection with geometry in
the associated subgraph.

Changed the ordering of events processing in Viewer and CompositeViewer to allow
scene graph event handlers to take precidence over viewer event handlers and camera manipulators
2008-11-03 15:08:04 +00:00
Robert Osfield
545a5d02c7 Changed version number to 2.7.5 in prep for dev release 2008-11-03 15:03:49 +00:00
Robert Osfield
b28612bce2 Various warning fixes 2008-10-27 13:09:43 +00:00
Robert Osfield
0ff3f48693 Improved the support for no pre compile, and configuring the number of threads in the DatabasePager. 2008-10-26 22:22:38 +00:00
Robert Osfield
10186190f6 Introduced support for controlling mipmapping of osgTerrain::ImageLayer and compression of osgTerrain::HeightFieldLayer. 2008-10-20 08:43:25 +00:00
Robert Osfield
ac975bf79a Added a Refrenced::getGlobalReferencedMutex, and OpenThreads::ScopedPointerLock() and use of this in add/removeParent() codes
to avoid threading problems when using atomic ref counting.
2008-10-14 14:27:41 +00:00
Robert Osfield
af13e84093 UPdated version numbers 2008-10-14 14:25:54 +00:00
Robert Osfield
5e95d6e3b5 Added Texture1D(Image*) and Texture3D(Image*) constructors 2008-10-08 11:30:18 +00:00
Robert Osfield
8c98220878 Added the ability to release OpenGL objects in PagedLOD subgrphs that are no longer being rendered. 2008-10-07 11:35:41 +00:00
Robert Osfield
8147bd4df8 Refactored ImageSequence to provided a cleaner and more robust implementation 2008-10-06 17:02:20 +00:00
Robert Osfield
eb01f3365f Added include <osg/Config> to take advantage of OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION 2008-10-03 16:57:01 +00:00
Robert Osfield
e7bfc59f5a From Neil Groves, addition on a T* implicit output conversion method and removal of comparison methods that are replaced by the single conversion method.
From Robert Osfield, optional compilation of above.
2008-10-03 15:13:11 +00:00
Robert Osfield
eb5a656f4e From Neil Groves, added intrusive_ptr_add_ref and intrusive_ptr_release methods to enable
usage of boost::intrusive_ptr<> with osg::Referenced objects.
2008-10-03 13:34:32 +00:00
Robert Osfield
99fd6ed93a From Neil Groves, "Frequently I would like code that has a signature like: void foo(osg::ref_ptr<osg::Node> node) to work for osg::ref_ptr<osg::Group>, osg::ref_ptr<osg::Geode> etc. The behaviour of osg::ref_ptr does not mimic the behaviour of a raw pointer in this regard.
To facilitate this possibility I have added a template copy constructor and a template assignment operator. These work for safe conversions like those in my previous example, but fail as desired for non-safe conversions since the template instantiation fails during the raw pointer copy/assignment.

The lack of this facility has appreciably handicapped development of generic algorithms applied to the scene graph, and I believe that this alteration will be welcomed by most of the community. If there are issues with antiquated compilers not supporting template member functions then perhaps a small piece of conditional compilation is in order.

I have made the change using the latest release version (2.6) as the base. The full file is attached.

I have not tested building the osg wrappers and the script binding code. I have tested the legal and illegal conversions of both copying and assignment to ensure that behave as expected on MSVC7.1, MSVC8, MSVC9, GCC 4.3."
2008-10-03 09:55:20 +00:00
Robert Osfield
3bbd4bbfd6 Removed unused methods 2008-09-25 15:19:42 +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
9510df9c2e From Alan Dickinson, change methods to virtual. 2008-09-18 13:54:13 +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
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
7ec5632bcc Introduce new templated clone(..) methods that return the correct type of object cloned. 2008-09-17 14:21:19 +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