Giuseppe Donvito | 28 Oct 12:14 2014
Picon

possible bug on clone() for drawables

I've found a weird behavior in the clone() method when the sub-graph to be cloned has a group with a ParticleSystem (or drawable) directly attached to it.

For instance in this case if you want apply a shallow copy for drawables and a deep copy for nodes and statesets, this piece of code will fail:
osg::ref_ptr<osg::Node>
   copy = static_cast<osg::Node*>(subgraph->clone(osg::CopyOp::DEEP_COPY_NODES | osg::CopyOp::DEEP_COPY_STATESETS));

The "copy" instance will have full copies of ParticleSystems (or drawables) instead of copies by reference.
I think this is due to the generic cast to "Node" objects in the Group constructor iteration for copy. (osg version 3.3.2, Group.cpp, line 39).

this bug, if verified, could cause performance issues in term of memory footprint.

BR,
 Giuseppe
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Anish Thomas | 21 Oct 07:48 2014
Picon

Texture2DArray on Android (OpenGL ES 3.0)

Hi,

Has anyone gotten Texture2DArrays working on OpenGL ES 3.0?

My code applies them on Windows 
(OpenGL 4.3) just fine. I also modified the check 

_isTexture2DArraySupported = OSG_GL3_FEATURES ||
isGLExtensionSupported(contextID,"GL_EXT_texture_array") ||
            strncmp((const char*)glGetString(GL_VERSION),"3.0",3)>=0;

So that bool _isTexture2DArraySupported is set to true. Debugging on Android 4.4.4 (Nexus 4) didn't yield
much help as it's dead slow even with Eclipse Luna.

In the debugger I do see that the necessary flags _isTexture2DArraySupported and _isTexture3DSupported
are both set to true and _maxLayerCount is 256. All the relevant GL extension func ptrs are also non-zero.

I used setTextureAttribute instead of setTextureAttributeAndModes.

What I see is that the textured objects are invisible. Any ideas?

Thank you!

Cheers,
Anish

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=61345#61345
Pjotr Svetachov | 17 Oct 12:02 2014
Picon

little optimization to state tracking

Hi Robert,

I was experimenting with VBO's to try to get them on par with display
lists when drawing lots of batches and noticed that my program
generated a lot of unneeded glClientActiveTexture calls. Digging
deeper I found out it came from State::disableTexCoordPointer where
the function would call glClientActiveTexture but not
glDisableClientState because the geometry didn't have texture
coordinates for that channel. This is because in our scene there are
some geometries that have move than one uv channels making
State::_texCoordArrayList grow. Then the method
State::applyDisablingOfVertexAttributes() will call
disableTexCoordPointer multiple times.

I rearrange the method a little to combat this. Now the logic has the
same ordering as disableTexCoordPointersAboveAndIncluding which
already combats this.

Cheers,
Pjotr
Attachment (State): application/octet-stream, 147 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Farshid Lashkari | 13 Oct 21:04 2014
Picon

Fix texture search path for obj loader

Hi Robert,

The obj loader was overriding the existing database path list with the file path of the model, instead of prepending the file path to the path list. The latter seems to be more common behavior for most of the existing loader plugins. Also, the local options weren't actually being used when processing the scene graph for textures. I've attached the fix for both issues.

Cheers,
Farshid
Attachment (ReaderWriterOBJ.cpp): text/x-c++src, 43 KiB
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Maxim Kuzmin | 13 Oct 15:19 2014
Picon

Small enhancement for osgAnimation

Hi,

Unfortunately, I didn't find the way to play animation in reverse mode, so I added such feature directly to
OSG. 

To be exact, two features were added:
1. New animation mode - ONCE_REVERSE, that plays animation in reverse mode one time.
2. "Overturn" allows user to overturn animation playback "on the fly", i.e. to reverse the playback of
already playing animation.

This features work good in my project, but I'm new to OSG, so I suppose that they can cause some unforeseen bugs.

I'm using OSG ver. 3.2.1, last stable release.

Cheers,
Maxim

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

Attachments: 
http://forum.openscenegraph.org//files/animation_src_203.zip
SkillCheck | 8 Oct 17:04 2014
Picon

SphericalManipulator generalized up axis

Hi,

I would like to submit my modifications to the osgGA::SphericalManipulator class to allow the specification of any up axis. The default now is to always use the Z axis as the vertical axis. This change is a generalization of the idea allowing one to specify any vector as the up axis.

I've implemented the getMatrix() and getInverseMatrix() methods to incorporate this additional transformation. However, I did not update the setByMatrix() method as I was unsure of the correct way to implement this. If anyone has hints about how to do this please let me know and I will incorporate it.

Regards,
Chris

$ diff /s/sandbox/dev/extern/OpenSceneGraph-3.2.0/include/osgGA/SphericalManipulator SphericalManipulator
81a82,85

