Commit Graph

8505 Commits

Author SHA1 Message Date
Robert Osfield
7d947d79ff From Wang Rui, "I've found a very covert bug in current VDSM implementation. It makes the computation of positional texgen incorrect if the shadow scene is under one or more child cameras with view/proj offsets. Using current stage instead will fix it." 2012-12-03 10:10:46 +00:00
Robert Osfield
e6141b984d Added include of osc plugin directory to help with Windows build 2012-12-03 09:35:12 +00:00
Robert Osfield
3e32d9c8af Fixed crash when no CameraManipulator is assigned to the viewer 2012-11-30 20:03:31 +00:00
Robert Osfield
d831f1b538 Added support for 0x and numeric defintion of keys to be used with <click_to_event> functionality. 2012-11-30 16:52:59 +00:00
Robert Osfield
6eb3b2f091 Added support for pausing and restart the property_animation. 2012-11-30 15:43:31 +00:00
Robert Osfield
236e75b2be Added xml defined property/property animation to .p3d format for <volume> propeties:
alpha="$alphaname"
   cutoff="$cutoffname"
   region="$minx $miny $minz $maxx $maxy $maxz"
   sampleDensity="$densityname"
   sampleDensityWhenMoving="$densityname"
2012-11-30 14:21:45 +00:00
Robert Osfield
7ffde8abce From Stephan Huber, New OscSendingDevice and OscReceivingDevice classes 2012-11-28 13:28:20 +00:00
Robert Osfield
8b231ba8e3 From Stephan Huber, added event sending support into osgGA::Device along with implementation on this into the osc plugin. Added osgoscdevice example to demonstate this in action. 2012-11-28 10:43:58 +00:00
Robert Osfield
694e603d15 Added support for <properties> tag for <presentation>, <slide> and <layer> scope to compliment the scope of <property_animation> 2012-11-27 16:00:43 +00:00
Robert Osfield
42529ca415 Added preliminary support for <property_animation> 2012-11-27 15:09:44 +00:00
Robert Osfield
a31d603f9a From Stephan Huber, "Attached you'll find a new ImageSequence.cpp which will fix an issue I had when moving the mouse cursor over the left window-border, as the index becomes negative. And I added a UdpSocket.cpp-file with more debuggin-output via some sprinkled printf-calls. " 2012-11-22 15:13:46 +00:00
Robert Osfield
1f50f23f86 Simplified CMakeLists and adjusted OscHostEndianness to automatically detect the endian at compile time 2012-11-22 11:55:38 +00:00
Robert Osfield
9ef448c7b1 From Stephan Huber, updates to explictly set the HOST Endian using Cmake 2012-11-22 11:47:03 +00:00
Robert Osfield
56bc0b14bc Added explict handling of osg::Image, osg::HeightField, osg::Shader and osg::Node when doing writes to the archive. 2012-11-22 09:49:24 +00:00
Robert Osfield
f0b3a47735 From Stephan Huber, further work on osc plugin 2012-11-21 15:19:58 +00:00
Robert Osfield
4b4327aaae Moved static for local to global scope in Uniform.cpp and removed the local static usage in Registry.cpp 2012-11-21 14:27:54 +00:00
Robert Osfield
3a67eefd9f Refactored osgDB::Input::readObjectOfType to use a template, and updated associated wrappers to avoid using local static's 2012-11-21 13:38:11 +00:00
Robert Osfield
ea9e13a0c6 From Paul Martz, fix for Windows build 2012-11-20 18:41:30 +00:00
Robert Osfield
7e67ac7a34 From Stephan Huber, added missing windows dependency 2012-11-20 13:01:57 +00:00
Robert Osfield
f3e9967f47 Added ws2_32 library to Win32 build 2012-11-20 10:37:42 +00:00
Robert Osfield
8b30807ef1 From Paul Martz, build fixes 2012-11-19 11:25:52 +00:00
Robert Osfield
e2ee774705 Frm Stephan Huber, osc plugin that supports send and recieving events via UDP packets. 2012-11-19 10:48:37 +00:00
Robert Osfield
c005e6997c Added first cut implememtation of PropertyAnimation class 2012-11-16 15:40:41 +00:00
Robert Osfield
10c43a3052 Moved PropertyManager related classes out from SlideEventHandler into their own dedicated header/source file. 2012-11-15 12:11:19 +00:00
Robert Osfield
057f8a8b3b Added support for <image blending="ON" or blending="OFF"> to allow user definition of when to enable OpenGL blending for an image or not. 2012-11-13 14:22:37 +00:00
Robert Osfield
0c02ef358f From Stephan Huber, fixed warning 2012-11-13 13:52:33 +00:00
Robert Osfield
933baf5db4 Changed COLOUR to COLOR to be consistent with OpenGL spelling 2012-11-13 13:32:01 +00:00
Robert Osfield
92975a01fd Moved colour space conversion of volumes from the osgvolume example into osg/ImageUtils and added support for colorSpaceConversion="MODULATE_ALPHA_BY_LUMINANCE","MODULATE_ALPHA_BY_COLOUR","REPLACE_ALPHA_WITH_LUMINANCE" and "REPLACE_RGB_WITH_LUMINANCE" to .p3d <volume> tag 2012-11-13 13:16:10 +00:00
Robert Osfield
e72af02c2b Added first step to adding pruning of expired image requests. 2012-11-13 11:45:20 +00:00
Robert Osfield
ad1cec1b2e From Stephan Huber, introduced syncornization of osgGA::Device 2012-11-13 11:20:36 +00:00
Robert Osfield
bf4daf11ff Cleaned up reported of events and added assigned of <volume> tag region properities when using the wildcard definition of the volume. 2012-11-12 16:46:08 +00:00
Robert Osfield
e8b86dc4ec Added missing files in support of key_jump and key_run tags 2012-11-10 12:12:24 +00:00
Robert Osfield
ff476e9c15 Added support for naming slides and layers with slide_name and layer_name properties respectively.
Added support for creating events based on key presses using a <key_to_run> and <key_to_jump> tags.
2012-11-09 21:32:54 +00:00
Robert Osfield
fd4126dc59 Added Node::getName() and getUserDataContainer() to check to see if an node can be removed or not. 2012-11-09 21:23:42 +00:00
Robert Osfield
36f6ef7242 From Alexander Sinditskiy, "I found issue with capturing mouse buttons.
This issue can be reproduced:
1. Create osgViewer window,
2. Push right&left mouse buttons on the osgViewer window,
3. Move mouse out of window, and release right&left mouse buttons.

osgViewer window handle only first mouse release, as result window thinks that we did not released second mouse button.

I attached fix for this issue."
2012-11-08 17:19:51 +00:00
Robert Osfield
1b871a822d Added support for <imagesequence interaction_mode="USE_MOUSE_Y_POSITION"> 2012-11-08 15:45:23 +00:00
Robert Osfield
b51bbaa406 Added check to avoid doing update when the imagesequence is empty. 2012-11-08 14:15:59 +00:00
Robert Osfield
014f13f774 Refactored ImageSequence to better handle random access usage. 2012-11-08 11:19:31 +00:00
Robert Osfield
4fa32ee0b8 From Stephan Huber, improved performance by using native apple functions for flipping image 2012-11-06 11:18:33 +00:00
Robert Osfield
f09b9576c6 From Stephan Huber, "Attached you'll find a fix for the image-io-plugin to handle out-of-memory situations more gracefully as before (don't crash)" 2012-11-05 17:22:34 +00:00
Robert Osfield
7cb6e103f4 Quitened down debug output 2012-11-05 12:21:34 +00:00
Robert Osfield
d7ce523529 From Stephan Huber, updated to debug output to RestHttpDevice and tweaks to ImageIO and QTKit plugins 2012-11-05 12:03:50 +00:00
Robert Osfield
e45bdb60d7 From David Longest, "When drawing, a transform with an absolute reference frame will ignore the
calculated model / view matrices up to that point. The IntersectionVisitor would instead keep the
view matrices calculated up to that point even though the Transform class will throw out the
calculated model matrix via “computeLocalToWorldMatrix.”

The change I made will push an identity matrix as the view matrix when running into a transform
with an absolute reference frame and will pop the matrix off after the traverse.

