Stefan Zellmann | 22 May 21:02 2015
Picon

Enhance osg::Observer to notify on state changes, exemplary implementations for some node types

Dear Robert,

in a discussion a while ago (http://forum.openscenegraph.org/viewtopic.php?t=14721) I asked if general changes to the scene graph can be monitored in a rather generic fashion.

I now started to enhance the osg::Observer class so that it may not only be used to monitor deletion, but also state changes.
The feature is far from complete, I implemented it for Matrix / PositionAttituteTransform and for modifications to Group's children list. At this early stage, I'd now like to ask you if you would have a look at it to decide if the approach is suitable at all. Being able to monitor the scene graph is a rather important feature to us. But then, it is only useful to us if it eventually goes into the official repos. If you don't find it suitable, what alternative approach would you suggest?

I added an "osgobserver" example which demonstrates how one should use the feature (the example needs C++11 for I feel that we're not going to keep it, anyway. Please tell me if that's a problem).

If you find this useful, I'd be glad to put some more effort into it to make the feature more complete.

For the time being I designed this for backwards compatibility, but I believe that interface changes (e.g. implementing osg::Observer as a template) could simplify the way the feature is used. There may however be caveats to this.

As far as this may apply yet: I don’t require to retain the copyright.

Best regards,
Stefan

_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Thomas Hogarth | 22 May 02:08 2015
Picon

Fix to osgDB::ClassInterface getSupportedProperties

Hi

Little fix for ClassInterface::getSupportedProperties, before if you set searchAssociates to false then it would return the same BaseSerialiser::Type for every entry in the PropertyMap as i was not being incremented on line 539. Fix attached.

ClassInterface is an awesome tool by the way.

Tom
Attachment (ClassInterface.cpp): text/x-c++src, 31 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Bin Chen | 21 May 08:33 2015
Picon

Fixed 3ds file cannot load texture file in 3.2 branch for iOS 8.3:

Hi, Robert, 

Fixed a bug in 3.2 branch for iOS 8.3:
    
In iOS 8.3, osg can not load 3ds texture file if the file is in the same directory of the .3ds file.

It is in src/osgPlugins/3ds/ReaderWriter3DS.cpp line 1199- line 1120.

Do you need me to push to a branch: fix/iOS/load3dsTexture?
The attachment is the code change screen shot.

And thanks for you guys' work my project can now run on Android, iOS, WinCE 7 smoothly so far:>

Cheers.

Bin

_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Colin McDonald | 20 May 18:28 2015
Picon

Minor MeshOptimizers portability fix

Hi Robert,

src/osgUtl/MeshOptimizers.cpp won't compile on some systems due to a missing std:: namespace prefix.

Regards

Colin McDonald
Attachment (MeshOptimizers.zip): application/zip, 11 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Farshid Lashkari | 19 May 18:38 2015
Picon

Support for custom RenderStage

Hi Robert,

I've attached a small change to the CullVisitor class, which will use cloneType() on the root render stage when creating children render stages. This allows us to pass a custom RenderStage object to the SceneView and have it used for all sub-stages.

Cheers,
Farshid
Attachment (CullVisitor.zip): application/zip, 14 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Emilian Mihalache | 17 May 21:45 2015
Picon

(Heavy-handed) Fix for fglrx crash originating from State::frameCompleted

Hello,

While going through the "OpenSceneGraph for Beginners" book and testing out the "rendering more scenes at one time" example, I came across a SIGSEGV in fglrx. Attached zip file contains stack trace (as reported by gdb) + source code of program that can be used to reproduce the crash 100% of the time on my machine (main.cpp) + proposed solution (tested to work, at least on my machine) (State.cpp).

I'm not 100% sure why this works, adding the Mutex was just something that occurred to me after adding some debug prints in State::frameCompleted and observing the behavior: 1. the first two Viewers block inside the 'glGetInteger64v' call; 2. the third Viewer comes along; 3. 'glGetInteger64v' un-blocks one of the callers; 4. SIGSEGV.

Assumption is that fglrx does not properly synchronise access.

I don't know if this solution is in any way acceptable (since I guess a Mutex would not be cheap, especially in that part of the framework), or if anyone else is seeing this problem, but I figured I might share my fix anyway.

Additional info: Ubuntu 14.04, fglrx 13.35.5 [Mar 12 2014] on a Radeon Mobility HD 5650.

Please let me know if any additional information is required.

Best Regards,
Emilian

Attachment (attachment.zip): application/zip, 17 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Konstantin | 14 May 15:05 2015
Picon

Uniform::Callback copy fix

Hello, Robert!

I've found, that Uniform's Callbacks (update and event) aren't copied.
Please, review fixed Uniform.cpp file in the attachment.

Best wishes,
Konstantin Matveyev

Attachment (Uniform.cpp): text/x-c++src, 109 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
We See | 11 May 16:09 2015
Picon

OSG crashes in RenderStage::draw()

Hi Robert,

I found a small bug in osgUtil::RenderStage::draw() (osg 3.3.7), which crashes osg. The problem was
caused by an access to the object _camera without checking whether the object is valid. So I changed the line:

Code:
if (_cameraRequiresSetUp || (_cameraAttachmentMapModifiedCount!=_camera->getAttachmentMapModifiedCount()))

to

Code:
if (_cameraRequiresSetUp || (_camera.valid() && _cameraAttachmentMapModifiedCount!=_camera->getAttachmentMapModifiedCount()))

The adapted file is attached.

Thank you!

Cheers,
WeSee

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63709#63709

Attachments: 
http://forum.openscenegraph.org//files/osgutil_renderstage_cpp_202.zip
Jannik Heller | 8 May 17:26 2015
Picon

osgParticle::ParticleProcessor uninitialized fix

Hi Robert,

This patch adds a missing initialization of osgParticle::ParticleProcessor::_frameNumber in the copy constructor.
I noticed this because valgrind was complaining about use of uninitialized memory.

Cheers,
Jannik

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63678#63678

_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Tyge Løvset | 8 May 13:20 2015
Picon

osg::Vec{*} harmonisation and improvements

Hi,

I have been playing with the osg::Vec classes, and also read a 2 year old thread about this here
on the forum (not allowed to link to it because I don't have 2 posts already).

I too find the current implementation rather inconsistent and limited so I've made
a concise c++03 implementation that I hope will be aproved. It should be much easier 
to maintain as it is much less code, and each function is defined only once (has no 
overloaded "similar" functions either). I suppose Matrix{f,d} and other classes
should be updated later to use the new template classes Vec2t<T>, Vec3t<T>, Vec4t<T>.

FULLY HARMONISED WITH TEMPLATES.
All Vec types have equal interface and can fully intermix in expressions. Most arguments
are templated, so no unneccesary conversions or temporaries are made, which should speed up code.
Also Vec4{*}::asRGBA() works for any type.

SMART RETURN TYPES
Expressions returns the "natural" Vec type, e.g. Vec3i ^ Vec3d => Vec3d, whereas Vec3s ^ Vec3i => Vec3i,
although the Vec3 ^ function is defined only once! Automatic conversion to other Vec classes is
enabled by default in order to compile the current OSG source, but I highly recommend that this
feature is turned off by default in the future (#define OSG_NO_VEC_AUTO_CONVERSION) and force
explicit conversions.

NOTE: Expressions involving integer types only (char, short, int and unsigned types) always return
int for implementation simplicity. E.g.: -Vec3us() => Vec3i, Vec3ub + Vec3s => Vec3i.

EXTENSIONS
I have not added excessive new functionality, but did add a few: 
    * Explicit constructors that also accept number array (e.g float[]).
    * Partial set() functions, which set some of the components, e.g.:

Code:
osg::Vec4 color1, color2;
color2.set<0,1,2>( color1.rgb() );

    * normalized() const. returns unity vector.
    * equivalent(u,v) implemented for Vecs.
NOTE: In partial set<>() above, the indices 0,1,2 are actually compile-time checked to be < 4
and unequal to each other! The rgb() function returns a Vec3, which brings us to the next point.

SWIZZLE FUNCTIONS
From a set of macros, a complete set of very convenient swizzle functions are generated,
e.g. v.wyxx(), v.xy(), v.bgr(), etc. This could potentially slow down compilation or create bigger
executables. However, I have not seen any of those effects with neither VC nor GCC.

FILES AND IMPLEMENTATION
The implementation is done in files Vec2, Vec3, Vec4 and VecFwd. The remaining osg/Vec{*}
files are needed for backward compability only, and osg/Export, osg/Config and osg/Math
are included only so the test can be compiled standalone.

NB: Code which predeclares class Vec2i; class Vec3f, etc. must #include < osg/VecFwd > instead.

Thank you!

Cheers,
Tyge

ps: I have contributed a few lines of code earlier.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63672#63672

Attachments: 
http://forum.openscenegraph.org//files/osg_vec_850.zip
Jannik Heller | 7 May 03:26 2015
Picon

Re: Various typo fixes

Hi Robert,

here's another "purge" - this might be the last one as I'm slowly running out of typos to find it seems. Just 65
changes this time, no api changes.

Thanks,
Jannik

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=63654#63654

Attachment (typo_r14865.zip): application/zip, 348 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Gmane