Commit Graph

11954 Commits

Author SHA1 Message Date
Robert Osfield
9c04527cbe Fixed the order of setting of CenterMode 2012-03-16 13:22:20 +00:00
Robert Osfield
e5b5494fe1 From Wang Rui, "I'd like to submit a slightly modified version of the ViewDependentShadowMap. It includes two fixes: one is in ComputeLightSpaceBounds::update(), which changes the statement "if (v.z()<0.0f)" to "if (v.z()<-1.0f)" as clipping space coordinates should be transformed to [-1, 1] and should not be discarded unless they go beyond the range; the other is in ViewDependentShadowMap::computeShadowCameraSettings(), in which I changed the line:
viewMatrix.makeLookAt(frustum.center+positionedLight.lightDir*zMin, frustum.center, lightUp);
to
viewMatrix.makeLookAt(frustum.center+positionedLight.lightDir*zMin, frustum.center+positionedLight.lightDir*zMax, lightUp);

The reason I've done such a change is that for huge scenes like a city on the earth, the values of frustum.center can be extremely large, but zMin may be very small (e.g., when model depth in light coords equals the model radius by chance) in some cases so the result of (eye - center) might jiggle while moving around the shadow scene and thus make the shadow map suddenly disappear some time. The small change here also considers the effect of zMax to avoid such problems.

"
2012-03-14 16:42:07 +00:00
Robert Osfield
7977b31577 Moved static initializers into global scope to prevent problems with using exit(). 2012-03-12 14:22:48 +00:00
Cedric Pinson
df82754203 Changed osgAnimation::StackedTransform::update(t). It can now be used for custom usage 2012-03-11 22:05:29 +00:00
Robert Osfield
d546f95412 Updated ChangeLog and AUTHORS file for 3.1.1 dev release 2012-03-09 13:16:39 +00:00
Robert Osfield
5e105d2fc4 From Chuck Seberino, "Attached are modified versions of RotateCylinderDragger and Projector files that clean up the use of _onCylinder / isProjectionOnCylinder().
I have also made changes to the RotateCylinderDragger to provide a cylinder ring with a thickness.   It is totally optional, but IMHO makes the default behavior work better than a solid cylinder (which typically obscures the geometry you are trying to drag).  Gives it a bit more to grab, especially in the case where eyepoint and cylinder axis are near parallel.
"
2012-03-09 10:20:23 +00:00
Robert Osfield
fc6fdeaa2c Updated version number for 3.1.1 dev release 2012-03-08 16:33:44 +00:00
Robert Osfield
fef2628d00 From Farshid Lashkari, "I've added support for reading contents of cubemap textures to the osg::Image::readImageFromCurrentTexture method. I added a new parameter to the method for specifying which face of the cubemap to read." 2012-03-08 16:05:17 +00:00
Robert Osfield
71893c46e5 From Olaf Flebbe, "Appended now a bugfixed proposition for the Win7 Multitouch Support.
Now examples/osgmultitouch really works ;-)

Based on yesterdays trunk.

