HI Marcel,

I am just reviewing the submission and haven't merged yet but believe
I understand the issue and the need for a fix something along the the
lines you have come up with.  I will need to reflect on the issue a
bit further to make a final decision about how best to resolve the
bug, but it going with your solution as is or adapting it or other
codes.

Could you send me a .osg file that contains an example of the problem
geometry repreationation so I can test conversion to .osgt/.osgb and
the suitability of various solutions.

Thanks,
Robert.

Robert.

On 16 May 2014 18:25, Marcel Pursche
<[email protected]> wrote:
> Hi,
>
> I found a bug in the new version of the geometry serializer.
> In our application we use custom vertex attributes to store object and 
> material IDs. According to this page 
> http://www.opengl.org/sdk/docs/tutorials/ClockworkCoders/attributes.php some 
> vertex attribute indices are used by the built-in attributes like gl_Vertex, 
> gl_Normal, gl_Color etc. This seems to be true for nVidia Hardware. To 
> prevent issues we only use the vertex attribute indices that are not used by 
> the built-in attributes e.g. 6 and 7 or used by built-in attributes we don't 
> need.
> The old serializer would save a vertex attribute list where only the second 
> attribute is set like this:
>
> Code:
>
> VertexAttribData 2 {
> Data {
> Array FALSE
> Indices FALSE
> Binding BIND_OFF
> Normalize 0
> }
> Data {
> Array TRUE ArrayID 124 Vec4fArray 1 {
> 1 0 0 0
> }
> Indices FALSE
> Binding BIND_OVERALL
> Normalize 0
> }
> }
>
>
>
>
> A place holder for the unused vertex attributes was written. But the new 
> serializer writes this:
>
> Code:
>
> VertexAttribArrayList 2 {
> osg::Vec4Array {
> UniqueID 9
> Binding BIND_PER_VERTEX
> }
> }
>
>
>
>
> This leads to a corrupted file as the reader tries to read exactly two vertex 
> attribute arrays, but can only read one. Instead other objects are read that 
> are not part of the vertex attribute list.
>
> I wrote a bugfix for this issue that introduces a new place holder for this 
> cases.
> If an element of a list is NULL the OutputStream will write
> "osg::NullObject ID {}" as a place holder.
> Additionally I modified the InputStream to return NULL and skip the search 
> for a fitting object wrapper if it reads "osg::NullObject".
>
> Thank you!
>
> Cheers,
> Marcel
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=59470#59470
>
>
>
>
> Attachments:
> http://forum.openscenegraph.org//files/bugfix_serializer_761.rar
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to