OgreWater

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

What's this? Could it be...

A release! (Only Direct3D though...)

Controls:
AWSD (QE) + mouse to move around.

Ctrl + 1/2 - Decrease / increase reflection strength
Ctrl + 3/4 - Decrease / increase refraction strength
Ctrl + 5/6 - Decrease / increase water fog
Ctrl + 7/8 - Decrease / increase water blur

1/2 - Decrease / increase red color channel
3/4 - Decrease / increase green color channel
5/6 - Decrease / increase blue color channel

Source code (MIT license) currently being pushed and should be available shortly from here.

Please leave some feedback (Does it work for you or not? What could be improved?). Thanks!
Last edited by lingfors on Sun Oct 09, 2011 10:48 am, edited 1 time in total.
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 136

Re: OgreWater

Post by spacegaier »

Wow, thanks!

Three remarks though:
1. There is some z-fighting going on (see image).
2. When you are above the water and look straigh down on it, you cannot tell that there is water, since you only see the ground. There should be some sort of visible waves.
3. I was not able to see any change when using the mentioned keys.
Fighting.png
You do not have the required permissions to view the files attached to this post.
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

spacegaier wrote:Wow, thanks!

Three remarks though:
1. There is some z-fighting going on (see image).
I don't think that's z-fighting, but rather due to some inaccuracies in the custom clip planes. Easily fixed by offsetting the custom clip planes, but since this is just a small demo I didn't fix it.
spacegaier wrote: 2. When you are above the water and look straigh down on it, you cannot tell that there is water, since you only see the ground. There should be some sort of visible waves.
If you increase the refraction amount, terrain under the water surface should "wobble" due to refraction.
spacegaier wrote: 3. I was not able to see any change when using the mentioned keys.
Fighting.png
Are you sure you pressed the keys long enough? I made the change pretty slow, so that I could get more control over it. A couple of seconds should be enough to see the change.
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

Just to check, does anyone else have the same problem (problem 3) as spacegaier?
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4304
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 136

Re: OgreWater

Post by spacegaier »

lingfors wrote:Just to check, does anyone else have the same problem (problem 3) as spacegaier?
My bad. I had to realize two things first in order to get it working:
1. Do not use the keys in the numpad area.
2. Even numbers do increase values/effects and not the uneven. Somehow I expected otherwise ;) .
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
Alexiss
Halfling
Posts: 74
Joined: Wed Aug 10, 2011 2:11 pm
x 11

Re: OgreWater

Post by Alexiss »

First of all, thanks a lot for this awesome release.

A quick note about the camera : when rotating the camera, Y axis movements work fine, but X axis movements still follow the axis-aligned plane.

Is it possible, with your current implementation, to achieve the same result as shown in your very first video ? I've been trying to play with settings. Adding more water fog and playing with its colour brought it closer to your original version, but it still wasn't the same.

Cheers,
Alexis
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

Alexiss wrote:First of all, thanks a lot for this awesome release.
You're welcome. :)
Alexiss wrote:A quick note about the camera : when rotating the camera, Y axis movements work fine, but X axis movements still follow the axis-aligned plane.
After a little experimenting, I think I understand what you're talking about. This is after rotating the camera, right? I'll see if I can fix it.
Alexiss wrote:Is it possible, with your current implementation, to achieve the same result as shown in your very first video ? I've been trying to play with settings. Adding more water fog and playing with its colour brought it closer to your original version, but it still wasn't the same.
Probably not. The first video was basically thrown together immediately after I got something that looked anything like water. After that I've changed the normal map lookup routines quite as bit, as well as made the strength of the distortion effect on refraction/reflection dependent on the viewing distance between the water surface and the geometry behind it (i.e. deep water gets more distorted than shallow water).
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

Just uploaded a new release, please have a look and tell me what you think. :)

New in this release:
  • Adjustable water height.
  • Caustics effect.
Also, please tell me if you'd like to see a port to OpenGL.
User avatar
Sslaxx
Greenskin
Posts: 104
Joined: Thu Apr 27, 2006 12:37 pm
Location: Malvern, Worcs., UK

