Search Unity

CREST - Open Source Unity Ocean Renderer

Discussion in 'General Discussion' started by JamesArndt, Aug 30, 2018.

  1. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    I took some footage in the Unity editor of that new CREST ocean renderer I came across on Github. It's pretty stellar considering these are the first iterations on the system and it's being bug fixed and improved. Did I mention it's open source and free as well? Links in the video description.

     
    Glitch12, tswalk, Ruberta and 21 others like this.
  2. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    668
    Wow. Does it work in HDRP ?
     
    erenaydin and JamesArndt like this.
  3. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,028
    That looks great. Could be a perfect fit fir a current project, too. Thanks for showing!
     
    JamesArndt likes this.
  4. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,825
    Ugh.... I hate seeing stuff like this... because my first thought is now I want to make a ocean type ship based game. Thanks for the distraction. ;)

    Looks nice, I like color shifts.
     
  5. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,446
    Thanks for posting. It looks nice.
     
    JamesArndt likes this.
  6. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,414
    Just being open source isn't enough though. It needs to be a permissive license to be valid with Unity. This asset was released under the MIT license which makes it valid to use in Unity, but there are assets out there with non-permissive licenses like GPL that you simply can't use.

    At a glance (I went and read the packages manifest) it appears to be using built-in.
     
    Last edited: Aug 30, 2018
    Ony and JamesArndt like this.
  7. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    I don't think it does as I see people putting in the requests on the Github for it. I'm sure it's coming, the creator is a very experienced developer. I found him watching talks at Siggraph on simulation and rendering.

    Very good observation. I think I get so excited testing it out I forget to check what license it's using. Very important if you plan on using this for anything commercially.

    Ha ha you and me both. I have a system already in place for a working prototype with deck crew, FPS controller and physics on the ocean. I even have a weapons system for cannons, deck guns, swivel guns, etc. This is my prototype from a month ago or so and it's using the Community Ocean found on Github as well.



    The most exciting thing is that the Crest ocean is actively in development and is not stagnant. Speaking with the developer he had mentioned "The 'flow' stuff that's coming online atm will really unlock some unique features with moving bodies of water I think". I have to contain some of my excitement to see how he's implementing these things. I can imagine it can only be good.
     
    Last edited: Aug 30, 2018
    ftejada, erenaydin, IsDon and 3 others like this.
  8. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,340
    Looks really good. I'm currently still using the deprecated Ceto ocean system, but this may be even better. Does it support endless oceans?
     
  9. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,414
    I followed the instructions on the repository for setting up a scene and added a script to the main camera that would move it in one direction. When the camera moved the ocean borders moved with it.
     
    Joe-Censored likes this.
  10. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,372
    Overall really like this. Code quality and good abstractions seem to be a thing actually. Using native containers, didn't see any jobs in use. Did immediately find that the majority of their cpu usage in Update stems from using NativeArray.CopyTo which could likely be fixed with a memcpy approach that's been posted, or copy manually but do it in a job.

    The main thing is I'd feel comfortable actually tweaking this thing, it's layed out very well.

    Number of layers it uses is a bit insane. It fails to mention the required Terrain layer, so it's 4 layers this asset eats up.

    Ability to control shape locally is kind of huge. Nobody else has that and it's one of those things you can't really just tack on. Waves themselves are very basic, not a fan of Gerstner only waves.
     
    angrypenguin likes this.
  11. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    668
    In Cryengine, infinite ocean comes as default asset. I hope this could be as default prefab in Unity 2018.3.
     
    JamesArndt likes this.
  12. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,372
    Ah I missed that they had other wave algorithms besides gerstner.
     
  13. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,372
    Found another layer it requires. So that's 5 layers now.
     
    JamesArndt likes this.
  14. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,417
    Looks superb.
    Surely Jobyfing would bring lot of benefits. Or even ECS?
     
  15. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,372
    It doesn't really spend much time on the cpu. If you fixed that one issue I saw I think cpu time in Update would be around .25 ms.

    Their wave generation approach just doesn't appear to require a lot of compute time. Most other water shaders use compute buffers with a more brute force FFT approach which gets really expensive. Crest is using like half the gpu resources that UWS does on my system.
     
  16. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,417
    Oh that is very interesting to hear.
    Surely it is superb asset. Shame I don't have project related directly to be able use it.
    But I see, many people will be adapting this in theirs projects.

    I would love to see some stormy weather sample, if somebody don't mind put on youtube, or even screenshot?
     
    JamesArndt likes this.
  17. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,372
    I had a hard time getting realistic looks out of it just tweaking the obvious stuff. FFT I think does a better job at that. It needs a bit more chaos in the right places. UWS I can make that look better. But Crest has a lot of gameplay oriented features. Like fine grained control over wave spectrums and height sensitive to objects. A lot of control over the water itself they have a nice whirlpool demo for example.

    Their buyancy script is really nice. They use displacement plus wave normals. Most of the other solutions out there sample and then apply force at a bunch of positions based on height. Normals means they can just apply it once and the end result is really much better.
     
    IsDon, angrypenguin and JamesArndt like this.
  18. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,028
    Yeah, I'm really liking this. There are a few extra things I'd like, but what's there seems great. Honestly, I'd more than happily pay for this.

    I haven't checked this against all of my project's requirements, but so far it seems a better fit than any of the other solutions I've tried.

    I haven't got the same realistic look out of this that I've seen elsewhere, but I don't particularly care about that. I've also only been experimenting with it for a short while.

    I think shorelines could definitely use some work. There's a harsh water edge and I'm not getting particularly useful behaviour out of the shore foam. The latter is presumably because my shores are more like cliffs than beaches. The former can quite possibly be changed with some shader tweaking.

    Oh, I didn't run into a 5th last night. What's that for?
     
    Ony likes this.
  19. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,372
    There are the 3 lod layers. One for the water itself, and one for terrain/ground that it interacts with.
     
    angrypenguin likes this.
  20. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,562
    I think it would be really cool to see Unity put some backing behind open source projects like this. Give their devs a couple hours a week to contribute and submit PRs.
     
    one_one, angrypenguin, Ryiah and 3 others like this.
  21. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,372
    Oh been a while since the last time i pull their repo. Gotta pull em up tonight.
    Thanks for the remainder :D
     
    JamesArndt likes this.
  22. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    Well 2 /1 does = 2 :)
     
  23. RealmLord

    RealmLord

    Joined:
    Aug 25, 2018
    Posts:
    5
    @JamesArndt
    It seems you have experience with both Crest and Ocean Community.

    If you don't mind could you give a rundown of both of them.
    1. Feature differences
    2. Performance differences.
     
    JamesArndt likes this.
  24. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    I've only done small experiments with both, so I can't speak for the entirety of both packages. I can, however, give some insights into some major things that stick out to me in both. For starters, the buoyancy in the Crest system seems quite a bit more solid. Floating and moving over the ocean feels natural and it just works, no weird physics glitches or visual anomalies. In the Community Ocean, the buoyancy is very finicky. By default when you adjust new custom collision, without fail the physics get very strange and my boat flops over, falls out of the world or shoots to the sky. So I think Crest has an advantage in the buoyancy code.

    Crest has all kinds of awesome looking features for the foam and it just visually looks far more impressive. This also goes for the translucency of the wave faces, depth scattering, light scattering and the appearance of the sun on the water. Crest also does this underwater "foam" bubbling in the wakes of wave breaks, behind your vessel or AI vessels. It also does a deformation of the water in the wake of a moving vessel. I didn't see any of this working in the Community Ocean, at least nothing quite near the visuals of Crest. I will add though I believe the Crest system is missing some of the micro normal map details to really add smaller ripple or wave details to the water. You have the large forms of the waves and large ripples rolling over the ocean, but I'd like to see another overlayed normal map for smaller detail. I do believe the Community Ocean does have these details in their settings.

    One thing I've noticed is that Crest does not seem to do any reflections of the terrain or the ships. If they are there I am not yet sure where to turn them on or how to adjust them. The Community Ocean does have reflections, but I've found they can appear glitchy, scintillating or aliasing really poorly on the horizon or distance. Crest has very nice caustics that appear on the hull of your ship, which I've turned way down in my video so you don't see them as much. Crest also does a very nice depth fading of the water around your boat, you can adjust the density of the water clarity around the hull of your ship. This is really outstanding and in my video, you can see I've set it to be a bit dark. When you make it nice and clear the caustic reflections show through very nicely.

    I will be moving over to using Crest in my own prototype. I haven't put it through insane stress testing, but on my system, it's run at a consistent 60 fps the entire time. I've seen no physics glitches or framerate issues yet. My own two decision makers for this move are the extremely stable buoyancy and the higher visual fidelity. It's also important to note that the developer for Crest is currently bug fixing, improving and adding features right now. In contrast, the Community Ocean has sat a bit stagnant for a while now (I'm active in that thread as well). I think he does some bug fixing here and there, but no major improvements or features in a while. I'm not complaining either way because it's amazing these free systems are supported or were created at all.
     
    Last edited: Sep 3, 2018
  25. RealmLord

    RealmLord

    Joined:
    Aug 25, 2018
    Posts:
    5
    Thanks a lot for the detailed answer. Appreciate it a lot. As a hobby game dev. insight like yours are invaluable as we don't really have time to test everything out.
    I will fully move to crest in due time as per your opinion. I had posted regarding CREST in the other community ocean forum hoping to get such an opinion.
    Ideally we would have the community come over and merge. But we can always hope.
    Thanks.
     
    Last edited: Sep 3, 2018
    JamesArndt likes this.
  26. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,028
    No, they're not there. It's a pending issue on the GitHub page.

    Same deal with shadows.
     
    Lesnikus5 and JamesArndt like this.
  27. berkantoptas

    berkantoptas

    Joined:
    Apr 19, 2018
    Posts:
    2
    Hi, I just watched your uploaded video.It seems pretty nice.I want to take nice foam vision behind my ship like yours.
    Can you share your script settings? Or if you added new codes to Ocean shader, where should I work with to catch that nice foam?
    When I try to play with bigger ships like titanic how can I get bigger foam?
    Also I have some issues with playing with bigger ships.How can I apply buoyancy for bigger ships?
    When I try to apply buoyancy for smaller boats I just change buoyancy coeff, boyancy torque, boat width from BoatAlignNormal script and WaterObjectInteractionSphere's transform scale.

    Sorry I'm almost new in Unity.I know that I want too much answers. :)
     
    JamesArndt likes this.
  28. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    Nothing to it really. I just adjusted the SimSettingsFoam object to thicken up the foam and make it more apparent. All of the settings are on that object and pretty self-explanatory so you should have it looking good within a minute or so.
     
    berkantoptas likes this.
  29. eatsleepindie

    eatsleepindie

    Joined:
    Aug 3, 2012
    Posts:
    348
    And there goes my Friday night...

    Great share, thanks!
     
    JamesArndt likes this.
  30. Dekata

    Dekata

    Joined:
    May 20, 2016
    Posts:
    46
    hi James, adjust SimSettingFoam not work with me, can you show more detail ?
     
    JamesArndt likes this.
  31. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    Well, you'd make the adjustments and then drag it into the appropriate slot. If you're not seeing any difference with the adjustment, it's most likely that the Sim object you're adjusting isn't plugged into the ocean object.
     
  32. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
  33. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    4,830
    wow, looks nice. supports Singel pass instanced rendering?
     
  34. Justice0Juic3

    Justice0Juic3

    Joined:
    Apr 29, 2013
    Posts:
    175
    Sure this is going to look impressive. Inspired me to create a ancient-style deathmatch game located in a port with this beautiful sea surrounding it. :p
     
  35. samuelbrunner

    samuelbrunner

    Joined:
    Jan 29, 2017
    Posts:
    51
    Anyone able to set up the object cache ?
     
  36. sebasfreelance

    sebasfreelance

    Joined:
    Aug 27, 2015
    Posts:
    204
    Hi, sorry my inglish...

    Your water is incredible! I do not know if it's optimized for mobile, but on my iPhone 6 it's going very well.

    Can I use your ocean in a commercial project? I do not know if I'll finish it some day;)

    and I'm trying to activate and deactivate the shadows of the material by unsuccessful script,

    [Toggle] _Shadows ("Shadowing", Float) = 0

    when it is under the water I want to deactivate it and when it is not under the water I want to activate it, could you tell me how can I do this?

    thank you!
    and excellent work your ocean!
     
  37. crashTX

    crashTX

    Joined:
    Dec 2, 2012
    Posts:
    10
    Does it have some more detailed documentation? I could not find any and I would like to try with with something larger than a boat.... more battleship sized.
     
  38. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    39
    Hi
    I'm super impressed and am using CREST now in my project.
    However, for some reason, there is this HUGE wave emerging every time, like that water planet in Insterstellar. I'm using the Shape Gernster Batched with the WavesModerateSmooth preset with weight only 0.24. And have some (speed)boats in the scene. What could cause the tsunami like monster waves?
     
  39. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    379
    This isn't an official support thread, so you might have better luck filing an issue on the GitHub project.
     
  40. blogsabout

    blogsabout

    Joined:
    Aug 20, 2014
    Posts:
    43
    What an awesome asset! Just watching the waves and light hitting the water is mesmerizing.
    I tried to add some lights on the boats to make a night scene - is there a way to get the ship and light reflected in the water? The refraction under water is awesome - but can't get the light to reflect.

    Look forward following this project.

    EDIT:
    Saw this has been raised

     
    Last edited: Feb 20, 2019
  41. Alduran

    Alduran

    Joined:
    Oct 29, 2018
    Posts:
    1
    Hi,
    One of you can tell me how to get a point on the water surface with a raycast? In my test, the raycast unfortunately goes through the surface, so I get a false point from the object under the water.
     
  42. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    379
    don't make your raycast ignore the water's layer, would be my advice.
     
  43. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    199
    Hello,

    Is there support for realtime reflection probes?
     
    Bartolomeus755 and mons00n like this.
  44. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    Antypodish and Socrates like this.
  45. generaltofu203

    generaltofu203

    Joined:
    May 9, 2018
    Posts:
    40
    Hi everyone, am I able to use CREST in a commercial project?
     
    tomericardo likes this.
  46. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,417
    If there would be ship reflection on surface, that would be even cooler.
    Shame light go through a ship and glare on the surface, where shadow suppose to be, just after adding sun shaft.
     
    JamesArndt likes this.
  47. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,671
    Well the good news they have been iterating on it and making improvements and new features.
     
    Antypodish likes this.
  48. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    379
    If you read the License it's MIT. so yes.
     
  49. FirstTimeCreator

    FirstTimeCreator

    Joined:
    Sep 28, 2016
    Posts:
    717
    Does this ocean system support point and spot lights? It appears that it doesn't but I was really hoping that the shaders support this so I can use it in a night time setting where lights hit the ocean surface.

    Suimono does this but the buoyancy system in suimono is very innacurate so I'm looking for another solution.

    This system would be perfect for my requirements if the shaders support surface lighting from point/spot lights.
     
  50. blogsabout

    blogsabout

    Joined:
    Aug 20, 2014
    Posts:
    43
    If you enable the planar reflection, it will reflect the light in the ocean.
    I did a night time scene with some ships with lanterns at some point.
    If the reflection is too "blurry", you can increase the size.
    It worked on my old macbook mid 2014 - for some reason I'm having issues getting the same result on my new mid 2018.