Commit Graph

12751 Commits

Author SHA1 Message Date
Robert Osfield
cf66750d7b From Farshid Lashkari, "fix for the Collada loader where it would access a null string in some cases" 2014-05-02 09:12:36 +00:00
Robert Osfield
1f33e2a2a0 From Ali Botorabi, "recently I ran into a problem with Microsoft's Appverifier while using OpenThreads on win32 platform. The Appverifier complained about an invalid thread handle during starting of a new thread. After looking closer into the problem it seemed that indeed a potential root of problem may be in the thread startup code. See the line below in Win32Thread.cpp (line number 347):
pd->tid.set( (void*)_beginthreadex(NULL,static_cast<unsigned>(pd->stackSize),ThreadPrivateActions::StartThread,static_cast<void *>(this),0,&ID));

the method "pd->tid.set" sets the thread id, however via the startup function "ThreadPrivateActions::StartThread" that thread id is used (see further down the call hierarchy the line "int status = SetThreadPriority( pd->tid.get(), prio);".

Until now I never ran into any problem in debug or release builds, though. It seems that furtunately the tid.set method was executed always before the tid.get method in the startup code. However, this may make trouble in the furture. A simple solution is the following: just replace the line above with following two lines:

    pd->tid.set( (void*)_beginthreadex(NULL,static_cast<unsigned>(pd->stackSize),ThreadPrivateActions::StartThread,static_cast<void *>(this),CREATE_SUSPENDED,&ID));
    ResumeThread(pd->tid.get());


The trick is just starting the thread in suspended mode so the StartThread function does not get executed and we can safely store the tid by pd->tid.set. Then start the Thread by calling ResumeThread."
2014-05-02 09:11:16 +00:00
Robert Osfield
35d73ea41c From Stephan Huber, fix for OSX build 2014-05-01 15:50:14 +00:00
Robert Osfield
298f1c65b6 Renamed the new include/osg/OpenGL automatically configured header file to include/osg/GL replacing the original hand built GL header 2014-04-30 13:19:22 +00:00
Robert Osfield
e16eb147a1 From Sebastian Messerschmidt, "attached is the compile/linker fix for multiple definitions of getTypeEnum when compiling the Lua with VisualStudio and potentially other compilers.
"
2014-04-30 11:51:40 +00:00
Robert Osfield
a04232a75a From Pjotr Svetachov, "have added some missing serializers for RigGeomery. Withouth them I
ran into two issues.

At first you get a bunch of warnings that osg::ComputeBoundCallback
and osg::UpdateCallback were unsupported wrapper classes when
converting fbx models with skeletal animation to osg(t/b).

The second issue was that when reading, the readers fail to read the
ComputeBoundCallback and UpdateCallback and set them to NULL which
messes up the RigGeometry.

Because a RigGeometry makes his own classes in the constructor it
might be preferable to not write them at all, because now those
classes are being made two times when reading a RigGeometry. But after
thinking about this that would place too much limits on them (you
won't be able to share or name them and save that information or make
a new inherited class from them and write that one) So I ended up
thinking the best way was to just write the files.
"
2014-04-29 15:14:39 +00:00
Robert Osfield
b6404d18c3 From Pjotr Svetachov, "Today I found a bug in the IutputStream class when saving array
attributes in vec3b format. It looks like my compiler takes the wrong
overload and outputs integers instead of characters. The problem is
that vec3b is of type signed char and that is not the same as char (
see http://stackoverflow.com/questions/436513/char-signed-char-char-unsigned-char
) and visual studio 2013 will promote it to integer when choosing an
overload.
It looks like that the InputStream class already takes care of this
issue (if it didn't it would have read everything ok and I would have
not even stumbled upon this bug. :) )"
2014-04-29 13:41:35 +00:00
Robert Osfield
fa6f5219bf From Mattias Helsing, "I finally got to fix the cmake Modules that have duplicates in later
version of cmake. See attached submission. I have tested the ones that
I compile myself (GDAL, Freetype, ZLIB) on ubuntu 12.04 with
cmake-2.8.7."
2014-04-29 12:19:21 +00:00
Robert Osfield
ecd26f9f5b From Paul Martz, "There is no standard place for gl/glcorearb.h on Windows. Previously, the only way to get OSG to build for core profile was to append an additional include directory ("/I") onto the CFLAGS variables This submission adds a FindGLCORE.cmake script so that the path to gl/glcorearb.h can be specified with a variable, GLCORE_ROOT, either in CMake or the environment.
Currently this submission is Windows-only. I don't think OSX or Linux require any help in locating gl/glcorearb.h. But if they do, this submission can be easily modified.

Files:
 - "CMakeLists.txt" is the top-level file.
 - FindGLCORE.cmake" and "OsgMacroUtils.cmake" go in CMakeModules.
