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. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    Thank scrawk, that helped. Also reducing the clipping planes far of the camera helped with the artifact (it was on 20000), as well as increasing the grid resolution.
    I just set the fade to 1 in the cginc. So far no artifacts or issues. It looks more realistic with waves not flattening out.
     
    John-G likes this.
  2. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Ahh, ok. My bad it is a Ceto issue.

    I thought it was from the leaf billboards in the tree mesh but its the actual tree billboards which I did not realize are in a different queue.

    Painting the trees on the terrain reproduces the issue which I had not checked before. I had just been placing a few trees to check they work.

    So you need to open the Ceto/Shader/OceanTopSide_Transparent shader and you will see this in the tag

    "Queue"="Transparent-1"

    It needs to be...

    "Queue"="Transparent-101"

    You then need to open the Ceto/Shader/OceanUnderSide_Transparent shader and change its queue to this. The under side should be drawn before the top.

    "Queue"="Transparent-102"

    I had a look at the default tree billboard shader Unity uses and it had the queue as Transparent-100 so as long as the ocean is before this it will be drawn first. The billboard shader does not write to the depth buffer so the ocean will just draw right over it if its drawn after.
     
    clickmatch likes this.
  3. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    Hooray I'm not crazy! Thanks man. I'll try this today.
     
  4. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    *checks a bug off his list*

    Thanks Scrawk
     
  5. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    41
    Hey Scrawk,

    I need to make a compound elevation mask for the water layer to affect an irregular shaped area, when I lay these out... if they touch they freak out. Is there a way to have these not fight, but simply use the average (height texture alpha) setting.

    Thanks :)
     
  6. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    The default blend mode for the overlays is additive so where they overlap they get added together.

    If you look on the ocean component there is a height overlay blend mode setting. Changing it from additive to max should fix the issue.
     
  7. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    Hi Scrawk, me again. I am running into some sort of height cap for waves. The wind speed is 30 and most waves pass below the cap, but the big swells get capped. Can you point me to the cap variable/setting? (deleted pics with cap to keep post small)
    Otherwise really great asset! Riding high waves with dynamic buoyancy works great!
    really happy with the waves :)
     
    Last edited: Aug 23, 2016
  8. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    I'm getting an error on ps4, any idea on how to fix it?

    ExecutionEngineException: Attempting to JIT compile method 'System.Collections.Generic.LinkedList`1<System.Collections.Generic.KeyValuePair`2<Ceto.WaveSpectrumConditionKey, Ceto.WaveSpectrumCondition>>:.ctor ()' while running with --aot-only.
    at Ceto.Common.Containers.Queues.DictionaryQueue`2[Ceto.WaveSpectrumConditionKey,Ceto.WaveSpectrumCondition]..ctor () [0x00000] in <filename unknown>:0
    at Ceto.WaveSpectrum..ctor () [0x00000] in <filename unknown>:0
     
  9. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    There is a max wave height thats hard coded. Anything larger than that gets clamped. Its so the projected grid know what the largest waves it will have to deal with would be.

    You can just increase the limit. In the Ocean script there is this property on line 75

    public const float MAX_SPECTRUM_WAVE_HEIGHT = 40.0f;

    Just increase that a bit. I would try and keep it as low as you can with out getting any clamping. Maybe try 50.

    In the WaveSpectrum script I use a custom container called a dictionary queue for the m_conditionCache property.

    Theres something that PS4 does not like about the way I used a linked list but Im not sure what it is.

    If you email the support ( cetosupport@digital-dust.com ) I can send you a version of that script that does not use that feature as its optional any way. You will need to let me know what Ceto version you have.
     
    BlueBudgie1 and hopeful like this.
  10. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Just want to mention that Ceto is currently on sale for $49 during the Asset store madness sale.
     
  11. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    In this sample from my code if I comment out the dummy part of the code I'll receive the JIT error as well. So it's possible all you need to add is the dummy part.

    Code (csharp):
    1.  
    2. #if UNITY_EDITOR
    3. using UnityEditor;
    4. #endif
    5.  
    6. using System.Reflection;
    7.  
    8. namespace Goon
    9. {
    10.    public static class GoonUtility
    11.    {
    12.      // Clears the debug console
    13.      public static void ClearLog()
    14.      {
    15.        UnityEngine.Debug.ClearDeveloperConsole();
    16.      }
    17.  
    18.   public static void Dummy()
    19.   {
    20.   System.Collections.Generic.List<IntVector2> dummy01;
    21.   }
    22.   }
    23.  
    24.    [System.Serializable]
    25.    public struct IntVector2
    26.    {
    27.      public int x;
    28.      public int y;
    29.  
    30.      public int col
    31.      {
    32.        get { return x; }
    33.        set { x = value; }
    34.      }
    35.  
    36.      public int row
    37.      {
    38.        get { return y; }
    39.        set { y = value; }
    40.      }
    41.  
    42.      public IntVector2(int _x = 0, int _y = 0)
    43.      {
    44.        x = _x;
    45.        y = _y;
    46.      }
    47.  
    48.      public IntVector2(IntVector2 _other)
    49.      {
    50.        x = _other.x;
    51.        y = _other.y;
    52.      }
    53.  
    54.      public static bool operator ==(IntVector2 lhs, IntVector2 rhs)
    55.      {
    56.        return ((lhs.x == rhs.x) && (lhs.y == rhs.y));
    57.      }
    58.  
    59.      public static bool operator !=(IntVector2 lhs, IntVector2 rhs)
    60.      {
    61.        return !(lhs == rhs);
    62.      }
    63.    }
    64. }
    65.  
     
    scrawk likes this.
  12. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    I'm having a second weird issue when i unload my level and come back in. The water gets totally messed up for some reason. Any idea on what's happening? I don't have any error messages.
    http://imgur.com/a/PijgJ
     
  13. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Not sure about that. It looks like the FFT is getting messed up but not sure why.
     
    Last edited: Aug 25, 2016
  14. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Thinking about this it is similar to a issue some people where getting when they minimized the window in the editor.

    Unity would screw up the FFT textures for some reason. When the issue occurs for you try changing the Fourier size on the WaveSpectrum script. This will force Ceto to recreate the textures.

    The other issue was only happening in the editor so might be worth checking the build as well. It might not happen there.

    Knowing your Unity and Ceto version and your GPU model would also help.
     
  15. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Is this ocean system ready to be used for Lakes (thus many small planes instead of one big plane)?
     
  16. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    41
    Hi Scrawk,

    I'm having a reflection offset issue when I change the height of the grid with an height overlay. Any way I can (at the same time) alter a setting to make sure the reflections line up to the new height?

    Let me know if you require a screen.

    Thanks :)

    Gian, I still think we are limited to one projected water plane. You can however offset that height using a texture to raise certain parts of that grid slightly higher/lower than the main level. Scrawk may have plans for other things - lets see what he says :)
     
  17. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    You can only have the one ocean plane so wont be good for lakes on less they are the same level as the ocean. No plans to add in support for this at the moment.

    Theres not much you can do about this.

    The reflection plane is always presumed to be the same as the ocean plane so any displaced surface wont have correct reflections. Once the waves get big or you push up the surface with a overlay you will encounter this issue.

    Since the displaced area is still part of the same mesh it has to use the same reflections.
     
    gian-reto-alig likes this.
  18. wightwhale

    wightwhale

    Joined:
    Jul 28, 2011
    Posts:
    390
    I'm using unity 5.4.0f3 and this only happens on the PS4 when I quit my scene and then re-enter it. I tried the following but the issue still occurs.

    Code (csharp):
    1.  
    2.   FindObjectOfType<WaveSpectrum>().fourierSize = FOURIER_SIZE.LOW_32_GPU;
    3.   FindObjectOfType<WaveSpectrum>().enabled = false;
    4.   yield return new WaitForEndOfFrame();
    5.   FindObjectOfType<WaveSpectrum>().enabled = true;
    6.  
    Is there another way to clear out ceto or does some game object persist that I need to cleanup?
     
  19. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Everything should be destroyed when the scene is quite and recreated when loaded again so Im not sure what is causing this. Its probably one of the textures it in the spectrum causing the issue but dont know why.

    If its only happening on the PS4 I dont think its something I would be able to fix as I dont have a PS4 developers license.

    Sorry but the best I can do is offer you a refund.
     
  20. freakbyte

    freakbyte

    Joined:
    Oct 30, 2014
    Posts:
    3
    Is there any way to smooth out the horizon with the transparent prefab?
    Maybe i'm doing something terribly wrong, but the horizon in the opaque prefab does not look like this.


    Thanks a bunch! :)
     
  21. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Are you using some sort of atmospheric scatter script from a sky asset on the camera?

    If so it wont be applied to the transparent ocean as transparent objects get rendered after the effect is applied.

    You will have to stick with the opaque queue ocean if this is the case.
     
  22. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    899
    The documentation on the store page says "Officially supported platforms: PC, OSX, WebGL, VR". Is there a VR demo? I'm curious in regards of performance.
     
  23. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    I use the global fog in the Lighting Window (Windows Tab -> Lighting -> Fog). That fog affects the transparent ocean as well and I can fade the ocean out in the distance really well. I am on Unity 5.3.5.
    That could be updated in the documentation. I think it is quite new (not sure).
     
    John-G likes this.
  24. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    I dont have a VR demo sorry.

    There are few people on the thread using Ceto for VR and they seem to be happy with performance.
     
  25. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I've been using Ceto with VR very recently, along with Truesky in the same scene and some costly effects like AA and bloom and it all runs really well and looks beautiful
     
    scrawk likes this.
  26. freakbyte

    freakbyte

    Joined:
    Oct 30, 2014
    Posts:
    3
    Thanks for the help both of you :) Turns out it's the fog that's causing it, it affects the water but not the skybox.

    Looks much better without it:
     
    scrawk likes this.
  27. long_GUNDAM

    long_GUNDAM

    Joined:
    Mar 9, 2016
    Posts:
    4
    Excuse me,new Ceto Manual don't download.
     
  28. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Im going to take a guess that your in China?

    If you are then the hosting site I use (The Box) is blocked in china so your wont be able to download it. Iv never seen the error you get but I am told it says something like the link is not available.

    If you contact the Ceto support (you will need to provide your order number) I can send you a copy.

    cetosupport@digital-dust.com
     
  29. ronjart

    ronjart

    Joined:
    May 16, 2013
    Posts:
    94
    I'm also using this asset successfully in VR. It does not seem to work in single pass stereo mode. Am I missing something or is that feature not supported?

    Thanks!
     
  30. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Hi,

    Ceto does not work in single pass stero mode. As far as I can tell complicated image effects that rely on the depth buffer dont work with this mode in Unity. Basically the issue is that some things need info for each eye but in single pass this info no longer exists.
     
  31. _alphaBeta_

    _alphaBeta_

    Joined:
    Aug 8, 2014
    Posts:
    37
    This is probably a dumb question, but I've just updated to Unity 5.4.0f3 with Ceto 1.1.3 and I have a dark, almost oil slick looking ocean. Seems like everything is working fine, just the color is quite off from what is was coming from Unity 5.3.5f1. I can't seem to get back to the previous blue state which I was quite happy with. Even previously, I've always been using the default color scheme. Issue persists with a brand new scene and pulling in either prefab right out of the box. I also tried a complete re-import of Ceto. Any ideas?
     
  32. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Unity have change something in 5.4 and it makes the ocean color darker but I dont know what they changed.

    You can change some of Cetos settings to get it look how its was .

    On the Underwater component...

    Change the Above refraction intensity from 0.5 to 1.0.

    Change the Above Inscatter Modifier color from 5,25,43 to 7,51,77

    If you had already changed either of those values just double what you have.
     
  33. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    Hi,

    I am looking into workarounds to get particles working under water. The second camera + layering works, but with the big disadvantage that particles are rendered always in front of everything else.

    I looked into materials/shader that write to z-buffer and are transparent. Idea is to wrap invisible cubes made from this shader/material around my submarine and give the particles some depth value to render against. Cubes would be transparent/invisible and only provide a depth buffer.

    This page here describes how to render to depth buffer for transparent materials, but when I use the shader on cubes under water, the particles still do not appear even though there should be a depth values behind them now. Am I doing something stupid wrong?
    https://docs.unity3d.com/Manual/SL-CullAndDepth.html

    Shader "Transparent/Diffuse ZWrite" {
    Properties {
    _Color ("Main Color", Color) = (1,1,1,1)
    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
    }
    SubShader {
    Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    LOD 200

    // extra pass that renders to depth buffer only
    Pass {
    ZWrite On
    ColorMask 0
    }

    // paste in forward rendering passes from Transparent/Diffuse
    UsePass "Transparent/Diffuse/FORWARD"
    }
    Fallback "Transparent/VertexLit"
    }


    What also puzzles me is that the underwater particles render when I look up to the under water ocean surface, even though the under water ocean surface also seems to be transparent and should not provide a depth value to render against...?
     
    Last edited: Sep 7, 2016
  34. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Your particles with the second camera should still be depth tested. You dont have the second camera clear mode to 'Clear Depth' do You? Should be dont clear.

    The post effect knows what the oceans depth value is even though its transparent because it gets it from a separate texture the ocean renders into.
     
    Last edited: Sep 8, 2016
  35. _alphaBeta_

    _alphaBeta_

    Joined:
    Aug 8, 2014
    Posts:
    37
    Much thanks! I just couldn't seem to nail down what to change. I was also starting to doubt my current scenes from after the Unity upgrade, so I appreciate the confirmation on the color change.
     
  36. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    That did not come across well. I do not want to use the second camera at all, because putting underwater cliffs etc in other layers is not working. And without that, the particles are always rendered in front of the cliff and anything else.
    I want to render the particles with the main camera and work around the issue that they do not write to depth buffer by wrapping cubes around my submarine. (underwater fog uses depth of objects behind particles, like described in your manual). Those cubes are supposed to be invisible, but still render to depth buffer. Therefore the shader above. Or should they render to the ocean depth texture? I do not know how to do this.
     
  37. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Ok, I see.

    So basically the depth texture the underwater post effect uses is copied from the depth buffer using a command on the camera (its Cetos RefractionCommand script in the Underwater folder that handles this) if the depth mode is set to USE_DEPTH_BUFFER.

    This gets copied at the end of the opaque queue and your transparent objects write to the depth buffer after this happens. Thats why they are not in it.

    Even if you got it to work I dont know if this will look good as the post effect will apply the effect to the cubes depths also and the outline maybe very noticeable.

    The other mode (USE_OCEAN_DEPTH_PASS) uses a replacement shader so having your cubes layer in the depth mask will render them into it and will do what you want but your cubes render type in the shader must not be transparent. The ocean depth pass will ignore transparent objects since they dont normally write to the depth buffer.

    I think the best way for you to do this is use your own replacement shader to manually render your objects depth value into a texture (Like how Cetos Ocean Depth replacement shader works) from a script.

    You can then control exactly when and what gets written. That way you can still have the ocean depth mode to USE_DEPTH_BUFFER which will be cheaper.

    You can then manually add you objects depth value into the depth used by the underwater post effect same way the ocean is added (ie use min) or maybe have a second version of the post effect run to just add the particles the way your want them to draw.
     
  38. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    4,251
    While not directly related to Ceto, I hope it's still of interest. Here is a video from the Sea of Thieves developers, talking a little bit about their water solution. Maybe it's good for a little inspiration :)

     
    scrawk likes this.
  39. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    hmm, I will probably try in that order the next days:

    1. Move underwater depth texture after transparent queue instead of opaque. See if there are artifacts from the invisible cubes and how much of a fight they put up.
    2. Try USE_OCEAN_DEPTH_PASS with the above transparent z-write shader on the cubes to not have the cubes ignored.
    3. new replacement shader like you describe in the second half of your post. Though I am quite new to Unity, so this is hard for me right now.

    I got all high wave artifacts and issues worked around and solved. The underwater particle issue is the last obstacle left and it is quite a tough one!
     
  40. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    I like the furniture! There is a small room left in the apartment that I could 'redesign' and put my development machine in while doing the ocean work ...
     
  41. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    You wont be able to move when depth buffer gets copied to after the transparent queue. The ocean also needs those depths so it needs to get copied by the ocean is drawn.

    If you just change you cube objects shader render type to opaque the will show up in the depth pass. Just enable there layer on the depth mask and disable it on the main camera.

    This will be hard but will be the most flexible method.
     
  42. Kemonono

    Kemonono

    Joined:
    Nov 7, 2013
    Posts:
    303
    Hi,

    I was wondering if there is any chance of negative volumes, for open boats etc.
     
  43. BlueBudgie1

    BlueBudgie1

    Joined:
    Apr 14, 2016
    Posts:
    47
    I tried the solution in point 2 above to get transparent particles to work properly under water and it works, but the approach itself to render some invisible cubes behind the particles to give the underwater fog a depth for them is flawed. The moment when the particle jumps from a cliff to the cube backdrop, the change in fade out is sudden. That's not working.

    How about using a shader similar to the OceanUnderWater_Transparent (the under water ocean surface material)? That one is transparent when you look up under water and reacts to fog. Would a shader with similar properties also work for particles underwater (or any transparent scene object like a underwater glass dome)?
     
  44. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    You will have to use a depth mask shader to do this.

    The only reason the ocean underside works is that the effect shader knows its depth value. If you can get the depth value of your particle then you could do the same thing. This would require you use a replacement shader to render it into a texture.

    This would be harder as your particles would be alpha blended so you will also to store the alpha and some how blend them in the post effect.

    I know you said the second camera option is not working for you but it might be easier to try and fix that then try and do this.

    Only other option is to use a particle shader that is alpha tested (like grass billboards) instead of blended so it can run in the opaque queue. I think alpha tested particles wont look great but if the ocean fog covers them a bit it maybe ok.
     
    Kemonono likes this.
  45. jzq740176597

    jzq740176597

    Joined:
    Jul 31, 2015
    Posts:
    13
    @scrawk
    Hello! I just wander whether the boat wakes finished(which version if so?) Ceto Ocean systems?
     
  46. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Hi,

    There are no plans for any more updates to Ceto at the moment.
     
  47. mak3r76

    mak3r76

    Joined:
    Sep 14, 2016
    Posts:
    18
    Hi, I´m looking forward to use this asset with the realistic water physics, which works very well with the Ceto asset. But I´m asking myself if it´s also works well in the VR mode?! Are there any experiences?
     
  48. rgrlee71

    rgrlee71

    Joined:
    Sep 11, 2012
    Posts:
    31
    I did a quick test awhile back with the Rift and the OVR setup from Unity and it all worked fine with Ceto.
     
  49. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    I am just letting everyone know that I will be on a over seas holiday for the next 4 weeks and during that time I wont be checking the forums or replying to support emails.

    I might try and check in after two weeks but not sure if I will have the time so cant guarantee it.

    I will reply to any questions when I get back on the 19th of October.
     
  50. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    Have a great trip, you deserve a break, thanks for all the support.
     
    scrawk likes this.