* It should now work with all Visual Studio Versions.
* WIN_VER is left as-is
* I added the missing declarations from a recent SDK, if not supplied by the SDK
* If someone chooses to update WIN_VER, the declarations should not break.
* All API Calls are runtime detected.
* No CMake Variable, Support is enabled automatically ."
2012-03-07 09:32:38 +00:00
Robert Osfield
17ba6f0a24 From Guillaume Millet, "Please find a small fix to avoid crash of texture Atlas builder in case of textures with NULL image.
If an object is comming with texture and NULL image, the texture atlas builder crash when sorting textures according to texture height.
The fix is to skip textures with NULL image when inserting textures in the builder texture list.
"
2012-03-06 10:35:57 +00:00
Robert Osfield
ecbe4b1058 From Farshild Laskari, "The vertex shader for the point stateset of PrecipitationEffect was not properly computing the clip vertex. It needed to apply a modelview transformation to the clip vertex. Attached is the fix." 2012-03-06 10:33:20 +00:00
Robert Osfield
7c278ce5d6 From Christian Buchner, "The attached openscenegraph example is much simpler than
osgshaders.cpp and demonstrates the use of GLSL vertex and fragment
shaders with a simple animation callback. I found the osgshaders.cpp
too complex to serve as a starting point for GLSL programming"
2012-03-06 10:29:47 +00:00
Robert Osfield
fd97a9a800 From Chuck Seberino, "Here is a fix for the RotateCylinderDragger. This patch fixes the case where the picking direction is close to the cylinder axis. The current behavior is this:
* If the eyepoint and cylinder axis are close to parallel (given some tolerance), then it uses a plane perpendicular to the cylinder axis.
* Otherwise it uses a plane parallel to the cylinder axis oriented towards the eyepoint (previous behavior).  This gives decent behavior and is the only path that was taken in the previous code.   I kept with previous behavior and that allowed a good bit of code to be removed, simplifying things.  There is now no need for the _onCylinder flag, but since there is a public accessor, I wasn't sure how to handle it for backwards compatibility, so I left it in.  NOTE - there is no default initialized value, so if it is kept in, it should be set to 'false' to keep same behavior as before.  I am not quite sure how the _onCylinder case was supposed to behave as even forcing that path gave undesirable behavior, even with carefully controlled dragging.
"
2012-03-06 10:08:49 +00:00
Robert Osfield
8d3790d594 Added RotateCylinderDragger and RotateSphereDragger to list of manipulators for testing purposes 2012-03-06 10:06:00 +00:00
Robert Osfield
f59f4d2929 From Paul Martz, "Just a minor update and typo fix.
"
2012-03-05 14:17:01 +00:00
Robert Osfield
51f3a02f73 From Luc Frauciel, "I've modified dxf writer :
- correction to writeFace : the fourth point was defined with an incorrect code (http://www.autodesk.com/techpubs/autocad/acad2000/dxf/3dface_dxf_06.htm)
- if no layer name was found, an empty string was used, with is incorrect according to dxf specifications and was rejected by Autodesk DWG TrueView
- the plugin was writting polygons and triangles as LINE, as if PolygonMode GL_LINE was active, and didn't use 3DFACE primitive.
   I changed this behaviour to write 3DFACE  as default, and LINE when  PolygonMode GL_LINE is active.
  when reading back the file with osg, the result is now consistent with the source

Tested with osg plugin, FME (Safe software), Autodesk DWG TrueView
"
2012-03-01 11:33:31 +00:00
Robert Osfield
ac2be18fbc From Luc Frauciel, "In 3ds plugin, asGeometry() is used on a drawable but the resulting pointer is not tested for nullity.
It leads to a crash when writing osgText::Text or Shapes"
2012-03-01 11:03:18 +00:00
Robert Osfield
2c7b82b401 From David Callu, "I found a bug in osg::Program.
in osg::Program::PerContextProgram :

typedef std::vector<UniformModifiedCountPair> LastAppliedUniformList;
should be
typedef std::map<unsigned int, UniformModifiedCountPair> LastAppliedUniformList;

Intel driver can use index uniform value > 200000.
With a std::vector, this index uniform value generate an out of memory error

Nothing in OpenGL or GLSL specification define index uniform value rules.
And all other implementation that deal with uniform index in osg::Program
use a std::map.
This fix could have a little performance impact but this is the cost
to pay to work with
all driver."
2012-03-01 10:38:28 +00:00
Robert Osfield
2907284d00 Removed redudent spaces at ends of lines 2012-03-01 10:14:55 +00:00
Robert Osfield
1744617988 Updated ChangeLog and AUTHORS for dev release 2012-02-29 14:01:44 +00:00
Robert Osfield
9c5774defb Improved the handling of endian swap of osg::Array 2012-02-29 10:22:56 +00:00
Robert Osfield
7bcf5e3b36 From Glenn Waldron, "Attached are modifications to ZipArchive to make it safe for mutli-threaded access.
Here's a summary:

* Uses a separate ZIP file handle per thread
* Maintains a single shared (read-only) index, created the first time through
* Stress-tested with the DatabasePager using 24 threads under osgEarth

I also updated the member variables to use OSG's leading-underscore convention."
2012-02-29 10:22:18 +00:00
Robert Osfield
33e7857af9 From Guillaume Millet, "When using the texture Atlas builder, it will convert from REPEAT to
CLAMP all textures using only texcoord between [-0.001 1.001] to give a
chance to create an Atlas.
If the atlas creation failed for other reason (texture size, only one
compatible texture, ...) the texture remain modified in CLAMP mode.

But if you use texcoords between [0.0 1.0] using CLAMP mode instead
REPEAT it is not safe because you will have a blend to the border color
at extremities.
If we want to have exactly the same rendering after changing mode from
REPEAT to CLAMP we should use the CLAMP_TO_EDGE mode instead of CLAMP to
avoid blending to border color at extremities.

Please find as attachment the proposed patch against latest svn version.
"
2012-02-28 12:03:48 +00:00
Robert Osfield
84ca21655e Added build problem with using float Matrix. 2012-02-28 11:37:09 +00:00
Robert Osfield
11c9ec4f7d From Thomas Hogarth, build fix for IOS build 2012-02-28 10:21:21 +00:00
Robert Osfield
1a080dfa6a Added fin.imbue(std::locale::classic()); to avoid problems with parsing of .obj files 2012-02-27 09:50:47 +00:00
Robert Osfield
e8ac276451 Added s/getByteSwap to teh InputStreamOperator base class and use of this method in the InputStream::start(InputStreamOperator*) method to ensure the bytes are swapped consistently. 2012-02-24 21:07:02 +00:00
Robert Osfield
c3fb8dc714 Added support for using glGenerateMipmap instead of GL_GENERATE_MIPMAP_SGIS on GLES2 2012-02-24 12:15:15 +00:00
Robert Osfield
3ca30736b4 Added support for checking the possible endian reversal the OSG_HEADER_LOW and OSG_HEADER_HIGH when reading binary files written out from systems that have a different endian to the system reading it. 2012-02-24 11:43:35 +00:00
Robert Osfield
f86efdcd31 Cleaned up CMake warning 2012-02-24 10:56:48 +00:00
Robert Osfield
b4155dd817 Moved the
state.applyTextureMode(0,GL_TEXTURE_2D,osg::StateAttribute::ON);

into the #if defined(OSG_GL_FIXED_FUNCTION_AVAILABLE) block to solve problems under GLES and GL3.x/GL4.x
2012-02-23 17:51:40 +00:00
Robert Osfield
6d351ba237 From Mathieu Marache, "I was trying to play with the configuratiion files from the data but
couldn't load them with osgviewer's -c CLI switch, this correction
should make the alias work :-)
"
2012-02-23 15:55:30 +00:00
Robert Osfield
949c635d5d From Sergey Polischuk, "In and Out control points were computed incorrectly for some animation channels with cubic bezier interpolation" 2012-02-22 10:50:38 +00:00
Robert Osfield
caceb94db8 From Miha Ravsel, "While trying to create my custom serializer class, i created some dummy data which accidentally popped-up bug in InputStream readObjectFields function.
Bug description:
 Let's say we have class A
