Search Unity

Ceto (Scrawks Ocean)

Discussion in 'Assets and Asset Store' started by scrawk, May 4, 2015.

  1. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Ah I see! so it looks better for general game scenes, but can be a bit of a performance hog and suffers when it comes to simulation scenarios and network. Thanks for the write-up!
     
  2. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    AMD Phenom 9850 Quad-Core 2.5Ghz
    HIS Radeon 6670HD 1gb
    4.0gb DDR2 Ram

    Looks amazing. Will state the issues I had.

    DX9: 30 fps

    No reflections. Very jumpy. Even though the frame rate was staying at 30 the scene was jumping. Guess an issue with the buoyancy. Except for the lack of reflections the water looked amazing.

    DX11: 27 fps

    Had reflections. Waves did not work though. Only could be usable with wind speed at 0. Just no waves though. If I added any wind speed it would look like @elias_t image from above. Maybe an AMD issue?
     
    Last edited: Jul 20, 2015
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @hippocoder and @CaptainMurphy Oh, no no no . . . . i'm not talking about the shore effect on the video above, for the video i'm talking about the breeze effect. . . around 0:23 not sure if it's noticeable or not.
     
  4. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I understand what rea is saying, they're talking about local wind on the surface creating a kind of 'shimmering' - watch a still lake or canal and you won't see it NOT happening, someone mentioned it earlier in this thread. I don't personally see it as too hard to do (says me hah).

    It's a little unfair deconstructing technically competing ocean solutions in a copetitors thread, at least take it to pm, there'll always be a place for suimono in my uses simply because it's so configurable - the creator sells it short in his demos, I've had it look absolutely great at times and like a good toolbox it has its place for me. This ocean itself has already taken its place since I first started using the freely available projects on scrawks blog, I know what to expect and it's really quite exciting as it fills a role where there was a hole for unity.

    I think all the feature requests sound reasonable. I know suimonos use of textures for shores but never could figure how I'd make them local in a potentially huge seascape. Material lods make loads of sense, geometrically it's using, I think, probably the most suitable for the role

    It seems like amd cards don't like it atm though, maybe people should mention their exact gpu when reporting problems
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I'm not sure it's illegal or bad to discuss other solutions where the intent is to improve all solutions. We all just want great water :)
     
    Teila likes this.
  6. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Those are the same critiques I have given Chingwa on both on his forum and in the Suimono thread. He is well aware of the limitations of his system in regards to ocean rendering and has been very up front about it's suitability being tailored for smaller bodies of water like lakes and rivers. Nothing I have said is new or unknown. I have been a beta tester for his system for about a year now across 3 different projects and it has gotten amazing, but it still has a few areas lacking in terms of performance that are, again, well known. You are welcome to tag him in this thread and he will more than likely make an appearance and confirm what I am saying. It just turns out that my latest project is just not a good fit for his water system, no matter how good it looks.

    I see what you are talking about with the 'cats paws' on the water surface. They are a bit too subtle in the rather low res vid (720) so they were missed in my first viewing. That is something that can be done with a texture map and applying normals on the surface using the texture map as a mask. Shouldn't be overly complicated.
     
  7. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    yeah it's actually very simple and easy effect to add, but those kind of subtle detail is always make thing interesting :)
     
  8. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Dont worry myself and Chingwa are familiar! I dont think the exchange is harmful in regards to those familiar with the creators of the asset or the asset themselves, more people who arent familiar. Like i said, there's a place for both, i just depends on what you need, i'd personally put it down to the 3d wave creation method - this is procedural, suimono is texture based
     
  9. Maxi77

    Maxi77

    Joined:
    Mar 3, 2015
    Posts:
    15
    Hi,

    I have been following this thread for some time and i must say it looks very promising.

    I am wondering if Ceto could be used for a project, that has a more toon´ish kind of a look. Dont get me wrong i think the realism looks great, but for what I am currently working on, I dont need alot of surface detail. What i do need is a ocean renderer that renderes infinite ocean. That has reflections and refractions. That works great with fog and day/night cycle.

    I downloaded the demo and played around with the settings, and ended up with the look below (setting the windspeed to zero and turning of reflection). This is very close to what im looking for.

    1) Are you planning to make Ceto tweekable in a way, that a more "simple" look like below are possible?
    2) Would it be possible to get the look below and still have waves?
    3) What about performance.. is it possible to get better performance without the surface detail?
    upload_2015-7-20_22-18-48.png

    I turned reflections off because I think it was to "overpowering".
     
  10. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Umm, i think Unity provides the water you just asked for for free as part of its standard assets

    Edit: I'll just add 'i think' here. It's just you're not really benefitting from the ocean system in this case. You could have a go at writing such a shader yourself
     
  11. spraycanmansam

    spraycanmansam

    Joined:
    Nov 22, 2012
    Posts:
    254
    Hey scrawk,

    Great work!
    Both builds work fine for me on a GTX970. DX9 has no reflections like you mentioned.

    Cranking the wave speed to maximum is truly a 'mother-of-god' moment. Being on the surface of a 70ft swell is terrifying - fantastic! My only concern would be detail closer to the surface. No doubt an increased fourier size would help, or even an additional animated normal map like AC:BF to keep the fourier size down. I'm sure you've got it covered tho :)
     
    bbennett2 likes this.
  12. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Currently there is no code to do it but I can add both those things. The projected grid is divided into tiles the only catch is that the tiles are all the same size and in screen space. I can project the tiles corners into world space and then check if they are covered by anything and then not render them if they are. This is the method used in AC Black Flag.

    I have also found the thing that is causing the ships "shadow" artifact. Its actual the reflection thats causing it but not sure why atm. I have increase the blur on the reflections and that hides it. The reflections are just done using a planar reflection and this doesnt work that great when the waves get larger.

    @rea: yes, you can uses a textures for the foam. Im not using one atm so the foam is a very solid white. The texture will show where the wave foam is currently. There will also hopefully be local breeze effects done by altering the wave normals in certain locations. Will also be a Shader LOD system for the grid.

    @elias_t and @XPAction : I think I know what is causing the issue with your AMD cards. It maybe the way the grid border is done. I realized this morning that my math was not right and have changed how its done. It was resulting in a neg value being used in a lerp function and looks like the AMD cards handle it differently that NVIDIA ones. Maybe.

    This should also fix the grid pulling away from the screen like @CaptainMurphy saw. I have also reduced the wave max size a little to reduce the likely hood of this happening. The issue with the grid pulling away maybe a on going problem that may take sometime to tweak the math until its gone but I think the current method is now working.

    I have updated the demos with these changes and have also added some extra sliders to change the reflection roughness (how blurring they are), the reflection intensity and the slope smoothing (helps reduce aliasing in distance but removes some detail).

    Also fixed the wireframe toggle which was not working
     
    John-G and CaptainMurphy like this.
  13. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Just need work to finish, so I can get home and try this out.
     
  14. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Runs really good. Wasn't able to recreate the pulling of the grid into frustum this time. The shadow blurring helps greatly in toning down the clarity without losing the actual light contributions to the water surface.

    I was able to find another odd item though, as the waves get taller and get more perpendicular to object behind them, they become too clear.



    At a lower angle they are fine.


    As it moves perpendicular they become clear.


    Got another extreme version.
     
    Last edited: Jul 21, 2015
  15. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Same with Radeon HD7850. DX9 OK. DX11 :confused:
     
  16. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    @CaptainMurphy: Ah yes, sorry forgot to mention that. Still working to fix that.

    @ZJP: Ok, thanks.
     
  17. Maxi77

    Maxi77

    Joined:
    Mar 3, 2015
    Posts:
    15
    Unity water works well in some cases, but I havent had great results with it. I could have a go at writing af shader for the surface, but then there are the waves, infinite ocean and blending with horizon. I just think this system has a ton to offer, besides the realistic surface detail. My thought was, that maby this system could be used for different styles.

    In any case Ceto looks awesome!
     
  18. nipoco

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    I wondering if you ever plan to provide the Ocean shader, you've used in Stranded Deep. Because that is the best water I've ever seen in a Unity game.
     
  19. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Being playing around a bit in the Beta and even as this ocean stands I'm completely delighted with the results I'm getting.
    Once shoreline support and underwater effects etc are added it will be a Blow your Mind Ocean package.

    Here's a few screenshots in a quick scene I threw together to test Ceto.

    Using TrueSky for the Environment, and delighted to say haven't noticed any issue's as of yet between Ceto and Truesky.












    A stunning ocean package and getting good performance too. :D


    They posted in there dev blog that they will be using Ceto in the future ;)
    http://beamteamgames.com/category/stranded-deep-2/
     
    Peter77, elias_t and spraycanmansam like this.
  20. Tiny-Man

    Tiny-Man

    Joined:
    Mar 22, 2014
    Posts:
    482
    How easy would it be to intergrate this into Jove 2? Is it possible?
     
  21. spraycanmansam

    spraycanmansam

    Joined:
    Nov 22, 2012
    Posts:
    254
    First off have to say I'm loving Ceto so far. I've spent most of my time getting used to the range of it - from small river ripples to huge mountains.

    I think I may have a color space issue though. We're running in deferred, hdr and linear color space. The problem is easily replicated in the demo scene. Rendering with either deferred or forward in linear color space shows different results ---



    There's also a problem in deferred with lots of little white spots dancing over the surface ---


    One other thing I should mention is that the refraction lighting starts to break down when using high intensity lights. We're using a directional light with an intensity of 3 and it absolutely blows out the refraction color. I can adjust the sliders to get approximate results using very tiny numbers, but then it still doesn't appear entirely correct from the color space difference ---




    Issues aside, this is going to be one hell of an asset :)
     
    bbennett2, John-G and Eric2241 like this.
  22. spraycanmansam

    spraycanmansam

    Joined:
    Nov 22, 2012
    Posts:
    254
    Not much point anymore, this blows it out of the water! Pun intended :p
     
    hippocoder and bbennett2 like this.
  23. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Foam Trails are nicely implemented and follow the water surface :D

     
  24. nipoco

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    I'm a bit surprised by this reply tbh.
    Don't get me wrong. This ocean here looks great. But it seems more suitable for open and vast ocean simulations.
    But for shallow water and underwater scenes, your shaders look absolutely gorgeous with the caustics, correct fresnel, chromatic aberration etc. Pretty much like the awesome water studies from Martins Upitis.

    But I guess you have a reason why you said that. I've been looking only at the screenshots here. So I might don't see the full potential of this one.
     
    Last edited: Jul 21, 2015
  25. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    All of that has to be added yet, this is just the beginning of the system.
     
    nipoco and spraycanmansam like this.
  26. nipoco

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    Ok, that makes sense.
     
  27. spraycanmansam

    spraycanmansam

    Joined:
    Nov 22, 2012
    Posts:
    254
    Unfortunately a lot of the effects for Stranded Deep are tied in very specifically. It would take a fair amount of work to make them function nicely in a general setting and then need to be maintained and supported as an asset -something we just don't have the time for. But thanks for the kind words :)

    Like John G mentioned, scrawk's got these features planned and from what I've seen already, it should be great!
     
    nipoco likes this.
  28. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,367
    Unfortunately the issue remains.
     
  29. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    @Maxi77: Im sure I can make the shader more customizable but the focus at the moment is on getting the core features working correctly.

    @Tiny Man: Never used Jove so dont know sorry. Have heard good things about it some I might give it a go.

    @John G. Looks great. Glads it working with True Sky.

    @elias_t: Ok. I will buy some AMD cards and give them a go to see if I can replicate it. I need to have some around as they are always the problem cards.

    @spraycanmansam: There is a issue with deferred rendering at the moment. I think the issue is only showing up in dx11? If you look on the projected grid component you can disable receive shadows. That should make the white spots go away?

    Looks like there is also some HDR linear color space issues. I did fix a few things when I ran the Blacksmith project but maybe some more work needed. I will be having a close look at HDR at some point so hopefully the issues will be resolved then.

    For those of you who had some performance issues I think the problem is the shader. It has not been optimized, has no LOD and a complicated BRDF model. This will be fixed at some point.
     
  30. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Today is ocean day. Time to get stuck into that frag shader
     
  31. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Results so far are really good. I still haven't wired up the batching for buoyancy objects but we have already picked up over 150fps in our test battle scene with 6 ships. It seems to work good with TOD in Forward, the Deferred has those fun lighting bugs so we will just wait for that to get fixed before testing on it.




    My only real item for now is the foam tends to glow. Just needs to have the shader swapped out I think. Does it use the same shader as the foam? It may be part of my setup, who knows right now. I am too busy writing the cannonball height batching to care. Only see this in Gamma color space.
     
    Last edited: Jul 21, 2015
    John-G likes this.
  32. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    If it's using brunettons whitecap shader the contribution of the whitecaps to the bdrf is variable, its a simple tweak to get what you want. If i understand correctly, scrawks intention is to use the whitecaps (theyre the result of the jacobian ffts) as a mask for a foam texture if you dont like them as they are - ive gotten great results with them before, mind. The good thing with them being a mask though is that, in the whitecap project i had, theyre implemented over several frequencies and scales - that technically gives you a huge amount of control over your foam. I'll be investigating this today - just getting a suitable terrain ready!

    The good part of most the problems so far is that they all seem to relate to the most straightforward part of the system - the actual surface rendering, and much moreso than the wave generation can be written, rewritten, tweaked endlessly, so im not too fussed about all that - the meat of this as a system though seems very solid. That said ive yet to start on the beta, want my terrain ready for it
     
  33. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Without any optimization of the batching of height calls I did a quick test to see what was going to bottleneck by dropping 8 ships in a scene to duke it out. Each ship has 10 buoyancy objects that are used to determine their floating, 45 guns that reload every 5 seconds, and each one creates a cannonball from a pool each shot. The cannonball checks the Y height every frame by calling a single Ocean.Instance.QueryWaves (I know, like I said, not optimized) and when it goes under the Y height it calls a particle effect for splash and does another QueryWaves for position, then the splash updates per frame to follow the water height for its rings. Oh, and each ship as 4 trail components as well. With the ships fighting I counted 640 cannonballs at one point, 340 water particles, and 120 buoyancy calls EACH FRAME. So, all said and done it was still clipping at around 109fps.

     
    John-G likes this.
  34. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    That is great! What fourier size and so on? I'm just about to start now, i like to have another heavy resource in the scene just to check its 'gameability' so i did an rtp terrain, but its looking promising already, lets get stuck in
     
  35. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Ahh yeah, to respond to the question above, theres no reason this cant be used in jove, just need to adapt the frag shader to it

    I'll try testing this with various other shaders interacting with it, i think making sure it plays well with the standard shader is the first port of call, then UBER, then my frankenUBER and so on. I noticed above there seemed to be some sorting issues
     
  36. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Ahoy, first problem found. It happens periodically but getting garbage collector spikes every so often, here's a grab of the profiler

     
  37. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I left the prefab completely stock. We are running Alloy shaders and Substances in this scene. Each ship is around 240k tris with no LOD. So far we are not even hardly seeing the water in the profiler. Everything sems to be optimization items that are completely unrelated to Ceto.
     
  38. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    That was from standard windows build, forward, linear, fresh import of package. As it's a gc thing I'm guessing there's memory allocations being piled up there
     
  39. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Okay just VR battletested - switching to windows made the GC alloc go away, weird

    Performance? Amazing. Experience? One of the best things ive done so far in VR. There is nothing quite like that available to my knowledge. Inspired
     
  40. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    @lazygunn: That's great its working in VR. Have not looked at GC yet so maybe some optimizations to do.

    @CaptainMurphy: Will add the pink foam issue to the list. I can put up a example script of how to use the Async batching if you like. It pretty straight forward, you just need to make sure you don't send another batch before the previous results arrive.
     
  41. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    @scrawk I am working out a batch system right now to handle all of the particles, buoyancy, and projectiles in their own pools. In all it will be 4 collections of points to work with. Each system has different times that it executes, otherwise I would do one large collection and do them all at once. I am very happy with the results so far, even without trying to optimize it at all.
     
  42. spraycanmansam

    spraycanmansam

    Joined:
    Nov 22, 2012
    Posts:
    254
    Yes, only in DX11. However, toggling receive shadows has no effect.
     
  43. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    A vidya showing Ceto and Truesky having a love-in. Frame rate isnt perfect and i left the mouse in frame (and a nullexception) so sorry bout that, i was viewing through an oculus and recording the mirror, so i didnt know what was going on

     
    John-G and CaptainMurphy like this.
  44. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Maybe this is something I am overlooking, but how would we go about changing the timescale? I need to pause the world for menu and slow it for a 'bullet time' but the ocean keeps trucking along at the same speed.
     
  45. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Feature request! I think scrawk would be amenable. It would definitely be nice, i have planned tinkering to do with timescales and truesky's very good for it so Ceto would be great for it too. Maybe a stretch but having a Truesky style sequencer would be great too, so you can make ocean behavior regional or set to certain conditions at precise points
     
    John-G likes this.
  46. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746

    Yeah, it looks that good....
     
    John-G likes this.
  47. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    @CaptainMurphy: Oh wow that does look good. The default time it uses is just Unity's Time.realtimeSinceStartup.
    If you go to the script Ceto/Scripts/Ocean/OceanTime.cs you will see where it comes from. You can provide your own class if you like by implementing the IOceanTime interface and adding it to the ocean. If you prefer I can write one for you if you tell me how you want the time to work. Maybe just a pause and time scale setting? A time scale of 0 would pause the ocean and a negative time scale would put the ocean into reverse.

    @lazygunn : There will be ways to have location effects and set certain conditions added at some point. Have not seen the true sky sequencer so maybe worth having a look. The video looks great as well. The sky reflections show up nicely.
     
  48. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I was just looking to have it match the speed of time passing for physics. That way the buoyancy doesn't go crazy when it starts back to regular speed, especially for larger waves. It isn't a massive need right now, but what I am building is a time-freeze component with a step function so our artist can capture screenshots that are actually in-game but have more control over the scene by sending commands to ships and get the camera in a perfect position. I will look into the time system as it is now, but as a feature it would be helpful to make it easily adjustable.
     
  49. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    This one's better



    Glitches, but its nice. TrueSky draws behind the ocean, its quite vexing because if i could fly over the clouds over the ocean i'd be in a very happy place. Again it was recorded off the mirror on the desktop of the oculus session, the movements look quite natural because it was my head. You wouldn't believe how good this is in VR
     
    Baldinoboy, elias_t, Karearea and 2 others like this.
  50. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Who should I talk to about the truesky behind ocean thing? I wonder if it would be an issue with other volumetric effects? It's probably a bit nonimportant right now but i would love to see that rectified. If its down to truesky i suppose ill email simul tomorrow