Commit Graph

11651 Commits

Author SHA1 Message Date
Robert Osfield
b32d8e0151 Added computation of the extents, in light space, of the shadow maps RenderStage contents and use of this to produce a tighter bound light space projection. 2011-09-28 10:54:30 +00:00
Robert Osfield
12e8d09ed1 Added a half second sleep after calling system command when the command is run in the background so
that this command has a chance to run and open a window before the calling present3D moves on to the next frame.
2011-09-20 11:46:45 +00:00
Robert Osfield
0b7dbc68c9 Added better error reporting and handling when <key> tag contents are not valid. 2011-09-20 10:59:18 +00:00
Robert Osfield
845d33b353 Added handling of <!DOCTYPE...> tag and "" options. 2011-09-20 10:01:07 +00:00
Robert Osfield
2c1b6789db From Ulrich Hertlein, "attached is a patch that cleans up compiler warnings and common functionality." 2011-09-19 10:42:54 +00:00
Robert Osfield
e557d4f28b From Wojciech Lewandowski, "There was a bug in reading modifier keys when focus to GraphicsWindowWin32 was restored. Handler of WM_SETFOCUS was reading pressed keys and sending WM_KEYDOWN messages to fill initial keyboard state. But WM_KEYDOWN messages sent had 0 on lParam and adaptKey method computing state of modifier mask was using lParam to find which modifier keys are down. Obviously when lParam was 0 it was not recording proper modifier masks.
This patch fixes this code sending proper lParam and also makes sure LEFT_CONTROL will be not confused with RIGHT_CONTROL."
2011-09-19 10:39:19 +00:00
Robert Osfield
8a230d42ed From Luc Frauciel, "You'll find attached a new option that allow, when using LOD in USER_DEFINED_CENTER mode to expand the radius of the node by the radius of loaded objets.
Motivation ;
When using PagedLODs, you don't always know the real size of loaded children,
If it occurs that they  are out of predefined bounds, picking on the parts that are out of bound will fail
They also can be culled out too soon.
The problem often  occurs with long object (roads).
I've modified LOD and ProxyNode to include this option."

and later email:

"Attached the UNION_OF_BOUNDING_SPHERE_AND_USER_DEFINED version
There are impacts on some serializers (dae, osgWrapper).
I haven't modified deprecated osg, since it's deprecated"
2011-09-19 10:34:31 +00:00
Robert Osfield
6e01f05853 Added removal of [..] from names returned from glGetActiveUniform results to avoid issues with name lookups when the driver add the [..] for uniform arrays. 2011-09-19 10:12:53 +00:00
Robert Osfield
f9dffdba2c Copya and Paste Anti-Pattern strikes again! Renamed FreeType usage to Revisions to correct previous mistake when copying and modifying the ReaderWriter. 2011-09-19 09:44:29 +00:00
Robert Osfield
3279e9a5f5 Fixed memory leak 2011-09-14 10:45:11 +00:00
Robert Osfield
420d8f6acf Added missing forward declaration 2011-09-14 10:22:04 +00:00
Robert Osfield
8345c85c3c Added asCamera() methods into osg::Camera and osg::Node 2011-09-14 10:02:11 +00:00
Robert Osfield
0f30c08701 From Laurens Voerman, "attached is a zipped
OpenSceneGraph\src\osgPlugins\ffmpeg\FFmpegDecoderAudio.cpp

It solves a wrong sample format being set for audiostreams type S32 and F32, for the
enum AVSampleFormat (in include/avutil/samplefmt.h) doesn't match
enum SampleFormat   (in include/osg/AudioStream) for anything but
SAMPLE_FORMAT_U8 and SAMPLE_FORMAT_S16
"

and follow up that address versioning issue

"I can find the change, avutil version 50.38.0 introduced a new header file:
libavutil/samplefmt.h
older versions use
libavcodec/avcodec.h
with the sampleformats without AV_

an intermideate fix with the FF_API_OLD_SAMPLE_FMT is removed from ffmpeg 0.8.3 so
I think this is the correct fix:

#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(50,38,0)
#define AV_SAMPLE_FMT_NONE SAMPLE_FMT_NONE
#define AV_SAMPLE_FMT_U8   SAMPLE_FMT_U8
#define AV_SAMPLE_FMT_S16  SAMPLE_FMT_S16
#define AV_SAMPLE_FMT_S32  SAMPLE_FMT_S32
#define AV_SAMPLE_FMT_FLT  SAMPLE_FMT_FLT
#define AV_SAMPLE_FMT_DBL  SAMPLE_FMT_DBL
#define AV_SAMPLE_FMT_NB   SAMPLE_FMT_NB
#endif
"
2011-09-14 09:49:28 +00:00
Robert Osfield
c1af863f78 From Morten Hauknes, "I have been using the getLastVisiblePixelCount on pre 3.0 osg. I believe maybe this was a private function that we made public in our side. I use(d) this method to make a simple algorithm to tell how much visible an object was in percent.
So with the 3.0 api change we propose the following change:
- put OSG_EXPORT on the QueryGeometry class so that we get access to the getNumPixels method.
- Create a function called getQueryGeometry that returns a casted _queryGeode->getDrawable(). Or a function called getQueryGeode that returns _queryGeode."
2011-09-13 13:38:26 +00:00
Robert Osfield
6c46956918 From Jean-Sebastien Guay, removed unneccessary BUILD_QT_EXAMPLES cmake option 2011-09-13 13:33:41 +00:00
Robert Osfield
41924dfc14 From Sukender, "I just fount that writing double precision values (eg. Vec3dArray for vertices) works with .osg but not .osgt/.osgx. So here is the fix (SVN trunk r12712). I suppose .osgb works as expected on this point and did not change anything.
So, as for .osg, if you add "precision 16" (for instance) to the optionString, then you'll get double precision vertices written correctly.
"
2011-09-13 11:48:06 +00:00
Robert Osfield
64fa6aec43 From Robert Milharcic, "This will hopefully fix some issues with osgQt, more precisely with GLWidget event handling. There are at least two current GL context braking events, QEvent::Hide and QEvent::ParentChange. When running in a multithreaded mode they both try to change current GL context in a wrong thread (main GUI thread). The QEvent::ParentChange is also problematic when running in a single threaded model because Qt is going to release current contex then delete it, and then it will create new one, and as a result the osg will continue to render to an invalid deleted context. This changes workaround above problems by deferring execution of the problematic evens. These events has to be enqueued and executed later. The enqueued event processing is currently done right after swap in a swapBuffersImplementation of GraphicsWindowQt while code is running in a render thread by calling QGLWidget handler directly. In principle the deferred events queue should be executed while in GUI thread but I couldn't find any reliable way to do this, that is without risking a deadlock. For now it is assumed, Qt is not going to execute any GUI thread only operations inside the QGLWidget handler." 2011-09-13 11:09:39 +00:00
Robert Osfield
098bc6df5e From Farshid Lashkari, "
The osgUtil::CullVisitor class will display an OSG_INFO notification when attempting to clamp the projection matrix with invalid near/var values. This usually appears when the scene graph is empty or all objects are culled. I don't think this scenario warrants having this message appear every frame. It makes it very difficult to debug other issues when this notification floods the output window.

I'd prefer to have the notification removed, but there might be legitimate cases where you want this displayed. Instead, I just disabled the output if the near/far values are equal to FLT_MAX (their initial values). This should at least prevent the notification for the common case where everything was culled."
2011-09-13 10:15:07 +00:00
Robert Osfield
408c2a2267 From Paul Martz, "Here's my proposed change regarding the osg-users post "small feature culling threshold". I've updated the comments and brought the default values into agreement, but didn't bother to add the environment variable support." 2011-09-13 09:59:21 +00:00
Robert Osfield
c35fdf7333 From Jean-Sebastien Guay, "I added a simple setting in OSG's CMakeLists.txt to be able to disable building anything related to Qt. It just skips the FindPackage(...) for Qt3 and Qt4, so since they are not found nothing related to Qt will be generated by CMake. The default is to build the Qt related stuff, so current behavior is unchanged." 2011-09-13 09:53:34 +00:00
Robert Osfield
698a284da8 From Sukender, "I added a tiny check to avoid an integer divide-by-zero, when image is invalid (ie. all values are 0)." 2011-09-13 09:46:22 +00:00
Robert Osfield
abb7228d56 From Sukender, "I added a crash-guard against corrupted 3DS files, having faces indexes out of the range of existing vertices." 2011-09-13 09:43:45 +00:00
Robert Osfield
6d1ba5b06d From Farshild Lashkari, "Attached is a simple patch that avoids the depth write pass in Text::renderWithDelayedDepthWrites if the current osg::State object has GL_DEPTH_TEST disabled." 2011-09-13 09:21:07 +00:00
Robert Osfield
43483408f3 Reverted Paul Idstein warning fix as this was breaking the build 2011-09-13 09:17:21 +00:00
Robert Osfield
757d00c3c8 From Ulrich Hertlein, Added some error checks and memory cleanup. 2011-09-12 16:24:08 +00:00
Robert Osfield
cd6e174a5c From Stephan Huber, fixed build for OSX 10.6 and earlier 2011-09-12 16:20:45 +00:00
Robert Osfield
cc37579392 From Johannes Baeuerle, opptimization of ES support of osg/BufferObject 2011-09-12 16:17:33 +00:00
Robert Osfield
140a04aebc From Bjorn Blissing, "Found a minor (probably a copy & paste) bug in ViewerEventHandlers.
Line 251:
int getKeyEventWindowedResolutionDown() const { return _keyEventWindowedResolutionUp; }

