Commit Graph

11789 Commits

Author SHA1 Message Date
Robert Osfield
a5cd9c0630 Changed #ifdef __IPHONE_4_0 to #if defined(__IPHONE_4_0) to fix error that Clang compile warning highlighted 2012-04-19 14:34:28 +00:00
Robert Osfield
c3bfa67576 Fixed build with OSG_USE_REF_PTR_IMPLICIT_OUTPUT set to OFF. 2012-04-19 13:18:58 +00:00
Robert Osfield
9f93b005cc From David Callu, "Here the fix for Matrix{2,3,4}x{2,3,4}{fd} defined in Uniform header.
My previous patch for Atomic Counter Uniform provide new template implementation
of Matrix{2,3,4}x{2,3,4}{fd}. This new implementation use Column-Major Matrix.
Original code define matrix as Row-Major matrix like other Matrix in OSG, and
my matrix implementation break compatibility with previous code.
For example osg_normalMatrix define in osg::State report by Roland Hill.
Thanks to Paul Martz to spot me when the bug appear."
2012-04-19 10:27:58 +00:00
Robert Osfield
9045813aab Added missing getUniformBlocks implmentation 2012-04-19 10:10:26 +00:00
Robert Osfield
c6a4fde917 From Jorge Izquierdo Ciges, "Mostly small changes to add more compile options, and shared linking (still testing that capability, but this enables on a compile basis if the user wants). Robert, when you give the Ok I'll update/rewrite the Android section in the old/new wiki you'll say where is better. Mostly to be clear for the future users what options can configure and what are their purpose." 2012-04-19 09:50:10 +00:00
Robert Osfield
97e4ad473b Refactored the handling of GLES adaptations of the 1,2,3,4 internal formats and added handling of GL_RGB8_OES and GL_RGBA8_OES. 2012-04-18 10:16:09 +00:00
Robert Osfield
01beb82041 From Mathias Froehlich, "Attached is a change to the slow path geometry dispatch tables that allows the
use of 3 component float color vectors."
2012-04-18 09:56:00 +00:00
Robert Osfield
25989e73f5 From Martin Naylor, "I have been experiencing a crash in the example osgtexture2D.
Not sure why my system seems to be so sensitive to these problems.

But attached is a fix which seems to stabilise the example.
Note: it only seems to crash intermittently when spinning the object with
your mouse.

So I assume this is a threading issue because of the data variance missing
in some of the text node setups in the example.
"
2012-04-18 09:51:39 +00:00
Robert Osfield
b882467217 Updated version number 2012-04-18 09:50:23 +00:00
Robert Osfield
96effb3690 From Martin Naylor, "Please find attached a fix for the STD library(tested under Windowsx64
VS2008) when atomiccounter is found but not used."
2012-04-06 11:29:29 +00:00
Robert Osfield
95cac0b549 From Ulrich Hertlein, Fix for MatrixTemplate compile errors 2012-04-06 10:42:17 +00:00
Robert Osfield
5e315d5fab From Wang Rui, "I'd like to submit the changes that will put ObjectProperty and ObjectMark variables into the InputStream/OutputStream class instead of static ones. This should avoid the threading problem and won't repeatedly reallocate memory for the properties. Some of the wrappers will be slightly modified to use the property variable stored in the InputStream/OutputStream as well." 2012-04-05 13:53:47 +00:00
Robert Osfield
28a9a235b6 Update AUTHORS for release 2012-03-30 17:08:21 +00:00
Robert Osfield
bac5e760da Updated ChangeLog for dev release 2012-03-30 16:58:24 +00:00
Robert Osfield
6a40df7b7d Added check to avoid accessing pointer past the end of the string. 2012-03-30 10:10:27 +00:00
Robert Osfield
c0bd5cda99 From Magnus Kessler, typo and documentation fixes 2012-03-29 15:08:15 +00:00
Robert Osfield
ba2432ca45 From Cedric Pinson, "I Updated the ply plugin to support alpha color in files. Plus I updated it to use by default an alpha of 1.0 instead of 0 when no alpha is specified.
Last changes is to divide byte color by 255.0 instead of 256.0."
2012-03-29 14:58:00 +00:00
Robert Osfield
68412a1784 From Magnus Kessler, "remove unecessary conversion from float in double precision method" 2012-03-29 09:57:47 +00:00
Robert Osfield
aab27e106c From David Callu, "Here an update of osg::Uniform :
- add non square matrix
- add double
- add all uniform type available in OpenGL 4.2
- backward compatibility for Matrixd to set/get an float uniform matrix
- update of IVE / Wrapper ReadWriter

implementation of AtomicCounterBuffer based on BufferIndexBinding

add example that use AtomicCounterBuffer and show rendering order of fragments,
original idea from geeks3d.com."
2012-03-29 09:43:12 +00:00
Robert Osfield
59d6931b59 Added int packing parameter to Image::readPixels(..) 2012-03-29 08:27:21 +00:00
Robert Osfield
055e1258ea Removed trailing spaces 2012-03-23 16:09:30 +00:00
Robert Osfield
695e08ec8c Updated ChangeLog and AUTHORS for 3.1.2 dev release 2012-03-23 11:32:10 +00:00
Robert Osfield
eb9f545d67 Fixed potential memory leak 2012-03-23 11:20:17 +00:00
Robert Osfield
1feea279a5 From Luc Frauciel, "I've encoutered a nasty group of dae which are incompatible with dae plugins (and probably collada schema ) in 4 different ways :
1)  they use direct link to texture