Re: OgreWater

Post by Sslaxx »

Simply for the cross-platform ability if nothing else, OpenGL would be appreciated by folks.
Stuart "Sslaxx" Moore
User avatar
Zonder
Ogre Magi
Posts: 1172
Joined: Mon Aug 04, 2008 7:51 pm
Location: Manchester - England
x 76

Re: OgreWater

Post by Zonder »

with mobile devices in the category of cross platform they do need a simpler water solution so I am sure people will love GL support.
There are 10 types of people in the world: Those who understand binary, and those who don't...
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

Experimenting with projected grid. Wow, did that open up a can of worms! :?
User avatar
Pyritie
Gnome
Posts: 363
Joined: Wed Feb 25, 2009 6:15 pm
Location: UK
x 8

Re: OgreWater

Post by Pyritie »

will this work on other meshes too, like I have a river in my scene so the water's "height" isn't all on one plane
I use Mogre, BulletSharp, LuaNetInterface, irrKlang, and Miyagi! | Ponykart (Showcase)
Image
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

Pyritie wrote:will this work on other meshes too, like I have a river in my scene so the water's "height" isn't all on one plane
There is untested support for supplying your own geometry, yes. However, all geometry for a given water instance would have to be at the same height, and all water has to be parallell to the y plane.
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

Okay, figured out what was going wrong with the projected grid. Note to self: Not allocating enough space in the index buffer leads to very confusing heap corruption errors. :oops:

Anyways, geometry part of projected grid seems to be working okay now. Will try to finish the shader parts tomorrow and hopefully have something to show off. :)
User avatar
Pyritie
Gnome
Posts: 363
Joined: Wed Feb 25, 2009 6:15 pm
Location: UK
x 8

Re: OgreWater

Post by Pyritie »

lingfors wrote:
Pyritie wrote:will this work on other meshes too, like I have a river in my scene so the water's "height" isn't all on one plane
There is untested support for supplying your own geometry, yes. However, all geometry for a given water instance would have to be at the same height, and all water has to be parallell to the y plane.
Even if I don't want that geometry-moving one that you posted?
I use Mogre, BulletSharp, LuaNetInterface, irrKlang, and Miyagi! | Ponykart (Showcase)
Image
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

Pyritie wrote:
lingfors wrote:
Pyritie wrote:will this work on other meshes too, like I have a river in my scene so the water's "height" isn't all on one plane
There is untested support for supplying your own geometry, yes. However, all geometry for a given water instance would have to be at the same height, and all water has to be parallell to the y plane.
Even if I don't want that geometry-moving one that you posted?
That one is scrapped. :wink:

Probably going to do some configurable water detail, from a single 2-triangle plane with normal mapping, to a pretty dense projected grid. And of course the option to provide your own geometry.

But yes, probably going to stick with the limitations posted above, due to how reflection/refraction is handled.

And if my solution is not exactly what you want, the source is released under MIT license. :wink:
User avatar
Herb
Orc
Posts: 412
Joined: Thu Jun 04, 2009 3:21 am
Location: Kalamazoo,MI
x 38

Re: OgreWater

Post by Herb »

@lingfors - First off, great work on this and thanks for sharing the source. I really like the water you showcased in the first post via youtube. Is there a way to get a hold of that source?
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

Herb wrote:@lingfors - First off, great work on this and thanks for sharing the source. I really like the water you showcased in the first post via youtube. Is there a way to get a hold of that source?
Sorry, no, that was long before I put the code under source control.
User avatar
architekth
Gnoblar
Posts: 14
Joined: Thu Oct 20, 2011 2:56 pm
Location: France
x 7

Re: OgreWater

Post by architekth »

Really great work! I've tested your demo and the render is really pretty. Unfortunately i don't know why the demo is launched with my Intel HD card and i can't launch it with my nVidia card (On my laptop). So i will test it on my desktop computer later with my nVidia 470GTX :D!

Great work! And good luck for improving your add-on !

