Commit Graph

9226 Commits

Author SHA1 Message Date
Robert Osfield
7994ed1eb7 changed debug info to output to INFO instaed of NOTICE. 2009-03-11 17:39:08 +00:00
Robert Osfield
5233a716c8 Added handling of Image::isImageTranslucent(), when it is enabling blending.
Added handling of Image::getPixelAspectRatio() in geometry sizing.
Added scaling of the projection matrix to ensure that aspect ratio is honoured with running in fullscreen mode
2009-03-11 15:43:13 +00:00
Robert Osfield
b6bffdd02f From Tanguy Fautre,
Clean up of the FFmpeg plugin's class API/AudioStream API. 
Implementation of isImageTransparent().
Implementation of Image:g/setPixelAspectRatio()
2009-03-11 15:12:46 +00:00
Robert Osfield
998cfec137 Added View::removeEventHandler(..) method and added check into addEventHandler() to prevent handlers being added twice. 2009-03-11 14:18:30 +00:00
Robert Osfield
d808149e05 From Philip Lowman, "At a cost of bumping the required version to CMake 2.4.4 (released all the way back on November 21, 2006)... this cmake script patch
1. Makes IF/ELSE/ENDIF code blocks easier to read by replacing code like this:

IF(FOO)
   MESSAGE("FOO is true")
ELSE(FOO)
  MESSAGE(" ??? ELSE(FOO)??? ")
ENDIF(FOO)

with this:

IF(FOO)
   MESSAGE("FOO is true")
ELSE()
  MESSAGE("FOO is clearly false")
ENDIF()

2. Also adds an ELSEIF() where it makes sense to do so (safe to use as of CMake 2.4.4)"
2009-03-11 14:08:43 +00:00
Robert Osfield
6791f65add From Neil Hughes, "I've spent the past four days playing with PNG files on 3DS objects, and I think I may have come across a small issue with the 3DS loader.
At the company where I work we model literally thousands of 3DS models for all types of objects. Most don't have transparent textures applied to them, but a few do. The issue is that a texture may have an alpha channel defined, yet its 3DS material definition is not marked as being an alpha source, or transparent. This can happen for any number of modelling reasons (so I'm told) but the net effect is that when a 3DS object is loaded with such a material applied, the stateset creation for the 3DS geometry omits to add the GL_BLEND attribute as neither of the conditions that it currently tests for are satisfied under this scenario.

However, one thing that is apparently an indication of transparency/alpha information that we do make use of when modelling, but that the 3DS reader omits to test, is that we assign to the transparent texture to the opacity_map of the 3DS material structure.

Now, having discussed with our modellers the theory behind the opacity map, it seems that it is safe to say that if an opacity map is specified, then the reader should really apply the GL_BLEND attribute as it is an indication of some form of blending being required between materials.

With this in mind, I have made a minor change to the function createStateSet below, from the ReaderWriter3DS.cpp file, that checks for an opacity map having been specified, and in such a scenario the GL_BLEND attribute is applied to the geometry. This fixed our issue, and thought it might be helpful to others."
2009-03-11 13:27:51 +00:00
Robert Osfield
ec63cfd930 From Mathias Froehlich, "small addition to osg::Texture to include all possible depth test variants for
the shadow depth comparison."
2009-03-11 13:08:12 +00:00
Robert Osfield
771f3a3238 From Stephan Huber, files were are missed by Robert in check in of changes to GraphicsWindowCarbon.cpp 2009-03-11 12:55:20 +00:00
Robert Osfield
d040b9f9d6 From Lionel Lagarde, "the attachment contains a correction of the Optimizer::MergeGeometryVisitor.
When 2 geometries are merged, the primitive sets of the second geometry
are copied to the first geometry.

The primitive sets were copied with a std::insert into the first geometry
primitive set vector. It doesn't work when the geometry is using VBOs (because
the element buffer object of the primitive set is not updated).

The correction replaces

lhs.getPrimitiveSetList().insert( lhs.getPrimitiveSetList().end(),
                                rhs.getPrimitiveSetList().begin(),
                                rhs.getPrimitiveSetList().end() );

