Hi Robert,

maybe you have overseen my last mail. So here is it
again:


--------------------------------------------------
Hi folks.

I have attached a patch to the current osg (revision
7835) which extends the functionality of osgDB and
osgdb_osg plugin for non-embedded (non-inlined) shader
source codes in the .osg files (similar to textures).
Here the description;

----------------------------------------------------
- New functions writeShaderFile and readShaderFile to
the osgDB namespace added. The functions allows
directly write and read of shaders in/from the files

- New methods to osgDB::Registry, osgDB::ReaderWriter,
osgDB::Input, osgDB::Output added. The methods allows
similar to osg::Image writing and reading of the
shader sources from and to the files.

- New plugin osgdb_glsl added. This plugin do simply
read or write glsl shader sources from files. Options
to the readShader method can be added informing about
the type of the shader source which is readed from the
file ("fragment", "vertex", "geometry")

- New methods in osg::Shader allowing storing of the
filename where the shader source was readed from. The
filename can also be used to specify where the source
code has to be written to.

- Changed the functionality of osgdb_osg Plugin to
allow either to embed the shader source code or to
write it to external files. This behaviour is similar
to the texture behaviour. If the
osgDB::Output::getOutputShaderFiles() methods returns
true, then the source code is written to a file and
.osg file just get the reference to that file. If the
method returns false, then the source code is
embedded. Default behvaiour is to embed the code.

-------------------------------------------------------
Testings:

The source code was successfully compiled against the
current osg (rev. 7835). Call of
osgDB::writeShaderFile(shader, "test.glsl") does
writes the shader to the file as expected. Call of
osgDB::readShaderFile("test.glsl") does read the code
appropriately. 

Writing to .osg files does also performs as before.
Specifying of
osgDB::Output::setOutputShaderFiles(true) does writes
the shader sources to external files and add "file
file.glsl" sequence into the .osg file instead of
"code ..." sequence.
-------------------------------------------------------

I would be lucky if this functionality will be
included into the osg, since from my point of view
(and as already discussed with Mike) this is what we
really need.

Best regards,
Art


      Jetzt Mails schnell in einem Vorschaufenster überfliegen. Dies und viel 
mehr bietet das neue Yahoo! Mail - www.yahoo.de/mail

Attachment: WriteShaderToFile.tar.gz
Description: pat356793989

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

Reply via email to