EDIT : Just for information, with my Intel HD Graphics i've 27/30 fps above water and 17/20fps under water with a lot of fog and blur. So it's really great because Intel HD is a really bad chipset.
User avatar
Mind Calamity
Ogre Magi
Posts: 1255
Joined: Sat Dec 25, 2010 2:55 pm
Location: Macedonia
x 81

Re: OgreWater

Post by Mind Calamity »

architekth wrote:Really great work! I've tested your demo and the render is really pretty. Unfortunately i don't know why the demo is launched with my Intel HD card and i can't launch it with my nVidia card (On my laptop). So i will test it on my desktop computer later with my nVidia 470GTX :D!

Great work! And good luck for improving your add-on !

EDIT : Just for information, with my Intel HD Graphics i've 27/30 fps above water and 17/20fps under water with a lot of fog and blur. So it's really great because Intel HD is a really bad chipset.
Here's a thread that states the exact same problem "Not Detecting Multiple Cards in Laptop", I assume this is what happened to you ? If so it hasn't been fixed yet.
BitBucket username changed to iboshkov (from MindCalamity)
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39

Re: OgreWater

Post by Beauty »

Thanks for sharing your project. :D
Now I tested your second demo.
It's nice.

Unfortunately there is a problem with underwater rendering.
There is only reflection and the sky isn't visible. So for example flat water looks like caves:
Image

My suggestion:
Extend the configuration API for use of different settings for over- and underwater rendering.


An other thing:
For the demo it would be fine to display the configuration keys (e.g. as overlay).
Just as an idea :wink:
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

Beauty wrote:Thanks for sharing your project. :D
Now I tested your second demo.
It's nice.

Unfortunately there is a problem with underwater rendering.
There is only reflection and the sky isn't visible. So for example flat water looks like caves:
Image

My suggestion:
Extend the configuration API for use of different settings for over- and underwater rendering.


An other thing:
For the demo it would be fine to display the configuration keys (e.g. as overlay).
Just as an idea :wink:
That's not a bug, it is physically correct. :) I can't see how it renders directly above you, but for angles greater than 50 degrees viewed from below the water surface, the water surface is totally reflective.
User avatar
Beauty
OGRE Community Helper
OGRE Community Helper
Posts: 767
Joined: Wed Oct 10, 2007 2:36 pm
Location: Germany
x 39

Re: OgreWater

Post by Beauty »

Oh, you are right. I forgot total reflection.
On the other hand underwater rendering still could be improved.
The scene of the screenshot would be correct for a flat water surface without any waves.

In the case of waves, the surface should be different (in comparison to the bottom).
Here I found an example image. (click to enlarge)
Image

I suppose underwater rendering has no high priority (because most games show water only from above).
But if you like, you could improve it. :wink:
Help to add information to the wiki. Also tiny edits will let it grow ... :idea:
Add your country to your profile ... it's interesting to know from where of the world you are.
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: OgreWater

Post by lingfors »

Beauty wrote:Oh, you are right. I forgot total reflection.
On the other hand underwater rendering still could be improved.
The scene of the screenshot would be correct for a flat water surface without any waves.

In the case of waves, the surface should be different (in comparison to the bottom).
Here I found an example image. (click to enlarge)
Image

I suppose underwater rendering has no high priority (because most games show water only from above).
But if you like, you could improve it. :wink:
I assume you've found how to change reflection/refraction etc? Otherwise:

Image

:wink:

But you're right, there's always room for improvement. Any concrete suggestions are very welcome. I am a programmer, not an artist, so my ability to create artistic resources as well as view an image and say "this would look better if foo" is sadly severly lacking. But if I get some nice input on how something should look (or not look) I can probably code it. :wink:

That's also the main reason why I posted the code as well as the executable, to let people run it and give me some input.
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Re: OgreWater

Post by syedhs »

Hi,

I can spot two bugs, although both can be either minor or slightly major bugs depending on how you see it :wink:

1) Reflection is not following the water wave ie terrain is reflected on the water as if the water is super-cool or not moving at all..
2) Quite minor I must say.. if anti aliasing factor is set to 8 for an example, reflection image is not AA-ed.

The rest is nice so far..
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me