by
 for( primItr=rhs.getPrimitiveSetList().begin();
   primItr!=rhs.getPrimitiveSetList().end();
   ++primItr )
{
  lhs.addPrimitiveSet(primItr->get());
}"
2009-03-11 12:08:24 +00:00
Robert Osfield
3e535d7456 Fixed crash due to Geometry::copyToAndOptimize(..) not handling cases where indices are present, but no arrays are assocaited with them. 2009-03-11 11:58:31 +00:00
Robert Osfield
31608b2559 From David Callu, "osgManipulator Object have not META_Object macro call in class definition.
> I add META_OSGMANIPULATOR_Object macro which define className, libraryName,
> isSameKindAs methods.
> Clone method is not appropriate for osgManipulator Object."
2009-03-11 11:29:00 +00:00
Robert Osfield
c58ff9b656 From Lionel Lagarde, "The copy constructor of the nodes and the drawables do :
Node::Node(Node &node, copyop) :
  _stateSet(copyop(node.getStateSet()),

It doesn't call the setStateSet method of osg::Node (or osg::Drawable). So the parent
list of the state set is not updated with the new node (drawable)."
2009-03-11 11:00:24 +00:00
Robert Osfield
06ef559d91 From Martin Beckett, added get/setScrollWheelZoomDelta() support for controlling the mouse scroll wheel zoom delta. 2009-03-11 10:50:03 +00:00
Robert Osfield
c3810e130b Converted tabs to four spaces 2009-03-11 10:34:29 +00:00
Robert Osfield
357d465d49 From Stephan Huber, "refactored the code and moved
some stuff out into DarwinUtils.h/.mm so both implementations can share
some of the code. There's even a bugfix for GraphicsWindowCarbon, which
fixes some issues with multiple windows on different screens."
2009-03-11 10:34:04 +00:00
Robert Osfield
529685c6b1 From Mathias Froehlich, "an other topic pointed out by some Microsoft verification tool:
On destruction of some static variables, the global referenced mutex is used
to lock access to the parent lists of state attributes, nodes and so on.
This even happens past the mutex is already destroyed.

This change to Referenced.cpp revision 9851 uses the same technique like the
DeleteHandlerPointer already in Referenced.cpp to return an zero pointer for
the global referenced lock if it is already destroyed."
2009-03-10 17:51:05 +00:00
Robert Osfield
5157f06bcd From Konstantin Matveyev, submitted by Valery Bickov:
"There is error in WoW shader, you can see it by this simple example:
osgviewer cessna.osg --wowvx-42 --clear-color 0,0,0

Clear color may be choosed any with at least one component equals to 0
or 1. In my case I see weird blinking between normal image and image
with depth map at right side on the screen."
2009-03-10 17:47:54 +00:00
Robert Osfield
9cccd087a8 From Martin Beckett, "Modified osgGA::TrackballManipulator so that osgGA::GUIEventAdapter::SCROLL performs a zoom.
Arbitrarily zooms 10% in/out for each click."

Note from Robert Osfield, flipped the orienation of the zoom to make the right mouse key zoom and the scroll wheel work in the same direction.
2009-03-10 17:39:46 +00:00
Robert Osfield
a0a06c8b2a Completed support for automatic detection of plugin features.
Cleaned up debug out of various plugins to ensure a clean osgconv --formats.
2009-03-10 17:27:39 +00:00
Robert Osfield
3ec2da76e8 quitened down debug info 2009-03-10 17:13:51 +00:00
Robert Osfield
c0863e96ca Made bool isImageTranslucent() const virtual to allow subclasses to provide their own implementation 2009-03-10 16:52:18 +00:00
Robert Osfield
287ff37b34 From Ralf Habacker, "The appended patch fixes this issue by adding a virtual method named supportedFeatures() to the class ReaderWriter, which could be overriden by a specific plugin to adjust the set of features.
Single features are implemented as bits asother enums in ReaderWriter class already does, so that combinations are possible and fast comparison operations are possible

By default all features are enabled.

I have added this virtual method to the dot plugin to get an idea how to use these features.

With this patch osgconv --formats shows an additional line 'features' for each plugin"
2009-03-10 15:00:39 +00:00
Robert Osfield
0669107287 From Roland Smeenk, "While working on the Collada plugin I noticed that all geometry created by the dae reader result in slow path geometry.
Because there already exists the option to convert slow path geometry to the fast path by computing an internal fast path alternative, I added a new optimizer option that automatically does this. To check the results I also made some changes to the statistics gathering and rendering.

Somewhat unrelated, but also part of the optimizer I disabled removal of CameraView nodes during RemoveRedundantNodes optimization.
As discussed on the ML, CameraViews were removed from the scenegraph. This solves that issue.

Summary:
-Geometry::areFastPathsUsed now also looks at internalOptimizedGeometry
-Added Optimize option to make all slow path geometry compute their internal fast path alternative
-Added fast geometry counter to the statistics
-Disabled removel of CameraViews in optimizer
"
2009-03-10 14:15:59 +00:00
Robert Osfield
9ddb8f65b6 Added copyright + fixed typo 2009-03-10 13:46:55 +00:00
Robert Osfield
b5a15fb5b4 From Stephan Huber,
"Attached you'll find a proposal for using different
protocols. The idea behind the new code is:

1.) plugins/apps register protocols which they can handle. This is done
via osgDB::Registry::registerProtocol(aProtocolName). Plugins register
supported protocols as usual via ReaderWriter::supportsProtocol(..), the
Registry is updated accordingly.

2.) osgDB::containsServerAddress checks first for an appearance of "://"
in the filename and then checks the protocol against the set of
registered protocols via Registry::isProtocolRegistered(aProtocollName)

3.) the other getServer*-functions changed as well, there's even a
getServerProtocol-function


With these changes filenames/Urls get routed to loaded plugins even with
different protocols than 'http'."
2009-03-10 12:21:13 +00:00
Robert Osfield
199067d150 From Martin Spott, compile fixes for IBM AIX. 2009-03-10 11:14:56 +00:00
Robert Osfield
9643c15346 From David Callu, "Problem:
osgText::Text and osgText::Text3D use the same font file.
     The first really load the file and obtain an osgText::Font object,
     the second use the cache created during the first load of the
     font file, and so obtain an osgText::Font object instead of
     osgText::Font3D object. To obtain an osgText::Font3D object,
     osgText::Text3D call osgDB::readObjectFile(...) with an option
     to specify the plugin we want an osgText::Font3D instead of
     osgText::Font.