To test this, I created a camera with a perspective view and added a transform with some geometry
in it. Afterwards, I set the transform’s reference frame to ABSOLUTE_RF and spun the camera around
using the trackball manipulator. When trying to pick with a LineSegmentIntersector, it would not
pick the geometry in the transform with the reference frame set to ABSOLUTE_RF."
2012-11-01 18:06:46 +00:00
Robert Osfield
2e1f90f7e8 Changed the PropertyEventCallback to only respond to mouse releated events. 2012-11-01 16:11:13 +00:00
Robert Osfield
9271b53c56 2012-11-01 14:29:26 +00:00
Robert Osfield
a6f3e0af78 Added event and update callbacks to pass up changes to the mouse position to the ImageSequence::seek() to control which images is selected based on mouse x position 2012-10-31 16:07:23 +00:00
Robert Osfield
fa2fb07609 From Stephan Huber, RestHttpDevice plugin for support of remote application control via Rest http. 2012-10-30 12:31:27 +00:00
Robert Osfield
d879cd7715 Intial work towards support an interaction <imagesequence> tag in Present3D. 2012-10-29 15:58:02 +00:00
Robert Osfield
ce623c697e From Luc Frauciel, "Compile Fix - KTX plugin with Visual Studio, <stdint.h>not defined under MSVC" 2012-10-26 15:31:18 +00:00
Robert Osfield
cebb9f6103 Fixed bug in click_to_run feature where events would be handled by hidden labels 2012-10-24 16:10:38 +00:00
Robert Osfield
f9fd4342ba From Stephan Huber, "attached you'll find the latest versions of the QTKit + the AVFoundation-plugin, some changes to osgPresentation and a small enhancement für ImageIO.
I fixed some bugs and did some more tests with both of the video-plugins. I integrated CoreVideo with osgPresentation, ImageStream has a new virtual method called createSuitableTexture which returns NULL for default implementations. Specialized implementations like the QTKit-plugin return a CoreVideo-texture. I refactored the code in SlideShowConstructor::createTexturedQuad to use a texture returned from ImageStream::createSuitableTexture.

I did not use osgDB::readObjectFile to get the texture-object, as a lot of image-related code in SlideShowConstructor had to be refactored to use a texture.  My changes are minimal and should not break existing code.

There's one minor issue with CoreVideo in general: As the implementation is asynchronous, there might be no texture available, when first showing the video the first frame. I am a bit unsure how to tackle this problem, any input on this is appreciated.

Back to the AVFoundation-plugin: the current implementation does not support CoreVideo as the QTKit-plugin supports it. There's no way to get decoded frames from AVFoundation stored on the GPU, which is kind of sad. I added some support for CoreVideo to transfer decoded frames back to the GPU, but in my testings the performance was worse than using the normal approach using glTexSubImage. This is why I disabled CoreVideo for AVFoundation. You can still request a CoreVideoTexture via readObjectFile, though.
"
2012-10-24 10:43:01 +00:00
Robert Osfield
1591fe09f3 Added osgGA::Device class for integration of both physical and virtual devices.
Added template readFile(..) function to make it more convinient to cast to a specific object type.

Added support for osgGA::Device to osgViewer.

Added sdl plugin to provides very basic joystick osgGA::Device integration.
2012-10-23 16:15:03 +00:00
Robert Osfield
f9ad1e5673 Added mutex lock to Uniform::addParent()/removeParent(). 2012-10-22 16:21:04 +00:00
Robert Osfield
1872137d88 Added serializers for osgGA 2012-10-12 14:51:08 +00:00
Robert Osfield
ad926d7265 Removed the insert of requests in the ImageSequence::_filesRequested data structure so that it always requests files, leaving it up the ImagePager to decide to track duplicates 2012-10-09 16:14:21 +00:00
Robert Osfield
9fab99ddd9 From Wang Rui, "I modified the Serializer header to add a UPDATE_TO_VERSION_SCOPED
macro, which could set version within brackets and reset it after
that. All related serializers are also modified so that the
backward-compatibility bug reported by Farshid can be fixed.
"

From Robert Osfield, removed the use of osg::Referenced and creating the proxy object on the heap.
2012-10-09 16:05:50 +00:00
Robert Osfield
16de7e9f33 From Wang Rui, "I've added CDATA tag support to XmlParser so that we can keep user
data (e.g., GLSL shader texts) in XML files without parsing them. This
will be necessary for the coming-soon effect compositor submission.
:-)"
2012-10-08 16:14:23 +00:00
Robert Osfield
7244e97850 From Aurelein Albert, "Under some Visual Studio configuration, I get compile error on "lib3ds_io.c" due to use of these kind of conversion :
b[1] = uint8_t((w & 0xFF00) >> 8);

I replaced it with :

    b[1] = (uint8_t)((w & 0xFF00) >> 8);

And it compiles fine
"
2012-10-08 15:10:56 +00:00
Robert Osfield
4235169d41 From Gill Peacegood, "In the attached file I have changed the colour space used for writing images to match the one used for reading images. Also this color space does not make subtle changes to the original colours which i think is probably what most people intend when writing an image and is more consistent with other plugins.
The effect is that an image that is written does not have a noticeably different colour when it is read back."
2012-10-08 12:00:53 +00:00
Robert Osfield
232bda3828 From Oren Fromberg, ""
--This line, and thosAttached is an update to ReaderWriterDAE.cpp/h and daeReader.cpp/h that implements

osgDB::ReaderWriter::ReadResult

ReaderWriterDAE::readNode (std::istream&, const osgDB::ReaderWriter::Options*)

This virtual function had never been implemented in ReaderWriterDAE. I implemented this function because the DAE plugin could not load files from other ReaderWriter derived objects that use protocol handlers.

I have updated function declarations in the header to have identical signatures with the base class declarations that include the default parameter.


readNode (std::istream&, …) is nearly identical to readNode(const std::string &, …) except it uses a new private function to convert the file from standard input:

bool daeReader::convert( std::istream& fin )

When this function is called fileURI is the string “from std::istream” to make the user aware where the file is coming from. Then instead of calling

_dae->open(fileURI)

we call

_dae->openFromMemory(fileURI, buffer.data())

Where buffer.data() is a pointer to the dae file text in memory.


Other changes include private functions to clear caches and to consolidate redundant code that appears between the two convert functions.


e below, will be ignored--

M    src/osgPlugins/dae/ReaderWriterDAE.cpp
M    src/osgPlugins/dae/daeReader.cpp
M    src/osgPlugins/dae/ReaderWriterDAE.h
M    src/osgPlugins/dae/daeReader.h
2012-10-08 11:54:40 +00:00
Robert Osfield
b742a9e71a From James Athey, "I've attached a new osgDB ReaderWriter that can read Khronos Texture Files
(KTX).  The KTX file format is straightforward and designed to be easy to
use in OpenGL.

http://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/
http://www.khronos.org/opengles/sdk/tools/KTX/

The attached plugin can read:

* 1D, 2D, and 3D textures
* uncompressed and compressed images
* mipmapped and non-mipmapped textures
* little-endian and big-endian files
* textures from files as well as seekable istream objects

It does not handle:

* array textures (not supported by the ReaderWriter API)
* cubemap textures (not supported by the ReaderWriter API)
* the "KTXorientation" key-value pair; support could be added later (see
the file format spec for more information)
* non-seekable istream objects (would require more complicated memory
management)
"
2012-10-08 11:10:25 +00:00
Robert Osfield
47c5ddbce5 Improved ImageSequence's handling of seek() and added a simply hack to ImagePager to prevent the number of requests accumulating. 2012-10-05 10:37:36 +00:00
Robert Osfield
23786604c6 From Stephan Huber, "attached you'll find a fix for Registry.cpp not using the QTKit-plugin for video-files. W/o this fix you had to preload the plugin to open movie-files." 2012-10-04 13:45:54 +00:00
Robert Osfield
1796d55bea From Stephan Huber, OSX and iOS Video support via a QTKit plugin from OSX 10.7 and before, and an AVFoundation plugin for iOS and OSX10.8 and later. 2012-10-02 14:07:12 +00:00
Robert Osfield
0dbafcc316 From Leigh Stivers, "We had this problem which shows up with nVidia's latest Quadro driver, 305.93 - and older drivers when the nVidia's setting "Thread Optimization" was turned on, running Windows 7. The symptom, is that after creating a first view and using it, and then creating a second view, the first view will never render anything but black.
What happens is this:
A view is created, and then the viewers thread is created and runs.
The setReleaseContextAtEndOfFrameHint is true.
To create a second view, the viewer is setDone(true), and we wait for the thread exit.

At this point, inside the ViewerBase::RenderingTraversals code, there are places where it reads "if(_done) return;"

The problem, is that it won't reach the code that will releaseContext().

Apparently, this driver won't let any other thread to makeCurrent(), if another thread (dead or not) has ownership.  So when the Viewers is re-started, the first view won't be able to use the gc.

The change attached (against rev 13153) corrects this."
2012-09-28 16:36:42 +00:00
Robert Osfield
4896edda56 From Thomas Hogarth, "Apple have decided in their eternal wisdom to do away with separate depth and stencil buffers on iOS from version 5 and above.
Attached are changes to GraphicsWindowIOS.mm to support setting up the new buffer type when compiling for iOS5,
also attached is a small change to FrameBufferObject.cpp to report support for packed depth stencil via the
GL_OES_packed_depth_stencil extension.

For anyone reading this you can attach a packed depth stencil to your FBO like so

_rttCamera->attach( osg::Camera::PACKED_DEPTH_STENCIL_BUFFER, GL_DEPTH24_STENCIL8_EXT );

