Hi Peter,

Hi, I was wondering if it was possible using osgOcean to blend between water 
areas different shaders, for instance, if you are flying from New Jersey to the 
Bahamas, you obviously won't see the same level of ocean cleanness in the two 
areas. I was wondering if it was possible using osgOcean to set areas which 
would be dirtier than other areas in the same ocean, or if it would be possible 
to set up a method of blending the two areas seamlessly. This would prevent 
areas such as those that are highly industrial from having the same ocean 
transparency as an area like the Bahamas while flying between the two areas.

Well, you don't need to blend between different shaders (not even sure what that means, you can only have one shader outputting the final fragment color at a time so what would you blend between?), you just need to alter some parameters used in the shaders based on the camera's location.

There's a setting for underwater attenuation in osgOcean, which you could set in a callback depending on the camera's location. This will make the water more or less "clean" when the camera is underwater. You could easily blend between different values, yes. But you would need to do that yourself, it's not supported by osgOcean itself, it only has one setting for underwater attenuation.

But you mention flying, so please note that currently the ocean surface is not translucent. All you will see from above the surface is the reflection of the sun and objects that are above the surface. The underwater attenuation will only be visible if the camera is underwater.

One thing we might consider doing is to have a base color for the ocean surface, which you could then change based on the camera's location, so the ocean surface could look green/blue in the Bahamas, blue/brown in New York, anything you want...

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