[osg-users] Reading shader source on Mac

Stephan Maximilian Huber ratzfatz at digitalmind.de
Mon Sep 8 01:20:25 PDT 2008


Filip Wänström schrieb:
> More merry mac musings...
>
> I get the impression (from the osg source) that when a shader is read from
> the file it uses raw c++ IO. This means that shaders source that I have put
> in my Resources directory in my App bundle (e.g.
> OsgTest.app/Contents/Resources/data/shaders/simple.vert) won't read.
>   
does

std::string filename = osgDB::findDataFile("data/shaders/simple.vert");
if (!filename.empy()) {
 ....
}

work? findDataFile should find your files in the resource-path of your 
app bundle automagically. IMHO findDataFile is called by the Registry 
when loading models / images, perhaps this call is missing when loading 
shaders.

cheers,
Stephan




More information about the osg-users mailing list