Luckily GL_DEPTH24_STENCIL8_EXT happens to have the same value as iOSs GL_DEPTH24_STENCIL8_OES"
2012-09-27 08:34:56 +00:00
Robert Osfield
0e8bcc9027 From Frederic Bouvier, "fix PNG write for images with bits per components different than 8 that was hard coded." 2012-09-24 10:10:28 +00:00
Robert Osfield
ea631c777d From Aurelien Albert, "In the DXF plugin, DXF layers are decoded and each layer is added in a separate group, which is very usefull to retrieve a layer or display a list of all layers in the aplication.
But the layers are not always children of the "model root" node : there can be a matrix transform between "model root" and "layers parent", so I've added the name "Layers" on the node which contains all layers to easily retrieve the layers groups from application code."
2012-09-20 14:06:01 +00:00
Robert Osfield
01c7d87b1a From Farshid Lashkari, Added GLBeginEndAdapter::reset(), and _overallNormalAssigned, _overallColorAssigned flags to avoid the GLBeginEndAdapter adapter setting colour and normals when none has been assigned. 2012-09-20 11:18:19 +00:00
Robert Osfield
d511288718 From Ulrich Hertlein, "attached is a patch to src/osgViewer/CMakeLists.txt that inverts the logic of when to use
Cocoa and when to use the old Carbon interface for the windowing system.

The old code had to be modified for every new OS X release to default to Cocoa.
The new code uses Carbon for <= OS X 10.4 and Cocoa on everything else."
2012-09-20 11:16:02 +00:00
Robert Osfield
b32cf216a7 Added ReadQueue::size() method to help with debugging. 2012-09-20 11:14:10 +00:00
Robert Osfield
5d5cf26138 Added osgDB::getSortedDirectoryContents and osgDB::FileNameComparator to help with sorting directory contents into alphabetic and numerical order. 2012-09-12 16:02:02 +00:00
Robert Osfield
cfe36876d4 Converted sorting of directory contents across to use the new osgDB::FileNameComparator and osgDB::getSortedDirectoryContents() 2012-09-12 11:09:41 +00:00
Robert Osfield
55d03d5b34 Added setting of the input range of the event state based on the master cameras viewport. 2012-09-07 09:31:26 +00:00
Robert Osfield
53405c118a Added check so not intialization is down when you select the current camera manipulator 2012-09-07 08:33:24 +00:00
Robert Osfield
0b778533c8 From Piotr Domagalski, "I've added reading of node names ('DEF' element) to the VRML reading plugin. The changes were based on trunk's version of the plugin." 2012-09-06 13:53:58 +00:00
Robert Osfield
46104008c7 From Piotr Domagalski, "I've rewritten some bits of the STL plugin in order to support ASCII STL files with multiple named solids (reading and writing). The names are also used as OSG nodes names.
- Also, a 'dontSaveNormals' was added. It allows to ignore normals when writing an STL file. For example, it is useful for me when writing an STL file for CFD simulations.

- Some comments and code formatting were improved (to be consistent with the formatting already used in the plugin).

- With 'separateFiles' option files are now named fooX.stl instead of foo.stlX

The changes have been tested on various STL, both ASCII and binary found on the net. The change was based on the trunk branch."

From Robert Osfield, changed assert in Piotr's code to a runtime check warning report.
2012-09-06 13:48:17 +00:00
Robert Osfield
39dcea9ebb From Colin McDonald and Robert Osfield, converted Traits::sharedContext from GraphicsContext* to osg:observer_ptr<GraphicsContext> to prevent dangling pointer issues. 2012-09-05 21:03:41 +00:00
Robert Osfield
63444f648f Fixed inappropriate comment 2012-09-05 13:51:34 +00:00
Robert Osfield
f5a3c40934 Moved the OSG_INIT_SINGLETON_PROXY macro into include/osg/Object to make it more generally useful and added it's usage into the RenderBinPrototypeList initialization. 2012-09-05 13:48:23 +00:00
Robert Osfield
e8c4a6785c From Andreas Ekstrand, The attached ESRIShape.cpp contains fixes for comparing calculated byte sizes with the content length from the record header. According to the ESRI Shape documentation (http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf), the content length is specified in 16 bit words, which is why I have multiplied it by 2 when comparing to byte sizes. Note that the comparison in line 813 is made with a fix number of 16-bit words so it hasn't been changed.
This fixes problems with PolygonZ records where the previous code was reading past the end of the record since it thought it had M values even if it didn't. I suspect the problem that James McGlone had back in 2006 was the same but reversed, when he tried to simply comment out the check, which was a (correctly) refused submission.""
2012-09-05 10:24:10 +00:00
Robert Osfield
a5478cf910 From Nico Kruithof, "There is a small typo in the ShapeDrawable code for a sphere. There was a gl.Begin(GL_QUAD_STRIP) that was never closed, nor used.
"
2012-09-05 10:19:01 +00:00
Robert Osfield
5c9a302beb Added GL_RGBA8 and GL_RGBA16 entries to the Image::computePixelFormat() and improved he readability of the method by inserting line spacing. 2012-09-05 09:08:25 +00:00
Robert Osfield
0172bacdf4 From Brad Christiansen, changed OSG_INFO to OSG_DEBUG to quieten down volume of messages in INFO 2012-09-04 08:21:09 +00:00
Robert Osfield
568aeef975 From Brad Christiansen, "fix for the NVTTImageProcessor. When the code was updated in revision 12912 a couple of typos where made. These cause a crash when compressing transparent images and mangled colours when compressing rgb images. " 2012-09-03 15:19:00 +00:00
Robert Osfield
0ce9407c69 From Lilin Xiong, " there is a small bug in osgDB::readNodeFiles(std::vector<std::string>& fileList,const Options* options) in file ReadFile.cpp line 85:
osg::Node *node = osgDB::readNodeFile( *itr , Registry::instance()->getOptions() );
   It should be:
   osg::Node *node = osgDB::readNodeFile( *itr , options );"
2012-09-03 08:30:01 +00:00
Robert Osfield
f13dd3d75d Added a fix for a multi-threading bug that occured when TerrainTiles were accessed via the Terrain::_updateTerrainTileSet that were being deleted at the same time by the DatabasePager thread. 2012-08-31 16:00:55 +00:00
Robert Osfield
8961d45ebf From Wang Rui, "This patch fixes a problem of the osg::Program serializers that can't
save/load GeometryInputType data correctly. The bug is initially found
by John Kelso."
2012-08-29 16:48:27 +00:00
Robert Osfield
e489767f71 Fixed bug in GLBufferObjectSet::discardAllDeletedGLBufferObjects() and GLBufferObjectSet::flushDeletedGLBufferObjects(double currentTime, double& availableTime)
where the NumberActiveGLBufferObjects was errneously being incremented by numDiscarded.

M    osg/BufferObject.cpp
2012-08-23 15:06:27 +00:00
Robert Osfield
58b66be7b7 Added check against the Camera NodeMask to decide whether it's appropriate to test for events on that camera. 2012-08-21 09:45:24 +00:00
Robert Osfield
284f410436 Added ShadowSettings::s/getMaximumShadowMapDistance(double) property, usage of these property in ViewDependentShadowMap,
and setting of it with --max-shadow-distance <double> in the osgshadow example.
2012-08-15 12:40:48 +00:00
Robert Osfield
52861ecbb0 Added a mutex to protect the removal and addition of Uniform and Program to StateSet to avoid parents being invalidated when multi-threading. 2012-08-14 20:15:00 +00:00
Robert Osfield
fb83c2b061 Introduced --near-far-mode into osgshadow and ShadowSettings::setComputeNearFarModeOverride(..) to allow user control of how the cull traversal is optimized for computing the depth range of the shadow map. 2012-08-03 16:14:14 +00:00
Robert Osfield
42cb311f41 Added FireGL to prefernce list for use glGenerateMipMap 2012-07-24 09:05:04 +00:00
Robert Osfield
2e611be9c9 Fixed build 2012-07-23 08:15:57 +00:00
Robert Osfield
0a746faa2d Introduced Texture::Extensions::s/getPreferGenerateMipmapSGISForPowerOfTwo() flag that defaults to false for Radeon, true elsewhere.
This is used to workaround mipmapping bugs with ATI/AMD cards.
2012-07-12 16:41:53 +00:00
Robert Osfield
2f86ac1896 Fixed indentation 2012-07-11 14:36:14 +00:00
Robert Osfield
86db687bce Replaced use of now deprecated methods. 2012-07-10 16:20:32 +00:00
Robert Osfield
269d360484 Enabled the use the getReceivesShadowTraversalMask(). 2012-07-10 16:11:40 +00:00
Robert Osfield
b4d397cfd7 Moved mask settings into ShadowSettings 2012-07-10 15:50:46 +00:00
Robert Osfield
4b220d4fd7 Changed updateCamera(Camera*) to updateCamera(Camera&) to make it clear that a valid Camera object should be passed in. 2012-07-09 17:49:04 +00:00
Robert Osfield
65ab874143 From Riccardo Corsi, introduced CameraManipulator::updateCamera() method that allows more Camera properties to be controlled by the CameraManipulator. 2012-07-09 17:32:13 +00:00
Robert Osfield
f784884fd1 Refactored the way that the static Scene cache is managed by moving all the functionality into a SceneSingleton 2012-06-25 16:31:36 +00:00
Robert Osfield
a821a1cbbc Restructed the way that the global notify variables are initialized to avoid problems with multi-threaded initialization of these variables. 2012-06-22 16:21:08 +00:00
Robert Osfield
fc4aeac75b Fixed spelling of FileNameComparator 2012-06-16 09:08:05 +00:00
Robert Osfield
59133b43d3 Moved the frame() event into the event traversal after then events and their state have been accumulated. 2012-06-15 09:04:32 +00:00
Robert Osfield
1dc215a1da Added FileNameComparator to sort the filenames in an ImageSequence into alphanumerical order so that it can handle the numerical ordering found in screenshot numbered sets of files 2012-06-12 20:15:58 +00:00
Robert Osfield
4ab8cdb746 Enabled 6 ImageThreads in the ImagePager 2012-06-12 18:29:03 +00:00
Robert Osfield
c1a3ab2a5b Commented out the disabling of use of PBO's in ImageStream, and disabled the use ClientStoreHint in Present3D. 2012-06-12 10:31:50 +00:00
Robert Osfield
2faeaf553b Added support for setting the <image> paging_mode property to PRE_LOAD_ALL_IMAGES, PAGE_AND_RETAIN_IMAGES or PAGE_AND_DICARD_IMAGE for osg::ImageStream,
with PAGE_AND_DICARD_IMAGE set as the default.
2012-06-11 19:54:07 +00:00
Robert Osfield
c39ee015d6 Added ImageStream support to <image> and <stereo_image> tags in .p3d 2012-06-08 10:26:23 +00:00
Robert Osfield
5d3cb4f754 Added osg::ImageSequence support into osgPresentation::SlideShowConstructor and the associated <image> tag in .p3d. 2012-06-08 04:18:28 +00:00
Robert Osfield
2200ebfbe1 From Wang Rui, "A very small but maybe fatal problem was found when I saved models with shader and uniforms (with new double types support) to osgb format and tried to read it again. The application will crash here. And the serializer file should be slightly changed to fix it. Please replace the original file in osgWrappers/serializers/osg/Uniform.cpp." 2012-05-25 16:07:11 +00:00
Robert Osfield
1dbb0a7a82 Added Dragger::get/setActivationMouseButtonMask(uint). 2012-05-25 15:32:51 +00:00
Robert Osfield
c21f1f488f From Jaap Glas, "Added a default parameter to the following constructor in TabPlaneDragger
and TabPlaneDragger.cpp:

TabPlaneDragger(float handleScaleFactor=20.0f);

The reason for this is that the default OSG tab sizes are way bigger than
those we used in our application so far. And since handleScaleFactor_
is already a (constant) class member, I see no objection against making
it user defined."
2012-05-25 08:56:25 +00:00
Robert Osfield
a28907a67f From Jaap Gas, added missing break, and missing removeDraggerCallback. 2012-05-24 18:15:44 +00:00
Robert Osfield
45c6ba0b73 From Mathias Froehlich,"Attached is a change to the ac3d model loader as of rev 11498, that uses
indexed draws instead of plain array draws to save some amount of main memory.
Draw performance does not change with the nvidia binary blob as well as with
the open source drivers."
2012-04-20 10:01:50 +00:00
Robert Osfield
18b5e2a9b8 From John Kaniarz, "Here's a patch to add new extensions for tessellation shaders to the GLSL
plugin." "I went with .tctrl and .teval for the shader extensions."
2012-04-20 09:53:41 +00:00
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
9045813aab Added missing getUniformBlocks implmentation 2012-04-19 10:10:26 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Robert Osfield
4457d2a145 From Colin McDonald, "Upgrading to OpenSceneGraph 3.0.1, texture mip mapping stopped
working on some junk low-end graphics cards which I still have to
support.  They worked ok with osg 2.8 and earlier.

The problem turned out to be with gl proxy textures, which are
unreliable on those devices.  Proxy textures are used by the glu
mipmap build routines to determine if a texture size is
supported. The external glu library had a nice fallback
behaviour, so that if proxy textures didn't work then the mipmap
texture was still created.  But in the work on the new embedded
glu routines that fallback behaviour has been inadvertently
lost.  I have restored the fallback in
src/osg/glu/libutil/mipmap.cpp.  It doesn't add any extra
complexity."
2012-02-10 17:20:43 +00:00
Robert Osfield
d507a54456 From Domenico Mangieri, "Implementation for MoveRight and MoveUp methods in FirstPersonManipulator is missing.
I'm using the manipulator, so I added it."
2012-02-10 16:12:28 +00:00
Robert Osfield
bd81dd5ff8 From Stephan Huber, attached you'll find a compile fix for the new introduced rowlength-feature on IOS/OpenGL ES builds 2012-02-10 15:57:51 +00:00
Robert Osfield
9b6e10ddf0 From Torben Dannhauer, "Modification to osgfilecache: Now source data can also be local.:
find attached my modifications to osgfilecache.

It now allows also the caching of LOCAL terrain databases. In combination with the extends and level cmd parameter it allows to extract parts of terrain databases and write it in a new "Sub database".
I also modified osgDB::FileCache to create correct filenames if the data source is local."
2012-02-09 17:52:13 +00:00
Robert Osfield
2dbd24b52d From Martin von Gagern, "The xine osg plugin won't compile against xine-lib-1.2.0:
OpenSceneGraph-3.0.1/src/osgPlugins/xine/video_out_rgb.c:2772:25:
error: ?video_driver_class_t? has no member named ?get_identifier?
OpenSceneGraph-3.0.1/src/osgPlugins/xine/video_out_rgb.c:2773:25:
error: ?video_driver_class_t? has no member named ?get_description?

This has been reported on Gentoo: https://bugs.gentoo.org/397643
The relevant commit to the xine-lib repository is
http://anonscm.debian.org/hg/xine-lib/xine-lib-1.2/diff/806b590a4d38/src/xine-engine/video_out.h

This change addresses the issue. I'm sending the full modified file as
an attachment. It is based on the 3.0.1 release of OSG. I'll also paste
a diff below. You will find a colorized view in the Gentoo bugzilla.

The xine-lib API changed in the following way: the identifier and
description members are now "const char*" strings instead of "char*
(*)(video_driver_class_t*)" getter function. As the functions in the osg
plugin will always simply return a string literal, without accessing
their argument, it is safe to simply call them with a NULL argument and
use the returned string. This makes it easy to support both API
versions. When you drop support for older xine one day, you might want
to move the string literals to the assignment, getting rid of the
functions in the process.

The modified code compiles for me. I'm not sure how to test it, as I've
only got OSG around in order to build (and hopefully one day even use)
Flightgear.

I'm assigning my copyright in this change to the osg project leads.
"
2012-02-09 16:42:47 +00:00
Robert Osfield
5743d30dc1 From Olaf Flebbe, "there are two ocurrences where pointer to bool is mixed with bool. Fixes warnings on MacOSX with llvm.
diff --git a/src/osg/State.cpp b/src/osg/State.cpp
index 0b88d63..2137bbd 100644
--- a/src/osg/State.cpp
+++ b/src/osg/State.cpp
@@ -109,7 +109,7 @@ State::State():
        }
    }

-    _abortRenderingPtr = false;
+    _abortRenderingPtr = NULL;

    _checkGLErrors = ONCE_PER_FRAME;