Generalised Problem:
    In osgDB::Registry, loaded file cache is referenced by the name
    of this file, so if I load a file with some options, and the cache
    already contain object for this filename, I obtain an object
    potentially not loaded with my options.

Behaviours:
    Cache management is delegate to osgDB::Registry, but cache
    coherence (load a file with option then reuse it, deactivate the
    cache when load a specific file or don't cached the loaded file)
    is user's responsibility.

Text3D solution:
    Postfix the font file name by .text3d or something similar and then have the freetype plugin return
    osgText::Font3D when it detects this.
    This operation is done by osgText::readFont3DFile() which unsure the filename have .text3d as extension.
    This is totaly transparent for user, and backward compatible.


BTW, I fix the bug about the Normal of 3D text. Currently, the front and wall face have
the same normal (0,0,1) in the Text3D object coordinate. Now the wall face have its own
normal array computed by the plugin.

BTW 2, I implement
- void Text3D::accept(osg::Drawable::ConstAttributeFunctor& af) const
- void Text3D::accept(osg::PrimitiveFunctor& pf) const
so now statistics are well reported.
"
2009-03-10 10:56:00 +00:00
Robert Osfield
e7c4cda108 From Eric Wing and Stephan Huber, ImageIO code originally wrote by Eric Wing, and then later conveted into an OSG plugin by Stephan Huber. 2009-03-10 10:30:34 +00:00
Robert Osfield
5059aa808b From Stephan Huber, support for Cocoa windowing under OSX. 2009-03-10 10:13:20 +00:00
Robert Osfield
22c7ff353b Fixed osgWrappers for osgAnimation library 2009-03-09 23:11:23 +00:00
Robert Osfield
ae50d8d956 From Roland Smeenk & Cedric Pinson,
"Summary of changes:
From Roland
-Added MorphGeometry
-Bone Bindmatrix is only calculated if needed
-osgAnimation plugin now supports all available channel types (before only linear vec3 or quat channels)
-osgAnimation plugin now supports MorphGeometry
-osgAnimation plugin now supports animation and channel weights, animation playmode, duration and starttime
-removed osgAnimationManager.cpp from CMakeList

From Cedric
-fixed the last_update field (it was only updated at the first update) in BasicAnimationManager.cpp
- Refactore some part of MorphGeometry minor changes
- Add osganimationmorph as example
"
2009-03-09 17:38:39 +00:00
Robert Osfield
99477fa422 Tweaked API to get wrappers to build 2009-03-09 16:53:57 +00:00
Robert Osfield
f4b7a5b274 Updated wrappers 2009-03-09 16:17:57 +00:00
Robert Osfield
173357252b Further work on IncrementalCompileOperation 2009-03-09 14:56:20 +00:00
Robert Osfield
73c2615d17 Fixed thread exit problems 2009-03-08 16:48:48 +00:00
Robert Osfield
7473b06275 Preliminary work on general purpose incremental compile support in osgViewer. 2009-03-08 12:00:36 +00:00
Robert Osfield
43a081ee98 Updated wrappers and dev release version numbers 2009-03-05 15:31:03 +00:00
Robert Osfield
9eac90b8cb Cleaned up FindFFmpeg.cmake 2009-03-05 14:33:21 +00:00
Robert Osfield
fa14e7d5f2 Added quick proof of concept for live video streaming under linux 2009-03-05 10:57:54 +00:00
Robert Osfield
56330d5b29 Added search for headers in ffmpeg directory 2009-03-04 16:35:08 +00:00
Robert Osfield
273be5f0ae From Jean-Sebastien Guay, added non pkg-config based ffmpeg search scheme. 2009-03-04 16:16:07 +00:00
Robert Osfield
d2099da5cb Fixed indentation 2009-03-04 16:15:05 +00:00
Robert Osfield
6fd4cd4933 Removed boost reference and cleaned up debug output 2009-03-04 16:03:28 +00:00
Robert Osfield
ab82553f97 Introduced double buffering of video stream to avoid tearing of image.
Removed swapBufers call and image y inversion.
2009-03-04 14:49:39 +00:00
Robert Osfield
df2964c315 Added handling of ImageStream Origin to make sure the movie always appears the correct way up. 2009-03-04 13:24:36 +00:00
Robert Osfield
ac8ee3792c Fixes to non swscale code path 2009-03-04 11:59:15 +00:00
Robert Osfield
d0dabd2665 Fixed img_convert usage 2009-03-04 11:46:34 +00:00
Robert Osfield
4ffef96874 Removed reference to OpenAL plugin 2009-03-04 11:06:34 +00:00
Robert Osfield
fb54fd0a69 Added support for using libswscale 2009-03-04 11:05:55 +00:00
Robert Osfield
97e987a9d9 Added SDL audio path 2009-03-03 20:59:16 +00:00