Wang Rui | 1 Jul 2011 03:36
Picon
Gravatar

Rewriting of the osgt reader (was: Re: Infinite loop at osgt loading)

Hi All,

A serious problem was found that some newly added .osgt models
(spaceship, lz and dumptruck) will cause infinite loop while reading.
I've studied into the source code and guessed the reason is that
istream under Windows doesn't handle unget() in an expected way. That
is, the reading buffer may be filled somehow so that unget() will fail
and thus mark the entire stream as 'bad'. The whole loading process
will then be locked and that's what we see currently. The problem can
be located in osgPlugins/osg/AsciiStreamOperator.h,
AsciiInputIterator::matchString() method.

I tried handling the stream in some other ways but couldn't work out a
good one that could put back characters stablely. To avoid opening
another can of worms, finally I decide to rewrite some of the osgt
reader and treat the string to be wrote back as a 'pre-read' string
that would be handled later before the stream. A quick test shows that
these models can be loaded successfully after the modification.

Could you please help test the .osgt reader under Windows and other
platforms to make sure it can work? It will be appreciated if there
are enough feedbacks and bug reports before I could submit the change
with security.

Thanks,

Wang Rui
(Continue reading)

Jean-Sébastien Guay | 1 Jul 2011 05:03
Gravatar

Re: Rewriting of the osgt reader (was: Re: Infinite loop at osgt loading)

Hi Wang Rui,

> Could you please help test the .osgt reader under Windows and other
> platforms to make sure it can work? It will be appreciated if there
> are enough feedbacks and bug reports before I could submit the change
> with security.

I can have a look on Monday, if that's ok with you. Tomorrow is a 
holiday in Canada (Canada day in fact) and then the weekend.

Thanks for looking into this,

J-S
--

-- 
______________________________________________________
Jean-Sebastien Guay    jean-sebastien.guay@...
                                http://www.cm-labs.com/
                     http://whitestar02.dyndns-web.com/
BARANGER Emmanuel | 1 Jul 2011 07:46
Picon
Favicon

Re: [build] OSG 3.1.0 SVN don't work for me

Hi,