>         void setUpAxis(const osg::Vec3d& upAxis);
>         const osg::Vec3d& getUpAxis() const {return _upAxis;}
>         const osg::Vec3d& getPitchAxis() const {return _pitchAxis;}
>
170a175,178
>         osg::Vec3d      _upAxis;
>         osg::Vec3d      _pitchAxis;
>         osg::Matrix     _orientationOffset;
>         osg::Matrix     _orientationOffsetInverse;



$ diff /s/sandbox/dev/extern/OpenSceneGraph-3.2.0/src/osgGA/SphericalManipulator.cpp SphericalManipulator.cpp
17a18,19

>     _upAxis.set(0.0, 0.0, 1.0);
>     _pitchAxis.set(1.0, 0.0, 0.0);
62a65,77
>
> //--------------------------------------------------------------------------------------------------
> void SphericalManipulator::setUpAxis(const osg::Vec3d& upAxis)
> {
>     _upAxis = upAxis;
>     _upAxis.normalize();
>
>     osg::Quat q; q.makeRotate( osg::Vec3d(0.0,0.0,1.0), _upAxis );
>     _pitchAxis = q * osg::Vec3d(1.0,0.0,0.0);
>     _orientationOffset.makeRotate(q);
>     _orientationOffsetInverse = osg::Matrix::inverse(_orientationOffset);
> }
>
263,264c278,280
<            osg::Matrixd::rotate(PI_2-_elevation,1.0,0.0,0.0)*
<            osg::Matrixd::rotate(PI_2+_heading,0.0,0.0,1.0)*
---
>            _orientationOffset*
>            osg::Matrixd::rotate(PI_2-_elevation,_pitchAxis)*
>            osg::Matrixd::rotate(PI_2+_heading,_upAxis)*
271,272c287,289
<            osg::Matrixd::rotate(PI_2+_heading,0.0,0.0,-1.0)*
<            osg::Matrixd::rotate(PI_2-_elevation,-1.0,0.0,0.0)*
---
>            osg::Matrixd::rotate(PI_2+_heading,-_upAxis)*
>            osg::Matrixd::rotate(PI_2-_elevation,-_pitchAxis)*
>            _orientationOffsetInverse*
427a445
>
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
Marc Helbling | 26 Sep 21:07 2014
Picon

Fix for invalid images in Inventor plugin

Hi Robert,

here is a trivial fix in the Inventor plugin. In one code path, the pointer validity is checked after
dereferencing a pointer that can be null (image->valid()) instead of calling ref_ptr::valid (image.valid()).

Hope this is useful.

Cheers,
Marc

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

Attachments: 
http://forum.openscenegraph.org//files/convertfrominventor_124.cpp
Marc Helbling | 19 Sep 10:48 2014
Picon

MeshOptimizers test for empty arrays

Hi Robert,

I'm submitting a small update in the mesh optimizers code.
I've come across scenes that contains geometries with initialized but empty vertex arrays and primitives
and that would make some optimizers crash.

The submission therefore only contains a test on the size of the vertex array for the
VertexCacheMissVisitor and the VertexAccessOrderVisitor visitors.

Hope this is useful. Thank you!
Cheers,
Marc

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

Attachments: 
http://forum.openscenegraph.org//files/meshoptimizers_582.cpp
Marc Helbling | 15 Sep 14:55 2014
Picon

Add option to disable DrawArrays in TriStripper

Hi,

I'm submitting a patch adding an option to prevent the TriStripper to generate DrawArrays when indices are
"in order". The default behavior still allows to generate DrawArrays to be compliant with current code.

The reason behind this submission is that my application should only work with DrawElements (which might
not be a constraint for everyone so I would understand if this doesn't go into trunk).

Thank you!

Cheers,
Marc

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

Attachments: 
http://forum.openscenegraph.org//files/disabledrawarrays_135.zip
Anish Thomas | 9 Sep 11:56 2014
Picon

Re: added support for etc2/eac compression

Hi Robert,

Can you merge this change to the OpenSceneGraph-3.2 branch?

Thank you!

Cheers,
Anish

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60982#60982
Sukender | 7 Sep 21:50 2014
Picon

Fix for NodeVisitor

Hi Robert,

Here is a...

"
Fix for NodeVisitor not taking into account Drawables as Nodes.
The main issues I found are that my visitors' methods are not called properly, and that
getParentalNodePaths() returns an empty result when called on a Drawable.
"
Based on master, revision 381c1b73cdd94ef0f81f77ea3fb1ee4c1ae378d9 (SVN trunk <at> 14422)

Cheers,

--

-- 
Sukender
Attachment (NodeVisitor.cpp): text/x-c++src, 5945 bytes
_______________________________________________
osg-submissions mailing list
osg-submissions@...
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Gmane