Hello Adrien,

So why using an OceanScene disable my lighting effects ??

osgOcean uses shaders for most of its effects, and these shaders assume directional lights. You will have to customize the shaders to do the right calculations for all types of light source.

This is not a trivial topic and will require you to get acquainted with writing GLSL shaders and also to modify the code of osgOcean and recompile it.

To make osgOcean use your customized shaders you have two options.

1. Modify the shaders embedded in the osgOcean source code and recompile osgOcean. 2. Modify the shaders in osgOcean's resource directory and disable the "USE_LOCAL_SHADERS" define in the osgOcean source code and recompile osgOcean.

I've been thinking of removing the USE_LOCAL_SHADERS define in osgOcean. Currently osgOcean will use shaders embedded in its source code if USE_LOCAL_SHADERS==1, and will load shaders from files if it's ==0. I think a more useful way would be to just make it try to load shaders from files (from the current directory, then OSG's data file path list, as is OSG standard) and if they're not found, use the shaders embedded in the source. This will allow apps to easily customize shaders without recompiling by just distributing the shaders with the app, and if they just need the default shaders they can not distribute them and the default ones from the source code will be used, all without recompiling.

I'll try to get around to doing this soon. Also I haven't heard from Kim Bale in a very long time, so I may try to make a release of osgOcean soon with the modifications I've made since the last release. It's been a while now.

Hope this helps,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to