"
2014-04-29 12:18:51 +00:00
Robert Osfield
2bb4e0566c From Pjotr Svetachov, "I had the osgvolume example crash on me when loading large volume
datasets due to an overflow in image.cpp after a unneeded cast from
unsigned int to int. Here is a small fix."
2014-04-28 14:58:36 +00:00
Robert Osfield
4dd3e3562f From Jason Beverage, "Here is a fix for a small race condition in osgDB::makeDirectory. It attempts to create all the directories in the given path and stops attempting to make directories when one of them fails. I've added a check to see if the failure occurred b/c the directory was created by another thread or process.
We were running into issues occasionally in osgEarth where multiple threads were writing out files like /1/2/3.jpg and /1/3/4.jpg.  Both threads would try to create the /1 directory and only one of them would succeed.  So the first thread would write out the full /1/2/3.jpg while the second thread wouldn't create the /1/3 directory b/c /1 was already created and the writing of /1/3/4.jpg would fail.
"
2014-04-28 14:57:05 +00:00
Robert Osfield
f5261b9877 Fixed type error 2014-04-28 11:53:58 +00:00
Robert Osfield
4994b806d2 From Pjotr Svetachov, "For me osgviewer.cpp and Renderer.cpp were not compiling (visual studio 2013 with profile GL2) because they were still using GLuintEXT. So I changed that, see the attached files.
I also noticed that the generated OpenGL header were not copied to the installation directory so my own application could not find it."
2014-04-25 08:57:27 +00:00
Robert Osfield
6a0270279c Reordered the configuiration file blocks to make it more understandable 2014-04-25 08:56:53 +00:00
Robert Osfield
3ec6938b95 From Paul Martz, fixed placement of OpenGL header so that it gets generated and placed in the build directory as per the Config file 2014-04-25 08:18:03 +00:00
Robert Osfield
7b4d7cd221 From Farshid Lashkari, "I've attached a small fix to the Collada loader which prevents a null pointer access in some cases." 2014-04-24 17:26:46 +00:00
Robert Osfield
77f1c58345 From Lionel Lagarde, "In the ::apply method, when the image data need to be re-uploaded, the Texture2DArray checks if the TextureObject can be re-used. The test was made using the constant 1 instead of the real texture depth, so the TextureObject was never re-used." 2014-04-24 17:23:16 +00:00
Robert Osfield
bc5575f83a From Kristofer Tingdahl, "I and my team have gone over the code again, and we feel that we are comfortable in our current proposal for change. It goes deeper than it did before, and I explain why:
There was code in the osgViewer/Viewer.cpp and osgViewer/CompositeViewer.cpp that transformed the Y-coordinates of an event. The code in the composite viewer did however miss the touch-data of the event. I thought that it should really be the GUIEventAdapter that should know about this, and hence I added the
GUIEventAdapter::setMouseYOrientationAndUpdateCoords which is re-computing the coordinates. First I simply added a boolean to the setMouseYOrientation function:

setMouseYOrientation( MouseYOrientation, bool updatecooreds=false );

but then the serializer complained.

This function is called from both the Viewer and the CompositeViewer. We have not tested from the viewer, but I cannot see it would not work from visual inspection.

The other change is in MultiTouchTrackballManipulator::handleMultiTouchDrag. I have removed the normalisation. The reason for that is that it normalised into screen coordinates from 0,0 to 1,1. The problem with that is that if you have a pinch event and you keep the distance say 300 pixels between your fingers, these 300 pixels represent 0.20 of the screen in the horizontal domain, but 0.3 of the screen in the vertical domain. A rotation of the pinch-fingers will hence result in a zoom in, as the normalised distance is changing between them.

A consequence of this is that I have changed the pan-code to use the same algorithm as the middle-mouse-pan.

The rest of it is very similar from previous revision, and there has been some fine-tuning here and there.

"
2014-04-24 17:14:54 +00:00
Robert Osfield
6f2d003bc5 From Mattias Helsing, "Seems I was only half right given what you asked for. CMP0017 only
says that modules that are found and ran from cmake modules dir should
prefer cmake-provided modules. find_package() and include() still look
in CMAKE_MODULE_PATH first.

