Commit Graph

5219 Commits

Author SHA1 Message Date
Robert Osfield
66a1996a5a From Wang Rui, "I have just done some changes on the classic osgdb_gif plugin (based on OSG 2.5.0). I wish our developers may use the newly written GIF reading plugin to attach animate GIF files as textures now! In my opinion, a GIF is much smaller than AVI and MOVs, and much more efficient sometimes.
Changes includes:
1. A new GifImageStream class (inherit from osg::ImageStream and OpenThreads::Thread) have already been added to implement different operations of a GIF movie, such like playing, pausing, rewinding, setting time and so on.
2. Some small changes to decode_row() and gif_read_stream(), which make the transparency of GIF images correctly.
3. Just a few changes to the ReaderWriterGIF::readGIFStream() function, which ensure that animate GIFs are loaded by GifImageStream (and the function returns GifImageStream objects) and static GIFs unchanged (still use the old method and returns osg::Image objects!).
 
Attachments are the cpp file and an animate GIF file for further test. Just rebuild the osgdb_gif project and use osgviewer or osgmovie to view it.
The plugin has been tested on Windows and Arch Linux."
2008-05-27 10:50:26 +00:00
Robert Osfield
476cb5373e From Philip Lowman, post 1:
"Here is a collection of changes which should fix issues building the OSG with CMake 2.6.0 (along with some other changes)

CMakeLists.txt:
* Set CMP0003 to supress warning about linking against -lpthread (which is a
  non-absolute library location).  (CMake 2.6.x fix)
* Modified the WIN32_USE_MP and a couple of other Visual Studio specific flags
  to be in an IF(MSVC) block  (minor tweak to reduce exposing this stuff on MinGW builds)
* Includes my second set of glu tesselator autodetection changes that you
seemed to want but haven't committed yet.

src/OpenThreads/pthreads/CMakeLists.txt:
* Eliminates warning when compiling on Linux about spaces in link line (CMake 2.6.x fix)

