Hi,

the .osg plugin's Reader supports both "file" (for an external filename
reference) and "code" (for literal embedded source) blocks.  The Writer always
writes a "code" block, but you can edit an .osg file to use the "file" form.
Then your GLSL source can live as a separate file (unless you may write the .osg
file again)  see OpenSceneGraph/src/osgPlugins/osg/Shader.cpp around line 44.

BTW the simplest (perhaps too simple?) plugins are probably the .rot, .trans,
and .scale pseudoloaders.  There are also several simple plugins in osgtoy at
http://osgtoy.cvs.sourceforge.net/osgtoy/osgtoy/OpenSceneGraph/src/osgPlugins/

cheers
-- mew




Robert Osfield wrote:
> Hi Oliver,
> 
> On 5/2/07, *Oliver Schoenborn* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
> 
>     Thanks Robert, but this doesn't work, since the writer saves the
>     source code of the shaders in the osg file, whereas I would want to
>     have only the shader file names so the shaders can be modified
>     independently. Also, I wouldn't want the user to have to know
>     low-level OSG stuff like DataVariance etc. 
> 
> 
> You could try using file "myshader.vert" etc in the .osg file, it might
> just work.  You don't need DataVariance stuff, the OSG will just use
> defaults if the values are in the file.
>  
> 
>     Is there docs for creating readers?
> 
> 
> The source code :-)
>  
> 
>     If not, what is the *simplest* reader that I could use as example?
>     Thanks,
> 
> 
> 
> The logo plugin might be simplest.
> 
> Robert.


-- 
Mike Weiblen -- Austin Texas USA -- http://mew.cx/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to