After some investigating I've come up with a proposal examplified in
the attached FindGDAL.cmake script. It simply calls the cmake provided
FindGDAL.cmake if it exists and returns if it succeeds in finding GDAL
using that, otherwise continue with our local cmake code.
Pro: Wont clutter our root CMakeLists.txt
Con: If we begin to write more advanced Findxxx modules (using
COMPONENTS, REQUIRED etc.) we may have to revise this scheme.
"
2014-04-24 10:49:57 +00:00
Robert Osfield
ec658b115c Fixed reference invalidation bug. 2014-04-24 10:38:58 +00:00
Robert Osfield
a43cc12394 Fixed typo in OPENSCENEGRAPH_OPENGL_HEADER name 2014-04-24 07:22:55 +00:00
Robert Osfield
ef76994c05 Removed header as this CMake generated configuration file is not required to be part of svn repository 2014-04-24 07:20:44 +00:00
Robert Osfield
a1342a6bf6 Added src/osg/OpenGL.in configuration file and include/osg/OpenGL header files 2014-04-23 19:30:33 +00:00
Robert Osfield
5597248895 Introduced new scheme for setting up which version of OpenGL/OpenGL ES the OSG is compiled for.
To select standard OpenGL 1/2 build with full backwards and forwards comtability use:

  ./configure
  make

OR

  ./configure -DOPENGL_PROFILE=GL2

To select OpenGL 3 core profile build using GL3/gl3.h header:

  ./configure -DOPENGL_PROFILE=GL3

To select OpenGL Arb core profile build using GL/glcorearb.h header:

  ./configure -DOPENGL_PROFILE=GLCORE

To select OpenGL ES 1.1 profile use:

  ./configure -DOPENGL_PROFILE=GLES1

To select OpenGL ES 2 profile use:

  ./configure -DOPENGL_PROFILE=GLES2


Using OPENGL_PROFILE will select all the appropriate features required so no other settings in cmake will need to be adjusted.
The new configuration options are stored in the include/osg/OpenGL header that deprecates the old include/osg/GL header.
2014-04-23 09:08:26 +00:00
Robert Osfield
560587c88f Fixed comment 2014-04-14 16:16:08 +00:00
Robert Osfield
5015fb6dac Renamed FindFreeType.cmake to FindFreetype.cmake to enable CMake build to pick up on CMake's own FindFreetype.cmake when it's available. 2014-04-13 16:04:27 +00:00
Robert Osfield
c168887e5e From Paul Cheyrou-Lagreze, "Attached is fix/feature for FBX osgplugins against latest trunk:
- ReaderWriterFBX.cpp: add "z up scene axis" support:  FBX provides facility to convert model scene axis during conversion. Currently fbx plugin convert axis to fbx:opengl axis system (which is arbitrarily at Y up, as opengl is in reality axis agnostic) and sometimes what is needed is Z up so added an option for Z up conversion

- FindFBX.cmake: add support for latest fbx sdk ( 2014.2 )"
2014-04-09 17:40:27 +00:00
Robert Osfield
db6df6fefd Disabled warnings to address issues in FBX headers that generate lots of warnings that we can't fix. 2014-04-09 17:20:26 +00:00
Robert Osfield
ef5be684ed Added extra search paths to add compatibility with Kubuntu/Ubuntu 14.04 now locaton for freetype 2014-04-08 19:42:05 +00:00
Robert Osfield
51671348f7 Updated ChangeLog and fixed Contributors list 2014-04-08 17:45:21 +00:00
Robert Osfield
a4a5957e2f From Remo Eichenberger, "I have extended the TIFF plugin that allows you to write LZW or JPEG compressed TIFF's. Options are:
tiff_compression = lzw | jpeg"
2014-04-08 12:00:52 +00:00
Robert Osfield
25ddbf8f1f From Sebastian Messerschmidt, "n the trunk version the osgGA::GUIActionAdapter has additional functions for lineIntersection which use osgGA::GUIEventAdapter&, but the class declaration is neither forwarded, nor is the header included.
Using the trunk together with osgEarth 2.5 will fail to build, due to the missing type.

Attached is the file forward declaring osgGA::GUIEventAdapter."
2014-04-08 11:48:34 +00:00
Robert Osfield
f2b746520b From Pjotr Svetachov, "We had a small problem converting skeleton animations from fbx to osgt
format. Turned out that the serializer didn't handle bone names with
spaces very well (the 3ds studio max biped for instance has spaces by
default). Here is a small fix for the problem."
2014-04-08 11:17:59 +00:00
Robert Osfield
ca4d93652d From Pjotr Svetachov, previous obj "commit broke compilation under visual studio 2013. To use std::not1 you need to include the functional header. Here is a fix." 2014-04-08 11:08:05 +00:00
Robert Osfield
efc493cfa0 Fixed build when using of double BoundingBox/BoundingSphere 2014-04-07 15:04:34 +00:00
Robert Osfield
391ab02573 From Jan Peciva, "I am sending four fixes to obj plugin:
- materialName used to be not stripped of whitespace, making number of models
fail to load materials; now fixed
- stripping was considering spaces only, thus models using tabs had problems
to load correctly; fixed
- fixed references to textures; they did not performed conversion to native
directory separators
- make d (dissolve) takes precedence over Tr (transparency); there seems to be
a confusion about the Tr item - some claiming 1 to be opaque and 0
transparent, while number of models uses exactly the opposite. d (dissolve),
if present in the model, does not suffer from this confusion, thus using it
instead fixes the problem for many many models.

