[osg-users] ive format and includeImageFileInIVEFile does it losereferences to same image?
roger at beardandsandals.co.uk
Wed Sep 19 13:28:14 PDT 2007
I spent some more time looking at this and realise that what I suggested has
already been implemented with a private cache of file names in
However, because of this I think that the reverse can be done in
DataOutputStream::writeImage and the image data omitted from the output
stream if it has already been written before.
I will have a go at this in the next few days.
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Roger James
Sent: 19 September 2007 12:43
To: 'Public OpenSceneGraph Users discussion list.'
Subject: [osg-users] ive format and includeImageFileInIVEFile does it
losereferences to same image?
Can anyone who is more familiar with ive ReaderWriter comment on the
Setting the includeImageFileInIVEFile option when writing ive files causes
very large files to be written even if the scene contains few textures. It
appears that whenever an image object is referenced in the graph a copy of
it is placed in the output stream along with a full copy of the image data.
Am I correct in this assumption?
Looking at the ive input code it appears that new image objects are created
unconditionally without checking for duplication whenever they are
encountered. It appears that this results in many copies of the same image
in the graph. Am I talking complete nonsense here?
I was just wondering whether it would be an easy change to make to get the
code that reads the mage data from the stream to tag the data with the
filename and put it in the cache. This data could then be used on subsequent
reads. Comments anyone?
I will have a go at this if it seems feasible, although a more elegant
solution that stops the duplicate data getting into the file in the first
place may be better. I suspect most of the other duplications that occur can
be removed with the optimiser.
I will not be offended if I am told the above is utter nonsense!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users