OgreWater
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
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!
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.
-
- OGRE Team Member
- Posts: 4304
- Joined: Mon Feb 04, 2008 2:02 pm
- Location: Germany
- x 136
Re: OgreWater
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.
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.
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...
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
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:Wow, thanks!
Three remarks though:
1. There is some z-fighting going on (see image).
If you increase the refraction amount, terrain under the water surface should "wobble" due to refraction.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.
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.spacegaier wrote: 3. I was not able to see any change when using the mentioned keys.
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
Just to check, does anyone else have the same problem (problem 3) as spacegaier?
-
- OGRE Team Member
- Posts: 4304
- Joined: Mon Feb 04, 2008 2:02 pm
- Location: Germany
- x 136
Re: OgreWater
My bad. I had to realize two things first in order to get it working:lingfors wrote:Just to check, does anyone else have the same problem (problem 3) as spacegaier?
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...
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
-
- Halfling
- Posts: 74
- Joined: Wed Aug 10, 2011 2:11 pm
- x 11
Re: OgreWater
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
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
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
You're welcome.Alexiss wrote:First of all, thanks a lot for this awesome release.
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: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.
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).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.
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
Just uploaded a new release, please have a look and tell me what you think.
New in this release:
New in this release:
- Adjustable water height.
- Caustics effect.
-
- Greenskin
- Posts: 104
- Joined: Thu Apr 27, 2006 12:37 pm
- Location: Malvern, Worcs., UK
Re: OgreWater
Simply for the cross-platform ability if nothing else, OpenGL would be appreciated by folks.
Stuart "Sslaxx" Moore
-
- Ogre Magi
- Posts: 1172
- Joined: Mon Aug 04, 2008 7:51 pm
- Location: Manchester - England
- x 76
Re: OgreWater
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...
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
Experimenting with projected grid. Wow, did that open up a can of worms!
-
- Gnome
- Posts: 363
- Joined: Wed Feb 25, 2009 6:15 pm
- Location: UK
- x 8
Re: OgreWater
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
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
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.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
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
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.
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.
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.
-
- Gnome
- Posts: 363
- Joined: Wed Feb 25, 2009 6:15 pm
- Location: UK
- x 8
Re: OgreWater
Even if I don't want that geometry-moving one that you posted?lingfors wrote: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.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
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
That one is scrapped.Pyritie wrote:Even if I don't want that geometry-moving one that you posted?lingfors wrote: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.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
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.
-
- Orc
- Posts: 412
- Joined: Thu Jun 04, 2009 3:21 am
- Location: Kalamazoo,MI
- x 38
Re: OgreWater
@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?
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
Sorry, no, that was long before I put the code under source control.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?
-
- Gnoblar
- Posts: 14
- Joined: Thu Oct 20, 2011 2:56 pm
- Location: France
- x 7
Re: OgreWater
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 !
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.
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.
-
- Ogre Magi
- Posts: 1255
- Joined: Sat Dec 25, 2010 2:55 pm
- Location: Macedonia
- x 81
Re: OgreWater
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.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 !
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.
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
Do you need help? What have you tried?
- xavier
---------------------
HkOgre - a Havok Integration for OGRE | Simple SSAO | My Blog | My YouTube | My DeviantArt
-
- OGRE Community Helper
- Posts: 767
- Joined: Wed Oct 10, 2007 2:36 pm
- Location: Germany
- x 39
Re: OgreWater
Thanks for sharing your project.
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:
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
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:
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
Help to add information to the wiki. Also tiny edits will let it grow ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
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.Beauty wrote:Thanks for sharing your project.
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:
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
-
- OGRE Community Helper
- Posts: 767
- Joined: Wed Oct 10, 2007 2:36 pm
- Location: Germany
- x 39
Re: OgreWater
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)
I suppose underwater rendering has no high priority (because most games show water only from above).
But if you like, you could improve it.
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)
I suppose underwater rendering has no high priority (because most games show water only from above).
But if you like, you could improve it.
Help to add information to the wiki. Also tiny edits will let it grow ...
Add your country to your profile ... it's interesting to know from where of the world you are.
Add your country to your profile ... it's interesting to know from where of the world you are.
-
- Hobgoblin
- Posts: 525
- Joined: Mon Apr 02, 2007 12:18 am
- Location: Sweden
- x 79
Re: OgreWater
I assume you've found how to change reflection/refraction etc? Otherwise: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)
I suppose underwater rendering has no high priority (because most games show water only from above).
But if you like, you could improve it.
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.
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.
-
- Silver Sponsor
- Posts: 2703
- Joined: Mon Aug 29, 2005 3:24 pm
- Location: Kuala Lumpur, Malaysia
- x 51
Re: OgreWater
Hi,
I can spot two bugs, although both can be either minor or slightly major bugs depending on how you see it
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..
I can spot two bugs, although both can be either minor or slightly major bugs depending on how you see it
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
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