Search Unity

Ceto (Scrawks Ocean)

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

  1. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I set up a public repository for an open source branch of the original voxel buoyancy.

    https://bitbucket.org/wolfpackgamesco/unity-voxel-based-buoyancy

    Goal is to make something that is able to give buoyancy and can be adapted to multiple water systems. Currently it is at the original state of the script and I will be rolling it forward to the latest version as I get time today. If someone has a more updated version you are welcome to do a pull request.
     
    rgrlee71 and John-G like this.
  2. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Also making my buoyancy system based of Alex Zhdankin's work, really is a good system that's efficient at what it does.
     
  3. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Yea but it needs a lot of work to get everything to work well.
    Had to build a system for water and air density, added a database of material types to base objects of, completly change how gameobject was working with the physics engine and a massive script to get the window to work so you can add/update gameobject without getting bugs.

    Will put a demo up soon ;)
     
  4. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Very Impressed :)

    I would but I am not even sure myself. I dont think the current foam trail script could look like that.
     
  5. imDanOush

    imDanOush

    Joined:
    Oct 12, 2013
    Posts:
    368
    No problem.
     
  6. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    If you don't want to run a full fluid dynamics simulation, you'd almost need to use a number of particle systems, originating at various points in the wake, to account for all of the shock waves generated by the passage of the hull through the water. If you look at a picture taken from overhead, you can see several wave fronts, that would each need to produce trailing particles, which would all need to collide and interact with each other. Unfortunately their positions and intensities vary quite a bit, depending on the shape and speed of the boat, so creating an automagic solution to this won't be easy. :(
     
    imDanOush likes this.
  7. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    I got a working demo up here
    There is a small delay in object drops as they fall from a great height.
     
    rgrlee71, scrawk and Bartolomeus755 like this.
  8. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    My new Vive just arrived. looks like VR support for Ceto will become official soon.

    IMG_0905.JPG
     
  9. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58
    I look forward to VR support as I may have to develop for it in the future.

    Beaufort scale was mentioned a few times in this thread, are you considering developing a slider for it in CETO?
     
  10. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    It has been mention but its not something I will be implementing. I think the current controls on the spectrum provide enough control for the ocean.
     
  11. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    The Ceto manual has been updated and can be downloaded here. It even has pretty pictures now.

    The tutorials and common problems sections have been finished and contain the following content.

    1. Tutorials
    • How to set Ceto up for a server

    • How to use the wave overlays

    • How to export shoreline masks for a terrain

    • How to create a shoreline effect

    • How to adjust the underwater effect

    • How to add per-camera settings for the ocean

    • How to find the height range of the waves
    1. Common Problems
    • Where are my reflections?

    • Why does this object not have the underwater effect applied to it?

    • Why is this wave overlay not working?

    • Why cant I get global fog to be applied to the ocean?

    • Why cant I get shadows to show on the ocean?

    • Why cant I get point and spot lights to show on the ocean?

    • Why is there a strange artefact on the ocean behind a Speed Tree?

    • Why is there a strange artefact on the tips of the waves?

    • Why is my object not floating on the waves?

    • Why is a object showing in the reflections when its not seen by the main camera?

    • Why are my particles not showing correctly underwater?


    CetoManualScreenShot.png
     
  12. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    Cool. Have fun. See ya in a few months. ;)
     
  13. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    272
    Updated Manual looks good! Tested the AddShoreMask, works as expected. I do notice a strange flickering (strobe) effect when viewing at certain angles, and it is not subtle. I suspect it's due to the Caustics if anyone else can confirm.
    BTW, are animated caustics on the request list? Other than that, Ceto Looks great!
    Ceto_ShoreSrobe1.jpg
     
    scrawk likes this.
  14. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    272
    caustics, they work, but for some reason I can only get them to work in the demo scene. When creating a new scene or using the Demo Assets in a new scene , they are not active.
     
  15. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    The caustics dont work for the opaque prefab at the moment so if your using that one they wont show. They also dont work on Unity versions 5.1 or less. I should add that to the manual.

    If the flicker is from the caustics I think I know what that is. They use the scene normals so they are only applied to the tops of objects in the but in forward rendering the normal texture is poor quality for some reason. It gets worse the farther you are from the water. I might have to tweak it a bit.

    The caustics move by displacing the texture uv with the wave normals. Its not a great way but its cheap. If I can find a easy method to generate more realistic caustics I will look into it.
     
  16. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    The manual looks great but im missing the helpfull links at the top so i can get where i need to go faster, but i scrolled trough the intire thing and read some stuff, helpfull info, good explaned, even found stuff i did not know before :D
     
  17. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Play testing the buoyancy system i build, added my player character to to and trying to stay on XD

     
    Bartolomeus755 likes this.
  18. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    Naked dude on a sinking raft, I don't know if Ceto is the problem
     
    imtehQ likes this.
  19. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    its not really sinking as the raft density is higher, but the naked dude on it is forcing it down, together with the waves, the raft will not get the chance to stabilize.

    The ceto waves only move up and down, so its a bit tricky to find a way to get momentum from the waves to the raft.
     
  20. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    272
    Making a list, If you work with Ceto + other plugins please post the Default or Required render-settings here.
    Trying to get all the plugins to work together.
    CETO: Gamma, forward rendering. (true?)
    UniStorm uses:
    TrueSkyAlpha:
     
  21. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Out of curiosity why can't you sample wave height on cpu while doing gpu rendering? I imagine sampling the wave height for cpu is extremely fast and does not need to read from gpu?
     
  22. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    272
    Trying to find out why emissive materials are not working in the demo scene.
    "Why cant I get point and spot lights to show on the ocean?"
    To enable other light sources like
    point and spot lights you need to go into the OceanTopSide_Transparent and OceanTopSide_Opaque shader and
    remove the noforwardadd tag"

    for us non coders, what is the corrected line suppose to look like?
    //#pragma surface OceanSurfTop OceanBRDF noforwardadd nolightmap keepalpha
    or
    #pragma surface OceanSurfTop OceanBRDF nolightmap keepalpha

    hmmm, VisualStudio seem clunky and is slower to open than Mono Develop.
     
  23. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Open Office was playing up and I couldnt get it to add the links again. I'ill try again sometime.

    Ceto should work in all combinations of forward or deferred with linear or gamma.

    The line should this if you want to remove the noforwardadd.

    #pragma surface OceanSurfTop OceanBRDF nolightmap keepalpha

    It does sample the wave height on the cpu while doing the rendering on the gpu.

    Its the FFT thats the slow bit. Thats done on the cpu as well but there is a option to do it on the gpu. It this case if the wave heights need to be sampled they have to be read back to the cpu.
     
  24. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58
    My ocean is changing colors at specific height levels. I don't believe any of my code is causing this but I could be wrong.

    It's related to the Underwater effect. Whenever my camera goes roughly 21m over the ocean's level the UnderWater script's Underwater Mode switches from ABOVE_AND_BELOW, as it was initially set, to ABOVE_ONLY. This drastically tints the ocean's color:

    Left : Camera at roughly 20m, Right : Camera move up to roughly 22m

    upload_2016-7-13_15-21-53.png

    I've tried to remove all my code that touches CETO and I did a fresh CETO install.
     
  25. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Sorry for the delay. I have only just worked out I need to go back to the old forums.

    I think you have control underwater mode ticked on the UnderWater post effect script on the camera.

    If this is ticked it will take control and switch the mode when it knows the camera cant be below the ocean surface. This should not effect the color so not sure about that but untick it and see if it helps.
     
  26. dB99

    dB99

    Joined:
    Jul 18, 2016
    Posts:
    2
    Hello,
    Bravo for this asset, the rendering is excellent.

    I have a small problem and a question.

    I show you the problem in picture:

    sdf
    .
    .

    And the question: In terms of the character movement underwater? Is there of functionalities in Ceto, or you have an asset to advise me?

    Thank you in advance !
    (sorry for my English)

    P.S: Unity 5.3.5f1 Personal, UFPS 1.6.1, Ceto Ocean System 1.1
     
  27. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Hi,

    If you look in the UFPS manual there is a section on image effects. Cetos underwater post effect should be treated like global fog.

    So according to the the UFPS manual that means that effect should be applied to the main camera (not the weapon camera) and it will only work in forward rendering.

    This does mean that the effect will not be applied to the weapon but its the only option in this situation.
     
    Last edited: Jul 19, 2016
  28. chainsawpenguin

    chainsawpenguin

    Joined:
    Sep 28, 2014
    Posts:
    107
    Downloaded the most recent update, and am receiving the following error:

    Assets/ART/Ceto/Scripts/UnderWater/RefractionCommandBase.cs(14,27): error CS0535: `Ceto.RefractionCommandBase' does not implement interface member `Ceto.IRefractionCommand.ClearCommands()'

    Any guidance or suggestions would be appreciated!
     
  29. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    I think I answered your email but just in case here's the fix.

    Can you please delete the Ceto folder before importing the new version.

    Unity wont delete any old files when importing a new package so if I have moved a file in the new version you can end up with two copies of the same script (the new and old version) which will give a error like this.

    I moved some scripts in 1.1.1 to clean up the folder a bit.



    Minor update for Ceto has been approved. Mostly fixes for VR.

    Ceto Version 1.1.2

    - Fixed VR issues in 5.4 and added support for SteamVR.
    See manual on how to Set Ceto up for VR.

    - Added a tight projection fit option to the ocean.
    This needs to be unticked to prevent some issue with the
    ocean grid in VR.

    - Fixed underwater mask texture not being cleared to correct color.

    - Fixed the height overlay mask mode not having correct default value.

    - Improved how spectrum caching works. Added tutorial for
    spectrum caching to the manual. Use this to improve performance
    where change ocean conditions frequently.

    - Fixed caching spectrum conditions not working until
    spectrum start called.

    - Fixed a black flickering patch that occurred in certain
    objects reflections when blurred in HDR.

    - The underwater post effect will now not run if the
    grid is disabled.

    - Underwater mode BELOW_ONLY has been added. If your game is
    all underwater use this mode to disable the top side mesh.

    - Fixed Asyc wave queries not working.

    - Added better support for async wave querys. See manual for
    a tutorial on how to use async query tasks.

    - Refraction intensity has been split into two settings.
    One for above and below.

    - Fixed wave ranges being incorrect if spectrum disabled

    - Fixed depth grab not working on Legacy Deferred

    - Fixed overlay normals not facing correct direction when
    overlay is rotated.
     
  30. dB99

    dB99

    Joined:
    Jul 18, 2016
    Posts:
    2
    Okey thx

    And for the question: In terms of the character movement underwater? Is there of functionalities in Ceto, or you have an asset to advise me?
     
  31. jangomoose

    jangomoose

    Joined:
    Feb 17, 2016
    Posts:
    40
    HI, I just updated to the latest version mainly for the VR update and am just wondering if it is just me but the ocean doesn't render. In the demo scene the ship is "floating" and reacting to the waves but they can't be seen. I have added the scripting box setting. Any ideas?
    Unity 5.4.0b20, Ceto 1.1.2
     
  32. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Theres nothing in Ceto to do that. Not sure if there is a asset to do it either.

    Sounds like there is a error that has caused the grid to stop rendering. If you look in the console you will see a red error message from Ceto if there was a issue. If there is one post what it says and I should be able to fix it.

    There is also a new section in the manual on how to fix any errors you get after updating. Its in the common problems section.

    I did hear there was a shader error in 5.4.0b22. Not sure about 5.4.0b20. I have checked 5.4.0b25 and its working ok.
     
  33. jangomoose

    jangomoose

    Joined:
    Feb 17, 2016
    Posts:
    40
    Updated to beta 5.4.0f1 all is good, thanks for the help on this rather excellent asset.
    It's sorted out the double shadows issue I had in VR, super.
     
    Last edited: Jul 20, 2016
    scrawk likes this.
  34. stevenc33

    stevenc33

    Joined:
    Apr 20, 2016
    Posts:
    18
    I’m seeing underwater render problems with Ceto 1.1.2. Underwater color/fog only covers to the horizon. Problem only shows up in the Player (Windows). It works fine in the editor.

    I completely ruled out anything to do with my project. I completely uninstalled unity. Downloaded the latest 5.3.5f1 and created a new project. I imported only Ceto 1.1.2 from the asset store. Then Added the Ceto DemoScene to the build. Made a Windows build and moved the camera underwater, problem appears.

    Problem appears in both 5.4.0f1 and 5.3.5f1.

    This behavior was not in 1.1.1

    I've also tested with both the Transparent and Opaque prefabs. Both show the same effect.

    I ruled out the Screen Resolution as I tested with 2560x1080 and 1920x1080. I also tested on two different Video Cards and Monitors.

    Please see the attached screenshot.

    UPDATE: I tested both 32bit and 64bit builds and tested on another PC, same problem.
     

    Attached Files:

    Last edited: Jul 21, 2016
  35. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Yes, your right. I forgot to check the build for issues.

    I will fix that and do a minor update.

    EDIT

    In the UnderWater.cs script at the bottom is a function called CreateBottomMesh.

    I added this line.

    mesh.UploadMeshData(true);

    Remove it. Its what causing the issue.
     
    Last edited: Jul 21, 2016
  36. rgrlee71

    rgrlee71

    Joined:
    Sep 11, 2012
    Posts:
    37

    I was just about to post this same issue. Thanks!!
     
  37. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    That makes sense. I tested the demo that is in the Asset Store description and it only runs ~15fps on an weak i5-4200m 2.5GHz. It was also bottlenecked by the cpu because graphics setting did not change the framerate.

    I have a few questions:
    + Is the FFT done in C# scripts and therefore it takes long because C# is an interpreter language with the time
    consuming byte code intermediate step ? Or is it integrated in some C++ that directly goes into the engine?
    + It is a power of two FFT, right?
    + Can I tweak the FFT/Spectrum calculation myself or is it wrapped in some dll?

    The demo is 128 FFT resolution from what I gathered, so lowering that to 64 at the expense of less detailed waves should be possible I guess.
     
  38. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Hi,

    The FFT is done in C#. The conversion of C# to byte code is only done once. I think people over estimate how much slower C# is compared to C++. They difference is not as much as you would think.

    Yes, the size of FFT must always be a power of two.

    Yes you can tweak the FFT code if you want. Its not in a dll.

    The demo is at 64 with the ultra detail option at 256. There is a 32, 64, 128, 256 and 512 option with some options of weather it runs on the CPU or GPU.
     
  39. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    I see. I did not know that. I always thought if the C# function updates every frame, then it is interpreted to byte code every frame. And from my understanding, the FFT is done every frame.
    If it is not too much hassle, could you post a sreenshot comparison between resolution 64 FFT and 32 FFT to get a feeling how the ocean looks at 32? If I am not wrong, more blind-guessing really, then 32 FFT is 4x faster than 64.
    Sorry to keep nagging, but the Assetstore does not allow refunds and pack price is rather high (absolutely ok for sth like this). Therefore I need to know if runtime budget is ok.
     
  40. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Theres quite a noticeable tiling at 32 so I dont normally recommend it.

    The FFT is done every frame. Theres actually multiple FFTS done for thing like height xz displacement, slopes and foam.

    I think you will find its not the FFT thats the bottle neck on low end hardware but the ocean shader. Try change the screen resolution instead on the demo and see what the impact is.

    I dont think you will be able to get much of more of a fps boost by dropping the FFT size but it might help a bit. If your counting on this Im not sure I can recommend Ceto to you. The height FFT is done on a separate thread anyway so does not impact much on the fps. The slope and foam are always done on GPU. That could be costly on integrated cards.

    Im no expert on the C# compiler but my understanding was C# is converted into byte code by the compiler for distribution and the first time a section of code is ran by the application the JIT compiler converts the bytecode to native binary for that target architecture. That only needs to be done once and the next time the same code needs to run the binary is reused.

    This is the ocean at FFT 32.


    fft32.jpg
     
  41. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    Thanks for the info and explanation! The FFT 32 Ocean actually still looks ok actually.

    Once I get started, I will propably try to turn the C# code into C++ and use it as a dll in the pro version to see the difference. But that would be ok, because it would still have saved me the time of writing my own FFT and testing and so on.
     
  42. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Just wondering is there any way to have the reflections split across two cameras?
    I have a split screen camera where 1st camera is split horizontal across the top of screen and 2nd camera is on bottom of screen.
    When looking at ocean both cameras have the full ocean reflection dispalyed across both screens so they don't match up.



    The above image is an example of a rangefinder system I'm simulating.

    Will post an image in game of the ocean and reflection when I get home.

    Edit: OK found a way around the issue using rect scissors method instead of camera matrix offset.
    Though it raised a similar issue with Truesky in that the top camera is rendering the complete sky to the camera instead of just top half.
    Oh well will talk to Roderick on how to edit Truesky to resolve.
     
    Last edited: Jul 25, 2016
    CaptainMurphy likes this.
  43. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    As far as I know your meant to change the camera rect to render two cameras to same screen. Ceto should do this as it was fixed quite a few versions ago.
     
    John-G likes this.
  44. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    This should work fine, we render to two cameras for a 8-display setup, and we even manipulate the projection matrix on one camera and still ceto works fine!
     
  45. m1nd1

    m1nd1

    Joined:
    Jul 26, 2016
    Posts:
    2
    Hello

    How could I use UI in underwater? If my character dead in underwater, I want to show UI element in screen.

    Thanks
     
  46. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    515
    Try including it in the culling mask in underwater script (Ocean Depth Mask)
     
  47. arnesso

    arnesso

    Joined:
    Mar 3, 2015
    Posts:
    96
    Hello !
    Does anyone have any experience about Ceto ocean and AI fishes c# scripting ? I would create a little life under the surface
    thank you :)
     
  48. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    arnesso likes this.
  49. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    Scrawk, so now that I'm back in the right forum (Damn you Unity)

    I notice the wave query seems to take into account all the noise on the wave.. IE.. continuous wave query leads to a bumpy value. Is there a way to get the "average" or smooth swell height before noise is added? I am trying to keep the character above the water on a hoverboard (swimming works ok, which leads me to believe I might have other issues, but that's for another day)
     
  50. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    Fixed this by moving everything into FixedUpdate. Seems I forgot this step when I separated out the Camera logic.