Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Ceto (Scrawks Ocean)

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

  1. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    Yes Ceto is working perfect with the 2 camera rects including waves when rotating between both cameras:



    If only Truesky also used this behaviour alas it renders fullscreen to both cameras breaking the effeect.



    Alas Camera Matrics is a black magic art to me :( so not sure if I can pull this one off.
    Was there anything special you deid to get Ceto working this way, that I could relay to Roderick - maybe he could implement it into his system.


    EDIT: Got it working seems like it was a Deferred Issue - works perfect in Forward mode

     
    Last edited: Jul 26, 2016
  2. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    Just spotted a New Version up:

    Release Notes
    Ceto Version 1.1.3 - Fixed a issue with the underwater post effect not working in the build. This was broken in the last update.
    - Small changes to the projector aiming to minimize a line artifact that appears across the horizon when ocean viewed from a low angle.
    - Fixed depth pass texture having wrong filter mode.
    - Improvements to the way refraction distortion is handled. This should fix issue around edges of object in the water.
    - Improvements to the way caustic distortion is handled.
    - Changed how stereo camera for VR is handled from conditional statement to keyword.
    - Underwater post effect attenuate by sun is now a slider instead of a bool on/off.
    - Some minor allocation reductions.

    :)
     
  3. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    I have not heard of anyone having this issue before so Im not sure if its a bug or just a set up issue. You might have to post a screen shot if you

    The wave queries do have small amount of error so you may need to average the result over a few frames to get a smooth result.

    It was quite a minor fix for Ceto so it could be for true sky as well but its hard to say as I dont know how it works.

    Basically Cetos reflection camera needs to have a full rect even if the main camera is only rendering to part of the screen since the reflection still need to be rendered to the full reflection texture. If the reflection camera copied the main camera rect which is only rendering to part of the screen the reflections will only render to part of the reflection texture. Dont know if that makes any sense.
     
    John-G likes this.
  4. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    As John pointed out there is a new minor version. This was mostly to fix the post effect I broke in last update but I also used the extra time to fix up a few other issues that had come up during the week.

    I have also decided that this update will be the last one for a long time. I think its time to call Ceto complete. I know there are still things that have not been done but I have been working on this for about 20 months now and I cant afford to spend anymore time on it. For the sake of my sanity I need to move on.

    It will still be supported and if a new version of Unity breaks anything or a major bug is found it will be fixed. There wont be anymore new features however.

    Maybe in 4-6 months I will feel differently and start adding in new feature again and maybe even start on a Ceto2 but for now this is it.
     
    clickmatch, olavrv, John-G and 2 others like this.
  5. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    208
    You have done a great job with Ceto. It is definitely the best ocean system available for Unity - making it possible to create AAA results.

    For us using Ceto in a commercial application the most important thing now is that it works on future versions of Unity and related framework.
     
    scrawk, clickmatch and John-G like this.
  6. zackrump

    zackrump

    Joined:
    Jan 19, 2014
    Posts:
    8

    I have to agree with John. Thanks for this amazing asset you provided-- far beyond second bests. And also for the amazing support you offered us (I mean, are on page 35 of as many other dense pages). Bravo.
     
    scrawk likes this.
  7. rgrlee71

    rgrlee71

    Joined:
    Sep 11, 2012
    Posts:
    31
    I hope someone releases a better buoyancy system.
     
  8. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    669
    Can't you use masks? Render 2 full images, but use a mask to cover the top or bottom half of each? It seems like the simplest way to ensure both cameras only show the portions they're supposed to. Then just combine them additively for the final image. I'm just guessing here, and may have misinterpreted the problem, but that would be my first approach if I wanted to do something like this.
     
  9. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    Interesting, never used masks before to hide camera.
    How is this done, would imagine it uses a alpha mask.
    Though it is working now I will look into it, as sounds like it would be a simpler solution.
     
  10. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    208
    Here are a couple of screenshots from our ship simulator system that we are developing.

    This location is a 80km x 80km terrain which goes from fjords to coastline into open ocean.
     

    Attached Files:

    Last edited: Jul 28, 2016
  11. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    669
    I use the standard "ScreenOverlay" image effect to add special frames around the image, when using a scope or binoculars for instance. Your split screen cameras should be no different really. As you said, it just uses the image alpha to determine which parts of the camera image are visible, and masks the rest to black. I've never tried combining two masked images, so I'm not sure about that part, but I imagine there should be a way to "add" the images, so the black areas are replaced by the corresponding images from the other camera. Here are some sample top and bottom masks to play with if you want:
     

    Attached Files:

    John-G likes this.
  12. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Anyone else getting these spots in VR? They are flickering around the water like crazy. I recall something similar happening before, but cannot recall what was causing it.
     
  13. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    230
    scrawk, olavrv, Karearea and 2 others like this.
  14. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    322
    Fantastic! Instant purchase, from a quick test in my project it works superbly. Really appreciate the physics / material based approach. Also like the suggestion it should work for lighter-than-air drigibles.
     
    imtehQ likes this.
  15. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    208
    I just tested it in our ship simulator system, and it works really well. This definitely a must to have in addition to Ceto.
     
    imtehQ likes this.
  16. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    230
    Thats great to hear!
     
    olavrv likes this.
  17. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    There was something like this on ATI cards. Cant quite remember what it was thought.

    I have not seen anything like that on the Vive. What VR device are you using?
     
  18. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    Remember I had that issue in an earlier version belive it was only happening in Deffered mode at the time.
    Think it was related to Truesky or post process effect.
    Is it occurring in both Deferred and Forward?

    On a side note got boat drift working that's effected by wind direction and wave strength.
    So boat is dragged by the waves works great, makes it that constant fixes to course are required in heavy winds if not facing directly into wind.
    Also speed is effected to in the same regard.
     
  19. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Not an ATI, this is on a GTX 660 and DK2, Unity Pro 5.3.6f1. It took me some time to finally narrow down what was setting this off and from what I can find, it is the Opaque queue water and having receive shadows enabled while in deferred mode. But that is only in one project. Another project with a near identical effects stack and camera setup can get the issue to occur without shadows enabled on the water. I have tested in new project on 3 different Unity builds (5.3.5p1, 5.3.5p7, 5.3.6f1) and all are doing the same. Happens with Ceto 1.1.2 and 1.1.3.

    Simple setup with Ceto imported into a fresh project with deferred, add a camera above the water, place the opaque queue prefab with shadows enabled. It doesn't show at all angles, just certain ones and under certain lighting (well, so far it has HAD to have a directional light visible on the water to occur). In my scenes using Tenkoku the issue stops once the world light is no longer causing specular lighting effects.

    I would hate to lose the shadows, as they really look good in our games.
     
  20. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    These look really great!
    Do you have more to show from the game (website,Youtube etc.)?
     
  21. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Ok, ta

    I should be able to reproduce it from that. It sounds like a nan somewhere in the shader. It should just be a one line fix if I can find it.
     
  22. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    322
    @imtehQ Are you planning on starting a support thread on these forums for Realistic Water Physics? I've got a few very minor improvements / requests- tweaked the scripts myself but always prefer to try and use the source as-is or extend via inheritance, makes updating easier.

    Agree with the above that it is shaping up to be a must-have for Ceto users.
     
  23. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    230
    Last edited: Jul 31, 2016
  24. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    208
    Hi, not at the moment. We working on a new version for late august, when everything is in and working we might do a video showing everything in action.
     
  25. jangomoose

    jangomoose

    Joined:
    Feb 17, 2016
    Posts:
    37
    Does anyone here who uses Steam VR have Single Pass Stereo rendering working? It increases my frame rate considerably but unfortunately breaks Ceto. Just wondering if it is just me.
    5.4.0f3 Ceto 1.1.3
     
  26. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    208
    Singlepass seems to break anything using depth buffer in my experience.
     
  27. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    The Single Pass Stereo wont work with Ceto. Im not sure if its fixable at the moment.
     
  28. m1nd1

    m1nd1

    Joined:
    Jul 26, 2016
    Posts:
    2
    Hello

    If I build my Oculus VR game, underwater cant working. But underwater working in Unity play mode. How could I fix this problem?

    a.jpg = > unity play mode
    b.jpg => build game
     

    Attached Files:

    • a.jpg
      a.jpg
      File size:
      46.6 KB
      Views:
      419
    • b.jpg
      b.jpg
      File size:
      64.9 KB
      Views:
      450
  29. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Update to the latest Ceto. There was a bug in 1.1.2 that would cause that to happen. @scrawk posted a fix to it a while back if you want to update your code itself.
     
  30. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    Hi, I bougth the asset and it is very nice.
    I have some small problem with graphics, maybe you can help. I am sure it is nothing big, but I am not that much experienced with everything in Unity yet.
    1. The (screenspace?) reflections get cut by high waves. Or in other words high waves do not block them. See island.
    2. The upper halfs of high waves turn dark blue/brown when looking at them from low angle. When they are close this looks pretty severe brownish.
    Are there solutions to this?



    Edit: it seems to be the horizon line actually...
     
    Last edited: Aug 2, 2016
  31. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    I accidentally broke that in 1.1.2. Its fixed in last update (1.1.3) or you can fix it like so...

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

    I added this line.

    mesh.UploadMeshData(true);

    Remove that line. Its whats causing the issue.

    Ceto does not use screen space reflections. It uses planar reflections. That means the reflections treat the water as a flat plane so if the waves are large their position does not match that plain and you get the reflection cut off.

    Theres not really much you can do to fix that. Its just the limitation of the planar reflection method. I just tend to increase the reflection blur when the waves get large to hide the issue. Its not a great solution but its the only idea I have.

    The darker color along the horizon is a different issue. The waters refraction color is based on what is behind the ocean. When at a low angle the tops of the waves takes the skybox color alone the horizon as thats whats behind them. I have not thought of a good way to fix that yet but am looking into it. It will probably just need some sort of shader hack to remove the refraction when viewed at that low angle.

    EDIT - opps, that was not correct. The dark color is also from the sky box reflections and is the same issue.
     
    Last edited: Aug 5, 2016
  32. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    Maybe a pack like the one below would help? I am not savvy enough with Unity yet, but my simple idea is to buy this pack for Screen Space Reflections, import it, replace the CETO reflections and then it is ok.

    Maybe someone has done that before with CETO, i.e. extented it with Screen Space Reflections?
    https://www.assetstore.unity3d.com/en/#!/content/15152
     
  33. ToneDP

    ToneDP

    Joined:
    Jun 23, 2016
    Posts:
    5
    edit: nevermind ... found the issue here. I will resolve it and make things easier. I apparently bought this using a different Asset Store account.
     
    Last edited: Aug 3, 2016
  34. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    I am not sure if that would work but it might be worth trying. If you disable Cetos planar reflection script the reflections will just be a solid color (its uses the default sky color) or just set the planar reflection mask to skybox only.

    If the screen space reflection asset will work then it should just show up on the ocean when you import it.

    However I dont think it will. You will need to check with the publisher if it will work in these cases....

    - Will the SSR work on forward rendered object? Cetos ocean is always forward rendered even if deferred is selected.

    - Will The SSR be applied to transparent objects? You can use Ceto in the opaque if not but it has some limitations.

    - Does the object need to be render into the depth/normal texture?

    If it works on forward objects you will need Ceto to render into the depth/normal texture which it wont by default. I can send you the depth/Normal shader with Cetos render type added to it if this is the case.
     
  35. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,925
    I'm feeling using reflection probes myself - do they work?
     
  36. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    I'm not seeing the reflection issue.. my player has a reflection probe around her to deal with her shiny metal armor, but I'm pretty sure the ocean was the same before.

     
  37. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    No, they are not working. Not 100% sure why.

    I know the ocean wont show correctly in the reflection probe because the projected grid cant handle being rendered into the cubemap.

    Im not sure why the reflection probe wont show on the ocean however. I think it has something to do with the way I set the shader up. It does not use Unity metallic work flow so that maybe the issue.
     
  38. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,925
    Oh I planned on just using a plane with similar texture via probe layers for that - as opaque - kind of overkill to render the ocean itself again into probes, and would be bad for business with probes that need to update for time of day.

    I guess that must be it. In deferred probes are all prerendered before they reach the shader AFAIK so its just a matter of reading something... I haven't looked into what specific calls are required from the includes though.

    I guess the planar reflections you use aren't so terrible providing I can use a specific layer for it to use, ie a super low poly low draw call approximation of the world.
     
  39. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    There is a layer mask that decides whats gets drawn in the reflection.

    If anyone wants the shader to make Ceto render into the depth normal texture heres the link.

    Theres instructions in a txt file.

    This is needed for some image effects like AO and SSR. All these type of image effects will only work on the opaque queue ocean. It will overwrite Unitys default depthNormal shader to add in the oceans render type. If you already have a depthNormal shader in your project from another asset Im not sure what will happen. Im guessing Unity will juts pick one of them to use.

    There is also a script included that will display the depth normal texture as the screen color so you can check its working.
     
  40. karonte

    karonte

    Joined:
    Jun 2, 2013
    Posts:
    21
    Good Morning Scrawk. i'm interested in your asset ..just one question:
    We will start a job where we need to show an ocean . Our project will be for GearVR.
    Question is:
    is your"geometry asset compatible with samsung S6? (of course i know that i cannot have same graphic result of normal windows pc)
     
  41. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Hi,

    Im not sure about GearVR. I have had reports Ceto does not work on some android phone (I think thats what GearVR uses?) and Im not sure how good the performance will be.

    If you buy it and it turns out its no good for GearVR then you can get a refund if you like. You just need to send your invoice number to the support email.
     
  42. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    I cant reproduce this sorry. Im trying with the Ceto 1.1.3, opaque queue, shadows enabled, Unity 5.3.6f, GTX660 in deferred with one directional light and Im not seeing any issues. Tried lots of camera and light angles.

    Tried a few images effects like blur, AA, Global fog and tone mapping hopping it would trigger it. Also tried combinations of linear/HDR.

    Tried on the Vive and that was fine. I dont have DK2 so cant check that but I dont think that would be the issue.

    This artifact is normally caused by a shader outputting a nan or neg number as a color. The best I can do at the moment is give you a list of things to try.


    - If a image effects blurs a nan then it will cause this issue. Try setting Cetos reflection bur mode to off or disabling the reflection component to see if thats the source of the issue.

    A line was added to Cetos Shader/BlurEffectConeTap.shader in version 1.1.2 to stop a similar issue so its strange your getting it now.

    In that BlurEffectConeTap shader this line that was added in 1.1.2.

    color = max(0.0, color);

    - This issue normally occurs in the oceans reflection when the reflected objects shader is the source of the nan. It could be the sky box shader. Try using Unity default sky box and see if the issue occurs. When I checked thats the sky I used. Not sure if thats the one your using in the screen shot (I think it is).

    - Finally I would go to Cetos Shader/OceanBRDF.cginc file. Near the bottom is a LightingOceanBRDF function. Try clamping the output to 0 with max. This should change any nan or neg number produced by the ocean lighting to black.

    return max(0, c);

    - It might also be worth disabling Cetos foam on the wave spectrum to see if thats the source.
     
  43. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    I seem to think it was already covered before but is there a way to re order the queue so that billboards are drawn after the ocean? (I'm getting ocean in front of trees)
     
  44. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    You can change the render queue in the shader. I would try and change the tree shader queue if you can but if not then you can tweak the ocean shader.
     
  45. veddycent

    veddycent

    Joined:
    Jul 22, 2013
    Posts:
    79
    Those images look amazing! nice to see some really high quality work, congrats!

    Out of interest what sky system are you using?
     
  46. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    208
    Time of Day (TOD). It is very nice to work with, and you get everything you need in terms of lighting (direct / ambient) and reflection environment. Performance is also very good!
     
  47. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    Hi,
    I worked some more on high waves.
    There is an artifact in the projected grid (I think) where depending on the camera angle the water surface changes. It is hard to see in screenshot. I uploaded a short recording here. You can see like a another layer of water shifting in and out, especially well from 0:15min because my boat goes under water when i change the camera angle.

    https://drive.google.com/file/d/0B_g3hVIuNxkUUDFGX3pfdjRaVWc/view?usp=sharing

    I thought my buoyancy was off somehow because my guinea pig boat was underwater when high waves rolled in, but then I noticed it is only a visual artifact that depends on the camera angle.

    Also two more question:
    + is the foam's appearance/disappearence rate hard-coupled to the wavespeed? I would like to make the foam appear/disappear slower, but have a hard time finding the exact line of code where I could introduce a factor to the time dependence.
    + at long distances away from the camera, the waves flatten out. Can I increase this distance?
     
  48. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    Ok, most of this I get, but how do i get to the built in shaders? I found some "nature" shaders inside the mapmagic folder. But how do I figure out what shader the billboards are using and edit it? I can't click the trees, just the terrain, and can't figure how to breadcrumb back to where these shaders are used or even what to look for. Is there some system folder outside assets i should be looking at?
     
  49. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    That artifact looks like the projected grid border. It should not be visible most of the time but if the waves are very big you can see it sometimes. Try decreasing the choppyness (On the spectrum script) a bit. Maybe 0.6 or 0.4. Its the xz wave displacement that causes the issue and lowering the choppyness when the waves are big may help.

    You might also want to try unticking the tight projection option on the ocean. Not sure if that will help but its worth checking.

    The foam is linked to the waves and used the same time value.
    In the WaveSpectrum script there is function called Generate Foam. In it is this line.

    m_jacobianBuffer.Run(m_conditions[0], time);

    Thats the time value used. You could scale that down a bit...

    m_jacobianBuffer.Run(m_conditions[0], time * 0.5);

    But the foam wont match the wave tips anymore. It may not be that noticeable however.

    The waves do flatten out with distance and I recommend you try and leave it like that if you can. The resolution of the grid becomes to low at a distance to represent the waves and there maybe other artifacts.

    If you do want to change it in the OceanDisplacement.cginc file there is a function called OceanPositionAndDisplacement. Near the bottom there is a fade applied thats based on the camera far plane.

    Im not sure why this is necessary. I didnt think there was a draw order issue with the ocean and the default tree shaders. You might have to change the ocean queue instead in this case but if you make a copy of a default shader and place it in the asset folder Unity should use that one instead of the default one.

    Is this with a speed tree and the opaque ocean prefab by any chance? If it is its a different issue and there is a simple fix. You might have to post a screen shot.
     
    Last edited: Aug 16, 2016
    BlueBudgie1 likes this.
  50. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58