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
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.
"
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."
I think the best way to achieve this is to overwrite the DatabasePager::addDatabaseThread() method within the customized database pager. However this method is not 'virtual' yet, so I propose to make the method 'virtual'."
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."
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.
(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.
"
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)"
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."
The initialisation of glu low level tessellator is done in osgUtil::Tessellator::beginTessellation()
This function is not virtual, preventing any customization of the tesselation.
In particular, there in an option in glu tesselator that force the generated primitives to be triangles and that I'd like to use (GLU_TESS_EDGE_FLAG).
"
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."
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.
"
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."
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);
}"
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.
"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."
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."