Should be replaced with:
int getKeyEventWindowedResolutionDown() const { return _keyEventWindowedResolutionDown; }"
2011-09-12 12:38:41 +00:00
Robert Osfield
6e6dafcd3e From Luc Frauciel, "When osgUtil::DelaunayTriangulator triangulate() function ends with no triangle generated, it crashes.
This patch fixes that"
2011-09-12 12:26:55 +00:00
Robert Osfield
ca51a1113b From Magnus Kessler, documentation fixes 2011-09-12 12:14:17 +00:00
Robert Osfield
22dd9df78b Improved the clarity of doxygen comments 2011-09-12 12:04:46 +00:00
Robert Osfield
4b6593b211 Fixed typos in the documentation 2011-09-12 11:51:14 +00:00
Robert Osfield
796ccd14c8 From Cedric Pinson, from three submissions:
"Here a patch that correct like the previous assign collada material name
to stateset."

and

"I changed how the collada reader set object name in osg. Current
implementation use collada ID to setup name. with this patch I use
collada name to setup name in osg object and if collada provide no name
I use as fallback ID. I am not sure we want this fallback.

The motivation of this change is that when an artist set names to its
objects and export to collada, I am not able to use those names in osg
to retrieve the node."

and

"Here the update of the file that fix the light id stuff"
2011-09-12 11:28:14 +00:00
Robert Osfield
19b8b1f474 From Bob Kuehne, build fix for OSX 10.7 SDK. 2011-09-12 11:24:52 +00:00
Robert Osfield
edd83a03fe From Paul Idstein, warning fixes for OSX 10.7 2011-09-12 11:24:24 +00:00
Robert Osfield
9be4a1a1c8 From Magnus Kessler, typo fixes 2011-09-12 10:52:16 +00:00
Robert Osfield
5162fcc108 From Wang Rui, "I've encountered a strange problem that osgviewerMFC doesn't work well
with the StatsHandler. When the 's' key is pressed, the rendering
window will be halted. I tried solving the problem by commenting a
line in CMFC_OSG_MDIView::OnKeyDown() and it seems to work now.

Another improvement here is to use a thread class derived from
OpenThreads to replace the old _beginthread(). It helps a lot in
keeping a high frame rate when you open more than one MDI child
windows. And the application using OpenThreads in my opinion will be
more compatible and portable."
2011-09-12 10:47:59 +00:00
Robert Osfield
c8de3b70ca Updated SO version number to 90 to allow for recent changes to the ABI, and to set the base for the 3.1.0 series. 2011-09-12 10:46:42 +00:00
Robert Osfield
94777c4ef5 From Sukender, "I added private constructors to osg::ValueObject & TemplatedValueObject, to avoid allocation on the stack and ugly things like:
TemplatedValueObject<int> value(....);
 container->addUserObject(value);"
2011-09-12 10:43:24 +00:00
Robert Osfield
83524f958e Added handling the ShadowSettings::LightNum for selecting which light to use. 2011-09-07 20:05:25 +00:00
Robert Osfield
b2fd8f4059 Added handling of the case when RenderLeaf::_modelview matrix is NULL, such as when LightPointNode is used in the scene graph. 2011-09-07 16:26:57 +00:00
Robert Osfield
3a79bc343d Moved ViewDependetShadowMap parameter settings into a dedicated ShadowSettings object in prep for making it possible to scale the API to handle multiple lights and multiple shadow maps per light. 2011-09-07 15:55:54 +00:00
Robert Osfield
772c7d75c5 Added setting of the shadow map Camera's name to "ShadowCamera" to improve integration with osgOcean. 2011-09-06 17:26:27 +00:00
Robert Osfield
f26ef2d9e0 Added optimization of the mutliple cessna shadow model to address peformance issues when rendering 100 cessna's. 2011-09-06 14:13:13 +00:00
Robert Osfield
f95f43dbc6 Added -5 model option using Wang Rui's test demo as a base 2011-09-06 11:42:54 +00:00
Robert Osfield
ecbca83c01 Fixed the heights of the trees and houses 2011-09-06 11:11:38 +00:00
Robert Osfield
f83722d62b Added s/getPerspectiveShadowMapCutOffAngle() and use of this when setting up light space to avoid sigularaties when
the light and view directions are co-incident.
2011-09-06 10:12:45 +00:00
Robert Osfield
15ad6eda63 Added support for setting whether ViewDependentShadowMap should provide it's own vertex and fragment shaders. 2011-09-05 12:36:47 +00:00
Robert Osfield
454ccad3b9 Replaced use of ShapeDrawable with osgTerrain for the terrain tile 2011-09-05 12:27:20 +00:00
Robert Osfield
52c2bc3ff5 Added s/getTextureSize() method for setting the shadow map texture size. 2011-09-02 10:16:16 +00:00