@@ -689,7 +689,7 @@ bool State::getLastAppliedTextureMode(unsigned int unit,Stat

 const StateAttribute* State::getLastAppliedTextureAttribute(unsigned int unit,S
 {
-    if (unit>=_textureAttributeMapList.size()) return false;
+    if (unit>=_textureAttributeMapList.size()) return NULL;
    return getLastAppliedAttribute(_textureAttributeMapList[unit],type,member);
 }

"
2012-02-09 15:54:13 +00:00
Robert Osfield
0a78919807 From Colin McDonald, "The bounding box returned by getBound() for Text which is not
auto-rotated (e.g. HUD text) is not always correct, because it
doesn't take account of the base line offsets added by the
various alignment options such as CENTER_TOP, CENTER_BOTTOM etc.

The attached src/osgText/TextBase.cpp fixes the problem."
2012-02-09 15:08:30 +00:00
Robert Osfield
359fc46757 From Colin McDonald, fix for Solaris build. 2012-02-09 14:40:07 +00:00
Robert Osfield
4935efc1a9 From Filip Arlet,"I ran into problem with osg::Text _BASE_LINE alignment. It didn't account line spacing. Btw. same problem in 3D text
Changed _offset from: -_characterHeight*(_lineCount-1)
to: -_characterHeight*(1.0 + _lineSpacing)*(_lineCount-1)"
2012-02-09 14:33:13 +00:00
Robert Osfield
5f4c155d6b Added back in support for checking the current working directory by default, but now do the check
after the Options and Registry DataFilePathLists have been checked, which will allow users to better control
over where files are searched for.
2012-02-09 14:28:39 +00:00
Robert Osfield
89cf88f2a9 From Chris Denham, "This is a submission to fix a problem with use of mode GL_RESCALE_NORMAL for geometries below a scaling transform which is not equal in X, Y & Z components. In this case, the 'slow' method of mode GL_NORMALIZE should be used to perform the normalization.
I have attached a correction to daeRTransforms.cpp based on trunk at [12892] which corrects this problem.

This is the changed section:

Code:
       if (scale.x() == scale.y() && scale.y() == scale.z())
       {
           // This mode may be quicker than GL_NORMALIZE, but ONLY works if x, y & z components of scale are the same.
           ss->setMode(GL_RESCALE_NORMAL, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);
       }
       else
       {
           // This mode may be slower than GL_RESCALE_NORMAL, but does work if x, y & z components of scale are not the same.
           ss->setMode(GL_NORMALIZE, osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);
       }"
2012-02-09 14:11:36 +00:00
Robert Osfield
ba4dde81bb From Thorsten Brehm, "attached update changes OSG's src/osgDB/Registry.cpp, so it doesn't (accidentally) resolve relative paths against the current working directory when searching for resources. So far, such paths were always resolved against the cwd first.
I guess the previous behaviour of giving the cwd precedence over any path configured in the "database path list" (osgDB::Options) wasn't intentional. Otherwise, if it was intentional after all, it'd be good to add another feature instead, to make this configurable - e.g. a flag in osgDB::Options to disable this, if an application doesn't want the cwd being considered.
"

Note from Robert Osfield, this submission will change the default behaviour of searching for files so can potentially break existing applications as it
won't search the current working direction unless it's included in the DataFilePathList entry in the Options or Registy.  I'll add a follow
up submission to add back in this feature.
2012-02-09 12:50:42 +00:00
Robert Osfield
c533c33457 From Hartmut Seichter, "attached a revised CMakeLists.txt file for Android that avoids the problems with a ARM gcc bug that appears in the NDK. It only overrides the optimization level for one file. As it resides only in the cfg parser this should not have side effects on performance." 2012-02-08 17:12:58 +00:00
Robert Osfield
f537ece404 From Leandro Motto Barros,
"I've made a few changes to osgUtil::PolytopeIntersector so that it
actually uses double precision floating point numbers everywhere (as
long as OSG_USE_FLOAT_PLANE is not defined).

I needed double precision intersections in a project I am working on.
These changes fixed the problems I was having -- this is all testing I
have done.

Notice that I have changed
osgUtil::PolytopeIntersector::Intersection's members to use doubles
(osg::Vec3d, instead of osg::Vec3). I could have added #ifdef's there
too, but I think it is better to not change the types of stuff in the
public interface depending on some preprocessor definition.

The modified files are attached. A diff also follows, for those who like it."

With the following changes from Robert Osfield:

"I've just reviewed your changes and have just tweaked them a little to
streamline them.  What I have done in the PolytopeIntersector header
is add:

       typedef osg::Plane::Vec3_type Vec3_type;

And then use this typedef in the definition of the vertices rather
then Vec3d as you did.  Next changes were to PolytopeInteresector.cpp
where to the PolytopeIntersectorUtils defintions of the Vec3_type, and
value_type which now simply read:

   typedef osg::Plane::Vec3_type Vec3_type;
   typedef Vec3_type::value_type value_type;

This way I was able to complete avoid any if def's and have essential
the same implementation as you achieved.  Changes now checked into
svn/trunk."
2012-02-08 10:06:58 +00:00
Robert Osfield
ce4890fa7a From Claus Scheiblauer, "in GraphicsWindowQt.cpp the GLWidget::keyReleaseEvent was implemented slightly different to the GLWidget::keyPressEvent, which caused the cursor keys values to be not correctly mapped from an QKeyEvent value to an osg key value when releasing a cursor key." 2012-02-08 09:34:44 +00:00
Robert Osfield
1432d4d54b Fixed build issues when compile with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF. 2012-02-07 16:14:13 +00:00
Robert Osfield
a9baf19f32 From Alexander Irion, "Added missing format GL_ALPHA to Image::computeFormatDataType()." 2012-02-07 12:37:48 +00:00
Robert Osfield
4d69577228 From Johannes Baeuerle, "The first problem is wrong value of the block size of etc1 textures in the getCompressedSize call in Texture.cpp. With the current block size of 16 the target application crashes with a GL_INVALID_VALUE. The reason is that the calculated size passed to OpenGL does not match the size of the passed data(data pointer,texture width,texture height,spec of etc1).
With a block size of 8 in the getCompressedSize call this error dissapears."
2012-02-07 12:02:04 +00:00
Robert Osfield
52270c9656 From David Fries, "Of the two ways to use the Tessellator object, only
retessellatePolygons was applying the winding and boundary option.
Moved the gluTessProperty calls into beginTessellation().

There's a comment typo fix, removing an unused VertexPointList
typedef, and allocates one _tobj instead of one per tesellation.
Protections were added to check that _tobj was allocated in the few
remaining places it wasn't being checked.

---
On a side note, I would like to avoid the 'new Vec3d' in
Tessellator::addVertex for each call to
gluTessVertex(tess, location, data).
The RedBook leaves it ambiguous if the location pointer must
remain valid after gluTessVertex or not.
http://www.opengl.org/sdk/docs/man/xhtml/gluTessVertex.xml
says that changing location is not safe, so being conservative, I'll
leave it as is, even though the Mesa GLU library copies the data not
the pointer, so it is currently safe."
2012-02-07 11:29:47 +00:00
Robert Osfield
0775483b7c From Lionel Lagarde, "The setNormal method of osg::Billboard has side effects (it calls updateCache and update the normal to Z rotation matrix). When cloning billboards, copying the normal vector is not enough. In the correction, the copy constructor calls setNormal to update the internal members." 2012-02-07 11:21:11 +00:00
Robert Osfield
3ae53557b1 From Wojciech Lewandowski, "This is a one line modification of StatsHandler.cpp to work correctly while dumping states to console when ViewerStats getEarliesFrameNumber() and getLatestFrameNumber() return zeroes. If that happened in current version, printing loop was iterating between 0 and 0xFFFF FFFF indices and that was hanging our system.
"
2012-02-07 10:57:19 +00:00
Robert Osfield
1454e9c760 From Tamer Fahmy, Fix for bug when scrolling down and using render on demand.
"Currently issuing a mouse scroll DOWN event would stop updating
animations in progress.

The fix consists of changing the line
 us.requestContinuousUpdate( false );
to:
 us.requestContinuousUpdate( isAnimating() || _thrown );

in OrbitManipulator::handleMouseWheel() as has been done for the
GUIEventAdapter::SCROLL_UP case a couple of lines earlier or in
src/osgGA/FirstPersonManipulator.cpp."
2012-02-07 10:51:22 +00:00
Robert Osfield
89417ee47f From Rudolf Wiedemann, "the file attached fixes the incomplete implementation of "osg::DefaultUserDataContainer"'s copy constructor.
Copying user objects was missing."

Note from Robert Osfield, in submission changed
    _objectList.push_back((*itr)->clone(copyop));
to
    _objectList.push_back(copyop(*itr));
2012-02-07 10:40:04 +00:00
Robert Osfield
7d5d742070 From Sukender, "I just fixed using UTF8 paths in JP2 readerwriter under Windows. Jpeg2000 plugin could not handle UTF8 paths as it was using an Japser open() function which seems to be based on the standard fopen(). The fix simply opens the file beforehand and only gives a FILE* to the Jasper lib (and then closes the file, of course).
"
2012-02-07 10:33:09 +00:00
Robert Osfield
251827c994 From Mathias Froehlich, "In Optimizer.cpp a nodes update callback is checked twice and the cull
callback is checked never for the decision of a node being redundant.
The change replaces one of the update callback tests with a cull callback
test."
2012-02-06 13:45:20 +00:00
Robert Osfield
5d50913722 From Mathias Froehlich, "Attached is a change to the stats handler so that the aspect ratio of the
viewer stats coordinates always stay about 1:1 to the pixels.
This helps for more readable stats with very wide windows for example."
2012-02-06 13:40:01 +00:00
Robert Osfield
af01a9e984 From Mathias Froehlich, "The attached change to the default font makes the baseline correctly working
and makes the glyphs aspect ratio match their 12x8 bitmaps.
I am not exactly sure about osgTexts current internals but it matches the
changes that happened lately to the txf font.
"
2012-02-06 13:35:45 +00:00
Robert Osfield
ec08c4dfea From Cory Riddell, "I've been using the dot plugin and found that our application which sets
the global locale was generating bad dot files. Specifically, the node
numbers had comma separators in them (like 1,234 rather than 1234).

The attached file simply forces the stringstreams used to build up the
dot file to use the "C" locale."
2012-02-06 13:29:38 +00:00
Robert Osfield
2298cc520c From Robert Milharcic, "In attached file I implemented LOAD_IMMEDIATELY mode for new osg ProxyNode wrapper. Current version of proxynode loading uses DatabasePager for both modes(DEFER_LOADING_TO_DATABASE_PAGER and LOAD_IMMEDIATELY).
Immediate loading of external references begins after ProxyNode has been deserialized in ProxyNodeFinishedObjectReadCallback."
2012-02-06 13:27:25 +00:00
Robert Osfield
55c4f9b401 From Paul Palumbo, "This change seems to fix a problem reading 32-bit Floating point tiff images. Without this fix, I'm only getting half my image displayed in "osgviewer --image"." 2012-02-06 12:42:52 +00:00
Robert Osfield
d21280785c From Jason Beverage, "Attached is a patch to the SVG plugin to use cairo_surface_destroy
instead of free.  This was causing a crash on Windows.
"
2012-02-06 12:38:11 +00:00
Robert Osfield
38b17bc5fa From Jan Peciva, "attaching improved StatsVisitor. Changes:
- apply() and reset() methods made virtual to allow overriding
- added apply(StateSet&) to make more easier to gather StateAttribute
statistics in user-derived classes
"
2012-02-06 12:36:25 +00:00
Robert Osfield
6ebe48d6bb Fixed indendation and line endings 2012-02-06 12:29:29 +00:00
Robert Osfield
db49c23944 From Brad Christiansen, "The attached files add the ability to control when a paged child becomes eligible for expiry based on time and/or elapsed frames.
I found that some of the items that had been paged in were being expired on the first frame that they were not visible (as the cache was full). This resulted in excessive paging every time the view was moved. With the following changes I could only allow children to be expired if they had not been used for e.g. 30 seconds or 60 frames."
2012-02-06 12:06:40 +00:00
Robert Osfield
ae27f1e210 From Alexander Sinditskiy, "looks like GlyphGeometries _glyphGeometries; should be removed because Glyph3D have the same named local variable." 2012-02-06 11:17:12 +00:00
Robert Osfield
0e3de701d9 From Stephan Huber, "attached you'll find a first version of multi-touch-support for OS X (>=
10.6), which will forward all multi-touch events from a trackpad to the
corresponding osgGA-event-structures.

The support is switched off per default, but you can enable multi-touch
support via a new flag for GraphicsWindowCocoa::WindowData or directly
via the GraphicsWindowCocoa-class.

After switching multi-touch-support on, all mouse-events from the
trackpad get ignored, otherwise you'll have multiple events for the same
pointer which is very confusing (as the trackpad reports absolute
movement, and as a mouse relative movement).

I think this is not a problem, as multi-touch-input is a completely
different beast as a mouse, so you'll have to code your own
event-handlers anyway.

While coding this stuff, I asked myself if we should refactor
GUIEventAdapter/EventQueue and assign a specific event-type for
touch-input instead of using PUSH/DRAG/RELEASE. This will make it
clearer how to use the code, but will break the mouse-emulation for the
first touch-point and with that all existing manipulators. What do you
think? I am happy to code the proposed changes.

Additionally I created a small (and ugly) example osgmultitouch which
makes use of the osgGA::MultiTouchTrackballManipulator, shows all
touch-points on a HUD and demonstrates how to get the touchpoints from
an osgGA::GUIEventAdapter.

There's even a small example video here: http://vimeo.com/31611842"
2012-02-03 15:15:37 +00:00
Robert Osfield
85bce8b8ad From Stephan Huber, "attached you'll find a first version of multi-touch-support for OS X (>=
10.6), which will forward all multi-touch events from a trackpad to the
corresponding osgGA-event-structures.

