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)"
This version adds:
- an encapsulation of the entire Depth Peeling procedure into a class (not currently a scene graph node) for easier integration in other projects.
- compositing with opaque (solid) geometry is possible and the opaque model is only rendered once. This needs to performs some depth buffer blitting between FBOs.
- mix and match with GLSL shaders in the transparent objects is possible, as demonstrated with a 3D heat map intersecting an opaque truck model.
Some Drawbacks:
- the display framebuffer does not receive any depth information from the compositing camera. This could be fixed by compositing with a GLSL shader and writing to FragDepth."
From Robert Osfield, ported the code to work under Linux and without the automatic ref_ptr to C* conversion.
I just added a field version_ to read it at the beginning and added extra code to check it and read the extra field if needed and read the good filename"
been removed in the most recent versions of libavcodec/ffmpeg. You're
already using avcodec_open2() elsewhere, but one appears to have been
missed. The change is trivial:
[skynet](0) $ svn diff
Index: src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp
===================================================================
--- src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp (revision 13355)
+++ src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp (working copy)
@@ -109,7 +109,7 @@
// m_context->flags |= CODEC_FLAG_TRUNCATED;
// Open codec
- if (avcodec_open(m_context, p_codec) < 0)
+ if (avcodec_open2(m_context, p_codec, NULL) < 0)
throw std::runtime_error("avcodec_open() failed");
}
[skynet](0) $
I've applied similar changes this year to many other packages, including
cheese, blender, linphone, ad nauseam. It's been tested by verifying that
with my patch, OSG builds against the newest libavcodec and ffmpeg, whereas
otherwise it does not.
The modified src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp is attached. It
originates in svn trunk revision 13355. Thanks!"
// 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."
a few modifications to these files:
- applications/present3D/Cluster.cpp
- src/osgDB/FileUtils.cpp
The changes are needed to fix a few platform specific things such as the
absence of stat64, int/socklen_t differences, etc... and are in the same
line as Linux, Apple and FreeBSD specific checks.
I have attached the modified files; the original patches to 3.0.1 are
also visible here if you find it more convenient:
http://dl.wolfpond.org/dports/graphics.osg/dragonfly/patch-applications_present3D_Cluster.cpphttp://dl.wolfpond.org/dports/graphics.osg/dragonfly/patch-src_osgDB_FileUtils.cpp
With these changes, osg 3.0.1 is able to be built and packaged on DragonFly
whereas it previously failed to compile."