[osg-users] Export shader programs to external files
Johan Hedstrom
leadcoder at gmail.com
Mon Sep 14 12:14:48 PDT 2015
Hi, Sebastian
We have a couple of inhouse applications that use OSG for terrain rendering the all share the same pagedLOD based terrain database. The terrain DB use shaders for landcover based detail texturing and some other stuff. The actual shader code is injected at the top node in a .osg file that in turn have a proxy childnode that points to the first LOD of the actual terrain DB that can be saved in whatever format we choose .ive, .osgb etc. By having the top node in a readable format we can easily change origo,detail textures, shaders etc. By using the .osg format anyone can change and view the DB without any custom applications or plugins which so far has been very convenient.
I’ve also tried to use the .osgt format that support serialization of the Texture2DArray but not external shaders (changing inline shaders in .osgt is tricky, you have to keep track of line count and be careful with indentation).
I guess the best solution is to create a custom plugin that extend .osg with Texture2DArray serialization or add external shader support to .osgt
Cheers,
Johan
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65133#65133
More information about the osg-users
mailing list