The support is switched off per default, but you can enable multi-touch
support via a new flag for GraphicsWindowCocoa::WindowData or directly
via the GraphicsWindowCocoa-class.

After switching multi-touch-support on, all mouse-events from the
trackpad get ignored, otherwise you'll have multiple events for the same
pointer which is very confusing (as the trackpad reports absolute
movement, and as a mouse relative movement).

I think this is not a problem, as multi-touch-input is a completely
different beast as a mouse, so you'll have to code your own
event-handlers anyway.

While coding this stuff, I asked myself if we should refactor
GUIEventAdapter/EventQueue and assign a specific event-type for
touch-input instead of using PUSH/DRAG/RELEASE. This will make it
clearer how to use the code, but will break the mouse-emulation for the
first touch-point and with that all existing manipulators. What do you
think? I am happy to code the proposed changes.

Additionally I created a small (and ugly) example osgmultitouch which
makes use of the osgGA::MultiTouchTrackballManipulator, shows all
touch-points on a HUD and demonstrates how to get the touchpoints from
an osgGA::GUIEventAdapter.

There's even a small example video here: http://vimeo.com/31611842"
2012-02-03 14:25:08 +00:00
Robert Osfield
e5a16de7d4 Improved handling of archives 2012-02-03 11:10:17 +00:00
Robert Osfield
1ed3833556 From Terry Welsh, improved support for handling archives 2012-02-03 11:09:45 +00:00
Robert Osfield
fe61dcac69 From Colin McDonald, "I have an application with multiple windows. They share GL objects
between the contexts, using the GraphicsContext::Traits sharedContext
and setting the same contextID.

When one of these shared contexts is closed, GraphicsContext::close
deletes all GLObjects for that contextID, regardless of the fact that
they are shared.  This means that all of the other contexts sharing the
objects have to recompile them.

The attached tweak makes GraphicsContext::close a bit less brutal for
shared contexts.  I have also changed a misleading diagnostic message.
"
2012-02-01 17:42:42 +00:00
Robert Osfield
43f9a76169 From Luc Frauciel, "FBX plugin was locked on version 2012.1 of FBX SDK which is not available anymore on Autodesk website.
This patch allows version of FBX >= 2012.1, which includes current one : 2012.2
"
2012-02-01 17:38:37 +00:00
Robert Osfield
487ee0f8e7 Added DraggerTransformCallback::HandleCommandMask to DraggerTransformCallback to allow applications to select which
commands they want the dragger callback to respond to why updating the transform.
2012-02-01 13:55:38 +00:00
Robert Osfield
7664d90504 Improved the handling of osgManipulator::Constraint, DraggerCallbacks and Command so that they now use a Visitor Pattern
to ensure the correct methods on constraints and callbaks are called for each Command.  Also fixed the handling of
Constraints when applied to composite Draggers.
2012-01-31 10:56:52 +00:00
Robert Osfield
a0df35b580 From Stephan Huber, "a recent submission added a 10.6-feature to GraphicsWindowCocoa. I added
some ifdefs around, so it compiles again with 10.5 SDK"
2012-01-26 18:03:26 +00:00
Robert Osfield
eb2e4d313a Quietend down debug message 2012-01-26 14:26:59 +00:00
Robert Osfield
167b6e69e4 From J.P. Delport, "when switching from windowed mode to fullscreen (with the 'f' key) in X11, no RESIZE event is generated. This confuses handlers that perform some processing on the RESIZE event, e.g. the InteractiveImageHandler.
To reproduce the problem I attach a minimally modified osgviewer that just prints resize events. You can check what's printed in the console when you go fullscreen and windowed a few times.

The attached version of GraphicsWindowX11 fixes the problem for me, but I'm not sure this is the right approach. Maybe you can see a fix for the problem clearer.

The only place where the RESIZE event is generated in GraphicsWindowX11 is in CheckEvents and it then depends on the ConfigureNotify message. For some reason, either ConfigureNotify is not sent when going fullscreen or the traits already reflect the latest window size."
2012-01-26 13:08:19 +00:00
Robert Osfield
8ecd0dea87 From J.P. Delport, "this fall-through had me scratching my head for a while...
It made InteractiveImageHandler eat keypresses outside its image."
2012-01-25 17:37:55 +00:00
Robert Osfield
45998e9ce1 From J.P. Delport, "GraphicsWindowX11 typo, I believe X/Y's should match." 2012-01-25 17:35:17 +00:00
Robert Osfield
5feb203d79 From Luc Frauciel, "Ati FirePro is as much crippled as other Ati drivers.
This patch add "FirePro" to the black list of renderers in State.cpp / initializeExtensionProcs

It allows to avoid an OpenGL error on Viewer initialization.
Tested on FirePro  M7740 / Windows7 x64  Driver 8.85.7.2"
2012-01-25 17:31:07 +00:00
Robert Osfield
7fc23467f1 From Tobias Ottenweller, "this is a fix for the problem where all input freezes for a quarter second when calling requestWarpPointer under Mac OS X (described here: http://forum.openscenegraph.org/viewtopic.php?t=3933 ).
I used the latest version available via subversion.

My fix is using some API only available on 10.4 and later. I used some preprocessor statements to gain compatibility with 10.3 and earlier using (now) deprecated API.

