openscenegraph / OpenSceneGraph

OpenSceneGraph git repository
http://www.openscenegraph.org
Other
3.25k stars 1.42k forks source link

Storage issues arising from osgb format conversion #1295

Closed HerculesJL closed 7 months ago

HerculesJL commented 10 months ago

Hello, why is it that when I use osgconv to convert a model from osgb format to osgt format, and then convert it back to osgb format without making any changes, the storage space it occupies becomes very large?

robertosfield commented 10 months ago

Please keep subject lines succinct, it's unhelpful to everyone to have put the whole question in the subject line.

As for why you model changes size, this is not normal behaviour. As we don't have information on the contents of the .osfb, .osgt or how the final .osgb grew there is no way of us knowing what might be going on,

HerculesJL commented 10 months ago

Thanks for your reply, and I am very sorry for my carelessness. The data is contained in Data.zip . InputOsgb is the original osgb, and convertedOsgb is the osgb converted from osgt. Data.zip

HerculesJL commented 10 months ago

By the way, if I want to change the name of osgb, Is there any other way besides converting osgb to osgt and then manually modifying the names of the LOD-related child nodes? Thanks again !

LaurensVoerman commented 10 months ago

The size increase is because you lost the jpeg compression on the image. This gets you closer: (jpeg re-compression) set OSG_OPTIMIZER=OFF osgconv -O WriteImageHint=WriteOut ..\InputOsgb.osgb out.osgt osgconv -O WriteImageHint=IncludeFile out.osgt out.osgb Cutting the jpeg data out of the osgb file with an hex editor gets you even closer, but I'm not aware of an option in osgconv to get it into a file directly.

HerculesJL commented 10 months ago

The size increase is because you lost the jpeg compression on the image. This gets you closer: (jpeg re-compression) set OSG_OPTIMIZER=OFF osgconv -O WriteImageHint=WriteOut ..\InputOsgb.osgb out.osgt osgconv -O WriteImageHint=IncludeFile out.osgt out.osgb Cutting the jpeg data out of the osgb file with an hex editor gets you even closer, but I'm not aware of an option in osgconv to get it into a file directly.

Thank you!