-> this is already handle by current plugin : OK

2)  they defined colors with only 3 color components

->  it leads to a crash when trying to acces to the fourth component
 I fixed that

3)  they contain empty primitive lists

-> reading is ok, but osgviewer crashes when trying to display the geometries
The reason is that osg assume that  DrawElementsare never empty (blunt acces to DrawElements.front() in PrimitiveSet.cpp)
I corrected this (on the plugin side), but I wonder :
Is it the responsability of plugins to create non empty DrawElements, or of osg core not to crash when they occur ?
If the responsability is on the osg core side, I can submit a patch to PrimitiveSet.cpp regarding that aspect.

4)  they use a material binding scheme not supported by the plugin

->I've implemented a mechanism to handle this binding scheme

You will also find in the patch an example of these evil dae and comments on the offending elements.
They seems to be produced by ComputaMaps (www.computamaps.com)
They load well in Google Earth
"
2012-03-23 11:16:01 +00:00
Robert Osfield
1227f3f620 From Ulrich Hertlein, "as discussed on osg-users there is an issue with clang++ on OS X and iOS that results in
the following error:

Users/stephan/Documents/Projekte/cefix/cefix/ios/../../libs/ios/include/OpenThreads/Atomic:244:48:
error: cannot initialize a parameter of type 'void *' with an lvalue of
type 'const void *const'
   return __sync_bool_compare_and_swap(&_ptr, ptrOld, ptrNew);

This can be solved by a cast to '(void*)ptrOld'.  This should be benign since both
'ptrOld' and 'ptrNew' are only read and the cast is in fact in place for all other
implementations as well.

On OS X the cast compiles cleanly on both g++ (i686-apple-darwin11-llvm-g++-4.2 (GCC)
4.2.1) and clang++ (Apple clang version 3.1 (tags/Apple/clang-318.0.54)).
"
2012-03-23 10:24:50 +00:00
Robert Osfield
5fc6f0a796 As per Ulrich Hertlrein's suggestion, changed APPLE_PLATFORM_SDK_CANONICAL_NAME to OSG_OSX_SDK_NAME. 2012-03-23 10:21:51 +00:00
Robert Osfield
c2ae14f94d From Erik den Dekker, "
IF(${CMAKE_OSX_SYSROOT} STREQUAL "/Developer/SDKs/MacOSX10.7.sdk")
...

            ELSEIF(${CMAKE_OSX_SYSROOT} STREQUAL "/Developer/SDKs/MacOSX10.5.sdk" OR ${CMAKE_OSX_SYSROOT} STREQUAL "/Developer/SDKs/MacOSX10.6.sdk")

...

ELSEIF(EXISTS /Developer/SDKs/MacOSX10.4u.sdk)
...

            ELSE()

...

            ENDIF()


Which is fragile because XCode could be installed into another directory than /Developer. (In case XCode is not installed into the /Developer directory CMake can automatically resolve the path via command line utility ${CMAKE_XCODE_SELECT} --print-path)

This issue bites me currently because the latest XCode (Version 4.3.1 - 4E1019) installed through the Mac App Store is per default installed in "/Applications/Xcode.app/Contents/Developer" and hence the 10.7 SDK in "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"

Searching the web to find the proper way to determine the version of the Platform SDK programmatically, I found no standard way. I came up with 2 options myself:

1) Parse the path string to extract the version number

2) Read a value from the SDKSettings.plist found in the root of each SDK  (e.g., "defaults read ${CMAKE_OSX_ROOT}/SDKSettings.plist CanonicalName" gives "macosx10.7")

I implemented the last option and verified that at least the following Mac OS SDKs (10.3.9, 10.4, 10.5, 10.6, 10.7) support this method. It also looks reasonably future proof. An additional benefit of this method is that it also seems to be compatible with iOS and iOS Simulator SDKs (at least for version 5.1, but I assume this also applies to older versions). This is interesting because the CMake infrastructure to build OSG for iOS currently still contains similar hard-coded paths and even requires you to manually change the cmake file to build for another iOS SDK version. In the near future I hope to address these issues, but I haven't been able to try this yet."
2012-03-23 10:18:27 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
1e35f8975d For all OSG_GL*_FEATURE #defines changed 1's to true and 0's to false. 2012-03-21 16:02:32 +00:00
Robert Osfield
f551c3dcec From David Callu, "just a typo fix that break the compilation under windows" 2012-03-21 14:08:07 +00:00
Robert Osfield
c3a0a8ddc3 Added Traits::getContextVersion(uint,uint) 2012-03-21 11:36:54 +00:00
Robert Osfield
cee53f6adc Updated version number 2012-03-21 11:26:09 +00:00
Robert Osfield
2f2908b7eb Removed inappropriate warning 2012-03-20 12:01:02 +00:00
Robert Osfield
f51bb8bc70 Replaced && with & to address error in handling bitmask 2012-03-20 11:18:45 +00:00
Robert Osfield
41863ecbb6 From Lukasz Izdebski, Added StencilTwoSided support to ive plugin 2012-03-19 09:49:41 +00:00
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