Hi Kim, Jean-Sébastien and others,

I've started to experiment again with osgOcean, and I have an issue about 
finding the osgOcean resources. OsgOcean/oceanExample modifies the osg file 
path by adding following items:
        resources/textures/
        resources/shaders/
        resources/island
        resources/boat


This leads to following problems:

- These path items are relative to the current directory. Therefore the 
application only find it's resources if the current directory is set to the 
folder containing the resources. Usually, it's not a good idea for the 
application to rely on a specific current directory to work correctly.

- I'm using MacOSX with unix makefile to compile osgOcean. A standard 
"make;sudo make install" puts the resources in "/usr/local/bin" which is the 
not the right place for resources. When running the "oceanExample" after 
installing, it doesn't find the resources (unless you manually change the 
current directory to "usr/local/bin").

- The "addResourcePaths" method is repeated by copy&paste across different 
classes. Not a real problem, but it's not elegant.


To fix these issues, I propose the following modification: 

Remove the "addResourcePaths" methods (eg. not adding relative path items to 
the osg file path). When loading a resource, add the folder prefix in the code 
(for example "osgDB::readImageFile("textures/sun_glare.png");" instead of 
"osgDB::readImageFile("sun_glare.png");").
The user would have to add the content of the osgOcean resource folder into 
OpenSceneGraph-Data or add the osgOcean resource folder to the OSG_FILE_PATH 
environment variable.
Resources would be excluded from the files to copy at install stage.


Please let me know if you see other ways to fix these issues. I'm happy to 
submit a patch if I'm on the right track.

Cheers,

Jean-Claude
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to