False joy :(

It lasted less than two hours. And it all again :(

Toute la 3D est fonctionnelle pour tout les logiciel sauf FG. Même osgviewer fonctionne. Je me demande si
ce n'est pas FG la cause de tout cela.

Thank you!

Cheers,
Emmanuel

------------------------
Some aircraft for FlightGear
http://helijah.free.fr

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41079#41079

_______________________________________________
osg-users mailing list
osg-users <at> lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Andreas Ekstrand | 1 Jul 2011 08:14
Favicon

Re: Rewriting of the osgt reader (was: Re: Infinite loop at osgt loading)

Hi Wang,

I can confirm that your fix works, with the models in OpenSceneGraph-Data-3.0.0 and also with a couple of my own models. I use Windows 7 64 bit and VC++ 2008 Express.

Regards,
Andreas


On 2011-07-01 03:36, Wang Rui wrote:
Hi All, A serious problem was found that some newly added .osgt models (spaceship, lz and dumptruck) will cause infinite loop while reading. I've studied into the source code and guessed the reason is that istream under Windows doesn't handle unget() in an expected way. That is, the reading buffer may be filled somehow so that unget() will fail and thus mark the entire stream as 'bad'. The whole loading process will then be locked and that's what we see currently. The problem can be located in osgPlugins/osg/AsciiStreamOperator.h, AsciiInputIterator::matchString() method. I tried handling the stream in some other ways but couldn't work out a good one that could put back characters stablely. To avoid opening another can of worms, finally I decide to rewrite some of the osgt reader and treat the string to be wrote back as a 'pre-read' string that would be handled later before the stream. A quick test shows that these models can be loaded successfully after the modification. Could you please help test the .osgt reader under Windows and other platforms to make sure it can work? It will be appreciated if there are enough feedbacks and bug reports before I could submit the change with security. Thanks, Wang Rui _______________________________________________ osg-users mailing list osg-users-ZwoEplunGu0hajLcUbyfC12AsgEQdTeF@public.gmane.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
<div>
    Hi Wang,<br><br>
    I can confirm that your fix works, with the models in
    OpenSceneGraph-Data-3.0.0 and also with a couple of my own models. I
    use Windows 7 64 bit and VC++ 2008 Express.<br><br>
    Regards,<br>
    Andreas<br><br><br>
    On 2011-07-01 03:36, Wang Rui wrote:
    <blockquote cite="mid:BANLkTi=XRronYmHQbxwbggcVw0fp7PR9MQ@..." type="cite">
      Hi All,

A serious problem was found that some newly added .osgt models
(spaceship, lz and dumptruck) will cause infinite loop while reading.
I've studied into the source code and guessed the reason is that
istream under Windows doesn't handle unget() in an expected way. That
is, the reading buffer may be filled somehow so that unget() will fail
and thus mark the entire stream as 'bad'. The whole loading process
will then be locked and that's what we see currently. The problem can
be located in osgPlugins/osg/AsciiStreamOperator.h,
AsciiInputIterator::matchString() method.

I tried handling the stream in some other ways but couldn't work out a
good one that could put back characters stablely. To avoid opening
another can of worms, finally I decide to rewrite some of the osgt
reader and treat the string to be wrote back as a 'pre-read' string
that would be handled later before the stream. A quick test shows that
these models can be loaded successfully after the modification.

Could you please help test the .osgt reader under Windows and other
platforms to make sure it can work? It will be appreciated if there
are enough feedbacks and bug reports before I could submit the change
with security.

Thanks,

Wang Rui

_______________________________________________
osg-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:osg-users@...">osg-users@...</a>
<a class="moz-txt-link-freetext" href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a>

    </blockquote>
  </div>
Andreas Ekstrand | 1 Jul 2011 08:18
Favicon

osgSim::MultiSwitch in osgt

Hi,

Another problem with osgSim and osgt: When converting the attached 
switch_test.flt to switch_test.osgt with osgconv and then trying it in 
osgviewer, I get the following warnings (even if it loads and shows):

AsciiInputIterator::readProperty(): Unmatched property }, expecting 
SwitchSet
AsciiInputIterator::readProperty(): Unmatched property {, expecting 
SwitchSet
AsciiInputIterator::readProperty(): Unmatched property FALSE, expecting 
SwitchSet
AsciiInputIterator::readProperty(): Unmatched property 3, expecting 
SwitchSet

I don't know if it's the writing or reading that's failing. Maybe it 
would be a good idea to write the line number in these warnings, if it's 
possible.

Regards,
Andreas

Attachment (switch_test.flt): application/octet-stream, 5788 bytes
#Ascii Scene 
#Version 80 
#Generator OpenSceneGraph 3.0.0 

osg::Group {
  UniqueID 1 
  Name "db" 
  UserDataContainer TRUE {
    osg::DefaultUserDataContainer {
      UniqueID 2 
    }
  }
  Children 1 {
    osgSim::MultiSwitch {
      UniqueID 3 
      Name "sw1" 
      Children 3 {
        osg::Group {
          UniqueID 4 
          Name "o1" 
          UserDataContainer TRUE {
            osg::DefaultUserDataContainer {
              UniqueID 5 
              UDC_UserData {
                osgSim::ObjectRecordData {
                  UniqueID 6 
                  Data Flags 0 
                  RelativePriority 0 
                  Transparency 0 
                  EffectID1 0 
                  EffectID2 0 
                  Significance 0 
                }
              }
            }
          }
          Children 1 {
            osg::Geode {
              UniqueID 7 
              Name "p1" 
              DataVariance STATIC 
              StateSet TRUE {
                osg::StateSet {
                  UniqueID 8 
                  DataVariance STATIC 
                  ModeList 2 {
                    GL_CULL_FACE ON 
                    GL_LIGHTING OFF 
                  }
                  AttributeList 1 {
                    osg::CullFace {
                      UniqueID 9 
                    }
                    Value OFF 
                  }
                }
              }
              Drawables 1 {
                osg::Geometry {
                  UniqueID 10 
                  DataVariance STATIC 
                  PrimitiveSetList 1 {
                    DrawArrays GL_QUADS 0 4 

                  }
                  VertexData {
                    Array TRUE ArrayID 1 Vec3fArray 4 {
                      -3 0 -1 
                      -1 0 -1 
                      -1 0 1 
                      -3 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_PER_VERTEX 
                    Normalize 0 
                  }
                  ColorData {
                    Array TRUE ArrayID 2 Vec4fArray 1 {
                      1 0 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_OVERALL 
                    Normalize 0 
                  }
                }
              }
            }
          }
        }
        osg::Group {
          UniqueID 11 
          Name "o2" 
          UserDataContainer TRUE {
            osg::DefaultUserDataContainer {
              UniqueID 12 
              UDC_UserData {
                osgSim::ObjectRecordData {
                  UniqueID 13 
                  Data Flags 0 
                  RelativePriority 0 
                  Transparency 0 
                  EffectID1 0 
                  EffectID2 0 
                  Significance 0 
                }
              }
            }
          }
          Children 1 {
            osg::Geode {
              UniqueID 14 
              Name "p2" 
              DataVariance STATIC 
              StateSet TRUE {
                osg::StateSet {
                  UniqueID 8 
                }
              }
              Drawables 1 {
                osg::Geometry {
                  UniqueID 15 
                  DataVariance STATIC 
                  PrimitiveSetList 1 {
                    DrawArrays GL_QUADS 0 4 

                  }
                  VertexData {
                    Array TRUE ArrayID 3 Vec3fArray 4 {
                      -1 0 -1 
                      1 0 -1 
                      1 0 1 
                      -1 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_PER_VERTEX 
                    Normalize 0 
                  }
                  ColorData {
                    Array TRUE ArrayID 4 Vec4fArray 1 {
                      1 1 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_OVERALL 
                    Normalize 0 
                  }
                }
              }
            }
          }
        }
        osg::Group {
          UniqueID 16 
          Name "o3" 
          UserDataContainer TRUE {
            osg::DefaultUserDataContainer {
              UniqueID 17 
              UDC_UserData {
                osgSim::ObjectRecordData {
                  UniqueID 18 
                  Data Flags 0 
                  RelativePriority 0 
                  Transparency 0 
                  EffectID1 0 
                  EffectID2 0 
                  Significance 0 
                }
              }
            }
          }
          Children 1 {
            osg::Geode {
              UniqueID 19 
              Name "p3" 
              DataVariance STATIC 
              StateSet TRUE {
                osg::StateSet {
                  UniqueID 8 
                }
              }
              Drawables 1 {
                osg::Geometry {
                  UniqueID 20 
                  DataVariance STATIC 
                  PrimitiveSetList 1 {
                    DrawArrays GL_QUADS 0 4 

                  }
                  VertexData {
                    Array TRUE ArrayID 5 Vec3fArray 4 {
                      1 0 -1 
                      3 0 -1 
                      3 0 1 
                      1 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_PER_VERTEX 
                    Normalize 0 
                  }
                  ColorData {
                    Array TRUE ArrayID 6 Vec4fArray 1 {
                      0 1 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_OVERALL 
                    Normalize 0 
                  }
                }
              }
            }
          }
        }
      }
      Values 5 {
        SwitchSet 3 {
          TRUE FALSE FALSE }
        SwitchSet 3 {
          TRUE TRUE FALSE }
        SwitchSet 3 {
          FALSE TRUE FALSE }
        SwitchSet 3 {
          FALSE TRUE TRUE }
        SwitchSet 3 {
          FALSE FALSE TRUE }
      }
    }
  }
}
#Ascii Scene 
#Version 80 
#Generator OpenSceneGraph 3.0.0 

osg::Group {
  UniqueID 1 
  Name "db" 
  UserDataContainer TRUE {
    osg::DefaultUserDataContainer {
      UniqueID 2 
    }
  }
  Children 1 {
    osgSim::MultiSwitch {
      UniqueID 3 
      Name "sw1" 
      Children 3 {
        osg::Group {
          UniqueID 4 
          Name "o1" 
          UserDataContainer TRUE {
            osg::DefaultUserDataContainer {
              UniqueID 5 
              UDC_UserData {
                osgSim::ObjectRecordData {
                  UniqueID 6 
                  Data Flags 0 
                  RelativePriority 0 
                  Transparency 0 
                  EffectID1 0 
                  EffectID2 0 
                  Significance 0 
                }
              }
            }
          }
          Children 1 {
            osg::Geode {
              UniqueID 7 
              Name "p1" 
              DataVariance STATIC 
              StateSet TRUE {
                osg::StateSet {
                  UniqueID 8 
                  DataVariance STATIC 
                  ModeList 2 {
                    GL_CULL_FACE ON 
                    GL_LIGHTING OFF 
                  }
                  AttributeList 1 {
                    osg::CullFace {
                      UniqueID 9 
                    }
                    Value OFF 
                  }
                }
              }
              Drawables 1 {
                osg::Geometry {
                  UniqueID 10 
                  DataVariance STATIC 
                  PrimitiveSetList 1 {
                    DrawArrays GL_QUADS 0 4 

                  }
                  VertexData {
                    Array TRUE ArrayID 1 Vec3fArray 4 {
                      -3 0 -1 
                      -1 0 -1 
                      -1 0 1 
                      -3 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_PER_VERTEX 
                    Normalize 0 
                  }
                  ColorData {
                    Array TRUE ArrayID 2 Vec4fArray 1 {
                      1 0 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_OVERALL 
                    Normalize 0 
                  }
                }
              }
            }
          }
        }
        osg::Group {
          UniqueID 11 
          Name "o2" 
          UserDataContainer TRUE {
            osg::DefaultUserDataContainer {
              UniqueID 12 
              UDC_UserData {
                osgSim::ObjectRecordData {
                  UniqueID 13 
                  Data Flags 0 
                  RelativePriority 0 
                  Transparency 0 
                  EffectID1 0 
                  EffectID2 0 
                  Significance 0 
                }
              }
            }
          }
          Children 1 {
            osg::Geode {
              UniqueID 14 
              Name "p2" 
              DataVariance STATIC 
              StateSet TRUE {
                osg::StateSet {
                  UniqueID 8 
                }
              }
              Drawables 1 {
                osg::Geometry {
                  UniqueID 15 
                  DataVariance STATIC 
                  PrimitiveSetList 1 {
                    DrawArrays GL_QUADS 0 4 

                  }
                  VertexData {
                    Array TRUE ArrayID 3 Vec3fArray 4 {
                      -1 0 -1 
                      1 0 -1 
                      1 0 1 
                      -1 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_PER_VERTEX 
                    Normalize 0 
                  }
                  ColorData {
                    Array TRUE ArrayID 4 Vec4fArray 1 {
                      1 1 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_OVERALL 
                    Normalize 0 
                  }
                }
              }
            }
          }
        }
        osg::Group {
          UniqueID 16 
          Name "o3" 
          UserDataContainer TRUE {
            osg::DefaultUserDataContainer {
              UniqueID 17 
              UDC_UserData {
                osgSim::ObjectRecordData {
                  UniqueID 18 
                  Data Flags 0 
                  RelativePriority 0 
                  Transparency 0 
                  EffectID1 0 
                  EffectID2 0 
                  Significance 0 
                }
              }
            }
          }
          Children 1 {
            osg::Geode {
              UniqueID 19 
              Name "p3" 
              DataVariance STATIC 
              StateSet TRUE {
                osg::StateSet {
                  UniqueID 8 
                }
              }
              Drawables 1 {
                osg::Geometry {
                  UniqueID 20 
                  DataVariance STATIC 
                  PrimitiveSetList 1 {
                    DrawArrays GL_QUADS 0 4 

                  }
                  VertexData {
                    Array TRUE ArrayID 5 Vec3fArray 4 {
                      1 0 -1 
                      3 0 -1 
                      3 0 1 
                      1 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_PER_VERTEX 
                    Normalize 0 
                  }
                  ColorData {
                    Array TRUE ArrayID 6 Vec4fArray 1 {
                      0 1 0 1 
                    }
                    Indices FALSE 
                    Binding BIND_OVERALL 
                    Normalize 0 
                  }
                }
              }
            }
          }
        }
      }
      Values 5 {
        SwitchSet 3 {
          TRUE FALSE FALSE }
        SwitchSet 3 {
          TRUE TRUE FALSE }
        SwitchSet 3 {
          FALSE TRUE FALSE }
        SwitchSet 3 {
          FALSE TRUE TRUE }
        SwitchSet 3 {
          FALSE FALSE TRUE }
      }
    }
  }
}
Torben Dannhauer | 1 Jul 2011 08:29

Creating a > 0.5 TB osgTerrain Database: Best file format?

Hi,

I plan to process a osgTerrain database with more than 1 TB source data with VPB.

The last version I processed was a .ive database. Now we have the new standard file formats osgx, osgt and osgb.

Which would be the best choice regarding runtime performance and regarding size?

My current coice would be osgb but I'm not sure.

Thank you!

Cheers,
Torben

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41082#41082

Wang Rui | 1 Jul 2011 08:39
Picon
Gravatar

Re: Creating a > 0.5 TB osgTerrain Database: Best file format?

Hi Torben,

The osgb format would be good for your requirement. It is a kind of
binary format similar to ive, but supports separated serializer
libraries, and can be extended to support user classes and
compressors.

Cheers,

Wang Rui

2011/7/1 Torben Dannhauer <torben@...>:
> Hi,
>
> I plan to process a osgTerrain database with more than 1 TB source data with VPB.
>
> The last version I processed was a .ive database. Now we have the new standard file formats osgx, osgt and osgb.
>
> Which would be the best choice regarding runtime performance and regarding size?
>
> My current coice would be osgb but I'm not sure.
>
> Thank you!
>
> Cheers,
> Torben
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=41082#41082
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@...
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
Wang Rui | 1 Jul 2011 08:45
Picon
Gravatar

Re: osgSim::MultiSwitch in osgt

Hi Andreas,

Ahhh... I'll try to fix it this weekend. It is just another slip of the pen.

Wang Rui

2011/7/1 Andreas Ekstrand <andreas.ekstrand@...>:
> Hi,
>
> Another problem with osgSim and osgt: When converting the attached
> switch_test.flt to switch_test.osgt with osgconv and then trying it in
> osgviewer, I get the following warnings (even if it loads and shows):
>
> AsciiInputIterator::readProperty(): Unmatched property }, expecting
> SwitchSet
> AsciiInputIterator::readProperty(): Unmatched property {, expecting
> SwitchSet
> AsciiInputIterator::readProperty(): Unmatched property FALSE, expecting
> SwitchSet
> AsciiInputIterator::readProperty(): Unmatched property 3, expecting
> SwitchSet
>
> I don't know if it's the writing or reading that's failing. Maybe it would
> be a good idea to write the line number in these warnings, if it's possible.
>
> Regards,
> Andreas
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@...
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
Torben Dannhauer | 1 Jul 2011 08:46

Re: Creating a > 0.5 TB osgTerrain Database: Best file format?

Hi Wang,

that was fast!
I have some further questions regarding some VPB features, but I post the in the VPB forum.

Thanks for the info! 

Cheers,
Torben

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41084#41084

Andreas Ekstrand | 1 Jul 2011 08:52
Favicon

Re: osgSim::MultiSwitch in osgt

Great, Wang. Thanks for looking into these issues so quickly. Much 
appreciated.

Regards,
Andreas

On 2011-07-01 08:45, Wang Rui wrote:
> Hi Andreas,
>
> Ahhh... I'll try to fix it this weekend. It is just another slip of the pen.
>
> Wang Rui
>
>
> 2011/7/1 Andreas Ekstrand<andreas.ekstrand@...>:
>> Hi,
>>
>> Another problem with osgSim and osgt: When converting the attached
>> switch_test.flt to switch_test.osgt with osgconv and then trying it in
>> osgviewer, I get the following warnings (even if it loads and shows):
>>
>> AsciiInputIterator::readProperty(): Unmatched property }, expecting
>> SwitchSet
>> AsciiInputIterator::readProperty(): Unmatched property {, expecting
>> SwitchSet
>> AsciiInputIterator::readProperty(): Unmatched property FALSE, expecting
>> SwitchSet
>> AsciiInputIterator::readProperty(): Unmatched property 3, expecting
>> SwitchSet
>>
>> I don't know if it's the writing or reading that's failing. Maybe it would
>> be a good idea to write the line number in these warnings, if it's possible.
>>
>> Regards,
>> Andreas
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users@...
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
> _______________________________________________
> osg-users mailing list
> osg-users@...
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>

Gmane