Search Unity

Ceto (Scrawks Ocean)

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

  1. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58
    Unity Version 5.4.0b17, CETO Version 1.1.1


    On CETO 1.1.1 Import
    Code (CSharp):
    1. Assets/Ceto/Scripts/UnderWater/RefractionCommandBase.cs(14,27): error CS0535: `Ceto.RefractionCommandBase' does not implement interface member `Ceto.IRefractionCommand.DisableNormalFadeCmd.set'
    2.  
    3. Assets/Ceto/Scripts/UnderWater/RefractionCommandBase.cs(14,27): error CS0535: `Ceto.RefractionCommandBase' does not implement interface member `Ceto.IRefractionCommand.DisableNormalFadeCmd.get'
    4.  
    5. Assets/Ceto/Scripts/UnderWater/RefractionCommandBase.cs(14,27): error CS0535: `Ceto.RefractionCommandBase' does not implement interface member `Ceto.IRefractionCommand.DisableCopyDepthCmd.set'
    6.  
    7. Assets/Ceto/Scripts/UnderWater/RefractionCommandBase.cs(14,27): error CS0535: `Ceto.RefractionCommandBase' does not implement interface member `Ceto.IRefractionCommand.DisableCopyDepthCmd.get'
    8.  
    9. Assets/Ceto/Scripts/UnderWater/RefractionCommandBase.cs(14,27): error CS0535: `Ceto.RefractionCommandBase' does not implement interface member `Ceto.IRefractionCommand.UpdateCommands()'
    10.  
    11. Assets/Ceto/Scripts/UnderWater/RefractionCommandBase.cs(14,27): error CS0535: `Ceto.RefractionCommandBase' does not implement interface member `Ceto.IRefractionCommand.ClearCommands()'
    I implemented those members to throw exceptions and got this:

    On Play In Editor
    Code (CSharp):
    1. <color=red>Ceto (1.1.1) Error:</color> UnityEngine.UnassignedReferenceException: The variable normalFadeSdr of UnderWater has not been assigned.
    2. You probably need to assign the normalFadeSdr variable of the UnderWater script in the inspector.
    3.   at (wrapper managed-to-native) UnityEngine.Material:Internal_CreateWithShader (UnityEngine.Material,UnityEngine.Shader)
    4.   at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00006] in C:\buildslave\unity\build\artifacts\generated\common\runtime\ShaderBindings.gen.cs:222
    5.   at Ceto.RefractionCommand..ctor (UnityEngine.Camera cam, UnityEngine.Shader copyDepth, UnityEngine.Shader normalFade) [0x0004b] in C:\GRI\FDK-Web_Clean\UnityProject\FDK-Web\Assets\Ceto\Scripts\UnderWater\RefractionCommand.cs:69
    6.   at Ceto.UnderWater.CreateRefractionCommand (UnityEngine.Camera cam, Ceto.DepthData data) [0x00017] in C:\GRI\FDK-Web_Clean\UnityProject\FDK-Web\Assets\Ceto\Scripts\UnderWater\UnderWater.cs:806
    7.   at Ceto.UnderWater.RenderOceanDepth (UnityEngine.GameObject go) [0x0015c] in C:\GRI\FDK-Web_Clean\UnityProject\FDK-Web\Assets\Ceto\Scripts\UnderWater\UnderWater.cs:614
    8. UnityEngine.Debug:Log(Object)
    9. Ceto.Ocean:LogError(String) (at Assets/Ceto/Scripts/Ocean/Ocean.cs:599)
    10. Ceto.UnderWater:RenderOceanDepth(GameObject) (at Assets/Ceto/Scripts/UnderWater/UnderWater.cs:642)
    11. Ceto.Ocean:RenderOceanDepth(GameObject) (at Assets/Ceto/Scripts/Ocean/Ocean.cs:1157)
    12. Ceto.Common.Unity.Utility.NotifyOnEvent:OnEvent() (at Assets/Ceto/Scripts/Common/Unity/NotifyOnEvent.cs:70)
    13. Ceto.Common.Unity.Utility.NotifyOnWillRender:OnWillRenderObject() (at Assets/Ceto/Scripts/Common/Unity/NotifyOnWillRender.cs:22)
     
  2. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    225
    Anyone have experience or Ideas on how to create a Waterspout, Whirlpool, Vortex, etc.?
     
  3. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Theres a shader on the underwater component that has been added. If you have created your own water prefab the shader wont be on it. If your using Cetos prefab then maybe it has not been set when imported for some reason.

    If you delete the under water component from the prefab and add a new one it should work.

    Or you could go into the underwater script and where you see the normalFadeSdr shader remove the 'Hide in inspector' tag to make it public. Then drag the missing shader (the MaskFlippedSdr may also be missing) fro Cetos shader folder on to the slots.

    Also did you delete the ceto folder before importing the new one? Not doing that can cause issues.
     
  4. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    I tried that and it made a dramatic difference, but way too much in the other direction. When it got even close to dark, it went pretty much to pitch black, with a hard transition at the horizon. Adjusting the reflection intensity seemed to have no effect. Tried 0.0 to 2.0.

    Here's the same scene from before at different times of day with that shader line uncommented:

     
    scrawk likes this.
  5. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Here's an FYI for anyone trying to use "Add Shore Mask" with a Gaia-generated terrain. Here are the size and offset values to use with a Gaia terrain with default settings. Took me a bit to figure that out. Also, some of the other settings I thought made for an interesting looking shoreline.

     
    FargleBargle and Stormy102 like this.
  6. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    520
    Hi there!
    I'm trying to create a hover game on the ocean. I have that working, but I need to use physics. That's not a problem... But now I need to move a boat in the water using buoyancy and I can't make the boat work using forces to move it. I think that's an issue with the rigid bodies of each buoyancy object. Any way to simulate that maintaining the buoyancy? I want to use only one script and using physics... Any idea? If it is not possible, how is the way to control a buoyant object realistically with keyboard?
    I checked the boat controller and I found it a bit hard to understand. I'm not too good with those calculations..

    Thanks!
     
  7. brave_mike

    brave_mike

    Joined:
    May 8, 2013
    Posts:
    26
    Hi scrawk,

    thank you - hope there is a solution. :rolleyes:

    But there is another issue - Distingo and Ceto not seem to be the best of friends. :(

    Ceto Ocean_TransparentQueue together with Distingo:

    1. there are no caustics displayed any more
    2. sometimes flicker in the planar reflection

    Can you please have a look?
     
  8. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    I set you a pm about the reflection probe issue. Im not sure if its possible to resolve.

    I will send the Distingo publisher a email and see if I can get a copy.

    EDIT - I also need the Ceto version and Unity version your using.
     
    Last edited: May 16, 2016
    Stormy102 likes this.
  9. brave_mike

    brave_mike

    Joined:
    May 8, 2013
    Posts:
    26

    Distingo:
    If I switch from deferred- to forward-rendering the caustics are rendered correctly (only works with USE_DEPTH_BUFFER). Only the black flickering in the planar-reflection of Ceto is still there. (With BLUR MODE off in the Planar-Reflection of Ceto the flickering is NOT there!)

    Mike

    EDIT:

    I'd have a look into the PlanarReflection.cs - if I comment out the lines 400 - 402


    //if((isHdr||QualitySettings.activeColorSpace==ColorSpace.Linear)&&SystemInfo.SupportsRenderTextureFormat(RenderTextureFormat.ARGBHalf))
    //format=RenderTextureFormat.ARGBHalf;
    // else
    format=RenderTextureFormat.ARGB32;


    the black flickering is gone!:)
     
    Last edited: May 16, 2016
  10. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Thanks. Thats interesting. I will have a look into that.

    The caustics will only work with USE_DEPTH_BUFFER mode at the moment but they should work with deferred and forward.
     
  11. Theekshana-A

    Theekshana-A

    Joined:
    Sep 27, 2014
    Posts:
    81
    Hello does this ocean system also generate the seabed?
     
  12. Danirey

    Danirey

    Joined:
    Apr 3, 2013
    Posts:
    520
    Hey,

    Any clue about my previous post?

    Also, how can i raycast to the surface? Obviouslly if the water has not a collider.. Raycast will not work, but is there a way to aim to a certain point of the surface like you do with raycasts?

    Thanks!
     
  13. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    Getting the following error with 1.1.1 when underwater (Camera stops rendering).

    Invalid pass number (1) for Graphics.Blit. Material=Ceto/UnderWaterPostEffect, npasses=1
    UnityEngine.Graphics:Blit(Texture, RenderTexture, Material, Int32)
    Ceto.UnderWaterPostEffect:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Plugins/Ceto/Scripts/UnderWater/UnderWaterPostEffect.cs:201)
     
  14. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    No, why would I even need to? Just use a terrain.

    I dont know much about physics in Unity so dont have a answer for you. I think the system to move your ship is somethings thats specific to your game and something you need to work out your self.

    For a ray cast just take a line segment and sample at intervals along it using Cetos wave query. When the water height is above the segments y pos then you have hit the water.


    Can you go into Cetos shader folder and click on the UnderwaterPostEffect shader and see if it has a error. If it does can you right click on it and hit reimport. If there no error try clicking on the shader folder and hitting reimport. If that does not work try removing the underwater post effect from the camera and adding a new one.
     
    Danirey likes this.
  15. Theekshana-A

    Theekshana-A

    Joined:
    Sep 27, 2014
    Posts:
    81
    Yeah but how would I manage to make the terrain stretch as much as the ocean
     
  16. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    671
    Ceto just represents the WATER. What you put under it is up to you. Either extend your terrain underwater to form the seabed, or if you want a big ocean with only a relatively small above water terrain, use a mesh to extend the seabed out from the edge of your terrain:

    Mesh_Seabed.jpg
     
    Theekshana-A and scrawk like this.
  17. NightStorm_100

    NightStorm_100

    Joined:
    Aug 28, 2013
    Posts:
    23
    Hi!
    I am very interreseted in this one. I plan to use it in an VR Game. How well does it work with in VR?
     
  18. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Hi. I dont have a VR kit but there are a few people on this thread who do and use Ceto without any major issues.

    You might want to have a look at the posts from kideternal who uses it for VR.
     
  19. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    77
    There's no better ocean available for VR, IMHO. It works great with the integrated Oculus stuff, but OpenVR (using 5.4 betas) currently has problems with the PlanarReflection and Underwater masking. Note: those problems exist in most of Unity's ImageEffects right now in the beta, so it may not be Ceto's fault. I imagine the problem will be fixed one way or another during the next month or two. I'm counting on it.
     
    Last edited: May 19, 2016
  20. dennisrsd

    dennisrsd

    Joined:
    Sep 18, 2013
    Posts:
    10
    He scrawk first of all just bought Ceto and I am loving it.

    Great product, but got a question.

    I want to use it for swimming in a big open ocean, I have a lot of things I need to figure out but I just start at the beginning.

    I want to change the sound when someone goes under water. Can I use the wave query to do this or do you have a better way to handle this.


    P.S: A side question are there any plans for underwater sun rays? Just a question I am curious about.

    Anyway love the product keep op the good work.

    Kind regards,

    Dennis

    UPDATE

    the following script from Danirey helped me alot

    Code (CSharp):
    1. float seaHeight = Ocean.Instance.QueryWaves(transform.position.x, transform.position.z);
    2.         if (transform.position.y < seaHeight && !enteredWater)
    3.         {
    4.             enteredWater = true;
    5.             //var splash = Instantiate(waterCollisionFX, transform.position, Quaternion.identity) as GameObject;
    6.             //Destroy(splash, 5f);
    7.             splash.enableEmission = true;
    8.         }
     
    Last edited: May 19, 2016
    Danirey likes this.
  21. olavrv

    olavrv

    Joined:
    May 26, 2015
    Posts:
    212
    We use Ceto in our VR projects for Rolls-Royce, and it works flawlessly. The only issue we encountered was some aliasing issues, but the developer was helpful to enable som script features to solve this.

    Ceto: Perhaps you could add a toggle button in the editor to enable/disable derivative sampling / slope smoothing? (just add a *note in editor regarding platforms where this can be an issue)
     
  22. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Im counting on it to but I am expecting a lot of issues with Unity 5.4 when it comes out. Every Beta version I have tried has broken Ceto in some way.

    Hi, Thanks.

    Yes, use Cetos queries for this. Danirey's script is exactly the way to do it.

    Underwater god rays are planned but not sure when atm.

    Unfortunately adding a toggle for a shader option requires using a shader keyword. I would really prefer to only use them for options its very common for people to toggle in a application.
     
    Danirey likes this.
  23. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    There is a foam overlay blend mode added in the latest version to fix this. Its on the ocean component. Set it to max and it should stop the overlays from adding up too much. Having it on may make the foam less bright compared to the other setting so you may need to go to the foam trail script and increase the alpha to make the foam more visible.
     
  24. Leng

    Leng

    Joined:
    Jun 21, 2014
    Posts:
    2
    I'm trying to use Ceto in my project and it looks fantastic.
    But I need some help.
    After I click the Play button, and drag the camera to a high position , I can see the edge of the ocean in the Game window.
    (though, the ocean looks infinitely in the Scene window)

    What should I to make it looks infinitely whatever the height of camera is?
     
  25. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    Have you set your camera far clip value to a large value, I'm using 500,000 for mine as I need a far horizon from height.
    Though you would probably get away with a lot less
     
    Last edited: May 21, 2016
  26. Leng

    Leng

    Joined:
    Jun 21, 2014
    Posts:
    2
    You are awesome! That helps me a lot.
    Thank you^^
     
  27. nikopol

    nikopol

    Joined:
    Jul 20, 2013
    Posts:
    3
    Hi,

    i'm in the process of changing from our in-house ocean shaders and simulators some external one (time is scarce), and I got to two: Ceto (i'm a follower of scrawkblog), and PlayWater

    I'm inclined for Ceto, but would need to replace your buoyancy scripts (hint from version.txt comment) with our own as we already have those in good shape (for us).

    Questions: are those buoyancy script in Ceto decoupled from the ocean (are they are "clients"?) From other comments, there are methods to get the height of water from some 2d coordinate (as we have in our own implementation). Appart from the GetHeight(x,y), is there any GetVelocity(x,y)? This is importante for us when we are working with a light objects on the surface. The waves should move the object horizontally as well. If not directly as a function, do you think there is already enough information on the ocean engine to construct that method?
     
  28. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Hi,

    The buoyancy scripts are decoupled from the ocean if you mean you can remove/replace them with no problems.

    Ceto has a get height method that you can use.

    Code (CSharp):
    1.  
    2. float waveHeight = Ceto.Ocean.Instance.QueryWaves(x, z);
    3.  
    There is no get velocity but there is a get normal which you should be able to use.

    Code (CSharp):
    1.  
    2. Vector3 normal = Ceto.Ocean.Instance.QueryNormal(x, z);
    3.  
    This normal is not quite the same as the one used for rendering (its just a estimate) but it should be fine for velocity.

    There is also a lot of other info that can be retried from a query object. There is also the amount of x/z displacement that could also be used for the velocity.

    Code (CSharp):
    1.  
    2. WaveQuery query = new WaveQuery(x, z);
    3.  
    4. Ceto.Ocean.Instance.QueryWaves(query);
    5.  
    6. float height = query.height; //wave height.
    7. float dx = query.displacementX; //amount of wave displacement on x axis.
    8. float dz = query.displacementZ; //amount of wave displacement on z axis.
    9. bool isclipped = query.isClipped; //Is there a hole clipped in the ocean here.
    10.  
    11.  
     
  29. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    Just got MapMagic on the sale yesterday.. any thoughts on the ramifications of this infinite terrain and how to get a shoreline in Ceto? I know there's a generate shore mask script, but your docs say "to be completed".. but I thought I'd pick your brain in regard to how it would be done when the terrain is generated.

    That being said, my world area is going to be a 6x6 terrain area, so I have a height map raw, but it spans the full 6x6 area. Do I need to chop it up into squares? Also modifying terrain with erosion, noise etc will change it past the original height map. Or maybe I need to but the map magic guy to generate a shore mask? (he might already do it behind the scenes as there is a shore component that takes water level.

    Sorry if this post is more me "talking to myself" than specifically a question. =)
     
  30. nikopol

    nikopol

    Joined:
    Jul 20, 2013
    Posts:
    3

    Thanks for the answers, scrawk, that is just what I needed, and you just got yourself another client!
     
    scrawk likes this.
  31. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    There is a editor tool in Ceto to generate the shore mask from a terrain. I just need to update the manual.

    If you go to Window->Ceto you should see it. You just need to drag on the terrain and choose your settings and hit generate. Then you can add Cetos AddShoreMask script to your terrain and add the masks that where generated.

    Obviously if you modify the terrain the masks will need to be regenerated but if its just a small change it might not be noticeable.

    It should work with 6x6 terrains but each terrain will need its own script and masks. Not sure how well the mask will fit together. It might be obviously where they join. Theres probably not much I can do about that though.

    Infinite terrain will be a issue. You would have to generate the masks as the terrains are created in game. That would be something you would need to script.
     
  32. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    Still can't get the shore mask to function. So strange.

    Your "Auto Add Shore Mask" actually works. But the regular one will not work for me. I set ocean height, generate the images, assign them, but it does nothing.
     
  33. Steve-Tack

    Steve-Tack

    Joined:
    Mar 12, 2013
    Posts:
    1,240
    Post your settings. Like, what do you have your width, height, and offset set to?

    Further up on this same page I posted the settings that work for a default Gaia terrain, if that helps:
    http://forum.unity3d.com/threads/ceto-scrawks-ocean.323545/page-32#post-2634328
     
  34. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Im sure its something minor but its a bit hard to tell without seeing it. If you make one small terrain and add the mask and send me the project I can check to see what the issue is.
     
    Last edited: May 27, 2016
  35. AdamThacker

    AdamThacker

    Joined:
    Jun 1, 2016
    Posts:
    6
    Hi Scrawk,

    We are using overlays extensively and it looks like there is a bug with the Normal Overlays in that if the overlay has a rotation in it, the normals read from the overlay texture are not transformed by it (e.g. if the normal is (X = 1, Y = 0, Z = 0) and the overlay has a rotation of 180 degrees, I'd expect the normal to be changed to (X = -1, Y = 0, Z = 0)).

    Cheers
     
  36. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Thanks. I think your right. Its just the texture thats being rotated while it should also be the normals direction that gets rotated as well.

    I will have a look into it.
     
  37. jammer42777

    jammer42777

    Joined:
    Apr 21, 2014
    Posts:
    87
    hello, I know this is a noob question.
    I just started using Alloy for unity. It uses its own brdf. (They said a disney brdf specifically)
    I am wondering if the ocean system (as it does also use it's own custom brdf - and it does look amazing) will work alongside the Alloy shaders.

    This is the issue as pointed out by the developer
    Unfortunately, this is an area where we have trouble integrating third party shaders as they tend to either write their own shader framework or use a custom lighting model. So unless they are deferred compatible, or use the Standard or StandardSpecular lighting models, they can't be integrated cleanly with Alloy.

    If there are any insights please let me know!
    --Joshua
     
  38. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Hi

    Cetos shader will not work with alloy since they don't use deferred or used the standard shader model. Render something as complicated as a ocean with all the features people want means it's pretty much impossible unless you write custom shaders.

    EDIT - Just to clarify, they can be used in the same project its just that Ceto will not use Alloys lighting model.
     
    Last edited: Jun 2, 2016
  39. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    Ceto and Alloy can be used together though. Ceto runs using its own shader and everything else can use alloy as it's shader.
    Reflections from alloy based game objects etc work fine on Cetos ocean surface.
    Belive CaptainMurphy uses Alloy in his game with Ceto. I'm also using it Alloy core shaders on my ship models with Ceto with no issues.
     
    jammer42777 and scrawk like this.
  40. dienat

    dienat

    Joined:
    May 27, 2016
    Posts:
    399
    I am using AddAutoShoreMask script in my unity terrain, which is flat in the borders, and i see in the borders of the terrain water distorsions, how can i solve this? This also happens when i use AddShoreMask using your export tool , i see that the exported images follow the island shape, discarding the flat parts that are in the borders but i still see the distorsion in the same place. I set the width and length to the terrain widht and length.
     
  41. jammer42777

    jammer42777

    Joined:
    Apr 21, 2014
    Posts:
    87
    Thank you!
    yes I would want ceto for the water and alloy for other objects in the scene.
    Thank yoU!
     
  42. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    scrawk and FargleBargle like this.
  43. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    671
    I've just tried this out, and it works great. My only quibble is that I still need to manually set the sea level afterwards. Gaia likes to put the base of the terrain at a height of 0, meaning that any water needs to be somewhere above that, while Ceto defaults to a sea level of 0. It would be nice if the GX extension addressed this by querying the Gaia Session Manager, and setting the Ceto "Level" to match Gaia's "Sea Level" setting. I don't know how difficult this would be to implement, but it would truly make adding Ceto to a Gaia scene a one click operation. Either way though, this is a great addition to both products. Thanks. :)
     
  44. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    77
    @scrawk So, I started looking a little more into PlanarReflection and Underwater using OpenVR, and found this thread: http://forum.unity3d.com/threads/5-4-beta15-reflection-rendering-wrong-in-openvr-htc-vive.398756/

    I have a feeling Ceto will need to be modified to do something similar to get it to work with Vive. Unity still lists "Native SteamVR Integration" on their Roadmap (https://unity3d.com/unity/roadmap) as "On Track", but given their 5.4 final release is this month, I think what we've got now is all we're going to get as far as "native integration" goes.

    I started looking at the Ceto reflection code and it doesn't seem too difficult to modify per that thread above, but it's over my head exactly how to do so without losing a week of dev time. So, I'm hoping you can find time to do it. Pretty please?

    Oh, and after having lived with both the Rift and Vive for a month, I can say with certainty that the Vive is by far the better headset. Room-scale Vive is just an order of magnitude better than seated Rift. (My Rift hasn't been touched in weeks!) Plus, I saw today that Oculus still hasn't caught-up to shipping those Rifts purchased during the first day it went on sale, while Vive is shipping within a day or two. It costs more, but includes more, and is worth every penny.
     
  45. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    Never thought of that will look into setting it up to match sea level of Gaia on setup.
     
    FargleBargle likes this.
  46. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    The masks are based of the terrain height so if the edges of the terrain
    are quite shallow they can still affect the mask leaving a visible border.

    There is a height spread setting. Lowering this can help remove this issue.

    If your terrain is quite shallow then the problem may still persist.
    If so you can open the masks created from the export tool in photoshop
    and manually remove the white areas from the edges of the mask.

    It would also help if your terrain slopes away deeper around the edges
    if thats possible.

    I had a look at that thread. It all sounds very hacky to me. I will have a look into the issues but I am not really sure how fixable its is at the moment. I still need to look at setting up a VR sdk in Unity and maybe getting a Vive. I will try and sort that out this month.
     
  47. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    77
    @scrawk QueryWavesAsync() doesn't seem to return anything but zeroes:

    Code (CSharp):
    1. using Ceto;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class Buoyancy : MonoBehaviour {
    6.  
    7.     void Update() {
    8.         WaveQuery[] querys = new WaveQuery[1];
    9.         querys[0] = new WaveQuery(transform.position.x, transform.position.z);
    10.         Ocean.Instance.QueryWavesAsync(querys, CallBack);
    11.     }
    12.  
    13.     void CallBack(IEnumerable<WaveQuery> querys) {
    14.         foreach (WaveQuery query in querys) {
    15.             float height = query.result.height;
    16.             print(height);
    17.         }
    18.     }
    19. }
    20.  
    ... just prints nothing but zeroes.

    (I've been up all night, but can't see where I'm doing anything wrong?)
     
  48. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,113
    Quick video of Ceto running across the network with Photon Bolt.

     
    Weezel, hopeful and Bartolomeus755 like this.
  49. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    765
    Yes your right. Looks like its not working. Must have got broken a few updates ago. That function has been neglected because I never did work out a way of getting it to work with the overlays. I was even going to remove it at one point.

    I will try and have it fixed for next update. Will try and improve it a bit as well. It will have a big memory allocation at the moment.

    I have no idea what I just saw but I am impressed!
     
  50. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    77
    I only started looking into it because I'm making ~20 individual get-height calls, which gets a little expensive. I stagger most of them so they don't fire every frame, but if batching them via Async reduces overhead, I'm all for using it. If the difference is negligible, you may want to make it a "low priority" feature or even remove it. The memory overhead isn't a big deal as long as the garbage-collector doesn't get called and spike framerate.

    (FYI, I can't use rigidbody/physics buoyancy on my ship because it's a complex model with a lot of mesh colliders, plus it causes all sorts of issues if you're walking-around on it.)

    Thanks!
     
unityunity