I've just managed to get the technique described above. Here is the result:
[Image: http://img825.imageshack.us/img825/926/stencilsolution.jpg ] I've also posted a video showing the difference here: http://www.youtube.com/watch?v=Rf1yJObCLKI In order to get this to work I had to first understand that the FFTOceanSurface's (Geode derivative) stateset will get overwritten any time a call to FFTOceanSurface::initStateSet is called. Unfortunately, this happens any time one of the many functions in FFTOceanTechnique gets called (ie setLightColor, setWindSpeed, etc...). To get around this I am waiting until after the stateset gets created the first time and then applying the stencil to it. If did it beforehand, it would be wiped out in the call initStateSet. Then whenever I change the lightColor (my app has changing time of day), i recreate the stencil on the next frame since the stateset for this surface will also have been recreated. This process would be made much easier if ocean surface only created a new stateset if a previous one didn't exist. Is there a reason for recreating it? ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=43052#43052 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org