Attached is a decent start at making archives accessible using archive
names as paths in OSG_FILE_PATH.  A lot of the necessary bits and
pieces were already in OSG.  I just had to modify Registry.cpp and
FileUtils.cpp.  Now you can do something like this:

create zip1.zip containing model.osg
create zip2.zip containing the models texture files
export OSG_FILE_PATH=zip1.zip:zip2.zip
osgviewer model.osg

model.osg will be loaded from zip1.zip, while all of its textures are
loaded from zip2.zip.

This basically works with osga as well.  However, using osgarchive, I
could get a .osga file to store .osg files but not .png files.  Maybe
osga has limitations I don't know about?

I tested a lot of combinations of osga and zip files with and without
directory trees in them, and I didn't find any cases where I changed
OSG's current behavior.  I was just trying to add new behavior.  So
far I have only tested in Linux.  Does this look reasonable for
inclusion in OSG?

The big piece I haven't figure out yet is shaders.  Shader files are
currently loaded in Shader::loadShaderSourceFromFile().  To load them
from archives I think the whole shader loading infrastructure would
need to be converted to work just like loading any other file.
--
Terry Welsh
mogumbo 'at' gmail.com
www.reallyslick.com

Attachment: vfs.tar.gz
Description: GNU Zip compressed data

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to