Page 4 of 6

Re: Water shaders, OpenMW vs MGEXE

Posted: 20 Jul 2018, 18:07
by visvaldas
wareya wrote: 20 Jul 2018, 13:06
Ruarl wrote: 20 Jul 2018, 07:24 Adding the foam would be great, but if the project ever gets to that stage it should somehow differentiate cells that are ocean water and cells that are river water. Difficult indeed. Probably will have to flag cells what type of water it contains or something similar.
There are cells where river water meets the ocean.
For this, a map which encodes water attributes could be used - like this:
viewtopic.php?f=8&t=4105&start=10#p48821

Re: Water shaders, OpenMW vs MGEXE

Posted: 21 Jul 2018, 00:00
by Ravenwing
OoOoO I had forgotten about that! Any progress with that? But yes, we'd have to come up with a more rigorous method than water type per cell. And preferably some kind of boundary condition between different types so the two different wave types would blend more naturally. I don't think you could simply blend a directional river that's relatively flat into more active water with foam simply by averaging the two. But I am also completely inexperienced in this realm. Does anyone actually know of any games that do that, fresh water into ocean, and have it look realistic?

Re: Water shaders, OpenMW vs MGEXE

Posted: 21 Jul 2018, 07:47
by CMAugust
This reminds me that Skyrim Special Edition has a flow-based water shader for rivers, which blend into the sea and even numerous adjoining currents quite nicely.

Re: Water shaders, OpenMW vs MGEXE

Posted: 21 Jul 2018, 13:28
by visvaldas
Ravenwing wrote: 21 Jul 2018, 00:00 OoOoO I had forgotten about that! Any progress with that? But yes, we'd have to come up with a more rigorous method than water type per cell. And preferably some kind of boundary condition between different types so the two different wave types would blend more naturally. I don't think you could simply blend a directional river that's relatively flat into more active water with foam simply by averaging the two. But I am also completely inexperienced in this realm. Does anyone actually know of any games that do that, fresh water into ocean, and have it look realistic?
No I didn't continue to work on that.

Vterrain has some links on water rendering:
http://vterrain.org/Water/

These ones look interesting:
http://maverick.inria.fr/Publications/2 ... /index.php
https://www.rug.nl/society-business/cen ... tershader/

Re: Water shaders, OpenMW vs MGEXE

Posted: 21 Jul 2018, 15:55
by ajira2
Hey look what says in one of the links you posted!

FOAM!! FOAAAAM caps!!!

"osgOcean
An add-on for the open-source OSG library which does deep-water wave surfaces: Foam caps, Refraction/Reflection, God Rays, Surface glare, Underwater depth of field, Simulated light absorption and scattering, etc."

Re: Water shaders, OpenMW vs MGEXE

Posted: 21 Jul 2018, 15:57
by ajira2

Re: Water shaders, OpenMW vs MGEXE

Posted: 21 Jul 2018, 16:02
by psi29a
You mean this...

https://github.com/kbale/osgocean
http://forum.openscenegraph.org/viewforum.php?f=15

looks like it worked with 3.2... last updated in 2017.

http://sundog-soft.com/2014/09/comparin ... an-hydrax/

Anyway, we have resources. ;)

Foam trail written in GLSL Shader for a ship simulator using osgOcean in 03-Jun-2015
https://www.youtube.com/watch?v=neMcmvLwXY8
https://www.youtube.com/watch?v=Bq6fHioZIzc

and more osgOcean
https://www.youtube.com/watch?v=LMSkonf3CnA
https://www.youtube.com/watch?v=ujFuX0ytax0

^-- this last one is cool, depending on environmental variables it can go from tropical to stormy with realistic effects

Update: Just tried compiling against osg3.4 and it fails... so there is a bit of work to be done.

Code: Select all

