Hi, I actually have been using osgOcean for a year now. Well, I actually use 
Delta 3D which uses OSG and in turn osgOcean. It's a pretty good library for 
rendering ocean, would be better if you can add atmospheric scattering using 
Mie and Rayleigh approximation for real time day-night situation. But beggars 
can't be chosers, right? :D

Anyway I've found 2 bugs on osgOcean. One I still haven't been able to solve, 
that is the glare functionality. It seems like the glare would also affect the 
skybox and not only the ocean. I believe it's a shader issue when you are 
downsampling the rendered texture with glare.

The other one is the "FFTOceanSurface::getSurfaceHeightAt()" method. It would 
crash from time to time due to negative tile_x and/or tile_y value whereas they 
are used to determine an index for vectors in 
"OceanTile::normalBiLinearInterp()" and "OceanTile::biLinearInterp()" function. 
I know that because I used the method quite a lot for determining a ship's 
transformation when there's a wave. Below is the fix for the said problem:



Code:

                ...
                if (_oldFrame < _mipmapData.size())
                {
                        const OceanTile& data = _mipmapData[_oldFrame][0];

                        float tile_x = oceanX - ix * _tileResolution;
                        float tile_y = oceanY - iy * _tileResolution;

                        //++ BAWE-20101119: BUG FIX
                        // Absolute value of dx & dy
                        tile_x = tile_x > 0 ? tile_x : -tile_x;

                        tile_y = tile_y > 0 ? tile_y : -tile_y;
                        //-- BAWE-20101119: BUG FIX

                        if (normal != 0)
                        {
                                *normal = data.normalBiLinearInterp(tile_x, 
tile_y);
                        }

                        return data.biLinearInterp(tile_x, tile_y);
                }




Thank you!

Cheers,
Bawenang

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=36177#36177





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

Reply via email to