Jump to content

Water Again - Help


Guest Red Ocktober
 Share

Recommended Posts

Guest Red Ocktober

i've gotten this mesh moving somewhat like what real waves would look like in ocean water (just a rudimentary sin waves done on the cpu, not the recommended way to approach this, but since i'm no good at shader coding right now, this will have to suffice for the interim)...

 

(see attached video)

 

what i really need help on is applying the water shader to the mesh (currently, cobblestones.mat is being used)... i've given it a shot, and have gotten as far as making it transparent with what looks like watery reflections... but i'm still a lil lost here...

 

thx in advance for all help...

 

--Mike

Link to comment
Share on other sites

I don't think CPU based waves is bad at all. Especially when using C++ they should be super fast. The benefit of using CPU based waves is that you can deform the water in realtime when a boat moves, and also create waves caused by the boat.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

The water tutorial will work for this. You just replace the mesh I created in that tutorial with this wavy one, using your vertex shader and my fragment shader.

 

I am looking for someone to hire to implement FFT-based waves in the engine. I don't want to spend the time researching it myself, and it makes more sense to find someone who already has that specialized knowledge. However, for your purposes, sine waves might be sufficient.

 

I am trying to get in contact with this guy, but all I have is his YouTube account:

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

I messaged him, but who reads YouTube email? I never do.

 

I wonder why waves even need to be calculated in real-time at all. If we can make a seamless looping animation, why not just use a precalculated series of heightmaps? As long as the data can be looped it would work. We can interpolate between two frames the way the water animation shader does. It would cost nothing to render.

 

Does anyone know any modeling programs that do fluid simulations? Why not just save a series of frames from it, and use that for the height and normal data?

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Those were probably done just by using a sine function, so that would be seamless. I think that's how I did it last time I rendered an ocean video. It can do pretty much anything, especially since it's totally programmable in python. 2.5 might have better support for water, these smoke demos from 2.5 are amazing:

 

 

 

I'll look at generating some heightmaps for you. Think just using a sequence of images would be best or playing back a theora video? What resolution and how many frames do you want?

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

Guest Red Ocktober

thanks for the info above... i know you're busy, and i kinda hate bugging you constantly over this water thing, but i'm really in need of this stuff like yesterday...

 

 

as far as someone who can implement what you need... have you talked to nikko lately... i remember he was here for a while, and he did some really decent looking stuff in Unity...

 

his web site --> http://www.nikko3d.com

 

 

 

 

 

thx again

--Mike

Link to comment
Share on other sites

He encouraged use of it in LE. His simulation looks impressive at first, but I'm not sure it's useful. Unidirectional waves are difficult to resolve with the scenery. They flow like a river, not like the ocean, so you'll see waves crashing into the shoreline on one side of an island, and flowing away from it on the other side. It seems odd after a while to see miles of ocean all traveling in one direction.

 

It seems rather simple to me to solve a water heightmap. For each pixel, you would just make liquid flow into the surrounding pixels to equalize the height. However, I am not sure how distinctive ocean waves can be generated. Maybe if some initial disturbances were input, it would just be kind of an emergent behavior? Now I am curious to see what the result would be. You'd need to account for water cohesion and velocity, maybe.

 

There a lot of info here, but it seems like these are a lot of research papers that always avoid or hide the problems with their method:

http://www.vterrain.org/Water/

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Isn't that how it really happens? All birds eye views of waves I can find seem to show them all traveling in the same direction, but can't find any really good videos that show what I'm looking for. Maybe just close to the shoreline you have some breaking backwards, but not sure about that. Maybe switch shaders depending on altitude of the ground, so waves all travel the same direction, but you get a foamier breaking wave effect close to shore?

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

This is what you want. The flow is not travelling in a distinct direction:

http://www.youtube.com/watch?v=VqVVIc3Lrj0

 

Maybe switch shaders depending on altitude of the ground, so waves all travel the same direction, but you get a foamier breaking wave effect close to shore?

You won't get a seamless transition, and the problem is still that the ocean will all be flowing around your land mass. I got a huge number of complaints about this when I tried using a scrolling texture lookup.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Guest Red Ocktober

josh... i tried the water tutorial as advised... the only problem with that is that the code only works on version 2.23 of the engine (at least that's the only one it worked on here)... when i tried compiling the code for 2.3 the dll was missing certain calls (GetNormalBuffer for example), and when i changed to the 2.3 engine code it failed to link (same reasons)...

 

 

is there an updated water tut for 2.3

 

in 2.3 the water is a plane, right... where as in the older versions, it is a mesh...

 

i'm just trying to get the water shader to affect my mesh... what are the steps involved in getting that done...

 

 

--Mike

Link to comment
Share on other sites

You might be able to replace the framework.renderer.waterpatch:TMesh mesh with your own. Just look at the framework source code.

 

If you follow the tutorial carefully, it tells you the different things that are needed to render reflection, refraction, etc. It's an advanced topic, but can be broken down into chunks. You might try just getting refraction to work, to start with, since that is easier. See the transparency and refraction lesson, it has some good information.

 

This is a frustrating problem, and what's even worse is that unless your solution is perfect, you'll find after using it for a while that it is really lacking. If you happen to come across someone who has experience with the FFT technique, you might send me their contact information.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

You could use Houdini Oceat Toolkit. It's free and open source, and uses also FFTW, which is the fastest FFT library benchmarked.

 

Houdini was used also in Terminator Salvation movie, and some other commercial stuff:

http://anusf.anu.edu.au/~drw900/houdini/ocean/docs/

 

Smirnoff Sea ad uses it also:

Smirnoff Sea

 

Video:

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

If you're saying to generate a series of textures then yeah it could be used. If you mean for realtime use w/ LeadWerks, then you may not be able to use it as it is GPL, so not really suitable for commercial use.

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

That would be LGPL, which allows you to link against the libraries w/o placing your own code under GPL. The libtheoraplayer library I used falls into the category, which is why I include the DLL instead of staticly linking against it. GPL requires you to place your own code under GPL if you include any GPL code. Which I'm not sure is even possible because I *think* you would also be required to include everything required for people to be able to modify and rebuild your code which would mean distributing LE, which is against the license for LE.

Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX

ZBrush - Blender

Link to comment
Share on other sites

Wierd, I thought this is quite clear:

Does the GPL require that source code of modified versions be posted to the public?

 

The GPL does not require you to release your modified version, or any part of it. You are free to make modifications and use them privately, without ever releasing them. This applies to organizations (including companies), too; an organization can make a modified version and use it internally without ever releasing it outside the organization.

 

But if you release the modified version to the public in some way, the GPL requires you to make the modified source code available to the program's users, under the GPL.

 

Thus, the GPL gives permission to release the modified program in certain ways, and not in other ways; but the decision of whether to release it is up to you.

Does the GPL allow me to sell copies of the program for money?

 

Yes, the GPL allows everyone to do this. The right to sell copies is part of the definition of free software. Except in one special situation, there is no limit on what price you can charge. (The one exception is the required written offer to provide source code that must accompany binary-only release.)

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...