Unity Community


Page 1 of 41 12311 ... LastLast
Results 1 to 20 of 812

  1. Location
    32.71 N, 117.15 W
    Posts
    5,419

    Wanted: Ocean shader

    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.

    Thanks!

  2. Unity Product Evangelist
    Location
    San Francisco CA USA
    Posts
    6,186
    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!
    Tom Higgins - Product Evangelist at Unity Technologies ApS
    unity3d.com | answers | blogs | feedback


  3. Location
    32.71 N, 117.15 W
    Posts
    5,419
    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.

    Here's some examples:

    Virtual Sailor (look at the two screens at center/bottom right):
    http://www.hangsim.com/vs/screen.php

    Quest3D (check out the Ship Sim 2008 video):
    http://quest3d.com/index.php?id=209

    DX Studio:
    http://www.dxstudio.com/gallery.aspx

    And Ogre 3D (check out the nVidia ocean shader screens:
    http://windmek.ca/ogre_renderings

    And here's the nVidia Ocean shader that most of these are based on:
    http://developer.download.nvidia.com...ary.html#Ocean

  4. Unity Graphics Developer

    Location
    Unity Technologies, basement
    Posts
    3,974
    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!


  5. Location
    32.71 N, 117.15 W
    Posts
    5,419
    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!)


  6. Location
    Berlin
    Posts
    1,047
    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.


  7. Location
    Halifax, Nova Scotia, Canada
    Posts
    154
    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.


  8. Location
    32.71 N, 117.15 W
    Posts
    5,419
    Something like "Hydrax" would be perfect!
    http://www.ogre3d.org/wiki/index.php/Hydrax

    Videos here:
    http://www.youtube.com/user/Xavyiy
    Attached Images  


  9. Location
    32.71 N, 117.15 W
    Posts
    5,419


  10. Location
    32.71 N, 117.15 W
    Posts
    5,419
    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...
    Attached Images  
    Attached Files


  11. Location
    Finland
    Posts
    66
    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 .
    Attached Files


  12. Location
    Luxembourg
    Posts
    658
    How did you guys script this vertex displacement for the waves?


  13. Location
    Luxembourg
    Posts
    658
    Oh, and I'm also working on creating reallistic water, but mainly playing around with shaders...
    Attached Images  


  14. Location
    Germany | Hamburg
    Posts
    1,916
    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.

    lars


  15. Location
    32.71 N, 117.15 W
    Posts
    5,419
    Quote Originally Posted by larsbertram
    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.


  16. Location
    Halifax, Nova Scotia, Canada
    Posts
    154
    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.

  17. Volunteer Moderator
    Posts
    23,691
    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.

    --Eric


  18. Location
    32.71 N, 117.15 W
    Posts
    5,419
    So what you're saying is that this can't be done in Unity, at least not without some Herculean effort?


  19. Location
    Halifax, Nova Scotia, Canada
    Posts
    154
    Quote Originally Posted by Eric5h5
    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.

    --Eric
    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.


  20. Location
    32.71 N, 117.15 W
    Posts
    5,419
    This isn't exactly what I was thinking about, but this is pretty interesting (and looks similar to Forrest's boat demo):

    http://www.cemyuksel.com/research/waveparticles/

Page 1 of 41 12311 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •