Commit Graph

7594 Commits

Author SHA1 Message Date
Robert Osfield
cc348f86cb Moved Performer and Inventor plugins into block protected to only compile when not using GLES. 2010-12-14 08:58:27 +00:00
Robert Osfield
bf6d45a531 Have moved gecko plugin to deprecated 2010-12-13 17:36:02 +00:00
Robert Osfield
543b2ee56e Added resizeGLObjectBuffers(uint) and relaseGLObjects(State*) to BufferData. 2010-12-13 17:09:31 +00:00
Robert Osfield
eb9510eb72 Moved GraphicsWindowQt from osgviewerQtContext into osgQt. 2010-12-13 16:25:50 +00:00
Robert Osfield
c665fdc973 Form Richard Schmidt, "The following features were added:
* the glsl plugin now supports processing #includes. The file extension sets the shader type.

* the registry releases gl objects of the shared state manager
 "
2010-12-13 12:16:57 +00:00
Robert Osfield
ea5d88e54f Added TODO notes 2010-12-12 10:00:57 +00:00
Robert Osfield
d9ab15bd4c From Wojciech Lewandowski, added docs on Swap Method env vars and command line options 2010-12-12 09:58:45 +00:00
Robert Osfield
c12b04368a From Trajce Nikolov, "attached is a fix for the txp loader (in TileMapper). The code was giving wrong parent tile ids using the stack - I implemented differnt approach for that" 2010-12-12 09:52:29 +00:00
Robert Osfield
244e751146 From David Fries, "The ffmpeg lockmanager was introduced in ffmpeg 52 30 1, but
later backported to 52 20 1, so add that to the version check
in ReaderWriterFFmpeg.cpp."
2010-12-12 09:40:16 +00:00
Robert Osfield
b4dad9bac3 From David Fries, "Avoid a terrapage crash with outstanding
requests to a removed archive file.  ReaderWriterTXP::getArchiveName
will create an archive if it doesn't exist.  This is causing a crash
if the terrain is removed and there are outstanding database requests
in the database pager.  The request will create a new archive, and as
the archive is newly create doesn't have the materials etc to support
the subtile that was just loaded.  To fix the problem getArchiveName
will only return existing archives.  createArchiveName was added to
create archives.
"
2010-12-12 09:37:14 +00:00
Robert Osfield
df5210f729 From Wang Rui, "I've found a possible bug in the new SmoothingVisitor implementation
(with a great 'crease angle' feature), which will crash if the normal
array is already set but without BIND_PER_VERTEX. I just believe that
we should reallocate the normal array in these cases, as the old
implementation does.
"
2010-12-12 08:56:58 +00:00
Robert Osfield
09ebb061c2 From Cedric Pinson, "Here a small fix about gdal plugin used to read dem file, if you dont
setup the log level to INFO it does not work. It's because of this line:
OSG_INFO << "   GetGeoTransform == "<<
dataset->GetGeoTransform(geoTransform)<<"

I have just put the function outside of an stream stuff, and it works.
It's possible we have other code like that in other plugins, I guess
it's a side effect of the MACRO stuff about notification."
2010-12-11 15:12:09 +00:00
Robert Osfield
017a03ffe5 Refactor of DatabasePage/IncrementalCompileOperation to use the IncrementalCompileOperator for compiling objects 2010-12-10 15:27:19 +00:00
Robert Osfield
c040b25699 Build fixes to keep up with changes in head inclusions/API in osgDB 2010-12-10 13:22:21 +00:00
Robert Osfield
3d67b7a7eb From Ulrich Hertlein, "attached are patches to osgTerrain that fix some typos and add a bit of documentation.
"
2010-12-08 10:34:29 +00:00
Robert Osfield
ebeed76643 Added protection against the Registry from being deleted prior to the proxy objects unregistering themselves 2010-12-08 09:54:23 +00:00
Robert Osfield
1b42084217 Fixes for benign threading memory contentions. 2010-12-08 09:52:58 +00:00
Robert Osfield
b2cf978ae3 Renamed YES and NO enums with more description names that don't overlap with iOS #define's 2010-12-06 10:35:02 +00:00
Robert Osfield
bc4f2c1209 From Johannes Bauerle, "When trying to use the osgText functionality in an osg application built without support for the fixed function pipeline I got a lot of warning messages about invalid calls.
I found two indirect calls to the glTexEnv in the file Text.cpp:

state.applyTextureAttribute(0,getActiveFont()->getTexEnv());

In the attached fix I surrounded these calls with #ifdef's checking for OSG_GL_FIXED_FUNCTION_AVAILABLE to ensure that the above function is only called when the fixed function pipeline is available.
"
2010-12-03 17:50:38 +00:00
Robert Osfield
c70679107d Removed redundent call. 2010-12-03 17:20:32 +00:00
Robert Osfield
9df56ad858 Commented out debug message 2010-12-03 14:24:23 +00:00
Robert Osfield
06509b9769 Introduced bool Texture2D::textureObjectValid(State) and bool SubloadCallback::textureObjectValid(Texture2D&,State&) method to make it tell Texture2D::apply() whether the texture object is still valid or whether it's no longed valid for the any changes to the image attached to the Texture 2010-12-03 14:18:16 +00:00
Robert Osfield
0754a78ddb From Ulrich Hertlein, "Attached; here's a summary of the changes:
- CMakeLists.txt
-- don't look for GL when compiling for iOS (device or simulator), look for OGLES instead
-- use architecture i386 for simulator
-- removed iphoneos-version-min for simulator

- examples/osgviewerIPhone/CMakeLists.txt
-- added build dependencies for osgdb_osg, osgdb_freetype, osgdb_imageio
-- added framework QuartzCore link dependency

- src/osgDB/CMakeLists.txt
-- don't link against Carbon on iOS (device or simulator)

- src/osgPlugins/freetype/CMakeLists.txt
-- don't link against OpenGL on iOS device or simulator

- src/osgViewer/CMakeLists.txt
-- link against OpenGLES on iOS (device or simulator)

- src/osgPlugins/imageio/CMakeLists.txt
-- compile ReaderWriterImageIO_IOS.cpp as Objective-C++

"
2010-12-02 14:20:52 +00:00
Robert Osfield
65aee287e7 From Mathias Froehlich, "Attached are most of the fixes that are required to build osg on solaris and
hpux. I have skipped irix this time as irix is too dead to keep osg building
there.

As usual, solaris does not like member templates in stl containers.
Some headers missing and link problems due to missing libraries."
2010-12-02 14:13:54 +00:00
Robert Osfield
88a76e7b69 From Brad Christiansen, commented out debug messages 2010-12-02 13:53:10 +00:00
Robert Osfield
ca0a556579 Removed redudent makeCurrentImplementation() that was causing a crash in osgscreencapture. 2010-12-02 09:39:31 +00:00
Robert Osfield
78b15f8e17 From Fabien Lavignotte, "I use Texture2D::copyTexImage2D to generate some textures at each frame on a PagedLOD databases.
There was some performance problems after a long run, because textures created with copyTexImage2D were not reused.
After investigation, there is a problem with the Texture Pool when a texture object is created with an empty profile, and then move after creation to TextureObjectSet with good profile using setAllocated method.
I have just changed a little bit the code of Texture2D::copyTexImage2D, to generate the texture object with the good profile at the start."
2010-12-01 13:33:31 +00:00
Robert Osfield
9c0e56d7a0 From "Matthew Roberso, I've attached a small fix to the src/osgWrappers/serializers/osg/Texture2DArray.cpp against the svn head r11965 it simply calls setTextureDepth before attempting to load the individual textures into the array. Currently without that the loading fails with the following printout "Warning: Texture2DArray::setImage(..) failed, the given layer number is bigger then the size of the texture array." and the texture array is empty if loaded from an osga/b." 2010-11-30 16:22:37 +00:00
Robert Osfield
e9cd13f120 Fixed the readObject method so it could handle reading from a file contains any valid type of osg::Object 2010-11-30 14:36:37 +00:00
Robert Osfield
55749eda59 Added passing of existingObj parameter 2010-11-30 12:34:06 +00:00
Robert Osfield
a7ff553925 From Stephan Huber, compile fix for iOS 2010-11-30 11:34:33 +00:00
Robert Osfield
5723050580 From Ulrich Hertlein and Stephan Huber, improves to iOS build 2010-11-30 09:26:18 +00:00
Robert Osfield
e5a9eaa711 From Tim Moore, "Here is initial support for uniform buffer objects. The binding between a buffer object and an indexed target is implemented as a new StateAttribute, UniformBufferBinding. I've included an example program based on the code in the ARB_uniform_buffer_object specification.
A few things remain to do:
* The binding between a uniform block in a shader program and a buffer indexed target number is fixed, like a vertex attribute binding. This is too restrictive because that binding can be changed without relinking the program. This mapping should be done by name in the same way that uniform values are handled i.e., like a pseudo state attribute;

* There's no direct way yet to query for the offset of uniforms in uniform block, so only the std140 layout is really usable. A helper class that implemented the std140 rules would be quite helpful for setting up uniform blocks without having to link a program first;

* There's no direct support for querying parameters such as the maximum block length, minimum offset alignment, etc. Having that information available outside of the draw thread would make certain instancing techniques easier to implement."
2010-11-29 17:43:27 +00:00
Robert Osfield
0739c15e0a Removed deperecated variables that are no longer used. 2010-11-29 09:32:43 +00:00
Robert Osfield
b523cb15c1 From Tomas Holgarth and Stephan Huber, "
attached you'll find the second part of the IOS-submission. It contains

* GraphicsWindowIOS, which supports external and "retina" displays,
 multisample-buffers (for IOS > 4.0) and multi-touch-events
* an ios-specific implementation of the imageio-plugin
* an iphone-viewer example
* cMake support for creating a xcode-project
* an updated ReadMe-file describing the necessary steps to get a
 working xcode-project-file from CMake

Please credit Thomas Hogarth and Stephan Huber for these changes.

This brings the ios-support in line with the git-fork on github. It
needs some more testing and some more love, the cmake-process is still a
little complicated.

You'll need a special version of the freetype lib compiled for IOS,
there's one bundled in the OpenFrameworks-distribution, which can be used."

Notes, from Robert Osfield, modified CMakeLists.txt files so that the IOS specific paths are within IF(APPLE) blocks.
2010-11-26 18:19:28 +00:00
Robert Osfield
d8d47199f2 From Katharina Plugge, fix for regression in handling of multitexturing. 2010-11-26 17:37:42 +00:00
Robert Osfield
b9ae28d344 From Eduardo Poyart, OSG patch: made it read ancillary IndexedStrings into MultiSwitch 2010-11-26 17:35:06 +00:00
Robert Osfield
ebfcb17744 From Marin Platings and Robert Osfield, fix of Uniform unique ID by making osg::Object::setName() virtual. 2010-11-26 13:54:11 +00:00
Robert Osfield
4820157fed From Martin Beck, "
recently we noticed a little mistake for 3DS files using instances of the same meshs: Every groupnode gets the same name instead of the (correct) instance name of the object. The fix only consists of two additional lines which check whether an instance_name is given for the object and then uses this one instead of the node name."
2010-11-26 12:44:53 +00:00
Robert Osfield
896b8c58d4 From Fabien Lavignotte, "There was a small bug when using the new serializer with AnimationPath. The serializer assumes NO_LOOPING is the defaut for LoopMode, but in fact it is LOOP.
The new serializer avoids to write default values in text mode, so the loop mode is not always correctly set."
2010-11-26 12:23:56 +00:00
Robert Osfield
d7b161078a From Thomas Hogarth and Stephan Huber, "attached you'll find part one of iphone-support. It includes
* support for NPOT-textures on IOS
* support for FBOs (only renderToTexture for now) on IOS (should work
for other OpenGL ES 1/2 targets, too)
* FileUtils-support for IOS"
2010-11-25 16:06:04 +00:00
Robert Osfield
1bd55d732d From Tim Moore, fix to stats timing 2010-11-25 13:00:24 +00:00
Robert Osfield
cdfbb7a753 From Michael Platings, To address performance bottleneck that occurs when using large number of uniforms introduced a name to uniqued ID scheme for Uniforms so comparisons can be done on a uint rather than a string. 2010-11-25 12:30:38 +00:00
Robert Osfield
c89c2502ed Removed default assignement of GeometryTechnique as the TerrainTechniquePrototype. 2010-11-25 11:40:09 +00:00
Robert Osfield
c1da825a7b From Wang Rui, "I'd like to provide a quick updates of the new tessellation shader
serializers and dotosgwrappers. It includes reading/writing supports
for the two new shader types and the GL_PATCHES enum. The
setParameterfv() method is not wrapped at present because it is still
not finished.

Enum serialziers don't require back-compatibility checks if only
add/remove enum items, so I'm not going to use the new
UPDATE_TO_VERSION macro this time."
2010-11-24 20:26:08 +00:00
Robert Osfield
1a227bf35e From Jean-Sebastien Guay, build fixes for windows. 2010-11-24 20:20:57 +00:00
Robert Osfield
5c97f0a7ed Added workaround for AMD/ATI driver bug 2010-11-24 17:01:09 +00:00
Robert Osfield
043ae090a5 From Tim Moore, Fix for drivers that don't properly support timer extensions.
""
2010-11-24 10:38:28 +00:00
Robert Osfield
e2a315ee49 From Wojciech Lewandowski, "1: fix for a issue with MinimalShadowMap and LightSpacePerspectiveShadowMapVB techniques ignoring minLightMargin parameter.
2: minor tweak for a DebugHUD drawn improperly case when multiple slave views  shared one window. It now uses slave view viewport to correctly position DebugHUD.
3: deactivated ConvexPolyhedron notifications (they were accidentaly activated when you replaced osg::notify calls with OSG_NOTIFY macro). These warnings are useful only for shadow map developer working on shadow volume optimizations. So there is no sense in having them active all the time."
2010-11-24 10:09:04 +00:00
Robert Osfield
0ee0aad0fe Moved TextNode from osgText into example/osgtext3D in prep for 3.0 2010-11-23 17:33:43 +00:00
Robert Osfield
d7747685b3 From Holger Helmich, Tessellation shader support 2010-11-23 14:50:31 +00:00
Robert Osfield
5b3691e602 From David Callu, "Here a fix for pssm.
Problem 1 :
With GLSL, multi pass to apply each shadow map is not required.


Problem 2 :
GLSL code use "shadow2DProj" build-in function to look up in shadow texture.
Projection is orthogonal so "shadow2D" build-in function is sufficient.

Problem 3:
Bad calcul in
osgShadow::ParallelSplitShadowMap::calculateLightViewProjectionFormFrustum(..)
provide some visual error in specific configuration.


to reproduce pssm_bug.jpg, you need to add a light direction in osgshadow.cpp example (done in joint osgshadow.cpp file)
then "osgshadow --noUpdate --pssm --maxFarDist 500 --minNearSplit 500 --mapcount 6 --debug-color  model_test.3ds"


As you can see in pssm_bug.jpg and pssm_fix.jpg, performance is really better when Problem 1 is fixed.
"
2010-11-23 11:11:58 +00:00
Robert Osfield
04b6a0888b Build fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF 2010-11-22 19:38:18 +00:00
Robert Osfield
ca9771f7ba Fixed typo 2010-11-22 19:18:00 +00:00
Robert Osfield
78cdf41d53 From Michael Platings, "the build is broken if you have the OSG_REF_PTR_IMPLICIT_OUTPUT_CONVERSION turned off - the attached files fix this." 2010-11-22 17:37:35 +00:00
Robert Osfield
e36c4d3a3b From Stephan Huber, "attached you'll find a proposal for handling multi-touch-events with
osgGA. My approach is to bundle all touchpoints into one custom data
structure which is attached to an GUIEventAdapter.

The current approach simulates a moving mouse for the first touch-point,
so basic manipulators do work, sort of.

I created a MultiTouchTrackballManipulator-class, one touch-point does
rotate the view, two touch-points pan and zoom the view as known from
the iphone or other similar multi-touch-devices. A double-tap (similar
to a double-click) resets the manipulator to its home-position.

The multi-touch-trackball-implementation is not the best, see it as a
first starting point. (there's a demo-video at http://vimeo.com/15017377 )"
2010-11-22 17:30:44 +00:00
Robert Osfield
27afe58f77 Fixed indentation 2010-11-22 15:52:20 +00:00
Robert Osfield
0235448cd1 From Johan Nouvel, "I've attached ReaderWriterVRML2.h. It is the same as the previous one, I've just add supportsOption() calls." 2010-11-22 11:31:35 +00:00
Robert Osfield
9b70348ced Fixed typo of commercial 2010-11-22 11:22:03 +00:00
Robert Osfield
1d7222f59f From Hartwig Wiesmann, fix to font search path under OSX. 2010-11-22 10:41:04 +00:00
Robert Osfield
f103d02cf7 From Katherina Plugge, "if using multitexturing and converting osg files to OpenFlight texture coordinates get corrupted. The texture coordinates for slot 1 and following are not computed correctly (see thread http://forum.openscenegraph.org/viewtopic.php?t=6993).
The attached files solve the problem.
"
2010-11-19 18:26:02 +00:00
Robert Osfield
92d6daaf70 Commented out debug output 2010-11-19 17:47:53 +00:00
Robert Osfield
426d2a50d8 Update Text wrappers to handle new Color member 2010-11-19 09:57:56 +00:00
Robert Osfield
5849634082 Moved text color into TextBase, added support for colour into Text3D 2010-11-18 17:59:55 +00:00
Robert Osfield
a5b83edc76 Added resetting of the freetype size when getting Glyph3D glyph's as otherwise use of 2D and 3D Text would cause incorrect text sizing. 2010-11-18 17:18:31 +00:00
Robert Osfield
265673bacc Improved handling of pending orphaned texture objects and max texture pool size. 2010-11-18 12:03:06 +00:00
Robert Osfield
c005e46d16 From Jean-Sebastien Guay, Changed debug info in State::frameCompleted() to OSG_INFO 2010-11-17 14:06:26 +00:00
Robert Osfield
07c4cfd97d From Sherman Wilcox, "added the following to the ADD_LIBRARY
list -- ${OPENSCENEGRAPH_VERSIONINFO_RC}"
2010-11-15 17:21:30 +00:00
Robert Osfield
4dd9de7f13 Fixed warnings 2010-11-12 11:04:53 +00:00
Robert Osfield
e1ee96b3f2 Fixed crash on intialization of static applications by moving the static mutexes inside singleton methods. 2010-11-12 09:48:21 +00:00
Robert Osfield
6cc7e109d3 Moved finding of RSVG, Poppler-glib and GtkGl out into their own Find*.cmake modules to enable easier specialization. 2010-11-11 16:51:46 +00:00
Robert Osfield
bda7ef8179 From Wang Rui, "I've finally completed the static build support for dotosg wrapper and
serialization libraries. My submission mainly includes:
1. Add two new macros USE_DOTOSGWRAPPER_LIBRARY and
USE_SERIALIZER_WRAPPER_LIBRARY. Applications using static OSG must
include corresponding static-link libraries and use these two macros
to predefine native format wrappers. Please see osgstaticviewer and
present3D in the attachment for details.

2. Add a LibraryWrapper.cpp file in each
osgWrappers/deprecated-dotosg/... and osgWrappers/serializers/...
subfolder, which calls all USE_...WRAPPERS macros inside. The
LibraryWrapper file is automatically generated by the
wrapper_includer.cpp (with some slight fixes), which is also attached
for your reference. The deprecated-dotosg/osgAnimation is not included
because it doesn't us REGISTER_DOTOSGWRAPPER to define its wrappers.

3. Modify the ReaderWriterOSG.cpp to prevent calling loadWrappers()
when static build.

4. An uncorrelated fix to Serializer and ObjectWrapper.cpp, which
ensures version variables of serialziers are initialized, and
serializers out-of-version are not written to model files.
"
2010-11-11 11:47:24 +00:00
Robert Osfield
a80c458285 From Mark Sciabica, "It's not Windows API calls that are causing the problem. It's a new
templated constructor of std::pair not being able to automatically
convert 0 to a pointer. Rather than use preprocessor checks and
#defines, I think a cleaner solution is to cast the std::pair arguments
to the appropriate types to help the compiler out. I attached an updated
version of the file implementing this."
2010-11-11 10:42:41 +00:00
Robert Osfield
68f37c4dcb From Tim More and Robert Osfield, implementation of ARB_timer_query based GPU timing stats syncronization.
Initial email from Tim : "I've implemented using a timestamp, available with ARB_timer_query and OpenGL 3.3, to gather GPU stats. This is nice because it can accurately fix the GPU draw time with respect to the other times on the stats graph, rather than having to estimate the wall time of the end of GPU drawing. This also prevents anomalies like the GPU phase starting before the draw phase..."
Changes to Tim's submission by Robert:  Removal of need for swap buffer callback in ViewerBase.cpp, by
integrating a osg::State::frameCompleted() method that does the stats timing collection.  Introduction of a
GraphicsContext::swapBuffersCallbackOrImplementation() method that calls the State::frameCompleted() and
the swap buffers callback or the swapImplementation as required.
2010-11-10 16:58:58 +00:00
Robert Osfield
40c6d99c15 From Mourad Boufarguine, "This is a small fix to osg::createGeodeForImage to adapt Tex coords to image origin.
"
2010-11-10 12:50:06 +00:00
Robert Osfield
5868022ca1 Added traversal of salve camera subgraphs when the slave camera doesn't share it's scene graph wiht the View's master scene graph. 2010-11-09 17:17:13 +00:00
Robert Osfield
ae27b4caaf From Wang Rui with small tweak from Robert Osfield, fix of memory leak in gif plugin when using GifImageStream 2010-11-09 15:48:46 +00:00
Robert Osfield
b7cccf6258 Refactored the versioning of serializers so it now uses a _firstVersion and _lastVersion make it possible
to specify what range of versions support each serializer.
2010-11-09 13:23:43 +00:00
Robert Osfield
b8a94a6d4e From Wang Rui, "I'd like to submit my latest modification of the serialization IO
functionalities. It includes two main parts: a version checking macro
for handling backward-compatiblity since 3.0, and enhencement of
current schema mechanism. I also change the option handling process to
use getPluginStringData(), and add new USE_SERIALIZER_WRAPPER macro in
the Registry header to allow for static-link usage as well.

The enhencement of schema machanism just tells the type of each
serializer while outputting them, such as:
osg::Group = Children:1

The meaning of the number can be found in the osgDB/Serializer header,
BaseSerializer::Type enum. It may help 3rdparty utilities understand
the structure of the wrapper and do some reflection work in the
future.

The new macro UPDATE_TO_VERSION can help indicate the InputStream (no
affect on the writer) that a serializer is added/removed since certain
OSG version. An example wrapper file is also attached. The
Geode_modified.cpp is based on the serializers/osg/Geode.cpp file
(hey, don't merge it :-), but assumes that a new user serializer
'Test' is added since version 65 (that is, the OSG_SOVERSION):

REGISTER_OBJECT_WRAPPER( Geode, ... )
{
   ADD_USER_SERIALIZER( Drawables );  // origin ones

   UPDATE_TO_VERSION( 65 )
   {
       ADD_USER_SERIALIZER( Test );  // a serializer added from version 65
   }
}

All kinds of ADD_... macros following UPDATE_TO_VERSION will
automatically apply the updated version. The braces here are only for
typesetting!
While reading an osgt/osgb/osgx file, OSG will now check if the file
version (recorded as the writer's soversion, instead of previous
meaningless "#Version 2") is equal or greater than Test's version, and
try reading it, or just ignore it if file version is lesser.

And we also have the REMOVE_SERIALIZER macro will mark a named
serializer as removed in some version, with which all files generated
by further versions will just ignore it:

UPDATE_TO_VERSION( 70 )
{
   REMOVE_SERIALIZER( Test );
}

This means that from version 70, the serializer Test is removed (but
not actually erased from the list) and should not be read anymore. If
the read file version is less than 70 (and equal or greater than 65),
Test will still be handled when reading; otherwise it will be ignored
to keep compatiblity on different OSG versions.
"
2010-11-09 12:41:55 +00:00
Robert Osfield
af22bd70db From Johan Nouvel, "Some times ago, I have coded an osg to vrml2 writer. Today, I have updated our writer to osg 2.9.9.
As it works (for our needs at least) I've done and attached a tar.gz file for the VRML2 plugin with a new part to write a VRML2 file from an osg one.

The read part is the same as in osg 2.9.9.

The write part code is in convertToVRML.cpp and .h  files. It works for some osg nodes (group, geode, matrixTransform, positionAttitudeTransform and geometry). Textures are converted to jpeg (if not translucent) or png (if translucent).
There are some options that could be given to the writer (with -O switch) :

convertTextures=0   to copy textures without converting them to jpeg or png
convertTextures=-1  do not copy textures, keep them in their original format and location
convertTextures=-2  do not use textures, parse only geometry
convertTextures=-3 (default) convert textures to jpeg or png ones.

textureUnit=X  in case of multiple textures, X= texture unit to use (default value=0)

directoryTexture=aPath  when texture will be copied, it will be in this directory, not in the current one."
2010-11-08 15:49:30 +00:00
Robert Osfield
be583ef0d6 From Jean-Sebastien Guay, "As promised, here is the fix for the background size. I also added another instance variable _lineHeight to clean up the code a bit more.
Also I've done the osguserstats example. I've kept the "toy example" that was in the modified osgviewer.cpp I had sent you, because they show different uses of custom stats lines (a value displayed directly, a value without bars and a value with bars and graph). I also added a function and a thread that will sleep for a given number of milliseconds and record this time in the stats. I think it clearly shows how to record the time some processing takes and add that to the stats graph, whether the processing takes place on the same thread as the viewer or on another thread.

BTW, feel free to modify the colors I've given to each user stats line... I'm not very artistic. :-)

I've also added more doc comments to the addUserStats() method in ViewerEventHandlers, so hopefully the arguments are clear and the way to get the results you want is also clear. Maybe I went overboard, but the function makes some assumptions that may not be obvious and has many arguments, so I preferred to be explicit."
2010-11-08 12:28:31 +00:00
Robert Osfield
a0607201a2 From David Fries and Robert Osfield, fix for handling remote GLX server that declares GL 3.0 support but doesn't actually implement it correctly. 2010-11-05 17:31:25 +00:00
Robert Osfield
752a5e2a3c From Javier Taibo, "ere is the new code with Billboard "rotate around axis" functionality.
A new AutoRotateMode was added. I named it ROTATE_TO_AXIS to be
consistent with the other AutoRotateModes, even though it changes from
how is called in Billboard (AXIAL_ROT).

  Setters and getters for rotation axis and normal were also added to the
AutoTransform class interface.

  The implementation is mainly a copy-paste from Billboard code.
"
2010-11-05 17:24:50 +00:00
Robert Osfield
5a0b2760b4 From Alexander Irion, "Please find another bugfix for the ReaderWriterGZ. This time, the writing did not work for me - the created output file could not be deflated by zip.
"
2010-11-05 17:09:58 +00:00
Robert Osfield
0f22d7bc3f From Ulrich Hertlein, "attached is a tiny cleanup for ReaderWriterFFmpeg that provides more accurate descriptions
for some extensions and also adds 'm2ts' for MPEG-2 transport streams.
"
2010-11-05 17:07:17 +00:00
Robert Osfield
147fdd0430 From Sukender, "1. More handled cases in MergeGeometryVisitor
- Algorithm doesn't try to merge double and single precision arrays together
- Algorithm doesn't try to merge incompatible geometries (ex: one with "vertices + texoords", and another with only vertices)

2. Better TextureAtlasBuilder
Algorithm is still sub-optimal, but it now tries to fill more blanks, using "unused space in the current line".
(Don't know if I already submitted it, but I guess not)
One day, someone should try to find a good solution to this NP-problem... For instance : http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.140.200&rep=rep1&type=pdf
"
2010-11-05 17:04:08 +00:00
Robert Osfield
95c7dc35d0 From Alaxandre Irion, "Trying to load the attached texture file "texture.dds.gz" fails and causes the following warning on the console:
ReadDDSFile warning: couldn't read mipmapData

The issue is caused, when the last block of data is read from the file (less than chunk size of 16384 bytes). The read operation in ReaderWriterGZ::read() then sets the eof and fail bit in the stream and the lines

if (fin.fail())
{
 (void)inflateEnd(&strm);
 return false;
}

causes the reading to be aborted with the last read data not beeing inflated.

Please find the attached fix for this problem."
2010-11-05 10:29:18 +00:00
Robert Osfield
1c6e33bc7e From Wang Rui, "Attached is a fix to the latest PVR plugin to make it compile under
MSVC. I've added definition to uint_32 and replaced std::max() with
osg::maximum(), because it is not supported by some VisualStudio
versions."
2010-11-05 09:12:28 +00:00
Robert Osfield
2aaf0ed297 From Fabien Lavingotte and Robert Osfield, Fixed handling of texture pool size when TextureObject::setAllocate(..) is called. 2010-11-04 17:53:58 +00:00
Robert Osfield
f7b33de6fc From Jason Beverage, "Here is a small change to the DirectShow plugin to support finding the
video and sound pins by type rather than searching for them by name
since the names of the pins can change based on what kind of file you
are opening.  This also removes the need for an explicit check to see
if the file is a .wmv file.

Also changes to the directshow plugin's CMakeLists.txt.
 It is not necessary to link against d3dx9 to build the plugin.
"
2010-11-04 13:53:31 +00:00
Robert Osfield
bb723e14fa From David Callu, fix in FrameBufferObject when using Texture2Darray and GeometryShader. 2010-11-04 11:05:47 +00:00
Robert Osfield
d2a9f48054 From Per Fahlberg, "I have added support for PowerVR texture compression. osg::Texture and osg::Image have been modified to support the texture formats and I have added a plugin to load pvr files. All modified files are in the attached zip. " 2010-11-04 11:02:37 +00:00
Robert Osfield
4ced7dffc4 From Wang Rui, "additional FFmpegParameters class in the ffmpeg plugin for setting parameters before opening the video file, which benefits from getPluginStringData() as shown in the ReaderWriter implementation.
Now we can use ffmpeg to render webcam video (using the vfwcap device) under Windows:

osgmovie 0 -e ffmpeg -O "format=vfwcap frame_rate=25"

The number 0 just indicates a default device number in ffmpeg.

I think this can work under Linux, too, and should be a bit better than comparing the filename with a '/dev/' string. Just type:

./osgmovie /dev/yourcam -e ffmpeg -O "format=video4linux2 frame_rate=30 size=320x240""
2010-11-03 10:37:32 +00:00
Robert Osfield
afa563df57 From Wang Rui, "a new parsePluginStringData() method in the osgDB::Options class which will be automatically executed to parse option string to the string data map" 2010-11-03 10:37:02 +00:00
Robert Osfield
1beedce6fc From Jean-Sebastien Guay, "For a long time now I've wanted to be able to add custom values into the stats handler's graph. Here is my proposal of how I'd do this. It's surely not perfect and I'm open to suggestions, but I've already made more changes than I wanted to in order to be able to implement this...
The user calls statsHandler->addUserStatsLine() providing:

- the label they want for that line in the graph
- the text and bar colors they want in the graph
- the stats names they want queried (one for time taken, one for begin and one for end time) and a few settings for how these will be displayed.

Then all they have to do is call viewer->getViewerStats()->setAttribute(framenumber, name, value) for their three attributes each frame and they'll have their stats in the graph.

They can also give only a time taken attribute (or some other numerical value they want printed, which can be averaged or not), or only begin+end attributes, and the graph will accordingly display only the (average or not) numerical value or only the bars.

Along the way I cleaned up the existing code a bit:

* Each time the setUpScene() or createCameraTimeStats() methods added a line to the graph, they did pretty much the same thing, so I moved that into a separate method called createTimeStatsLine() which is called by setUpScene() and createCameraTimeStats().

* I moved the font, characterSize, startBlocks and leftPos variables to member variables, since they were being passed around everywhere but were set only once at the beginning.

* The geode on which stats lines are added is also kept in a member variable, and createCameraTimeStats() adds the per-camera lines to this geode instead of returning a new Group with a new Geode. This further reduces the number of variables the createCameraTimeStats() method needs as input.

"
2010-11-03 10:04:34 +00:00
Robert Osfield
bdf1912fda From Jean-Sebastien Guay, "For a while now I've been bugged (pun) by a problem in the stats graph I submitted a long time ago. When it scrolled, sometimes it would scroll too little, leading to an empty space at the left that would grow as time went by. I was in that code today for something else so I fixed it.
"
2010-11-03 09:51:12 +00:00
Robert Osfield
2d28026654 From David Fries, "Fix remote X11 crash querying GL_NUM_EXTENSIONS
In osg::isGLExtensionOrVersionSupported in src/osg/GLExtensions.cpp when
using indirect X11 rendering,
glGetIntegerv( GL_NUM_EXTENSIONS, &numExt );
is leaving numExt uninitilized causing the following glGetStringi to
return NULL when the extension number isn't present.  Passing NULL to
std::string() then crashes.  This is with the following nVidia driver.
OpenGL version string: 3.3.0 NVIDIA 256.35

I went ahead and initialized some of the other variables before
glGetInitegerv in other files as well.  I don't know for sure
which ones can fail, so I don't know which are strictly required.
"
2010-11-03 09:28:28 +00:00
Robert Osfield
079b1c293e From Chuck Seberino, "Here is a minor fix for the vrml plugin when building with Visual Studio 2010. 2010 has updated STL/TR1 libraries that create a naming conflict with the current source. The fix is to remove the 'using boost::next' line and use the fully-qualified boost::next to get rid of the ambiguity. Here is the patch and attached changes." 2010-11-02 14:00:50 +00:00
Robert Osfield
526b39060c From Brad Christiansen and Robert Osfield, "I have added the new function as suggested. The change was made against trunk from an hour or so ago. I haven't tested the performance yet (and probably won't get a chance till next week) but I have checked my terrains still work. I defaulted the equalization to off as I thought this was best until we can look into why there is the performance hit.
", note from Robert, tweaked the names and enabled the code path.
2010-11-02 12:15:18 +00:00
Robert Osfield
5da431a9a6 From Mikhail Izmestev, "There is bug in GLBufferObject::compileBuffer when changed not first buffer entry, then generated
new wrong offset.
"
2010-11-02 11:44:20 +00:00
Robert Osfield
170da45842 Fixed function name 2010-11-02 11:27:38 +00:00
Robert Osfield
316c1a88a9 From Javier Taibo, " In current SVN code, when exporting an osgParticle::Particle object to the .osg file format, it crashes if no drawable was set in the particle.
In the attached file (src/osgWrappers/deprecated-dotosg/osgParticle/IO_Particle.cpp) I have added a check for the existence of the drawable before writing it to the file.
"
2010-11-02 11:19:17 +00:00
Robert Osfield
112c272452 From John Ivar Haugland & Robert Osfield, fix for bug in VisualStudio where it adds an redundent '/n' on the end of the command line arguments for no reason. 2010-11-01 17:19:39 +00:00
Robert Osfield
cc93824605 From Alexander Irion, "When a osg::Geometry node is loaded from a ".osgb" file, there is no element buffer object created for the primitives element indices, although _useVertexBufferObjects is enabled. This bug decreases the rendering performance." 2010-11-01 17:05:53 +00:00
Robert Osfield
7b0a500ffc From Sukender, fix for incorrect for loop test. 2010-11-01 17:02:48 +00:00
Robert Osfield
fb4d6b16f9 From Jan Peciva, "attaching Matrix_implementation fix for two problems:
- using m.getPerspective( fovy, tmp, tmp, tmp ) to get only FOV does not work.
The reason is that getPerspective is taking tmp as reference - thus all the three variables points to the same memory location. Then, zNear (third parameter) is used inside the method, while zNear content was spoiled by zFar that was written to the same place, resulting in fovy set to nan. I consider that it is the right of programmers to use 3 times tmp as parameter and I fixed the code in the method. I have done the same for getFrustum and getLookAt.

- I fixed makeFrustum to accept infinite zFar. (Some graphics techniques like shadow volumes require placing zFar to infinity to avoid visual artifacts.)"

Note from Robert Osfield, change the local near & far variable names to temp_near and temp_far MS Visual Studio has a record of using near and far names.
2010-11-01 13:57:44 +00:00
Robert Osfield
2ce4b9d8e9 From Jean-Sebastien Guay, osgDB functions to expand wildcards - required to aid windows consule usage as this doesn't not automatically expand * usage. 2010-11-01 11:06:12 +00:00
Robert Osfield
cd336a7d73 From Jean-Sebastien Guay and Robert Osfield, cleaned up the way that unix/windows file separators are managed. 2010-11-01 10:52:20 +00:00
Robert Osfield
b5c57c3d68 From Mikhail Izmestev, "I have discovered problem with draggers from osgManipulator in HUD.
This problem caused because osgManipulator::Dragger uses matrices of top camera instead last
absolute Camera in NodePath.

I attached modified osgManipulator/Dragger.cpp file, where added code for finding last absolute
camera. With this changes draggers works in HUD.

Example for demonstrate this problem you can find in osg-users list [1].

Mikhail.

[1] http://thread.gmane.org/gmane.comp.graphics.openscenegraph.user/62636
"
2010-10-29 15:18:34 +00:00
Robert Osfield
0328691f76 From Sherman Wilcox, "there's a bug in the cmake file for the tiff plugin. See
attached. The problem was that the output files were not properly
setting the debug/release libs due to this cmake bug. What occurred was
the release lib was set in all configurations."
2010-10-29 09:56:09 +00:00
Robert Osfield
7672cc57c2 Added X11_X11_LIB to LIB_EXTRA_LIBS when build X11 version of osgViewer to enable use of Mesa's GLES/EGL implementation 2010-10-29 08:33:10 +00:00
Robert Osfield
95902cd275 Fixed warning 2010-10-29 08:31:54 +00:00
Robert Osfield
b3074ad92d Commented out unused ElapsedTimer 2010-10-28 15:52:52 +00:00
Robert Osfield
1b2c689122 Added use ObjectWrapper's FinishObjectReadCallback to fix VertexBufferObject handling in osg::Geometry
and a call to the TileLoaded callback in osgTerrain.
2010-10-28 14:04:57 +00:00
Robert Osfield
f1b660997b Added FinishedObjectReadCallback to ObjectWrapper which allows
wrappers to register their own handling of post processing of objects once they have been read.
2010-10-28 14:04:07 +00:00
Robert Osfield
b622a99178 Added handling of vertex buffer objects into osg::Geometry copy constructor. 2010-10-28 14:01:47 +00:00
Robert Osfield
ea98b1a9f8 Improved code style consistency 2010-10-28 14:01:10 +00:00
Robert Osfield
441d832536 Quitened down debug messages 2010-10-28 14:00:25 +00:00
Robert Osfield
9978516bf7 Added number of primitive sets to on screen stats 2010-10-25 13:42:01 +00:00
Robert Osfield
f91944fbbf Added paging support to osganalysis example 2010-10-22 12:19:22 +00:00
Robert Osfield
1a292ad8e3 Integrated IncementalCompileOperation into DatabasePager.
Improved various facilities in IncrementalCompileOperation.
2010-10-21 16:29:23 +00:00
Robert Osfield
6ed74470b2 Introduction of IncrementalCompileOperation support to DatabasePager. 2010-10-14 18:16:03 +00:00
Robert Osfield
00fe3c0417 Introduced SubloadCallback::generatdTextureObject() method. 2010-10-14 13:35:36 +00:00
Robert Osfield
297be2290a From Wang Rui, warning fix. 2010-10-14 12:20:51 +00:00
Robert Osfield
8640929a2e From Brad Christiansen, fix function entry points under Windows to address crash 2010-10-14 11:10:16 +00:00
Robert Osfield
82c01cb72e From Wang Rui, QT based OpenThreads implementation 2010-10-14 09:31:09 +00:00
Robert Osfield
b55f75111e Added support for using a custom osg::Geometry that attempts to force the OpenGL driver
to download the texture object to graphics card.

Calling IncrementalCompileOperation::assignForceTextureDownloadGeometry() assigns a geometry
to the job.
2010-10-13 15:03:02 +00:00
Robert Osfield
ffa75c9c84 Changed the _ARB cube map defines to non ARB versions. 2010-10-09 11:51:24 +00:00
Robert Osfield
270a9fc47e Tempory fix for regression due to remove of glPushAttrib/glPopAttrib 2010-10-08 18:53:16 +00:00
Robert Osfield
078b21fa1e Build fixes for GLES1, GLES2 and GL3 2010-10-08 17:13:59 +00:00
Robert Osfield
9984281553 Refactored the Texture3D extension setup in osg::Texture3D and gluBuild3DMipmaps and gluBuild3DMipmapLevels. 2010-10-08 11:20:56 +00:00
Robert Osfield
d23ce985a1 Introduced osg namespace to new local GLU functions 2010-10-07 11:53:28 +00:00
Robert Osfield
12e6a23451 Introduced new gluScaleImage function that uses a PixelStorageModes structure to pass in details on image packing,
rather than relying upon glGet's to get the values.
2010-10-07 10:51:22 +00:00
Robert Osfield
021484440c Added #define GL_PROXY_TEXTURE_3D 2010-10-06 19:09:48 +00:00
Robert Osfield
477524f254 Fixed warning 2010-10-06 18:51:53 +00:00
Robert Osfield
46e798a4dc Changed tabs to 8 spaces 2010-10-06 18:37:43 +00:00
Robert Osfield
e928dfb6c7 From Jean-Sebastien Guay and Robert Osfield, build fix for Windows 2010-10-06 18:34:36 +00:00
Robert Osfield
ca4802142d Added #define GLAPIENTRY to attempt to resolve some Windows build issues 2010-10-06 17:19:01 +00:00
Robert Osfield
29bc5995e7 Added #define's and local include<osg/Image> to fix Windows GL 1.1 build against 2010-10-06 16:36:30 +00:00
Robert Osfield
7859a2a46d Removed gluois.h reference 2010-10-06 15:33:43 +00:00
Robert Osfield
10eac072c2 Removed usage gluos.h and redundent gluint.h 2010-10-06 15:14:01 +00:00
Robert Osfield
89f7726383 Copied libutil and libtess implementations in form Mesa 7.9/src/glu into the src/osg/glu,
changed extensions from .c to .cpp and got compiling as C files as part of the osg core library.

Updated and cleaned up the rest of the OSG to use the new internal GLU.
2010-10-06 14:44:52 +00:00
Robert Osfield
6df7dbf626 Improved the handling of matrices in serialization so that it's more reliable,
change was to use doubles for reading and writing matrices regardless of type of Matrix
being serialized.

Change does break backwards compatibility though, so code
path supporting original format has been left in for the
time being.  However, this code is not reliable enough and
is over complicated compared to the simplified handling.   Once
the new code has been bedded down for a while I'll remove this code block.
2010-10-04 15:23:19 +00:00
Robert Osfield
e6559af283 From Stephan Huber, "just a follow-up: I looked at the code of osg/Referenced.cpp and notice
a discrepancy in getOrCreateObserverSet. For the atomic- and
mutex-codepaths the newly created observerset gets manually ref'ed, but
not in the codepath used when OPENTHREADS_ATOMIC_USE_MUTEX is defined. I
added the manual ref and tadaaa, the crash went away."
2010-10-04 11:29:39 +00:00
Robert Osfield
b9f0efecb1 Added glMultMatrixf path for GLES1 2010-10-04 11:24:54 +00:00
Robert Osfield
f81a9eff50 From Wojciech Lewandowski, "As promised I prepared a patch to expose WGL_SWAP_METHOD / PFD_SWAP_METHOD selection via GraphicsContext::Traits. Since Traits don't define any enums (I guess to be simple to use) I tried to keep it that way and have added two boolean values: swapCopy & swapExchange. It is somewhat similar approach to GDI PixelFormatDescription were both options can be present together. Feel free to replace it with enum if you find it more appropriate.
I also uderstand that there is a need to select system wide default  method and have also modified DisplaySettings to contain swapMethod parameter. Swap method in Traits uses value set in DisplaySettings as default. Proper environment and command line args were added.  Its possible to define default DeisplaySettings swap method in standard way via system flags or with comand line.

Env Vars:
    OSG_SWAP_METHOD  = DEFAULT | COPY | EXCHANGE
or Command Line:
    --swap-method   DEFAULT | COPY | EXCHANGE

I also added handling of WM_ERASEBKGND in GraphicsWindowWin32. It may be unneccessary but code should be safer this way than without handling it.  I have placed a comment explaining the reason above the change.

Changes were made against today trunk.

PS. I tested only Windows code. I briefly checked X11 & Cocoa files but have not noticed SwapMethod to be used there.
"
2010-10-01 18:02:24 +00:00
Robert Osfield
fbbc8824cf From Magnes Kessler, "Attached are some fixes for the environment variable help strings in
DisplaySettings. They contain spelling fixes and an attempt to use consistent
expressions throughout."
2010-10-01 15:58:49 +00:00
Robert Osfield
8f2497e21d From Wojciech Lewandowski,"These are our changes to DatabasePager. To check if parent PLOD is registered, I resurrected PagedLODList::containsPagedLOD() method. This method was available some time ago, but got removed and was not currently present in trunk. To add this method I had to also modify the DatabasePager header. " 2010-10-01 15:37:35 +00:00
Robert Osfield
e5bc43f04c From Magnus Kessler, "After a closer look at this particular issue, I used some grep and sed magic
to fix all occurrences of "macro's" and "paramter".
"
2010-09-30 16:57:02 +00:00
Robert Osfield
17aaa4db94 From Craig Bosma, "Attached is an updated Image.cpp that fixes a very specific
compatability regression that was introduced almost 2 years ago in
r8834. The IVE version number was bumped to 32 because of the change
in binary layout, but the guard for reading/writing the new field was
checked against 31. Of course this only causes a problem (as for us)
when you've produced IVE files at version 31, which no longer load (or
crash) when loaded by newer OSG/IVE versions."
2010-09-30 16:31:22 +00:00
Robert Osfield
0eded3efbe From WojciechLewandowski, Added DispaySettings::SwapMethod and support for it in GraphicsContext::Traits 2010-09-30 14:25:27 +00:00
Robert Osfield
ff68236bad From Stephan Huber, fixed build under OSX 10.5. 2010-09-30 09:40:48 +00:00
Robert Osfield
ab1920c427 From Wang Rui, "I've fixed the problem that osgx format doesn't read the Font property and wrapped string correctly. The first problem happened because the matchString() made a mistake in comparing two strings with the same start but different size. The second just needs complete rewriting of writeWrappedString() and readWrappedString() in src/osgPlugins/osg/XmlStreamOperator.h
I also fixed a possible bug in osgDB::XmlParser that doesn't handle control characters (like &quot; to ") when reading node attributes, because the writeWrappedString() and readWrappedString() now depend heavily on control characters. An additional improvement is that osgx now supports comments."
2010-09-30 09:34:41 +00:00
Robert Osfield
47af827648 Fixed Text3D's handling of character aspect ratio. 2010-09-29 13:21:34 +00:00
Robert Osfield
dab1c79127 Moved handling of character aspect ratio into osgText::Style. 2010-09-29 12:45:35 +00:00
Robert Osfield
b40acacf53 Moved set/getFont from Text/Text3D into TextBase 2010-09-29 11:34:55 +00:00
Robert Osfield
e942cc770a Removed getScale() parameter from osgText::Font 2010-09-29 11:09:32 +00:00
Robert Osfield
5c3a1b3069 Fixed type of numberical constant 2010-09-29 10:54:53 +00:00
Robert Osfield
5af4884558 Moved Text3D across to using Style for character thickness.
Quitened down debug messages in 3D text geometry creation.
Improved the Text3D implementation of the new 3D text geometry.
2010-09-27 17:11:12 +00:00
Robert Osfield
f8b44c3b33 Added support for osgText::Style into osgText::Text3D.
Refactored Text3D implementation to use new GlyphGeometry class.
Implemented GlyphGeometry backend and cleaned up Glyph3D interface.
2010-09-27 16:18:20 +00:00
Robert Osfield
759749eb0c Changed the reading of animation paths so that it's always done without using the osgDB object cache.
This fixes a bug of reusing the animination path in an P3D file.
2010-09-27 09:58:07 +00:00
Robert Osfield
1224836664 From Eric Wing, QTKit plugin for reading movies under OSX using QTKit + CoreVideo 2010-09-24 12:59:37 +00:00
Robert Osfield
c006c75615 Moved Style and Bevel classes out into their own include/osgText/Style header.
Introduced GlyphGeometry class for handling the geometry data for rendering 3D text
2010-09-24 12:57:55 +00:00
Robert Osfield
d9a133476a Refactored the handling of readImage/writeImage/readObject/writeObject to avoid double setting of unique ID's, fixing the problem in reading/writing files with images 2010-09-23 16:12:05 +00:00
Robert Osfield
0d347352cf From David Guthrie, "The cocoa version of the window for Mac OS X doesn't implement the requestWarpPointer function, but it turns out that the code from the Carbon version of the window is the same because it uses the windowing interface, so it this version, based on 2.8.3 GraphicsWindowCocoa, I copied the function over. The trunk version it also missing the function and the code looks to be very similar, so I assume it will transfer simply enough.
"
2010-09-21 10:28:50 +00:00
Robert Osfield
7e8ca5ccdf From Per Fahlberg, "imageio was not spelled correctly when registering the plugin, attached is a fixed version of ReaderWriterImageIO.cpp." 2010-09-20 16:04:22 +00:00
Robert Osfield
5ecc2b9880 From Wang Rui, reverted changes to osgPartcile that caused problems with osgparticleeffects. 2010-09-20 11:50:24 +00:00
Robert Osfield
a8c8c70fb1 From Ulrich Hertlein, "attached is a fix that addresses these compiler warnings from the 64-bit OS X build:
/Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/3ds/WriterNodeVisitor.cpp: In
function ?std::string getFileName(const std::string&)?:
/Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/3ds/WriterNodeVisitor.cpp:88:
warning: comparison is always false due to limited range of data type

/Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/3ds/WriterNodeVisitor.cpp: In
function ?bool is83(const std::string&)?:
/Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/3ds/WriterNodeVisitor.cpp:102:
warning: comparison is always false due to limited range of data type

/Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/3ds/WriterNodeVisitor.cpp: In
function ?bool is3DSpath(const std::string&, bool)?:
/Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/3ds/WriterNodeVisitor.cpp:118:
warning: comparison is always false due to limited range of data type
/Users/uli/Projects/osg/OpenSceneGraph/src/osgPlugins/3ds/WriterNodeVisitor.cpp:121:
warning: comparison is always true due to limited range of data type

The code was using 'unsigned int' in places where it should've used 'size_t' for correct
comparison with 'std::string::npos' (which is size_t).
"
2010-09-20 11:02:40 +00:00
Robert Osfield
4daad70d17 Build fixes for when OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION is disabled 2010-09-17 13:33:09 +00:00
Robert Osfield
b0db0382f5 Reverted changes from Vivien Delage as there were some regressions discovered. Will need to revist this code to deal with bugs that Vivien was tackling. 2010-09-17 13:09:23 +00:00
Robert Osfield
d74ffd57aa From Magnus Kessler, "Changes to the quicktime plugin to remove unused variables and an unused
static function."
2010-09-16 13:04:55 +00:00
Robert Osfield
b4fda3a6da From March Sciabica, "Here is the solution I coded up over the weekend. For improved
performance option, I added a flag to control whether the depth writing
pass is performed.

Since text is alpha-blended when rendering, it is placed in the
transparent bin and rendered back to front. Writing to the depth buffer
should therefore be unnecessary. Indeed, rendering something behind text
(or any blended object) after that object is drawn will give incorrect
results whether the depth buffer is written or not. I therefore think it
is safe to keep this option off by default. Users can turn it on for any
special needs they have.

I did not fix the existing backdrop implementations to work with the new
code since this new method of rendering intrinsically handles backdrops
correctly. Its results are more accurate than all of the existing
backdrop implementations. Its only downside is that it requires two
passes if depth buffer updates are desired, whereas DEPTH_RANGE and
POLYGON_OFFSET achieve their (less accurate) results in one pass. The
NO_DEPTH_BUFFER method also only uses one pass, but it disables depth
tests and not depth writes so will have serious problems if anything is
drawn in front of the text before OR after the text is drawn.

Given the better all-around behavior of the new method, I believe the
other backdrop implementations can be safely removed. Code that adjusts
the backdrop implementation will of course be broken if the member
functions are removed. For this reason I left them in, but set the new
rendering method as the default backdrop implementation. At the very
least I think the old backdrop implementations should be deprecated and
removed at a later date.
"

Note from Robert Osfield, testing this submission with osgtext I found that the
text would not render correctly when different text labels were overlapping
in deth and screen space.  I change _enableDepthWrites to default to true and
found the that which artifacts still occurred around the alpha blended edges
the artifacts where better than issue with occlusion of nearer pixels that was
happening with _enableDepthWrites set to false.I therefore set the
_enableDepthWrites to true as I feel it's the lesser of the two artefacts.
2010-09-16 09:09:43 +00:00
Robert Osfield
26a41004c2 From Mathias Fielder, "i found an issue with the serializer writing shared arrays. At OutputStream::writeArray(), if the currently latest array is shared the full array content will be written.
The following code snippet will reproduce this issue:


Code:

osg::Vec2 vec(0.f, 0.f);
osg::Array* sharedArray = new osg::Vec2Array(1, & vec);

// create 2 geometries sharing same array
osg::Geometry* geom0 = new osg::Geometry;
osg::Geometry* geom1 = new osg::Geometry;
geom0->setVertexArray(sharedArray);
geom1->setVertexArray(sharedArray);

osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable(geom0);
geode->addDrawable(geom1);

std::stringstream buffer;

// write node
osg::ref_ptr<osgDB::Options> options = new osgDB::Options("Ascii");
osgDB::ReaderWriter* rw = osgDB::Registry::instance()->getReaderWriterForExtension("osgt");
osgDB::ReaderWriter::WriteResult wr = rw->writeNode(*geode, buffer, options.get());

// print result; array will be written twice with full content, though with same ID
std::cout << buffer.str() << std::endl;

// trying to read back node will print warnings about unmatched properties
osgDB::ReaderWriter::ReadResult rr = rw->readNode(buffer, options.get());




To fix this i made a change in OutputStream::writeArray().
I think the same issue applies to OutputStream::writeObject(). So i made the same change there.
"
2010-09-16 08:46:38 +00:00
Robert Osfield
94c86d495c From Paul de Repentigny, Commented out section of code that didn't work properly 2010-09-15 13:24:37 +00:00
Robert Osfield
65e49cf9db From Laura Cerritelli, "I modified TXPPagedLOD::traverse to prevent the terrain from inappropriately unloading the higher level of detail tiles. It wasn?t updating the frame number of the tile or the range it was traversing, causing PagedLOD::removeExpiredChildren to always consider the range expired." 2010-09-15 11:36:45 +00:00
Robert Osfield
6ac8b63419 From Wang Rui, "I've fixed some pen-slips in SharedStateManager.cpp, which writing the
last few examples for my to-be-finished book. I also do a minor fix to
the share() method to make it work for geodes, too."
2010-09-15 11:32:51 +00:00
Robert Osfield
df7df0739a From Lukasz Izdebski, "I made some changes in OcclusionQueryNode file.
I move declaration of classes TestResult, QueryGeometry from cpp to header file and made a void createSupportNodes() a virtual method.

Now is possible to inherit from class OcclusionQueryNode."
2010-09-15 11:27:31 +00:00
Robert Osfield
d6fe337728 Renamed file3ds and options member variables to _file3ds and _options to avoid confusion and keep the code consistent with the rest of the class/OSG.
Added _option parameter to writeImageFile(..) call.
2010-09-15 11:10:10 +00:00
Robert Osfield
7a6a226ddd From Todd Furlong, "I made a couple of changes to the osgFX::Outline class (SVN patch attached). I had a couple of issues with it that I was trying to resolve:
1. When an outline object was occluded by another object, the backfacing wireframe was exposed.  To fix that, I removed the disabling of GL_DEPTH_TEST.

2. In some cases, the outline color was the same color as the geometry being drawn instead of the specified color.  I'm not sure I have completely fixed this issue, but I did make some changes to match up to how we do a scribe effect."
2010-09-15 10:50:24 +00:00
Robert Osfield
d96e57c0c3 Added https, ftp and ftps to list of supported server protocols, and add ability for curl plugin to ignore the need for a server address when .curl extension is used. 2010-09-15 10:24:59 +00:00
Robert Osfield
d044d135f5 From Jan Peciva, "please, find attached improved Stencil and StencilTwoSided classes.
Goals:
- to handle INCR_WRAP values nicely if not supported by OpenGL (old hardware)
- to support two side stenciling of OpenGL 2.0. Current implementation does not work on ATI as it uses Nvidia extension.

Ready for commit:
- Stencil and Stencil.cpp - please, review them

Ready with "hack":
- StencilTwoSided.cpp: please, see the line 113 in apply():

      glEnable(GL_STENCIL_TEST_TWO_SIDE);

This line used to be in getModeUsage() as

      usage.usesMode(GL_STENCIL_TEST_TWO_SIDE);

but it produces OpenGL errors on ATI as it is unknown value there (it is Nvidia extension).
Problems with my "glEnable" solution:
- it enables two side stenciling forever, and it will disturb any other single-side stenciling in the scene graph.
"
2010-09-15 09:56:16 +00:00
Robert Osfield
0259a340fd From Wang Rui, "I've changed it back to _alive, _current_size and _current_alpha, and placed them one by one for setTexCoordPointer() to use.
All size() methods are now renamed to volume(). At present only the CompositePlacer will use it for randomly choose a place according to the volumes of all children.
 "
2010-09-15 09:24:45 +00:00
Robert Osfield
b4789863ac Form Wang Rui, "An initial GLSL shader support of rendering particles. Only the POINT
type is supported at present. The attached osgparticleshader.cpp will
show how it works. It can also be placed in the examples folder. But I
just wonder how this example co-exists with another two (osgparticle
and osgparticleeffect)?

Member variables in Particle, including _alive, _current_size and
_current_alpha, are now merged into one Vec3 variable. Then we can
make use of the set...Pointer() methods to treat them as vertex
attribtues in GLSL. User interfaces are not changed.

Additional methods of ParticleSystem are introduced, including
setDefaultAttributesUsingShaders(), setSortMode() and
setVisibilityDistance(). You can see how they work in
osgparticleshader.cpp.

Additional user-defined particle type is introduced. Set the particle
type to USER and attach a drawable to the template. Be careful because
of possible huge memory consumption. It is highly suggested to use
display lists here.

The ParticleSystemUpdater can accepts ParticleSystem objects as child
drawables now. I myself think it is a little simpler in structure,
than creating a new geode for each particle system. Of course, the
latter is still compatible, and can be used to transform entire
particles in the world.

New particle operators: bounce, sink, damping, orbit and explosion.
The bounce and sink opeartors both use a concept of domains, and can
simulate a very basic collision of particles and objects.

New composite placer. It contains a set of placers and emit particles
from them randomly. The added virtual method size() of each placer
will help determine the probability of generating.

New virtual method operateParticles() for the Operator class. It
actually calls operate() for each particle, but can be overrode to use
speedup techniques like SSE, or even shaders in the future.

Partly fix a floating error of 'delta time' in emitter, program and
updaters. Previously they keep the _t0 variable seperately and compute
different copies of dt by themseleves, which makes some operators,
especially the BounceOperator, work incorrectly (because the dt in
operators and updaters are slightly different). Now a getDeltaTime()
method is maintained in ParticleSystem, and will return the unique dt
value (passing by reference) for use. This makes thing better, but
still very few unexpected behavours at present...

All dotosg and serialzier wrappers for functionalities above are provided.

...

According to some simple tests, the new shader support is slightly
efficient than ordinary glBegin()/end(). That means, I haven't got a
big improvement at present. I think the bottlenack here seems to be
the cull traversal time. Because operators go through the particle
list again and again (for example, the fountain in the shader example
requires 4 operators working all the time).

A really ideal solution here is to implement the particle operators in
shaders, too, and copy the results back to particle attributes. The
concept of GPGPU is good for implementing this. But in my opinion, the
Camera class seems to be too heavy for realizing such functionality in
a particle system. Myabe a light-weight ComputeDrawable class is
enough for receiving data as textures and outputting the results to
the FBO render buffer. What do you think then?

The floating error of emitters
(http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2009-May/028435.html)
is not solved this time. But what I think is worth testing is that we
could directly compute the node path from the emitter to the particle
system rather than multiplying the worldToLocal and LocalToWorld
matrices. I'll try this idea later.
"
2010-09-14 15:47:29 +00:00
Robert Osfield
551d2b6479 From Ulrich Hertlein, "not sure how severe this is but I believe there's a bug in
Texture.cpp:applyTexImage2D_subload:

<code>
unsigned char* data = = (unsigned char*)image->data();
if (needImageRescale) {
 // allocates rescale buffer
 data = new unsigned char[newTotalSize];

 // calls gluScaleImage into the data buffer
}

const unsigned char* dataPtr = image->data();
// subloads 'dataPtr'

// deletes 'data'
</code>

In effect, the scaled data would never be used.

I've also replaced bits of duplicate code in Texture1D/2D/2DArray/3D/Cubemap/Rectangle
that checks if the texture image can/should be unref'd with common functionality in
Texture.cpp.

"
2010-09-14 13:19:55 +00:00
Robert Osfield
687fd9362f From Jean-Sebastien Guay, "osgWidget::WindowManager did nothing in its keyUp event, and in particular didn't call any callbacks. Since I wanted to have callbacks on keyUp, I copied what it does on keyDown, which works for me. I could have just used keyDown and saved myself the trouble, but you know me... :-)
osgWidget::Input:

[Functional changes]
- Previously, the field would be filled with spaces up to its max length, and typing would just replace the spaces. Also, there was a _textLength variable that kept track of the real length of text in the field, since the osgText::Text's length just reflected the length of spaces+text entered. This was not great, as you could still select the spaces with the mouse and it just feels hacky. So I changed it to only contain the text entered, no spaces, and _textLength was removed since it's now redundant (the osgText::Text's length is used instead).
- Fixed the selection size which (visually only) showed one more character selected than what was really selected.
- Fixed selection by dragging the mouse, it would sometimes not select the last character of the string.
- Cursor will now accurately reflect whether insert mode is activated (block cursor) or we're in normal mode (line cursor) like in most editors.
- Implemented Ctrl-X (cut)
- Added a new clear() method that allows the field to be emptied correctly. Useful for a command line interface, for example (hint, hint).
- Mouse and keyboard event handler methods would always return false, which meant selecting with the mouse would also rotate the trackball, and typing an 's' would turn on stats.

[Code cleanup]
- Renamed the (local) _selectionMin and _selectionMax variables which are used in a lot of places, as the underscores would lead to think they were members. Either I called them selection{Min|Max} or delete{Min|Max} where it made more sense.
- Fixed some indenting which was at 3 spaces (inconsistently), I'm sure I didn't catch all the lines where this was the case though.
- Put spaces between variable, operator and value where missing, especially in for()s. Again I only did this where I made changes, there are probably others left.

The result is that delete, backspace, Ctrl-X, Ctrl-C, Ctrl-V, and typing behaviour should now be consistent with text editor conventions, whether insert mode is enabled or not. I hope. :-)

Note, there's a nasty const_cast in there. Why isn't osgText::Font::getGlyph() declared const?

Also, as a note, the current implementation of cut, copy and paste (in addition to being Windows only, yuck) gets and puts the data into an std::string, thus if the osgText::String in the field contains unicode characters I think it won't work correctly. Perhaps someone could implement a proper clipboard class that would be cross-platform and support osgText::String (more precisely other languages like Chinese) correctly? Cut, copy and paste are not critical to what I'm doing so I won't invest the time to do that, but I just thought I'd mention it.
"
2010-09-09 16:49:10 +00:00
Robert Osfield
78cb15fdf8 From Torben Dannhauer, "I extended the attached CMAKE module to search for the collada libraries of my VS2008 3rdParty package if no other library is found.
No CMAKE should recognize all libraries of the VS2008 3rdParty Package."
2010-09-09 10:44:11 +00:00
Robert Osfield
2f14255dd7 From Joachim Pouderoux, "Please find attached a very small fix for the DXF reader. The bug made OSG
crash with some files.
Actually, itr was incremented into the loop and after the test with
nlist.end().
Then, the unreferencing of itr when nlist is equals to nlist.end() caused
the crash."
2010-09-09 10:17:55 +00:00
Robert Osfield
a5a7bcf165 From Joachim Pouderoux, "I have added the support for wkbMultiPolygon & wkbMultiPolygon25D in the OGR
plugin (it was mysteriously missing and no prevent warning messages was
print)."
2010-09-09 10:14:54 +00:00
Robert Osfield
fa94700e5c From Tassilo Glander, "I want to submit a fix for the plugin to load .x model files (Direct X).
The current version crashes when encountering global materials, as also reported in the forum by the author of the plugin.

The problem in mesh.cpp (app. ln 247) is, that references to global materials that are given in curly brackets {} are not supported by the reader. However, curly brackets seem to be common, according to Bourke. Unfortunately, I found no specification. However, also the DirectX model viewer that comes with the DirectX-SDK (August 2009) expects curly brackets and refuses models without them.

My fix checks 2 more cases ("{ aMaterial }" -> 3 tokens and "{aMaterial}" -> 1 token), and extracts the material name for the lookup. I don't know if this is the most elegant solution, but the tokenizer seems to split based on white spaces.

You can reproduce the bug with the attached model (box.x), which loads fine in other tools, such as 3DSmax, DeepExploration or the DirectX model viewer. When I remove the curly brackets at the reference of "myGlobalMaterial", it loads in osgviewer, but is not standard conform.
"
2010-09-09 10:09:31 +00:00
Robert Osfield
cbc43841e1 From Roland Smeenk, "this submission adds a "Fast Drawable" line to the camera scene statistics.
It shows the total number of sorted and unsorted drawables that use the fastpath for rendering."
2010-09-09 10:03:58 +00:00
Robert Osfield
77c35eabde From Jean-Sebastien Guay, "I've added a second ctor where no argument is optional, and documented that it's meant to be used when the InteractiveImage is going to be used in a fullscreen HUD.
"
2010-09-09 09:47:31 +00:00
Robert Osfield
60942d8e72 Added version check for av_lockmgr_register support. 2010-09-09 09:05:33 +00:00
Robert Osfield
6f08e25c05 From Nathan Monteleone and Robert Osfield,
submission email from Nathan: "I discovered a problem with POINT_ROT_EYE billboards in IntersectionVisitor: because we pass in just the model matrix to Billboard::computeBillboardMatrix, the billboard gets the wrong up vector.  It really needs to take the view matrix into account to get the correct up vector.

This version of IntersectionVisitor.cpp is made against today's SVN.  It corrects the problem by computing the billboard matrix using the complete modelview, and then multiplies by the inverse of the view matrix before pushing onto IntersectionVisitor's model stack.  The only code I changed is in apply(Billboard&)."

notes from Robert, refactored the matrix multiplication code and the use of RefMatrix to make Nathan's changes more efficient.
2010-09-09 08:47:12 +00:00
Robert Osfield
6f49d85f88 Cleaned up debug info, and changed Text3D across to using GL_NORMALIZE instead of GL_RESCALE_NORMAL. 2010-09-08 11:02:39 +00:00
Robert Osfield
c9bd91cc6a Added support for honouring PrimitiveSet names in new smoothing algorithm 2010-09-08 10:46:49 +00:00
Robert Osfield
4fe88ee2e4 From Jean-Sebastien Guay, build fixes for Windows 2010-09-08 08:09:01 +00:00
Robert Osfield
234cb82867 Moved Glyph and Glyph3D out of Font header/source file into their own header/source file. 2010-09-07 18:20:03 +00:00
Robert Osfield
50be800787 Moved TextNode into osgText.
Cleaned up freetype plugin so it no longer does tesselation - instead Glyph and TextNode do this.
2010-09-07 18:18:35 +00:00
Robert Osfield
a6abbb545e Further work on new 3D text support 2010-09-06 15:43:59 +00:00
Robert Osfield
b4f3818949 Removed now redundent Font3D files 2010-09-03 09:10:27 +00:00