Only tested on OS X Lion (10.7). Please do some testing as well since I'm fairly new to OpenSceneGraph. Someone should also test the code for 10.3 and earlier."
2012-01-24 17:49:18 +00:00
Robert Osfield
3c414c7962 Fixed indentation and spaces at ends of lines. 2012-01-24 17:47:04 +00:00
Robert Osfield
9da901e11b Chris Denham, fixed type of parameters to ensure they are longs where appropriate. 2012-01-24 17:38:23 +00:00
Robert Osfield
d350ea5395 Moved setEndBarrierOperation(..) implementation into .cpp and added support for stoppig and starting threading if required. 2012-01-24 17:30:44 +00:00
Robert Osfield
b0b98d49b8 From Paul Martz, Added ViewerBase::s/getEndBarrierOperation(..) method to allow user control of how viewers are sync'd. 2012-01-24 17:21:14 +00:00
Robert Osfield
884f480202 Fixed compile error 2012-01-24 15:44:58 +00:00
Robert Osfield
6d66e1abaa Added support for using GL_UNPACK_ROW_LENGTH in conjunction with texture's + osg::Image via new RowLength
parameter in osg::Image.  To support this Image::setData(..) now has a new optional rowLength parameter which
defaults to 0, which provides the original behaviour, Image::setRowLength(int) and int Image::getRowLength() are also provided.

With the introduction of RowLength support in osg::Image it is now possible to create a sub image where
the t size of the image are smaller than the row length, useful for when you have a large image on the CPU
and which to use a small portion of it on the GPU.  However, when these sub images are created the data
within the image is no longer contiguous so data access can no longer assume that all the data is in
one block.  The new method Image::isDataContiguous() enables the user to check whether the data is contiguous,
and if not one can either access the data row by row using Image::data(column,row,image) accessor, or use the
new Image::DataIterator for stepping through each block on memory assocatied with the image.

To support the possibility of non contiguous osg::Image usage of image objects has had to be updated to
check DataContiguous and handle the case or use access via the DataIerator or by row by row.  To achieve
this a relatively large number of files has had to be modified, in particular the texture classes and
image plugins that doing writing.
2012-01-24 14:34:02 +00:00
Robert Osfield
6aa6e9a38c Refactored the click_to_run implementation to avoid bug associated with running the first click_to_run entry in a layer when
subsequent click to run's are called.
2012-01-24 14:27:17 +00:00
Robert Osfield
76b1c8e20e Changed float QuicktimeImageStream::getCurrentTime() to double QuicktimeImageStream::getCurrentTime() to keep it consistent with
the type of the virtual function ImageStream::getCurrentTime(), and with this fixing a compile and runtime error.

Changed time variables all to use doubles rather than float to be consist with the change to getCurrentTime().
2012-01-23 18:48:18 +00:00
Robert Osfield
fa5100cc2c From Alberto Luacus, "The ffmpeg plugin fails to compile with the upcoming libav 0.8 because
the required header mathematics.h is not being included explicitly.

I have just included it, and verified that this also works with current
version 0.7, since the header is also available there."
2012-01-05 14:07:56 +00:00
Robert Osfield
329f98c83b Fixed the return value of SlideEventHandler::selectLayer() so that the 'n' now works correctly. 2012-01-03 15:59:19 +00:00
Robert Osfield
b828f5c083 From Farshid Lashkari, "Attached is a simple fix to osg::Sequence that allows it to load properly with the serializer formats (osgt/osgb). The problem was that the internal _nrepsRemain member was not being initialized properly if the number of repeats was equal to the default value of -1. When the number of repeats is explicitly set using setNumRepeats(), _nrepsRemain is set to the same value. However, in the constructor of osg::Sequence, it was not being initialized to the same value as _nreps. This fix simply changes the initial value of _nrepsRemain to the same as _nreps." 2012-01-02 16:54:05 +00:00
Robert Osfield
d9fd29d996 From Chris Denham, Implementation of write functions in CURL plugin 2012-01-02 16:38:01 +00:00
Robert Osfield
3aab31f198 From Paul Martz and David Glenn,
"From David Glenn and Paul Martz. This change adds support for the NO_COLOR bit in the Vertex records' flags field. If NO_COLOR is set, and PACKED_COLOR is not set, the code will now properly default to using the face color at those vertices. See the osg-users thread "Open Flight characteristic not reflected in the current OSG" for more info."

and

"In consultation with David Glenn, it appears we needed to change a second file to correct how OpenFlight handles transparency when vertices have NO_COLOR. "
2011-12-23 17:40:31 +00:00
Robert Osfield
a53308f7e8 Gunnar Holm, "After upgrading from 2.8.3 to 3.0.1 we experienced a lock in the Mutex
functionality when using Terrain::setVerticalScale. This was caused by
the following call sequence resulting in a lockup:

void Terrain::setVerticalScale(float scale)
  CALLS    dirtyRegisteredTiles();


void Terrain::dirtyRegisteredTiles(int dirtyMask)
 SETS LOCK    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
 and CALLS (on every tile)   setDirtyMask(dirtyMask);


void TerrainTile::setDirtyMask(int dirtyMask)
 CALLS _terrain->updateTerrainTileOnNextFrame(this);


void Terrain::updateTerrainTileOnNextFrame(TerrainTile* terrainTile)
 SETS LOCK   OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex);
******* PROBLEM - since lock has already been set! ********


The suggested fix submitted changes from using Mutex to ReentrantMutex.
"
2011-12-23 17:34:07 +00:00
Robert Osfield
c7698c1334 From Aurelien Albert, "I made a modification in the Dragger class :
You can now set a "intersection mask" and it will be used when looking for intersections.

So you can now easily "hide" some objects from manipulators."
2011-12-23 17:21:59 +00:00
Robert Osfield
50c7a31d62 From Brad Christiansen, "I have added an implementation for set/getVolume in the direct show plug-in." 2011-12-23 17:16:06 +00:00
Robert Osfield
f3ce66aa8b From Glenn Waldron, "Attached is a change to ClusterCullingCallback to make it work properly under an RTT camera with an INHERIT_VIEWPOINT reference frame." 2011-12-23 17:15:06 +00:00
Robert Osfield
dc55068db1 From James Turner, "Testing FlightGear with Cocoa osgViewer, encountered some problems with hiding / re-showing the cursor. Attached version fixes this, by tracking the current cursor value, and ensuring we don't nest calls to [NSCursor hide] or [NSCursor unhide]." 2011-12-23 16:57:34 +00:00
Robert Osfield
fa2e8b22c5 From Ulrich Hertlein, "attached is a patch for osgPlugins/mdl/MDLReader.cpp that improves its functionality on
Unix filesystems.  It also includes code cleanups/refactoring."
2011-12-23 16:29:51 +00:00
Robert Osfield
4e834dfc73 From Brad Christiansen, "Attached are some small changes to the ImageStream interface and the DirectShow and FFMPEG plugins to provide the current time being displayed in the image stream.
I don’t have access to an OSX or Linux dev machine to make the changes required to the quick time plugin. This plugin will just default to returning 0."
2011-12-23 16:27:25 +00:00
Robert Osfield
c9d19d7bff Added handling of an empty filename when writing out an image file. 2011-12-23 12:42:18 +00:00
Robert Osfield
0af31eff5d Removed inappropriate static usage 2011-12-19 16:18:18 +00:00
Robert Osfield
c86e2361d2 Moved the createSpotLightImage function into include/osg/ImageUtils 2011-12-19 09:37:57 +00:00
Robert Osfield
22e309e8fb Created new PerlinNoise class from the Noise.h+Noise.cpp code in the osgshaders example. 2011-12-13 21:12:00 +00:00
Robert Osfield
16c2bb5a2f To fix problems in tight bound computation of the shadow map made the ComputeLightSpaceBounds usage always used when the
CastShadowMask is active.  Changed the ComputeLightSpaceBounds to use just VIEW_FRUSTUM_CULLING.
2011-11-25 12:48:03 +00:00
Robert Osfield
2b2c1b5671 From Jean-Sebastien Guay, fix for handling texture unit >= 8 and negative LigthNum. 2011-11-25 09:24:50 +00:00
Robert Osfield
92ed903a7f Added prelimanary support for parallel split shadow maps into ViewDependentShadowMap. 2011-11-22 21:55:30 +00:00
Robert Osfield
862c1c4af3 Updated built in volume shaders to honour the osg::Matierial setting 2011-11-11 10:36:17 +00:00
Robert Osfield
d13bfb522b Enabled blending for the iso surface rendering to enable fade in/fade out of volume. 2011-11-11 10:25:20 +00:00
Robert Osfield
85418bf7ba Added handling of osgGA::GUIEventAdapter::getMouseYOrientation() in the orientation of mouse y position.
Added updating of properties on both mouse move/drag and keydown.
2011-11-10 15:50:22 +00:00
Robert Osfield
693d79c638 Implement presentation update feature that reloads the presentation on pressing 'u'. 2011-11-04 12:50:05 +00:00
Robert Osfield
e8bae33143 Improved the handling of setStartTick() being called mid app, such as when idirectly called when doing a Viewer::setSceneData().
Improved the setting the the initial event state.
2011-11-04 12:47:24 +00:00
Robert Osfield
0329ca5cea Improved handling of resetting of the EventQueue::startTick(). 2011-11-04 12:45:32 +00:00
Robert Osfield
747654fb6d Added removeFromObjectCache method. 2011-11-04 12:44:01 +00:00
Robert Osfield
3c461dd706 Add check to filter out the return of FILE_NOT_FOUND from archive results to prevent these from prematurely exiting the Registry::read(..) method
bofore it loads plugins to try and load requested file.
2011-11-02 10:57:17 +00:00
Robert Osfield
1bcd36f5ed From Stephan Huber, "A recent commit
(41e23f466d)
for GraphicWindowsIOS.mm broke the compilation for OpenGL ES 1.x as
GL_DEPTH_COMPONENT32_OES is not defined for 1.x. I added a #define-guard."
2011-11-01 13:41:48 +00:00
Robert Osfield
215512647c Added setting of the sampleDensityWhenMovingProperty at the same time as when setting the sampleDensityProperty 2011-11-01 11:08:48 +00:00
Robert Osfield
3cad9d0962 Fixed the use DCM_SeriesDescription 2011-11-01 10:30:18 +00:00
Robert Osfield
14a4aa9a19 Improved the handling of multiple datasets being read at once, with all the images in a series being group according to Series UID and SeriesDescription and orientation. 2011-11-01 10:27:12 +00:00
Robert Osfield
ca582c708d Adding missing checks against View's Camera and SceneData for any update callbacks that need calling. 2011-10-31 15:29:49 +00:00
Robert Osfield
d95801f6a8 Changed the notification level to INFO. 2011-10-28 11:00:55 +00:00
Robert Osfield
bbf081695b Changed the setting of Traits::sampleBuffers so that it's set to 1 when DisplaySettings::getMultiSamples() is set to a non zero value. 2011-10-28 11:00:08 +00:00
Robert Osfield
3e7900c39e Changed the default for SampleBuffers to be 1 when set. 2011-10-28 10:36:29 +00:00
Robert Osfield
20ffed1fa1 Removed OSX codepath for setting the depth value to 32 as this turned out to be unneccesary. 2011-10-28 09:45:51 +00:00
Robert Osfield
24ff8796d5 Changed the default depth to 24. 2011-10-28 09:11:21 +00:00
Robert Osfield
98d50250ff Updated volume shaders to use the GL_LIGHT 0 values to control the direction of the light source 2011-10-27 16:33:18 +00:00
Robert Osfield
3a64805d20 Reimplement the light direction controls so that they now work correctly with osgViewer::Viewer.
Improved the computation of the light direction from non-dimensional mouse coords so that they now project onto a hemisphere making
the interaction more intuitive.
2011-10-27 13:11:20 +00:00
Robert Osfield
7bcfb3c130 Added support for ignore returns as white space. 2011-10-27 09:24:34 +00:00
Robert Osfield
c403c052db Added support for American spelling of swap and add supportOptions(..) documentation for the new options. 2011-10-27 08:34:53 +00:00
Robert Osfield
881078289d Added support into the .p3d format for specifying the osgDB::Options::OptionString via the <tag options="value">.
Added support into .vnc plugin for passing in the keywords "swap", "RGB", "RGBA", "BGR", "BGRA" as OptionString values to allow .p3d presentations to control
whether the pixelformat should be swapped or set to a specific format.
2011-10-26 14:25:56 +00:00
Robert Osfield
5d26d16fd3 Added password support into present3D's vnc support via the tag usage : <vnc password="mypassword">hostname</vnc> 2011-10-26 12:48:57 +00:00
Robert Osfield
9995cb70a9 Added password support into osgvnc example and vnc plugin 2011-10-26 12:29:38 +00:00
Robert Osfield
b9d7989b44 Implement a simply attempt at detecting when the pixel format needs to be swapped. 2011-10-26 09:34:50 +00:00
Robert Osfield
2dc271d85f Added support for 32bit depth buffer 2011-10-25 15:55:33 +00:00
Robert Osfield
4b655d9c46 Added hack of using a 32bit depth buffer default setting for Traits when compiling under Apple. 2011-10-25 15:31:46 +00:00
Robert Osfield
1538ecf113 Fixed handling of slide with no layers. 2011-10-24 11:09:35 +00:00
Robert Osfield
e04ca06fc8 Fixed build of StreamOperator 2011-10-22 09:02:18 +00:00
Robert Osfield
9e903861a2 Fixed handling of Vec3dArray in GLBeginEdnAdapter/ArrayDispatchers. 2011-10-21 15:39:51 +00:00
Robert Osfield
d7cba048f5 Added support for using negative scale_x, scale_y and scale_z values in the <volume> tag to allow presentations to flip the imagery 2011-10-21 11:00:29 +00:00
Robert Osfield
d3cebab9a3 Added flipDepth() method 2011-10-21 10:59:42 +00:00
Robert Osfield
088d00c651 Fixed handling of scale.x, scale.y and scale.z paramters so that all of them now take an effect. 2011-10-21 09:31:56 +00:00
Robert Osfield
6607b373d5 Fixed handling of reading/writing of osgVolume::VolumeTile tiles 2011-10-20 16:49:08 +00:00
Robert Osfield
affe0b4a6d Added support for calling throwException() from InputIterator and added a check for negative string sizes. 2011-10-20 16:35:50 +00:00
Robert Osfield
61b2659fab Fixed typo 2011-10-17 15:39:46 +00:00
Robert Osfield
33479c7768 Improvements to the compute near/far 2011-10-17 14:41:49 +00:00
Robert Osfield
bdb0dfe27d Improvements to osgShadow::ViewDependentShadowMap and ShadowSettings 2011-10-17 14:40:29 +00:00
Robert Osfield
d9dbff18a2 Add catch for when shadows are enabled between the update and draw traversals. 2011-10-03 15:57:06 +00:00
Robert Osfield
e8e25e82a9 From Jean-Sebastien Guay, changed the border colour for the shadow map to be 1 rather the 0 used for debugging so that areas outside the shadow map default to being unshadowed rather than shadowed.
changed the shadow map texture assigment to StateSet so that it doesn't use OVERRIDE, enabling subgraphs to use the same texture unit for other textures if they so required.
                          tidied up indentation.
2011-10-03 15:25:16 +00:00
Robert Osfield
78ad56f76c Changed getVertical(..) so it uses the same coord scale as the getGlyph 2011-10-03 14:57:39 +00:00
Robert Osfield
951a437c0c Fixed handling of ShadowSetting LightNum 2011-10-03 14:56:38 +00:00
Robert Osfield
bb48cef38c Added Font::getVertical(float& ascender, float& descender) methods. 2011-10-03 10:36:18 +00:00
Robert Osfield
db329cf943 Added catch for NaN vertices that were being generated by osgText, these NaN vertices were causing glu tesselation functions to crash. 2011-09-28 11:52:27 +00:00
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
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
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
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
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
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
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
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
52c2bc3ff5 Added s/getTextureSize() method for setting the shadow map texture size. 2011-09-02 10:16:16 +00:00
Robert Osfield
f476406ae1 Disabled the use of the ReceivesShadowTraversalMask() mask 2011-09-02 07:46:08 +00:00
Robert Osfield
ec3b2ba2d3 Added test line for COMPUTE_NEAR_USING_PRIMITIVES 2011-09-01 18:49:33 +00:00
Robert Osfield
1fd3c84287 Added fine grained computation of the far plane when using the COMPUTE_NEAR_FAR_USING_PRIMITIVES ComputeNearFarMode.
Added COMPUTE_NEAR_FAR_USING_PRIMITIVES option that provides the original functionality where only the near plane
is computed in a fine grained way, with the far plane being computed simply from bound volumes.
2011-09-01 18:48:21 +00:00
Robert Osfield
b21d206d3a From Tony Horrobin, build fix 2011-08-29 16:01:02 +00:00
Robert Osfield
47db350da1 Added fallback base texture 2011-08-29 10:26:05 +00:00
Robert Osfield
2d71a390d3 Added support for setting the MinimumShadowMapNearFarRatio. 2011-08-29 09:59:47 +00:00
Robert Osfield
771075084b Fixed bug in computaton of the min/max x/z ratios. 2011-08-26 15:40:09 +00:00
Robert Osfield
0f14f53698 Added releaseGLObjects/resizeGLObjectBuffers support 2011-08-26 10:52:25 +00:00
Robert Osfield
966981f100 Improved the handling of depth partitioning and orthographic datasets 2011-08-25 17:21:38 +00:00
Robert Osfield
0d3169f645 Added support for user defined setting of the shadow texture unit 2011-08-24 19:38:58 +00:00
Robert Osfield
26e2106636 Changed new ViewDependentShadowMap to default to a perspective shadow map with automatic detection of a spot light/perspetive light projection
matrix to prevent inappropriate usage of perspective shadow map.
2011-08-24 13:57:15 +00:00
Robert Osfield
622cfb524c Imorovements to the new perspective/lispsm style shadow implementation. 2011-08-24 12:32:03 +00:00
Robert Osfield
3db0557ed5 Quitened down and fixed warning 2011-08-24 12:31:35 +00:00
Robert Osfield
3a70830e89 Quitended down debug messages and added passing of RenderStage to LispSM code 2011-08-19 12:42:51 +00:00