I’m looking for a full ocean shader, similar to what is available in Quest 3D and DX Studio. I can provide additional information and examples of what has been done in other engines. This is a paid project. Please contact me privately by email so we can discuss the particulars.
I’m not sure exactly what you’re after but is the water shader set used in the island demo suitable? There are two IIRC, the main water shader then another for the “foamy” shore area. Sorry if I’m off the mark but I thought I’d mention that in case it helps. Good luck!
I’m not talking about a water shader, but rather an Ocean Shader, with ocean waves and foamy crests. I’ve modified the Sine Wave Modifier script to animate a mesh, but that only gets me about half way to where I’d like to be.
I took a brief look at NVIDIA shader. It looks pretty much like our water shader (in fact, ours has better reflection), just with added sine wave perturbation in the vertex shader. Should be quite easy to add… but now it’s sleep time here!
Well, actually what I’m after is more like the Virtual Sailor screen at the top. Both Quest 3D and DX Studio offer similar ocean shaders (sine waves from 2 directions, variable foam on wave crests, boat wakes on the ocean surface, etc.) I just didn’t post screen shots of these since I’m using my Mac (and their demos only run on a PC).
@Aras - Sleep? When did you guys at Unity Tech start sleeping? Geez, sounds like things are slacking off over there! (I’m just teasing of course!)
You mean Tessendorf water? That’s what i’m also looking for - internet is full of manuals but i feel like i never visited school when i look at the math.
It can be a little much to do the tessendorf water, In fact many people spend a long time trying to get it looking right.
You’d need both a shader or script that moved the vertices and a shader that did bump mapping for the more detailed bits. You’ll also need a Fast Fourier Transform library and a good working knowledge of math. My guess is that any script you wrote from C# wouldn’t be fast enough to do a good job on it ( Written in C with very lightweight code is often just able to make it look good enough).
I think you are best sticking to a simpler approach or at least a shader only approach.
And here’s my best efforts so far using a modified sine wave generator script, Pro water, and some tweaked textures. Not bad overall, but not nearly as nice as can be done in many other engines…
I played around with the Tessendorfian ocean during the christmas holidays, and have the vertex displacement working:
The shader is only a stock Reflective/Bumped Specular with not-so-perfect textures applied. I used the Exocortex DSP for the complex 2D-FTT, and it seems to be fast enough with a 32x32 grid.
For those interested, a zipped webplayer is attached.
You’ll want to run the file a few times, as the waves are randomly generated and not always very interesting. Be warned though - it sometimes crashes the browser for reasons not clear to me. Also, there is some jitter in the ocean which is not present when played in the editor - entering full screen removes it a bit. Don’t get seasick .
great efforts so far – i would realy like to see more.
what about moving this thread to the sahder lab / showcase? because here it might get a bit lost i guess.
… because my whole purpose for starting this thread was to (hopefully) recruit someone to create a true ocean shader (comparable to what is available in other engines). So far, I’m sorry to say, there haven’t been any takers.
Incidentally, although the posts here might be good compared to past efforts in Unity, they pale in comparison to what is possible with Quest3D and DX Studio out of the box with no additional coding.
The interpreted script just isn’t fast enough to get that quality of wave made without the engine supporting it, unfortunately. Perhaps with C++ plugins and pro some of it could be done.
Scripting is JIT compiled rather than interpreted and generally gets at least 50% native C++ speed–up to 70% in some cases with built-in arrays, I gather, which is what you’d use for this–so I’m not so sure about that. TwinFox’s attempt was pretty decent.
I’m not sure if you know the area, but a 32 by 32 grid is not sufficient, and the algorithm’s bottleneck is the Fast Fourier Transform. Even on a 4 core 2.8, doing an acceptable grid of 256 or 512 (which is about 64 times and 256 times more expensive than Twinfox’s attempt, respectively) is a task with the Fast Fast Fourier Library, in assembly language. JIT code simply can’t hack it, in this case constant factors are important, and the underlying implementation of basic functions.
There are plenty of other options, like a number of baked wave animations or some other wave generation technique. There’s potential for doing the FFT on the graphics card, and also other techniques for oceans.
Best luck, of course! If someone got the tessendorf model working well, it would be very impressive.