CMakeModules/OsgMacroUtils.cmake:
* Tweaks to make the macros behave properly under CMake 2.6.0 (doesn't change behavior under CMake 2.4.x)

CMakeModules/Find3rdPartyDependencies.cmake:
* Adds the NO_DEFAULT_PATH option to all of the search options so that things in C:\Program Files\OpenSceneGraph aren't accidently picked up during configure time and instead only things in the "3rdParty" folder are discovered. (general bugfix)
"

post 2:
"Ok, hold the presses.  I just discovered that for some odd reason the osgdb_* plugins under Linux aren't getting put under the osgPlugins-2.5.0 folder.  Not exactly sure why this broke, the folder was there, just empty.  I'll have to look into it this evening."

post 3:

"Fixed, was caused by the switch to CMAKE_LIBRARY_OUTPUT_DIRECTORY and some code in osgPlugins/CMakeLists.txt that effectively overrides LIBRARY_OUTPUT_PATH on non-MSVC compilers to dump the plugins in the plugins folder.  I tweaked it to override CMAKE_LIBRARY_OUTPUT_DIRECTORY as well.  Seems to work fine."
2008-05-26 22:36:58 +00:00
Robert Osfield
51dd9676db From Paul Martz, "When exporting a DrawArrays PrimitiveSet, the DAE plugin computes an incorrect nbVerticesPerPoly if the first index is not zero. The issue can be reproduced easily with:
osgconv cessna.osg cessna.dae
 
Examination of the resulting .dae file reveals several out-of-range tristrip indices; viewing the .dae file in osgviewer causes a crash when OSG tries to lookup those indices.
 
Attached resolves this issue."
2008-05-26 22:34:06 +00:00
Robert Osfield
804c91c8c1 From Art Tevs, "I've attached a patch for the Texture2DArray which solves problems of loading image data into the texture array. So here are a small description:
- Solves issues of loading image data into the texture memory
- Print a warning if images are of different dimensions or have different internal formats (GL specification requires images to be the same)


Patch is tested and seems to work fine. It shouldn't break any other functionality. It should go into include/osg and src/osg
"
2008-05-26 21:53:57 +00:00
Robert Osfield
4c81aa0aa7 From Paul Martz, "The attached code changes StateSet::merge() so that it copies RenderBin data such as the rendering hint and RenderBin details from rhs into "this", only if "this" has RenderBin mode set to INHERIT.
It replaces a comment by you indicating something along these lines should be done. To me, this seems like the right thing to do."
2008-05-26 21:33:41 +00:00
Robert Osfield
8f6ca1dc6c From Gino, "According to the 1.4.1 COLLADA spec (2nd ed) the standard behavior for fx_sampler_wrap_common is as follows
CLAMP ->GL_CLAMP_TO_EDGE
NONE->GL_CLAMP_TO_BORDER

The current 2.5.0 daePlugin assumes the following binding

CLAMP ->GL_CLAMP
NONE->GL_REPEAT

Notably the GL_CLAMP binding will result in visible black seams on input files that use otherwise matching textures. Replacing GL_CLAMP by GL_CLAMP_TO_EDGE solves this problem. I've updated both the read and write functions.
"
2008-05-26 21:32:05 +00:00
Robert Osfield
3d163c3412 Updated wrappers 2008-05-26 21:10:10 +00:00
Robert Osfield
189049f9bd From Colin McDonald, "I had to tighten a declaration in OpenFlight/FltWriteResult.h, as the Solaris SunStudio 11 compiler was being picky and wouldn't compile." 2008-05-26 21:04:47 +00:00
Robert Osfield
55e98d390e Added debug block to output the location of the master camera for each View in a Viewer. 2008-05-26 20:46:21 +00:00
Robert Osfield
cac6e2facb Added continuous recording of the animation path to the RecordAnimationPathHandler 2008-05-26 17:30:43 +00:00
Robert Osfield
9623731185 Added RenderStage::setClear*() methods from Camera::getClear*() sources 2008-05-24 09:24:37 +00:00
Robert Osfield
6a16cbfca4 Reorginaized the DatabaseQueue's to avoid warnings under Windows 2008-05-22 12:38:36 +00:00
Robert Osfield
e6e4074143 Fixed warning by adding in missing return 2008-05-22 11:21:04 +00:00
Robert Osfield
58f5ebab19 Checking in missed header 2008-05-22 08:31:56 +00:00
Robert Osfield
7b003b24ea Refactored DatabasePager and related classes to introduce support for
multi-threaded paging, where the Pager manages threads of reading local
and http files via seperate threads.  This makes it possible to smoothly
browse large databases where parts of the data are locally cached while
others are on a remote server.  Previously with this type of dataset 
the pager would stall all paging while http requests were being served,
even when parts of the models are still loadable virtue of being in the 
local cache.

Also as part of the refactoring the DatabaseRequest are now stored in the
ProxyNode/PagedLOD nodes to facilitate quite updating in the cull traversal,
with the new code avoiding mutex locks and searches.  Previous on big 
databases the overhead involved in make database requests could accumulate
to a point where it'd cause the cull traversal to break frame.  The overhead
now is negligable.

Finally OSG_FILE_CACHE support has been moved from the curl plugin into
the DatabasePager.  Eventually this functionality will be moved out into
osgDB for more general usage.
2008-05-21 21:09:45 +00:00
Robert Osfield
100cc12ecb Moved the compile to after the updateSceneView 2008-05-20 09:28:44 +00:00
Robert Osfield
24fec21002 Updated wrappers 2008-05-14 20:22:01 +00:00
Robert Osfield
646fc43747 Introduced preliminary support for asynchronous file read requests,
ReaderWriter::ReadResult now has a FILE_REQUEST enum.
  ReaderWriter::Options now has a s/getAsynchronousFileReadHint() parameter methods.

  libcurl based plugin now detects enabing of the AsynchronousFileReadHint, but
  as yet does not handle async requests - handling everything syncronously.
  
  DatabasePager now by default will enable AsynchronousFileReadHint for http
  based file requests
2008-05-14 17:03:57 +00:00
Robert Osfield
d7c4e6f26e Moved the cache file writing into StreamObject so that the cache file is only
created once data is being read.
2008-05-14 14:59:50 +00:00
Robert Osfield
6be1928447 Introduced a thread safe map which manages a single EasyCurl object per thread. 2008-05-14 13:16:36 +00:00
Robert Osfield
094dcd9bfd Refactor curl usage so that a new EasyCurl class wraps up the curl handle and
reading from curl.
2008-05-14 12:47:26 +00:00
Robert Osfield
83f6f13914 Added --file-cache directoryname command line option support to readNodeFiles(ArgumentParser&)
to make it easier to specify a local file cache, in place of the default OSG_FILE_CACHE
env var.
2008-05-13 14:08:32 +00:00
Robert Osfield
f3d36055ef From Steven Thomas, "Subject: Collada fix
There was a problem converting a file to Collada by using osgconv like this:

osgconv file.osg file.dae

You would get an error message:

I/O error : Permission denied
I/O error : Permission denied
error : xmlNewTextWriterFilename : out of memory!
Error: daeLIBXMLPlugin::write(file://cessna.dae) failed
Warning: Error in writing to "cessna.dae".

This was due to some bad URI processing code in the Collada plugin. The attached file fixes this by using the Collada DOM's URI processing functions. After this change the file will convert successfully in the local directory.
"
2008-05-13 10:56:10 +00:00
Robert Osfield
61f630e163 Added missing getBound() method 2008-05-12 15:42:20 +00:00
Robert Osfield
7e8e7587be Update ChangeLog and wrappers for 2.5.0 dev release 2008-05-12 12:16:58 +00:00
Robert Osfield
7a074acd49 From Mathias Froehlich, Fixed FrameBufferObject attachement code to handle cases
where no texture or image is attached
2008-05-12 11:39:02 +00:00
Robert Osfield
965c72f5bd From Eric Sokolowski and Robert Osfield, moved command line option usage setup
from osgviewer example into osg::ArgumentParser and osgViewer::Viewer to make
them more universally available.
2008-05-12 10:55:55 +00:00
Robert Osfield
61cb0833b9 From Bob Kuehne, "* add easy multiple texture targets support for obj by refactoring texture
load into it's own method.

* use new method from step 1 to load 'map_opacity' textures from .mtl files"
2008-05-12 10:18:41 +00:00
Robert Osfield
a7e5972f82 Added CARIO_FOUND into svg plugins checks 2008-05-11 14:26:27 +00:00
Robert Osfield
13acf6420f From Miguel Escriva, Here you will find a SVG Image Reader. It renders a SVG file as an osg::Image using cairo and rsvg. 2008-05-11 14:23:19 +00:00
Robert Osfield
412717c151 From Paul Martz, "This change adds support for osg::Billboards to the OpenFlight exporter.
It might seem odd that the change actually removes the stub apply(Billboard&) method, but it turns out Billboards are easily supported in subordinate routines of the existing apply(Geode&) method with s dynamic_cast, so there's no need for a separate apply(Billboard&)."
2008-05-10 17:25:42 +00:00
Robert Osfield
e9589ebb49 From Paul Martz, "Another round of plugin enhancements.
3DC: Output now uses osg::notify.
JPEG: Now returns correct error code for empty input file.
FreeType: Prevent possible crash if Options is NULL."
2008-05-10 17:23:12 +00:00
Robert Osfield
4d7b2edd4c Moved compile setup from osgViewer::ViewerBase into osgViewer::Renderer to
avoid threading issues associated with compile running in a parallel with 
update/cull on the first frame.

Also added automatic recompile when a new SceneData is applied to a View.
2008-05-10 17:04:02 +00:00
Robert Osfield
ebf653369a From Art Trevs, set the _geometryVerticesOut to default to 1 as a workaround
for OpenGL driver bug that incorrectly reports a warning when value is 0.
2008-05-09 11:54:24 +00:00
Robert Osfield
61e3285ffc From Paul Martz, "Attached are some minor plugin fixes. PNM, RGB, and JPEG would all crash if attempting to read an empty file, and FLT would go into an infinite loop. All are fixed with this change.
I also fixed some return values for a couple of these, changing FILE_NOT_HANDLED to ERROR_IN_READING_FILE where appropriate."
2008-05-09 11:27:03 +00:00
Robert Osfield
f733bf17e9 Added missing check against handling invalid bounding sphere's 2008-05-08 17:02:08 +00:00
Robert Osfield
59653bcc08 From Eric Sokolowsky, "I found one compilation error in OSG 2.4 in the Inventor plugin, where one node (SoTextureCoordinate3) was assumed to be available in all versions of Inventor but is actually only available in Coin. The use of the node is now protected by #ifdef __COIN__ constructs. The attachment is based on OSG 2.4, not SVN." 2008-05-08 16:48:49 +00:00
Robert Osfield
9e6c3a7628 From Melchior Franz, "In KDE I switch desktops with Super-Tab, and occasionally I
get an excess Tab key report when switching back to an OSG
application (usually FlightGear :-). Although KDE has consumed
the Tab, it's sometimes still in the XKeymapEvent's key_vector,
and followed by a Tab KeyRelease event.

Avoid this artifact by
- asking for a "fresh" keymap (via XQueryKeymap()), rather than
 using the unreliable(?) XKeymapEvent's key_vector, and by
- flushing all key events on focus-in (to avoid the KeyRelease)

After Super-press, Tab-press, Super-release, Tab-release (note
the wrong release order!) I still get an extra Tab event. But
this is not surprising and not exactly wrong either. Also it's
hard to avoid, as we can't see what happened to the keyboard
before we regained focus.

Files changed:
 src/osgViewer/GraphicsWindowX11.cpp
 include/osgViewer/api/X11/GraphicsWindowX11"
2008-05-08 16:45:59 +00:00
Robert Osfield
ebf3804c84 From Sebastien Messerschmidt, "attached you'll find a patch for the shp-plugin.
I've spotted huge memory leaks int ShapeParser and fixed them.
Also, there was a missing destructor (PolygonM) and a missing member initialization (PolygonZ)
Would be nice if someone could test the changes.

To release the memory just if no reading error happened (and therefore the arrays would be valid) I've added an macro to release and reset the pointers at once. I'm not using macros myself very often as I don't like them, but I think it doesn't hurt in this code.

"
2008-05-08 15:17:53 +00:00
Robert Osfield
b9359048d6 From Raymond de Vries, "This fix tests the right variable before it is allocated. Fortunately, until now it tested another variable (_particleSizeUniform, which is, at that moment, not allocated as well) and everything went ok. So it does not fix a crash or so, it is a matter of correct code.
Line 353 is changed from

if (!_particleSizeUniform)

to

if (!_particleColorUniform)
"
2008-05-08 14:00:00 +00:00
Robert Osfield
6d61e554b4 From Paul Martz, "As I discovered prior to the 2.4 release, the FLT export geometry backend was using some old turn-on code, originally written just to enable other development but not intended for actual release. Sadly, my OSG training commitments prevented me from fixing this prior to 2.4.
In essence, the FLT exporter was emitting a full set of Mesh records each time it encountered a PrimitiveSet.
 
Attached is a fix. The code now emits the Mesh set up records, then iterates over all PrimitiveSets and emits a Mesh Primitive record per PrimitiveSet.
 
It also loops over PrimitiveSets twice, first writing Face records according to the mode, the writing Mesh records (again according to the mode).
 
The final change included here is support for GL_POINTS as single-vertex Face records.
 
Billboards are still to come."
2008-05-08 13:56:28 +00:00
Robert Osfield
0df8d414f4 Updated wrappers 2008-05-08 13:46:58 +00:00
Robert Osfield
973f104704 From Garrett Potts and Robert Osfield, changes to build against Collada DOM 2.x 2008-05-08 12:36:07 +00:00
Robert Osfield
5fbb582856 Commented out checking of DISPLAY env var 2008-05-07 17:06:36 +00:00
Robert Osfield
fd6a812dd0 Updated wrappers 2008-05-07 14:32:39 +00:00
Robert Osfield
96f2062115 From Miguel Escriva, "Attached to this mail you will find some files to work with the Philips WOWvx displays.
It's implemented in the same way that 3D Spherical Display and Panoramic Spherical Display.

You can test it running:
   osgviewer --wowvx-20 cow.osg
   osgviewer --wowvx-42 cow.osg
depending on the size of your Philips WOWvx display (20" or 42")

Other arguments you can use to control the 3D effect are:

--wow-content <value>
   This value defines the kind of content that can be:
      0: No depth
      1: Signage
      2: Movie
      3: CGI
      4: Still

--wow-factor <value>
   Percentage of the display recommended depth value. Default 64, Range [0-255]

--wow-offset <value>
   Amount of range behind the screen. Default 128, Range [0-255]
      0: Range is shifted in the direction of the viewer.
      128: Range is equally divided in front and behind the screen.
      255: Range is shifted away from the viewer.
      "
2008-05-07 14:17:15 +00:00
Robert Osfield
10c3044499 From Farshid Lashkari, "I've added hardware mipmap support to Texture3D." 2008-05-07 13:42:29 +00:00
Robert Osfield
e70d44e6a5 Added cast to avoid warning 2008-04-25 08:34:54 +00:00
Robert Osfield
6883c12ceb From Colin Dunlop, added alias for .live to quicktime plugin mapping. 2008-04-24 14:46:21 +00:00
Robert Osfield
78964b4baa Reverted the changes for ill fated tweaks for Apple build 2008-04-24 11:34:43 +00:00