Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Ceto (Scrawks Ocean)

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

  1. jason-fisher

    jason-fisher

    Joined:
    Mar 19, 2014
    Posts:
    133
    What about water on a spherical planet?
     
  2. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I think this was answered earlier as being not intended initially, may be wrong - scrawks port of Proland can be found on his site which has pretty neat spherical water implemented
     
  3. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    @KPlaton1: it's just a small group of people. Most have games already in development.

    @rea: yes, there probably will be.

    @jason.fisher: sorry, nothing for planets.
     
  4. longroadhwy

    longroadhwy

    Joined:
    May 4, 2014
    Posts:
    1,485
    This is great work! Looking forward to the official release.
     
  5. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    @scrawk - These guys are waiting.... :D
     
  6. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    228
    Don't want to clog the thread with praise, however, Ceto is looking awesome!
     
  7. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Thanks @longroadhwy and @sadicus

    @CaptainMurphy : Nice ships. Look forward to seeing them on these waves...

    Ocean31.jpg

    Ocean32.jpg


    As you can see from these images I have been pushing the wave size to see what the limits are. Not sure of the exact size but they are around 50 meters in height here. This will most likely be the biggest.

    I should point out that very large waves are quite hard to do and the settings for the mesh and the height/slope/foam maps really need to be at the max. A lower far plane will also help a lot (its 4000 in these images). This means that scenes like this will mostly likely only be possible on decent hardware. 2-3 years old dx11 PCs and definitely not mobile.

    Having said that these are running at 60fps on my computer no prob so it is possible.

    It also turned out that the buoyancy was quite hard to get right once the waves size get really big. Had to add in some fudge factors to make the boat stick to the surface nicely. But again, it does work.


    Just need to add so splashes and spray...
     
    Last edited: Jul 17, 2015
  8. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
    Wow up to 50 meters, that's some wave scale the system is capable of.
    Belive the highest wave recorded in open waters was a rouge wave of 18.5 meters.
    So great to know won't have to push the system that far and it will handle it no problem.
    Hmm maybe a nice tsunami scene may be in order :rolleyes:
    Really likening the swell from the foam on those big waves, as well as the lighting.
     
  9. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,433
    Awesome can't wait for the demo :)
     
  10. EBR

    EBR

    Joined:
    Jan 27, 2013
    Posts:
    117
    D: I am amazed by the quality of those last images. I have been following this for a while now but that has exceeded my expectations. So exited for a a demo :) You mentioned this was going on the asset store? Do you have a target and what is the estimated price range (or will it be free :p) ? Good work, keep going it is looking mighty fine
     
  11. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Yes, it will be going on the assest store. Target will be any device that supports at least SM3. Not sure on price yet. Was thinking around $60 but happy for people to make a suggestion on what they think it's worth.
     
    ZJP, John-G and EBR like this.
  12. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    A 'disconnected' rogue wave would be a great addition to this system. Maybe running a premade texture over the surface to modify the heights would be doable? Something similar to what AC did with their water. As much as I disliked that you hit a rogue wave every 2 minutes in that game, I did like the wave itself as it added a small bit of fear to it the first time you see one.

    @scrawk I want to see 64 of them on the waves, see if I can get past my limit of about 20 ships right now, lol. Our other killer lately has been registering the cannonball hits on the surface. Since it is doing texcoord for Y height pulls at the location there is just no way we can have each cannonball get the wave height under it to see if it is going to hit water in the next frame. What we end up with is forcing water to splash when it gets below a certain axis limit and that just looks wrong since the ball might actually 'hit' the water somewhere else before going below that Y height. We can't make waves any taller in a match because then the plane of the balls ends up being higher or lower than the water render. I am interested to see if this system can handle the multitudes of calls needed for projectiles. A single ship for us will have between 20-55 guns per side and will be firing them in scattered timings so there will be plenty of simultaneous height checks running. Then we also have splash generation points on the hull for when the hull plunges into the water, and for creating bow splashes during movement. All of those will also need Y height checks in order to align right.
     
    John-G likes this.
  13. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Will do some tests tomorrow to see how many y height checks can be done. Haven't tested it yet so it's a bit of a unknown.

    The rogue wave idea is possible and I have already set up the code to do so. It will use the wave overlay system which is what the foam trials use. More on that some time in the next few days.
     
    John-G, CaptainMurphy and hopeful like this.
  14. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,342
    Will it have a lower LOD level when viewed at very high altitude (10 km)?
     
  15. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    If it is using a projected grid then it shouldn't need a mesh LOD, just some form of shader LOD. I would swap out the water entirely before I got to 10km though, as at that distance there is no discernable detail in 3D, usually. You could move to a plane with some simple animated textures that cost a whole lot less in engine.
     
  16. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    380
    Looks absolutely fantastic.

    I was just wondering if it would be possible to make localized wind differences on the water surface. Just to break things up in a natural way.

    These images can explain it far better than I can.

     
    Last edited: Jul 18, 2015
  17. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
    @CaptainMurphy that would be unreal 64 ships each firing up to 55 guns. Can picture all the smoke from those volleys :D and masses of water splashes from missed shots, epic.
     
    Last edited: Jul 18, 2015
  18. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    @Elecman: There will be some sort of shader LOD and maybe mesh LOD for distance views but have not got to that yet.
    I suspect depth fighting will be a bigger concern for you at those heights.

    @StaffanEk: I know the effect you taking about and will hopefully be about to do it. There will be only one global wind and wave direction but it will be possible to add some small local effects by using the wave overlay system. More on this in a few days.

    Ive done the performance tests for the wave query system used to sample the wave heights at any x/z location. Obviously this will be different for each CPU but Im using a newish Intel i7-4770 CPU @ 3.40GHz.

    This is just testing the sampling of the wave heights. There was no buoyancy calculations. Its was done by sampling a location 1000 times and timing how long it took. This was done each frame for 200 frames in a row and then the average was printed out. This was then done five times in a row and the average is the results I will give here.

    To sample a single location you would use this line of code from any script.

    Code (CSharp):
    1.  
    2. WaveQuery query = new WaveQuery(x, z);
    3.  
    4. Ceto.Ocean.Instance.QueryWaves(query);
    5.  
    6. float height = query.result.height;
    7.  
    The reason the WaveQuery class is used is because you can adjust some settings on it to change how the waves are sampled. This is the method that the performance tests use.

    You can also just provide the x/z position if you dont need to change the query setting, which you wont most of the time. There are some settings that will make these querys faster than the results here but the wave height will be less accurate. This will be useful for things like cannon balls where the exact position may not be needed.

    Code (CSharp):
    1.  
    2. float height = Ceto.Ocean.Instance.QueryWaves(x, z);
    3.  
    The sample speed is effected by the choppyness of the waves because the x/z displacement of the waves complicates things. The choppyness can be turn off if you dont like it and if not turned off will increase the higher the wind speed is.

    With choppyness off and a wind speed of 8 (gives moderately rough waves) it took 1000 wave querys 0.78ms.

    With choppyness on and a wind speed of 8 (gives moderately rough waves) it took 1000 wave querys 1.39ms.

    With choppyness on and a wind speed of 20 (give very rough waves) it took 1000 wave querys 1.90ms.

    So a single query would take about 0.0014ms which I think is pretty good.

    There are two other ways provided to querys the waves. You can provide the querys in a batch if you like...

    Code (CSharp):
    1.  
    2.  
    3. WaveQuery[] querys =new WaveQuery[1000];
    4.  
    5. foreach(WaveQuery query in querys)
    6. {
    7.     query = new  WaveQuery(x,z);
    8. }
    9.  
    10. Ceto.Ocean.Instance.QueryWaves(querys);
    11.  
    12. foreach(WaveQuery query in querys)
    13. {
    14.     float height = query.result.height;
    15. }
    16.  
    17.  
    Batching like this takes the same amount of time per query.

    There is also a Async method provided that will run the querys on a separate thread and uses a callback when the task is done. The time the task takes depends on the number of querys in the task but I found that a task with 10000 (yes thats ten thousand) querys will be finished by the next frame. The delay in getting the result maybe a issue for some things but for some stuff it may not be noticeable.

    This uses the async method...

    Code (CSharp):
    1.  
    2.  
    3. WaveQuery[] querys =new WaveQuery[1000];
    4.  
    5. foreach(WaveQuery query in querys)
    6. {
    7.     query = new  WaveQuery(x,z);
    8. }
    9.  
    10. Ceto.Ocean.Instance.QueryWavesAsync(querys, CallBack);
    11.  
    12.  

    And The call back function would be something like this.

    Code (CSharp):
    1.  
    2.  
    3. void CallBack(IEnumerable<WaveQuery> querys)
    4. {
    5.    //Called when task is done
    6.    foreach(WaveQuery query in querys)
    7.    {
    8.        float height = query.result.height;
    9.    }
    10. }
    11.  
    12.  
    The performance for the tasks is a little hard to measure so I dont have any numbers. The actual sample time per task is the same its just that the main thread is not block so it wont effect your frame rate unless you overload the CPU with to much work.

    You can also send multiple tasks at the same time and each will run on different threads.

    I was able to send 5 tasks each with 10000 querys each frame and they where always done by the next frame.

    The frame rate dropped from 230fps to 130fps but thats still pretty good and 50000 querys is a bit extreme.
     
    Last edited: Jul 18, 2015
    hippocoder likes this.
  19. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    $60 and don't be afraid to ask for upgrades. I personally would expect to pay around $200 minimum but if you're going mass market perhaps it's a sensible price.

    Upgrade pricing ie $20 for rivers etc on top would not kill us :p
     
    ZJP, Reanimate_L, Furax and 1 other person like this.
  20. Furax

    Furax

    Joined:
    Nov 20, 2013
    Posts:
    5
    I advise you to start around 50 60$ to compete with suimono and upragrade in future. Sorry for my english
     
  21. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    828
    Don't forget to check builds instead of editor only.
    I tried every ocean you did so far (and I will buy this, too), but most of them missed textures when building ;)
     
  22. Weendie-Games

    Weendie-Games

    Joined:
    Feb 17, 2015
    Posts:
    63
    Looking forward to the release, keep up the good work!
     
  23. Rycons

    Rycons

    Joined:
    Nov 23, 2013
    Posts:
    31
    For an ocean system with continued support I would be willing to pay 300 - 500 (similar to Triton). $60 is a really good price for what I'm seeing. Can't wait for this!
     
    ZJP likes this.
  24. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    Yeah although as we're seeing - it generally pays to have some kind of subscription model or approachable pricing, at least for a new product. As features are added and people learn this is a good product (along with other water options) they can feel assured by 5* reviews that it's worth the higher price point. To get established, one would start reasonable I think.
     
  25. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    So for those of you involved in the beta testing there will be code sent out tomorrow.

    For everyone else I have some windows builds you can download and play around with.

    You can download the windows dx9 build here and the the dx11 build here.

    I dont have a mac so cant provide a build for IOS sorry. There maybe a web player at some point.

    There are still some issues with the builds. The waves can have quite a jittery look. I know what the issue is and hope to have it resolved soon. Also the reflections are not working in dx9 for some strange reason and I am sure there will be other issues I have not noticed.

    There are some sliders for you to adjust the look of the waves like wind speed, direction etc. There are plenty of other settings but I have only made sliders for a few.

    The dx11 build should look like this...

    Ocean33.jpg
    And with the wind speed at the max...

    Ocean34.jpg
     
  26. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Can't wait to break it!
     
  27. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    Awesome!
    Edit:
    GeForce GTX 770 : DX9 and DX11 no issues.
     
    Last edited: Jul 20, 2015
  28. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,258
    scrawk, the demo is already looking very good.

    For me only the dx9 demo works correct and it has correct reflections.

    On the dx11 demo I get this: (ati radeon hd 5870, latest drivers)

    cetodx11.jpg
     
  29. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Only critique I have in DX11 (running a NVidia 680) is the reflection is FAR too clear. It may need a slider to adjust the distance and about of distortion it has.
     
  30. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    @sjm tech: Thanks.

    @elias_t: Thanks. That is strange. Does it only look like that when the camera is below the boat?

    @CaptainMurphy: Funny you mention that. There is a setting to control how clear the reflections are. I had someone see it earlier and they thought the reflections where too blurry so I made them a lot clearer. Personally I liked them a bit more blurry. There is also a distortion setting.

    EDIT - Also my buoyancy scripts are pretty average at the moment. The ship will bounce and sink a bit when the waves are large.
     
    Last edited: Jul 20, 2015
  31. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    I get a few weird fuzzy halos in the DX11 build - some render texture stuff is off. 5.1.2 and 780 ti card. These halos are where the ship passes in front of objects which are submerged in water (cubes).

    But very cool work so far. Performance was 600-700fps at 1080p.

    Edit: added pics of strange dark halos and shadow streaks in water (dx11) - probably easy enough to work around if it can't be solved:


     
  32. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    That is absolutely great, worked fine on my gtx 580, didnt even break a sweat - i'll certainly be tweaking things but yeah, its like you got my whitecaps dream sorted as an actual usable thing. I made my own way to change ocean parameters ages ago for it but it was very costly, it calculated 3 spectra to blend between but took a second or two to do it when you wanted new conditions, and there you have it, working great. Everything there that i could pick fault in was obvious tweakable stuff, im assuming you're using brunettons bdrf for the sea surface - that can be played with to get any result you like so im not worried there - had a go at river conditions and figured you were running a low res normal map over the surface, something like that, breaks it up nicely at more ocean size settings but more still settings showed it up. It could possibly be part of the foam stuff too though, i know i had a lot of similar appearances in my play with the old whitecaps project

    To other people i can say - dont worry about a thing, absolutely everything there can be tweaked to death, the ostensibly tricky stuff like those FFTs in realtime, at that performance, seems nailed, im very impressed. Regarding worries about foam appearance, thats not a worry to me either ive already had a go at tweaking that effect to death and it can get pretty great looking

    To illustrate, this was me playing with scrawks whitecap project from his blog a few years back, he did all the heavy lifting, i just messed about with the frag shader and the parameters driving the whitecaps



    This is looking really good, bout time scrawk earnt a few bob from his work
     
  33. VIC20

    VIC20

    Joined:
    Jan 19, 2008
    Posts:
    2,444
    A demo for Mac would be nice.
     
  34. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    So how do we define ocean areas? pretty curious about that as we're essentially a very large island and it would be a waste if it was all rendering under ground... :)
     
  35. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    @hippocoder: Thanks. I never really noticed that. Dont think it will be a issue to fix, although whenever I say that it always is. Dont really have a answer to the ocean areas question atm. The projected grid makes that a little tricky but I have some ideas and will be covering that when I add shoreline effect .

    @lazygunn: How come everything always works for you? Lucky. Yer, generating the new conditions when settings change takes awhile. That was the reason I never made it so you can change then setting during runtime on the other projects.

    The fourier size used in the demo is 64 and generating new settings takes about 80ms. The calculations run on another thread which is why it doesn't lag out the frame rate.

    @VIC20: Sorry, not at the moment.
     
  36. elias_t

    elias_t

    Joined:
    Sep 17, 2010
    Posts:
    1,258
    scrawk, almost the same above the ocean.
    It behaves like the vertices move at very large distances.
     

    Attached Files:

  37. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I am seeing this as well. Also seeing as the waves are rising/falling in large format I get like a 'shadow' of the ship projecting on the wave surface once in a while. I am trying to snag a screenshot of it.
    My only real issue has been the projected grid gets pulled out of into the frustum once in a while on large waves:
     
  38. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    @elias_t: ok, thanks.

    @CaptainMurphy: Thanks. The pulling away can be fixed easy. I just need to increase the border on the the mesh. It may cause so stretching issues however. You can see the stretched border if you enable the wireframe. Thought I had it large enough but guess not.

    The big waves are rather hard for the grid to handle so it may not end up being practical to have the wind speed above 20.
     
  39. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    +1 for surface reflection (skybox) maybe too strong.
     
  40. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Got some shots of the odd 'shadow' effect. I am not sure what is causing it, but the ship seems to be the target of the effect.




    Also, before you get downtrodden from all of the 'errors' reported, I must say it looks FANTASTIC in motion. I really can't wait to see the ship-of-the-lines duking it out on top of it.
     
  41. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    Regarding the ocean thing, I think if you made it tile based, ie a large grid where we can just omit cells or tiles in a rough granularity (ie every 25, 50 or 100 units) then it would be sufficient savings and cull most things out.

    Alternatively you could keep things as they are but have objects which can define an area where the ocean isn't calculated or drawn, so we'd be able to keep on top of things optimisation wise. Obviously when it goes out of sight we'd turn it off.

    In any case it's all very exciting.
     
  42. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Almost every tile based system I have used shows a 'tearing' between vertices of neighboring tiles. No matter how tight they are put together it almost is inevitable for that to show up. This projected grid is fantastic in terms of optimization. I imagine he will be able to cull out based on visibility eventually.
     
  43. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I don't entirely know what i'm talking about but if there was a way to attach maps to locality in world space, a heightmap specifically, then that might be used to attenuate waves and maybe push grid verts way down when over land specifically (would a tex2lod do that? i may be talking out of my posterior)? or have the frag shader not draw, or a stencil mask? Umm, i should stop talking too much about stuff i don't know a lot about but those are some thoughts
     
  44. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Suimono does something very similar using a depth texture on an overhead camera. It normalizes the wave motion of the verts if they intersect with a color on the map. It is a bit more complicated than I am making it out, but it looks fantastic. It also is used to create shoreline waves.
     
  45. XPAction

    XPAction

    Joined:
    Jan 13, 2014
    Posts:
    11
    Dx11 on a AMD R9 290 looks the same as elias_t
     
  46. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,433
    Alright feedback time based from the demo. So first of all i know that this is still in progress which mean you gonna add more feature in it in the future, and i believe that some of my feedback might be already said by other people or already planned. Keep in mind that this is from artist point of view so basically about the visual appeal of the ocean
    1. For the foam, is it possible to overlay/multiply a foam texture on it, basically some kind of texture that used by the boat wave. For me i think the wave foam frequency is too high.
    2. Using normal map for high frequency wave, also might be awesome if we can have some small breeze effect (a localize very high frequency waves). Basically like lumion ocean around 0:23

    3. Shore effect of course, not sure how to handle this for open world ocean game tho. maybe some kind of world space projector to affect the wave in specific location that project the island depth textures.
    4. Also LOD maybe just like AC black flag ocean LOD (on material base)
     
  47. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    rea - those shores aren't very realistic actually - seen a lot better with cryengine. The ocean colour is more a set of aesthetic choices, I suspect Ceto will manage the overall look. The shoreline stuff doesn't look too hot there though, from what I saw in the vid.
     
  48. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Yeah, not real impressed with the Lumion. As far as Unity water systems go, Suimono does shorelines really well. Probably the best shoreline system for Unity water so far. Nearly infinitely adjustable for your needs and has some very nice gradients maps that can be adjusted for your depth coloring and transparency. Downside is that it is a bit of a resource hog and is not really tailored for oceans, more for lakes/rivers.
     
    Baldinoboy likes this.
  49. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    Suimono looks much nicer than I expected in that shot. I had previously rejected using it due to the demo being a bit ugly. Can you tell me why you're choosing not to use it? pros and cons etc.. .could help both developers improve their respective solutions.
     
  50. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    It is a bit longwinded, but as far as pros it is probably one of the most flexible systems I have used, to date. I have tried almost every water system in Unity and it was the most capable. Between customizable color maps to the smooth shoreline rendering it really does shine in terms of detail. Very literally, every setting can be adjusted using a simple slider in the inspector, then saved as a 'prefab' that you can then lerp between for in-game usage. Underwater mode is very nice, it has very slick transitions to and from above/under. For cons, that detail comes at a pretty heavy cost as it eats up frames pretty fast. Making it full detail and large tiling can take a scene from 350+ down to 50 quite fast. Also, buoyancy height calls are done using a texcoord system which is really slow beyond a couple of calls per frame and limits the distance that you can texcoord check to the size of the tiles. The wave patterns are not ocean friendly and we have spent weeks trying to get them to look right in an ocean setting, to no avail. Foam is a simple height blend and it hard to get to look right while lerping through the presets unless you make a whole lot of them to move through. Finally, it is not network capable. It is specifically frame dependent and has no method of syncing between clients as of yet. We have tried to keep the systems in sync across a network but have always ended up getting off after a matter of minutes. If we do any kind of 'reset sync' it makes the water look like it is glitching and really is not good for client side appearances.
     
unityunity