Updated lua plugin to use new osgDB::PropertyInterface to run methods.
Added addChild/removeChild() etc to Group.cpp, and addDrawable/removeDrawable() etc. to Geode.cpp serializers.
* a new command-line-option to present3d and a new option to the p3d-plugin to suppress any found <env> tags
* a new command-line-option to present3d to forward mouse-events via osgGA::Device (defaults to off) so we can test the interface-files with present3d better
* I added a new attribute forward_to_devices for click_to_event to forward the event to all attached devices instead of handling the event locally. This will fix the annoyance with the new interface-files when toggling polygon-mode or switching light on/off.
Here’s an example:
<click_to_event forward_to_devices="true">0x72</click_to_event>
"
* MultiTouchTrackball: some code cleanup and support for normalized touch-points
* oscdevice: receiving and sending multi-touch-events via the Cursor2D-profile from TUIO
* added some documentation
Added new WindowSystemInterface::setDisplaySettings() method to provide a mechanism for passing settings onto the WindowSystemInterface so it can then set up the system appropriately.
Added assignment of the DisplaySettings to the WindowSystemInterface in Viewer/ComppsiteViewer::realize().
the wrappers it contains. The registration creates a prototype
object for all of the wrapped classes. For some of the higher-level
classes this can be a bit heavy.
I noticed a problem with a model which required a single class from
osgSim. When osgdb_serializers_osgsim.so was loaded it registered
wrappers and created prototype objects for all of the osgSim classes,
including osgSim::ScalarBar. The constructor for that class creates
several drawables, and loads arial.ttf using the freetype plugin. I
don't need that, and don't even ship the font or plugin with my
application, resulting in an unexplained warning message loading
the model.
I've modified the ObjectWrapper class to defer the prototype object
creation until if & when actually required."
To make easier "lazy apply" on the customer OpenGL shaders, the easiest way was to add an accessor to current OSG state's UniformMap.
I've also added accessors for modes and texture, since it could be usefull in the same way.
All methods are const, so I think there is no side-effects."
I've also checked the modified files still build ok with other
compilers (Linux gcc, Windows Visual Studio).
osgDB/OutputStream.cpp and osgPlugins/lws/SceneLoader.cpp require
stdlib.h for atoi use.
In osg/Uniform.cpp the compiler complains that base_class is unknown
unless I add a class name qualifier.
Not a build fix, but I spotted a typo in osgUtil/SceneView."
Provided are lua, python and V8 (for javascript) plugins that just open up enough of a link to the respective libs to run a script, there is no scene graph <-> script communication in current implementation.
But for glPrograms, in order to get all osg's uniform management system to work, I had to subclass osg::program::PerContextProgram.
Here is a modified version of this class, which add some "virtual" method to allow easy subclassing."
osgViewer::Renderer doesn't use these enum settings so now no longer has a calls StateSet::clear() or StateSet::setGlobalDefaults() on the osg::Camera's StateSet. Previously these were being
called and breaking the ability to attached state to Camera's StateSet.
OpenSceneGraph/include\osg/BufferObject(701): warning C4138: '*/' found outside of comment (E:\osg\osgSvn\OpenSceneGraph\src\osg\Array.cpp)
adding a space before /* fixes the problem
void removeClient(osg::Object * /*client*/) { --_numClients; }
"
"The idea of this new OpenGL feature is :
- set RestartIndex = "n"
- draw elements strip
-> when the index is "n", the strip is "stopped" and restarted
It's very usefull for drawing tiles with a single strip and a "restart" at the end of each row.
The idea a an OSG StateAttribute is :
Usually we use to build geometry from code, because software modelers rarely support it (and 3d file formats doesn't support it) :
-RootNode <= "PrimitiveRestartIndex=0" // So now, we know that our restart index is 0 for all drawables under this node
|
- Drawable 1 : triangles => as usual
|
- Drawable 2 : triangles strip => as usual
|
- Drawable 3 : triangles strip + "GL_PRIMITIVE_RESTART" mode = ON => use the restart index
|
- Drawable 4 : triangles strip + "GL_PRIMITIVE_RESTART" mode = ON => use the restart index
|
- Drawable 5 : triangles strip => as usual
With a StateAttribute, it's easy for the developper to say "0 will be my restart index for all this object" and then activate the mode only on some nodes.
The main problem is if you set and restart index value which is not included in the vertex array (for exemple set restart index = 100 but you have only 50 vertex). There is no problem with OpenGL, but some OSG algorithms will try to access the vertex[100] and will segfault.
To solve this, I think there is two ways :
1/ add restart index in osg::PrimitiveSet and use this value in all algorithms. It's a lot of work, maybe dangerous, and it concern only a few situations : developpers who use this extension should be aware of advanced OpenGL (and OSG) data management
2/ use a StateAttribute, and choose a "correct" restart index. In my applications, I always use "0" as a restart index and duplicate the first vertex (vertex[0] = vertex[1]). So there is no difference for OpenGL and all OSG algorithms works properly.
"
"The attached file contains:
- a per-context read counter in GLBufferObject::BufferEntry
- a global client counter in BufferData
- the glue between Texture* and Image client counter
"
I think this is necessary on OpenGL 3.2+ since this is no more "default" locations in the OpenGL specs.
The default behaviour stay the same.
There is a few new methods on osg::State :
- resetVertexAttributeAlias : reset all vertex alias to osg's default ones
- set**Alias : set a vertex attribute alias configuration
- setAttributeBindingList : set the attribute binding list (allow to specify an empty list if you're using "layout" qualifier in glsl code to specify the bindings. This save some CPU operations)"
// A custom class
namespace CustomDomain {
class MyGroup : public osg::Group
{
public:
META_Node( CustomDomain, MyGroup );
void setMyName( const std::string& n );
const std::string& getMyName() const;
void setMyID( int id );
int getMyID() const;
...
};
}
// The serialization wrapper using a custom domain name
REGISTER_CUSTOM_OBJECT_WRAPPER( MyDomain,
CustomDomain_MyGroup,
new CustomDomain::MyGroup,
CustomDomain::MyGroup,
"osg::Object osg::Node osg::Group CustomDomain::MyGroup" )
{
ADD_STRING_SERIALIZER( MyName, std::string() );
{
UPDATE_TO_VERSION_SCOPED( 1 ); // Updated for a new domain version
ADD_INT_SERIALIZER( MyID, 0 );
}
}
Save the class instance as follows:
osgDB::writeNodeFile( *myGroup, "serializer_test.osgt", new osgDB::Options("CustomDomains=MyDomain:1") );
The output file will include the domain version definition and all the class data, and can be read back. We can also force setting the domain version by the CustomDomains option while reading the saved files. If we save the class instance without any options, MyID will be ignored because the default domain version is 0.
This may help third-party libraries like osgEarth to maintain their own serializers without regarding to the OSG soversion changes.
Another feature added is a more robust binary format, which in fact adds a size-offset at each block's beginning. When there are problems or unsupported data types while reading, we can now directly jump to the block end indicated by the offset value. So a .osgb file will automatically ignore bad data and read remains as normal (at present it will fail at all). This feature will not break the backward compatibility, and can be disabled by setting "RobustBinaryFormat=false" while writing out.
Hope these changes can work smoothly with present and future community projects. Maybe we should also consider have an osgserializer example to test and demonstrate all things we can do now."
following in the qopengl.h header:
# include <QtGui/qopengles2ext.h>
# ifndef GL_DOUBLE
# define GL_DOUBLE GL_FLOAT
# endif
# ifndef GLdouble
typedef GLfloat GLdouble;
# endif
Unfortunately, when building for normal OpenGL (not GL/ES!) on Windows
with MSVC2012, GLdouble is not defined (it is not a macro but typedef)
and the code above produces a conflicting definition, making the
compile fail. I am attaching a bit hackish workaround for this problem
in osg/GL "
New methods osg::Geometry::containsDeprecatedData() and osg::Geometry::fixDeprecatedData() provide a means for converting geometries that still use the array indices and BIND_PER_PRIMITIVE across to complient
versions.
Cleaned up the rest of the OSG where use of array indices and BIND_PER_PRIMITIVE were accessed or used.
GeometryNew is only temporary and will be renamed to Geometry on the completion of refactoring work and feedback from community.
Ported osggeometry across to use GeometryNew.
The solution for to refactor the way that events are checked so I add a bool return type to checkEvents() method across osgViewer::GraphcisWindow, osgGA::Devive and osgViewer::Viewer/CompositeViewer classes
TextureBuffer objects may use osg::Texture::bindToImageUnit(), so GLSL shaders are able to use not only texelFetch() function , but also functions defined in GL_ARB_shader_image_load_store extension : imageLoad(), imageStore(), imageAtomicAdd() etc."
second email: "After a while I found that osg::Texture::applyTexParameters() used with TextureBuffer may cause some OpenGL errors ( applying texture filters and wraps to TextureBuffer makes no sense ) so I fixed it."
with startThreading/stopThreading the _drawQueue and _availableQueue
are not reset properly. This can lead to a deadlock when threading is
started again. So before threading is started again the queues must be
reset. This deadlock is also reported earlier by someone else in here:
http://forum.openscenegraph.org/viewtopic.php?p=43415#43415"
* resthttp/osc: encapsulate RequestHandler-classes in their own namespaces to prevent class-name-lookup-errors in the debugger/code (had some weird crashes)
* QTKit: fixed a compile-bug for gcc and blocks
* osgPresentation: click_to_* will fire on RELEASE, only if the drawable received a PUSH beforehand
* p3d/osgPresentation: implemented "forward_mouse_event_to_device"-tag, which will forward mouse-events to all registered devices of a viewer, if an intersection occurs. The mouse-coordinates get reprojected
* present3d: all devices get registered with the viewer
* osgViewer: only devices which are capable of receiving events are queried for new events.
* GraphicWindowIOS: added a flag to GraphicWindowIOS::WindowData to set up a retained backing buffer (defaults to false) This will enable read-back of the render-buffer with glReadPixels even after the renderbuffer got presented
* curl: added an optimized check for file-existance, now only the headers are requested and checked, instead of reading the whole file and handle it with a ReaderWriter
* p3d: fixed a bug, where the existence of a local file may prevent the remote loading of a file with the same name.
"
The set method modify the buffer object of the BufferData while the get method returned the buffer object of the Image.
I've also removed the _bufferObject member of Image (not used anymore)."
--This line, Lionel Lagardeand those below, will be ignored--
M include/osg/Image
* ZeroConfDevice does now return FILE_NOT_HANDLED instead of FILE_NOT_FOUND
* present3D supports multiple devices per env-var P3D_DEVICE, separate multiple device with a space
I refactored parts the p3d-plugin, the curl-plugin and parts of Registry and ReaderWriter. Currently the p3d-plugin tries to open all remote files with the help of the curl-plugin.
I added a new method to Registry called getReaderWriterForProtocolAndExtension. which will return a ReaderWriter which is capable in handling the remote file for the given protocol and extension. If no readerwriter is found for the given extension, a list is built of all readerwriters supporting the given protocol and this list is checked for support of wildcards (extension = "*"). If anything matches it get returned.
I added this principle also to the Registry, so now it's possible to register a generic ReaderWriter which can handle all filetypes for a given protocol, similar what curl is doing. All you have to do is to load the plugin at startup. The curl-fallback is still in place.
With these changes it is now possible to reference a movie inside a presentation without a server-address, read the presentation (with curl) and stream the movie with the correct plugin (e.g. QTKit)
"