I put many comments to the file concerning d and Tr item as others may further
investigate. Let me know in the case of any problems."
2014-04-07 14:17:57 +00:00
Robert Osfield
64979a0c1a From Marcel Pursche, "The problem is that when OpenThreads is build with the Linux pthreads implementation all threads inherit the processor affinity from their parent thread.
This behavior is also described in the pthreads man page (http://man7.org/linux/man-pages/man3/pthread_create.3.html):

>
> Linux-specific details
> The new thread inherits copies of the calling thread's capability
> sets (see capabilities(7)) and CPU affinity mask (see
> sched_setaffinity(2)).
>

To prevent this behaviour I wrote a patch that explicitly sets the affinity mask to all cores of the system, if no specific affinity was defined with PThread::setProcessorAffinity(unsigned int) .

Thank you!
"
2014-04-07 14:11:14 +00:00
Robert Osfield
20c0292e97 From Bjorn Blessing, "I got bored of the constant reports of “missing chunk 0xA08A” when reading 3ds-files. After a bit of research I discovered that this property is related to the advanced transparency settings for the material in 3D studio. In this case the falloff parameter. These controls affect the opacity falloff of a transparent material. And the property chooses whether falloff is in or out. I have added the property to the file reader BUT no changes are made to make this property propagate into the osgMaterial. But at least we get rid of this annoying error message." 2014-04-07 14:03:40 +00:00
Robert Osfield
88aa9ac5de From Bjorn Hein, "please find attached a small fix for RayIntersector.cpp.
* Changes are made against trunk
* Reason: crashes when using specific constructor from RayIntersector
* Info: Line 42:  added in constructor
RayIntersector::RayIntersector(const Vec3d& start, const Vec3d&
direction) missing initialisation of _parent
"
2014-04-07 13:52:01 +00:00
Robert Osfield
ac380e03c4 From Paul Martz, "We discussed the issue of GL_RED_SNORM and GL_RG_SNORM some time ago, but the issue was never completely resolved. Please see the attached submission to fix the issue.
osg/GL2Extensions was incorrectly defining GL_RED_SNORM and GL_RG_SNORM as part of the definitions for OpenGL v3.1. However, a quick review of the 3.1 spec indicates that these are not part of the 3.1 standard.

My attached change moves these definitions out of the #ifndef GL_VERSION_3_1 conditional block, and defines them conditionally if not already defined. This allows the DDS plugin to build for GL3.
"
2014-04-07 13:48:15 +00:00
Robert Osfield
67b4d5412b Fixed iso surface shaders 2014-04-04 11:25:51 +00:00
Robert Osfield
d773d358c4 Improved the setting of sample density/ratio so that they are consistent 2014-04-01 18:56:57 +00:00
Robert Osfield
e5fe59799d Fixed handling of volume tiles with a region. 2014-04-01 18:33:02 +00:00
Robert Osfield
27b71e3927 Added cube and hull rendering support 2014-03-27 12:47:44 +00:00
Robert Osfield
2f8b0f7a70 Restructured the handling of TileData to make it more extensible and flexible. 2014-03-19 17:56:40 +00:00
Robert Osfield
d7944b6ca9 Addd ExteriorTransparencyFactorProperty for support of upcomming functionality of rendering a cube volume with a hull volume inside it. 2014-03-18 18:14:15 +00:00
Robert Osfield
ed724a730e Added support for animating volume hulls. 2014-03-17 15:54:52 +00:00
Robert Osfield
d703a2df44 From Stephan Huber, "attached is a fix for the rest-http-plugin which should fix the font-issue reported by Phil. The old implementation did forward all requests to the internal http-server via user-events. This prevented error-reporting for missing files, as the request was accidentally handled by the plugin. As a request for missing font-file succeeds and returned an empty file, the curl-plugin hands the data happily to the freetype-plugin which failed trying to load an empty font-file, obviously.
My fix was to rename the standard request handler to a specialized user-event-handler which handles only requests for "/user-event“

So fonts should work on iOS when loaded remotely, even when a local file is available and with the resthttp-plugin serving the presentation.
"
2014-03-13 14:02:50 +00:00
Robert Osfield
7f206fbf80 From Stephan Huber, fix for building lua plugin from local source 2014-03-13 13:59:34 +00:00
Robert Osfield
ea865d0ff9 Added support for directly invoking scripts using <run-script> and <run-script-file> to enable scripts to interact with each other. 2014-03-13 10:28:18 +00:00