Hi John,

Oh, so you are talking about the saving/reading of geometry shaders,
not just geometries. :-)

After checking the osg::Program serializer, I can confirm this is a
bug. As GL_POINTS is defined as 0, the serializer will ignore it as
incorrectly recognize it as GL_NONE. And when you load the file again,
the Program class will use a default value for GeometryInputType, that
is, GL_TRIANGLES.

I'll submit the patch to osg-submissions at once. You can also modify
the line at src/osgWrappers/serializers/osg/Program.cpp:

#define PROGRAM_PARAMETER_FUNC( PROP, NAME ) \
    static bool check##PROP(const osg::Program& attr) \
    { return attr.getParameter(NAME)!=GL_NONE; } \

to

#define PROGRAM_PARAMETER_FUNC( PROP, NAME ) \
    static bool check##PROP(const osg::Program& attr) \
    { return true; } \

and see if it can work.

Thanks,

Wang Rui


2012/8/28 John Kelso <ke...@nist.gov>:
> Hi,
>
> I apologize for the delay in responding.
>
> Here's my attempt to provide a simple example. I am attaching the three
> referenced files.
>
> I run my program and dump the node in question into two files: dump.osgt and
> dump.osg.
>
> If I grep for "Geometry" in the two files I see:
>
> dump.osgt:553:              GeometryVerticesOut GL_GEOMETRY_VERTICES_OUT_EXT
> 4 dump.osgt:554:              GeometryOutputType GL_GEOMETRY_OUTPUT_TYPE_EXT
> 5 dump.osgt:696:            osg::Geometry {
> dump.osg:49:        GeometryVerticesOut 4
> dump.osg:50:        GeometryInputType POINTS
> dump.osg:51:        GeometryOutputType TRIANGLE_STRIP
> dump.osg:661:      Geometry {
>
> That is, the osgt file seems to be missing the line
>   GeometryInputType GL_GEOMETRY_INPUT_TYPE_EXT 0
>
> If I convert dumop.osgt file to an osg file and diff it with the original
> osg
> file I see:
>>
>> diff dumpFromOsgt.osg dump.osg
>
> 46c50
> <         GeometryInputType TRIANGLES
> ---
>>
>>         GeometryInputType POINTS
>
>
> I think the problem is just in the writer, not the reader, because if I
> manually add the missing line to the osgt file it works. And, it if convert
> the modified osgt file to an osg file the input type is now points, not
> triangles.
>
> I seem to get the same results for osgb as I do for osgt.
>
> I'm not sure how to answer the question about setVertexArray versus
> setVertexAttribArray. But points.osg is the point data that's loaded.
>
> I hope this helps. Please let me know if you need anything else that might
> help with solving the problem.
>
> Thanks,
>
> John
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to