namespace Bug
{
class A : public osg::Object
{
public:
  //...
  typedef std::vector<osg::ref_ptr<A> > AList;

protected:
  AList _alist;
  //...
}
}

REGISTER_OBJECT_WRAPPER( A,
                        new Bug::A,
                        Bug::A,
                        "osg::Object Bug::A" )
{
       ADD_LIST_SERIALIZER(A,Bug::A::AList);
}


Bug:
We create say 3 instances of class A: A1,A2,A3 and then we add A2 and A3 and A1 as child instances of A1 so we get next structure:
A1
 |- A2,A3,A1

we call osgDB::writeObjectFile(A1,"/data/a.osgt") -> saved correctly( third element in list is saved as unique id that references parentClass

now we call
A1 = osgDB::readObjectFile("/data/a.osgt");

Everything is deserialized correctely except last element in list which should be same instance as parent A1.

The attached code resolves this issue by passing UniqueID in readObjectFields method and saving object in _identifierMap as soon as we have valid object instance so we can make reference to parent object from any child instance.
"
2012-02-22 10:46:35 +00:00
Robert Osfield
da44e4f4b6 From Paul Martz, "The attached fixes a few issues that are present when ref_ptr implicit casting is disabled." 2012-02-21 17:20:58 +00:00
Robert Osfield
0b88ad24b2 From Olaf Flebbe, "Macos X cleanup:
I added AFAIK proper defaults for several Macos X Version API targets.

* In order to determine which defaults to apply, consult the  CMAKE_OSX_SYSROOT variable pointing to the used SDK, not the pure existence of an SDK.

* Defaults are now:
10.7: Support Intel 32 and 64 Bit Cocoa with imageio picture reader
10.6 + 10.5: Support Cocoa with imageio on Intel and PowerPC
10.4: Carbon, Quicktime and PowerPC

Now OSG compiles out of the box for MacOSX  10.7. , tested with gcc and clang with FlightGear."
2012-02-21 11:30:07 +00:00
Robert Osfield
f56ab3a04e From Chris Denham, "ReaderWriter3DS smoothing group handling corrections" 2012-02-21 11:13:25 +00:00
Robert Osfield
aea4d1a261 Fixed warnings 2012-02-21 10:42:59 +00:00
Robert Osfield
67ce0d5244 Fixed erroneous use #if !defined(OSG_GLES1_FEATURES) && !defined(OSG_GLES2_FEATURES) which should have been #if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE) 2012-02-21 10:38:12 +00:00
Robert Osfield
ec89769e6b From Luc Frauciel, "When dae plugin is used with daeUseSequencedTextureUnitsoption, the transparency processing is done with the wrong texture unit
I've remplaced the unused parameter diffuseColorName by the diffuseTextureUnit effectively used."
2012-02-20 16:00:46 +00:00
Robert Osfield
b213f6030e From Alexander Sinditskiy, "Fix loading small monochrome bmp images" 2012-02-20 12:36:53 +00:00
Robert Osfield
5ac0181cdc From Dietmar Funck, "in order to use a customized database thread it's necessary to use a customized database pager, which creates such customized database threads, too.
I think the best way to achieve this is to overwrite the DatabasePager::addDatabaseThread() method within the customized database pager. However this method is not 'virtual' yet, so I propose to make the method 'virtual'."
2012-02-20 12:33:17 +00:00
Robert Osfield
acb48db89e From Farshid Lashkari, "I've attached a small optimization to osgDB::Registry::removeExpiredObjectsInCache that removes the expired items while iterating over the cache, instead of saving to a temporary vector and then removing." 2012-02-20 12:23:36 +00:00
Robert Osfield
041dd7a871 From Riccardo Corsi, Added passing of EventVisitor pointer to event handlers. 2012-02-20 12:18:50 +00:00
Robert Osfield
2a97715239 From Riccardo Corsi, "please find attached a small patch for HDR plugin,
which simply set by default the internal pixel format to GL_RGB32F_ARB where appropriate.

In the current version there's a comment saying that the plugin set it to GL_RGB8 (even when reading from float) to support old graphics cards,
but the comment dates back to 2004...
What's more I believe that it's correct to expect a floating texture format if you're loading an hdr image.
It was quite troublesome for us to discover why our background image wasn't showing hdr data...

In case you accept the submission, I've removed the comment as it would be misleading to leave it there."
2012-02-20 12:12:43 +00:00
Robert Osfield
48b9b25805 From Johannes Baeurele, "The osg::Image class now contains a 'supportsTextureSubloading()' method that is used inside the Texture2D::apply method. For now it only checks for the etc1 format in which case it returns 'false'. All other formats lead to a return value of 'true'.
Without the change the application does not work properly. First I get the notification that an OpenGL error occured. After some more of this error messages I see broken textures on the screen. With the changes attached to this message my application works as intended."

Note from Robert Osfield, changed the Image::supportsTextureSubloading() to be const and to be implemented in the .cpp rather than inline.
2012-02-20 12:03:14 +00:00
Robert Osfield
981182fb01 From Kim Bale, "The application description for osg2cpp was cut and pasted from osgconv and not changed.
I've added a more relevant description."
2012-02-17 16:51:10 +00:00
Robert Osfield
5a396c91e6 From Martin Lambers, "It adds a new ReaderWriter plugin for the GTA file format
(http://gta.nongnu.org). This allows to read and write floating point
image data. Unlike other formats, GTA also allows very good compression
ratios for floating point data. The compression method can be selected
with the COMPRESSION option of the plugin.
"
2012-02-17 16:45:49 +00:00
Robert Osfield
2f5e19447c Added usage of OSG_CPP_EXCEPTIONS_AVAILABLE for plugins that use std::exceptions. 2012-02-17 16:13:16 +00:00
Robert Osfield
d393604846 From Stephan Huber, "
Here's another small submission for IOS, which adds unique ids to the
touchpoints, so the ids stay the same during a touch-sequence.

(and some minor code enhancements)"
2012-02-10 17:24:08 +00:00