bcurtis@Wintermute:~/Workspace/Private/osgocean/build$ make -j8
Scanning dependencies of target osgOcean
[ 16%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/DistortionSurface.cpp.o
[ 16%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/FFTOceanTechnique.cpp.o
[ 20%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/FFTSimulation.cpp.o
[ 16%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/FFTOceanSurfaceVBO.cpp.o
[ 16%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/FFTOceanSurface.cpp.o
[ 29%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/Cylinder.cpp.o
[ 29%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/GodRayBlendSurface.cpp.o
[ 33%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/GodRays.cpp.o
[ 37%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/MipmapGeometry.cpp.o
In file included from /home/bcurtis/Workspace/Private/osgocean/include/osgOcean/FFTOceanSurfaceVBO:21:0,
                 from /home/bcurtis/Workspace/Private/osgocean/src/osgOcean/FFTOceanSurfaceVBO.cpp:18:
/home/bcurtis/Workspace/Private/osgocean/include/osgOcean/MipmapGeometryVBO:147:26: error: invalid covariant return type for ‘virtual osg::BoundingBox osgOcean::MipmapGeometryVBO::computeBound() const’
         osg::BoundingBox computeBound( void ) const;
                          ^~~~~~~~~~~~
In file included from /usr/include/osg/Geode:19:0,
                 from /home/bcurtis/Workspace/Private/osgocean/include/osgOcean/OceanTechnique:20,
                 from /home/bcurtis/Workspace/Private/osgocean/include/osgOcean/FFTOceanTechnique:20,
                 from /home/bcurtis/Workspace/Private/osgocean/include/osgOcean/FFTOceanSurfaceVBO:20,
                 from /home/bcurtis/Workspace/Private/osgocean/src/osgOcean/FFTOceanSurfaceVBO.cpp:18:
/usr/include/osg/Drawable:160:32: error:   overriding ‘virtual osg::BoundingSphere osg::Drawable::computeBound() const’
         virtual BoundingSphere computeBound() const;
                                ^~~~~~~~~~~~
[ 41%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/MipmapGeometryVBO.cpp.o
[ 45%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/OceanScene.cpp.o
[ 50%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/OceanTechnique.cpp.o
[ 54%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/OceanTile.cpp.o
In file included from /home/bcurtis/Workspace/Private/osgocean/src/osgOcean/MipmapGeometryVBO.cpp:18:0:
/home/bcurtis/Workspace/Private/osgocean/include/osgOcean/MipmapGeometryVBO:147:26: error: invalid covariant return type for ‘virtual osg::BoundingBox osgOcean::MipmapGeometryVBO::computeBound() const’
         osg::BoundingBox computeBound( void ) const;
                          ^~~~~~~~~~~~
In file included from /usr/include/osg/Geometry:17:0,
                 from /home/bcurtis/Workspace/Private/osgocean/include/osgOcean/MipmapGeometryVBO:19,
                 from /home/bcurtis/Workspace/Private/osgocean/src/osgOcean/MipmapGeometryVBO.cpp:18:
/usr/include/osg/Drawable:160:32: error:   overriding ‘virtual osg::BoundingSphere osg::Drawable::computeBound() const’
         virtual BoundingSphere computeBound() const;
                                ^~~~~~~~~~~~
[ 58%] Building CXX object src/osgOcean/CMakeFiles/osgOcean.dir/ScreenAlignedQuad.cpp.o
src/osgOcean/CMakeFiles/osgOcean.dir/build.make:158: recipe for target 'src/osgOcean/CMakeFiles/osgOcean.dir/FFTOceanSurfaceVBO.cpp.o' failed
make[2]: *** [src/osgOcean/CMakeFiles/osgOcean.dir/FFTOceanSurfaceVBO.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
src/osgOcean/CMakeFiles/osgOcean.dir/build.make:278: recipe for target 'src/osgOcean/CMakeFiles/osgOcean.dir/MipmapGeometryVBO.cpp.o' failed
make[2]: *** [src/osgOcean/CMakeFiles/osgOcean.dir/MipmapGeometryVBO.cpp.o] Error 1
/home/bcurtis/Workspace/Private/osgocean/src/osgOcean/OceanScene.cpp: In member function ‘virtual void osgOcean::OceanScene::traverse(osg::NodeVisitor&)’:
/home/bcurtis/Workspace/Private/osgocean/src/osgOcean/OceanScene.cpp:884:77: error: no match for call to ‘(osg::Callback) (osgOcean::OceanTechnique*, osg::NodeVisitor*)’
                 (*_oceanSurface->getCullCallback())(_oceanSurface.get(), &nv);
                                                                             ^
src/osgOcean/CMakeFiles/osgOcean.dir/build.make:302: recipe for target 'src/osgOcean/CMakeFiles/osgOcean.dir/OceanScene.cpp.o' failed
make[2]: *** [src/osgOcean/CMakeFiles/osgOcean.dir/OceanScene.cpp.o] Error 1
CMakeFiles/Makefile2:106: recipe for target 'src/osgOcean/CMakeFiles/osgOcean.dir/all' failed
make[1]: *** [src/osgOcean/CMakeFiles/osgOcean.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

Re: Water shaders, OpenMW vs MGEXE

Posted: 23 Jul 2018, 19:54
by psi29a
Sweet... got it working with osg34 thanks to this: https://github.com/kbale/osgocean/pull/52

So this is something we can pull into OpenMW alongside osgQt for example. The example is pretty sweet.

Update: the PR was finally merged after I commented. ;)

https://github.com/kbale/osgocean

It's now usable for us! :D
osgOcean_osg34.png
^-- ocean at dusk with foam caps

Re: Water shaders, OpenMW vs MGEXE

Posted: 24 Jul 2018, 12:05
by imec
The package linked in this thread is needed to render the sky and some other assets in the scene for anyone interested. Extracted files go in a folder called "resources" in the same folder as the executable.

http://forum.openscenegraph.org/viewtopic.php?t=17080

Re: Water shaders, OpenMW vs MGEXE

Posted: 06 Aug 2018, 17:01
by kuyondo
Image
Image
Image
Image
Image
Image