Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Ceto (Scrawks Ocean)

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

  1. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804

    I will have a look at the 1st person controller issue. Maybe it wasnt what I thought it was.

    Im not sure why your object is sinking. The code looks fine. Have a look at the StickToSurface script in Ceto.
    It Just makes a object stick to the surface of the water. If that works (its used in the demo scene) then Cetos height queries are working fine. There's not a ridged body attached to your object thats is being pulled down by gravity?
     
  2. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    The mesh used for Ceto isnt a tiled grid. It uses a projected grid. Im not very familiar with Water4Advanced but it definitely would not use a projected grid.

    Im not really sure what your requirements are.

    If TerrainEngine takes the water mesh and creates voxels from it then its not going to work with Ceto.

    Im not sure what the refund policy is on the asset store but if you buy it and its not for you I wont mind if you ask for a refund.
     
    Tethys, Beennn and kideternal like this.
  3. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    I am pretty inept at shader programming, but I can't help but wonder if there's a way to set up the underwater blur so that distance is blurry, but close up is clear. Is that a possible thing or does it lead to low fps/other issues?
     
  4. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    Yes, it was the rigidbody, good call. Thanks!
     
  5. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    82
    @scrawk Since the version on the asset store (1.0.6) is already 2 weeks old, and you've made some improvements to resource usage and whatnot, do you think you'll have a new version posted soon?

    I'm hoping to release my project tomorrow, so those changes might be nice to have if they're stable.
     
  6. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    *Purchased* Congratulations scrawk!
     
  7. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    @clickmatch blur by distance is a good idea and I was thinking of adding it as a option. It's a little more expensive but is still practical.

    @kideternal the original submission version was version was 1.0.5. I resubmitted the latest stuff the other day.

    The latest version has fixed the crash issue and has the optimisations I mentioned.

    @sadicus thanks!
     
  8. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    I'm not sure why FPS has dropped. (testing the DemoScene)
    Is it normal to have lower frame rates testing game mode in Unity (5fps), than the beta build (20fps)?
     
  9. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    If you get 20fps in beta build and 5fps in the demo scene that's not normal.

    If anything the demo scene should be faster and the latest version has some optimization not in the builds.

    Can you have a look in the profiler to see what is taking the most time?

    Can you disable everything but the camera and ocean and see what the frame rates like.

    Also set the mesh resolution on the projected grid component to low, set the Fourier size to 32 and disable the foam on the spectrum component and set the underwater mode to above only on the underwater component to see what effect that has on frame rate.

    EDIT - oh, and also put the blur mode on the reflection script and the underwaterPostEffct script (on camera) to off. Thats the only major feature added since those builds where released.

    It could be slow on some systems that are fill rate bound.
     
    Last edited: Oct 17, 2015
  10. Dazza007

    Dazza007

    Joined:
    Feb 11, 2014
    Posts:
    9
    I think the issue here is you say 'testing game in unity' - if you are running anything within the editor then it will be substantially slower. (At least I think thats what you meant)
     
  11. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,119
    Really having fun with Ceto, just got buoyancy working with a floatplane.
    That one was trickier to get working than I expected. Bit of tinkering yet to get the bounciness out of it.

     
  12. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Congratulation for the release! Will buy once the buoyancy system is integrated.

    Regards
     
  13. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Fantastic work you did on this John look great.

    Regards
     
  14. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    @Dazza007 Thanks for the feedback, good point indeed. It's not just FPS (it's around 20 on my laptop)
    New Project> Ceto that's it.
    Nothing else is running within the editor.
     
  15. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    It has a base buoyancy you can use which has a couple of simple methods built into it. Honestly you will end up using your own because no single solution will cover all of the usage scenarios. I have built and rebuilt at least 5 different types for our game and I can bet that the one we are using now will not survive to release. What Ceto does give you is a VERY fast method of getting the water height at a position so you can built almost any buoyancy system using it.
     
  16. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    82
    @scrawk I have a crashing bug for you:

    1) Add second camera that can view the Ocean in a disabled state.
    2) Run.
    3) Enable the second camera.
    4) Disable the second camera.

    Result: Silent crash to desktop.

    Workaround: Set the second camera's cullingMask to NOT view the Ocean's layer prior to enabling. If you need to disable the camera, remove the Ocean layer from the cullingMask first. (I've got a "yield return null" between setting the mask and enable/disable for good measure.)
     
  17. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Ok. Thanks.

    Im not getting the crash but I will look into it and see what I can do.

    Was that test in the Ceto demo scene?

    What the model of you GPU?
     
    sjm-tech likes this.
  18. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    Ceto is working as expected once nvidia> Program settings> Preferred graphics processor = Unity 3D
    yes this sounds foolish on my part, however Global settings were set to "Auto" but the NVIDIA GPU Activity icon = ON
    The NVIDIA GPU Activity icon was a lie...
    Intel HD 4000 sux
    This image, Ocean Level = 400 (what is the max level? 500 was too much)
    Ceto_nvidia_60FPS_02.jpg
     
  19. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    lol, thats ok. Ive done the same.

    It shouldnt matter what the ocean level is. It should always work as long its a reasonable number. 500 should be fine.

    What happened at 500?
     
  20. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    At Level 500, the Ocean was not visible. I was about to panic (after finally getting everything to work) changed Level to 400, and Ocean was again visible.
    When changing the Ocean Level, It"s cool the boat floats to the top....need a submarine.
    Ceto_60fps_nvidia_500_NoOcean01.jpg
     
  21. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    Game mode...noticed this random glitch where the Underwater (sometimes) does not render.
    Ceto_glitch_01.jpg
     
  22. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Ok, just had a look at this. If you set the level to > 400 you need to also set the ship y position to the same value as well.

    If the difference between the ship and water level is to great the buoyancy script has a error and flicks the ship and the camera into infinity.

    Im redoing the buoyancy stuff for the next update so that should fix that.

    With the underwater glitch I might need some more info about how to reproduce it if you can.
     
  23. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    Ceto_glitch_Camera02.jpg Ceto_layers.jpg Ceto_glitch_Camera03.jpg
    Underwater Glitch ( clickmatch described this issue ) Reading the Quick Guide, I'm not sure how to setup all the different types of layers.(reading Unity Tutorials now)
    Scene
    Ceto Ocean, Directional Light, 1stPerson controller, Terrain 2048px
    MainCamera + UnderwaterPostEffecs
     
    Last edited: Oct 18, 2015
  24. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Ok thanks.
    I will add it to the list.

    I think the under water stuff is not working with two cameras in the scene at the moment and maybe other issues.
     
  25. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Hi CaptainMurphy,

    I am just refering to post #625 from Scrawk here the reply : First major update should have a new buoyancy system. Both a fancy voxel based one and a simpler more practical one.

    Since we are not highly skilled programers we sometime need someone like Scrawk to help us.

    Regards
     
  26. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,119
    I have the Buoyancy script from Nevaran : http://forum.unity3d.com/threads/buoyancy-script.72974/page-2#post-2273330 which is Thanks to Alexzzzz who created the original Buoyancy script.

    I've updated it for use with Ceto and included it in its namespace. Works Great. :)
    Save it as BuoyancyCeto.cs

    Code (CSharp):
    1. using System.Collections.Generic;
    2. using UnityEngine;
    3.  
    4. namespace Ceto
    5. {
    6.  
    7.     public class BuoyancyCeto : MonoBehaviour{
    8.         //    public Ocean ocean;
    9.         public GameObject target;
    10.  
    11.         public bool isConcave = false;
    12.         public float density = 500;
    13.         public int slicesPerAxis = 2;
    14.         public int voxelsLimit = 16;
    15.    
    16.         private const float DAMPFER = 0.1f;
    17.         private const float WATER_DENSITY = 1000;
    18.    
    19.         private float voxelHalfHeight;
    20.         private Vector3 localArchimedesForce;
    21.         private List<Vector3> voxels;
    22.         private bool isMeshCollider;
    23.         private List<Vector3[]> forces; // For drawing force gizmos
    24.    
    25.         private Rigidbody rigid;
    26.         private Collider col;
    27.         private MeshCollider meshCol;
    28.    
    29.         private void Start(){
    30.             rigid = GetComponent<Rigidbody>();
    31.             col = target.GetComponent<Collider>();
    32.             meshCol = target.GetComponent<MeshCollider>();
    33.             forces = new List<Vector3[]>();// For drawing force gizmos
    34.        
    35.             // Store original rotation and position
    36.             var originalRotation = transform.rotation;
    37.             var originalPosition = transform.position;
    38.             transform.rotation = Quaternion.identity;
    39.             transform.position = Vector3.zero;
    40.        
    41.             // The object must have a collider
    42.             if(col == null){
    43.                 //            Debug.LogWarning(string.Format("[Buoyancy.cs] Object \"{0}\" had no collider.", name));
    44.                 enabled = false;
    45.             }
    46.             isMeshCollider = meshCol != null;
    47.        
    48.             var bounds = col.bounds;
    49.             if(bounds.size.x < bounds.size.y){
    50.                 voxelHalfHeight = bounds.size.x;
    51.             }
    52.             else{
    53.                 voxelHalfHeight = bounds.size.y;
    54.             }
    55.             if(bounds.size.z < voxelHalfHeight){
    56.                 voxelHalfHeight = bounds.size.z;
    57.             }
    58.             voxelHalfHeight /= 2 * slicesPerAxis;
    59.        
    60.             // The object must have a RidigBody
    61.             if(rigid == null){
    62.                 //            Debug.LogWarning(string.Format("[Buoyancy.cs] Object \"{0}\" had no Rigidbody.", name));
    63.                 enabled = false;
    64.             }
    65.             rigid.centerOfMass = new Vector3(0, -bounds.extents.y * 0f, 0) + transform.InverseTransformPoint(bounds.center);
    66.        
    67.             voxels = SliceIntoVoxels(isMeshCollider && isConcave);
    68.        
    69.             // Restore original rotation and position
    70.             transform.rotation = originalRotation;
    71.             transform.position = originalPosition;
    72.        
    73.             float volume = rigid.mass / density;
    74.        
    75.             WeldPoints(voxels, voxelsLimit);
    76.        
    77.             float archimedesForceMagnitude = WATER_DENSITY * Mathf.Abs(Physics.gravity.y) * volume;
    78.             localArchimedesForce = new Vector3(0, archimedesForceMagnitude, 0) / voxels.Count;
    79.        
    80.             //        Debug.Log(string.Format("[Buoyancy.cs] Name=\"{0}\" volume={1:0.0}, mass={2:0.0}, density={3:0.0}", name, volume, rigid.mass, density));
    81.         }
    82.    
    83.         private List<Vector3> SliceIntoVoxels(bool concave){
    84.             var points = new List<Vector3>(slicesPerAxis * slicesPerAxis * slicesPerAxis);
    85.        
    86.             if(concave){
    87.                 var meshC = meshCol;
    88.            
    89.                 var convexValue = meshC.convex;
    90.                 meshC.convex = false;
    91.            
    92.                 // Concave slicing
    93.                 var bounds = col.bounds;
    94.                 for(int ix = 0; ix < slicesPerAxis; ix++){
    95.                     for(int iy = 0; iy < slicesPerAxis; iy++){
    96.                         for(int iz = 0; iz < slicesPerAxis; iz++){
    97.                             float x = bounds.min.x + bounds.size.x / slicesPerAxis * (0.5f + ix);
    98.                             float y = bounds.min.y + bounds.size.y / slicesPerAxis * (0.5f + iy);
    99.                             float z = bounds.min.z + bounds.size.z / slicesPerAxis * (0.5f + iz);
    100.                        
    101.                             var p = transform.InverseTransformPoint(new Vector3(x, y, z));
    102.                        
    103.                             if(PointIsInsideMeshCollider(meshC, p)){
    104.                                 points.Add(p);
    105.                             }
    106.                         }
    107.                     }
    108.                 }
    109.                 if(points.Count == 0){
    110.                     points.Add(bounds.center);
    111.                 }
    112.            
    113.                 meshC.convex = convexValue;
    114.             }
    115.             else{
    116.                 // Convex slicing
    117.                 var bounds = col.bounds;
    118.                 for(int ix = 0; ix < slicesPerAxis; ix++){
    119.                     for(int iy = 0; iy < slicesPerAxis; iy++){
    120.                         for(int iz = 0; iz < slicesPerAxis; iz++){
    121.                             float x = bounds.min.x + bounds.size.x / slicesPerAxis * (0.5f + ix);
    122.                             float y = bounds.min.y + bounds.size.y / slicesPerAxis * (0.5f + iy);
    123.                             float z = bounds.min.z + bounds.size.z / slicesPerAxis * (0.5f + iz);
    124.                        
    125.                             var p = transform.InverseTransformPoint(new Vector3(x, y, z));
    126.                        
    127.                             points.Add(p);
    128.                         }
    129.                     }
    130.                 }
    131.             }
    132.        
    133.             return points;
    134.         }
    135.    
    136.         private static bool PointIsInsideMeshCollider(Collider c, Vector3 p){
    137.             Vector3[] directions = { Vector3.up, Vector3.down, Vector3.left, Vector3.right, Vector3.forward, Vector3.back };
    138.        
    139.             foreach(var ray in directions){
    140.                 RaycastHit hit;
    141.                 if(c.Raycast(new Ray(p - ray * 1000, ray), out hit, 1000f) == false){
    142.                     return false;
    143.                 }
    144.             }
    145.             return true;
    146.         }
    147.    
    148.         private static void FindClosestPoints(IList<Vector3> list, out int firstIndex, out int secondIndex){
    149.             float minDistance = float.MaxValue, maxDistance = float.MinValue;
    150.             firstIndex = 0;
    151.             secondIndex = 1;
    152.        
    153.             for(int i = 0; i < list.Count - 1; i++){
    154.                 for(int j = i + 1; j < list.Count; j++){
    155.                     float distance = Vector3.Distance(list[i], list[j]);
    156.                     if (distance < minDistance){
    157.                         minDistance = distance;
    158.                         firstIndex = i;
    159.                         secondIndex = j;
    160.                     }
    161.                     if(distance > maxDistance){
    162.                         maxDistance = distance;
    163.                     }
    164.                 }
    165.             }
    166.         }
    167.    
    168.         private static void WeldPoints(IList<Vector3> list, int targetCount){
    169.             if(list.Count <= 2 || targetCount < 2){
    170.                 return;
    171.             }
    172.        
    173.             while (list.Count > targetCount){
    174.                 int first, second;
    175.                 FindClosestPoints(list, out first, out second);
    176.            
    177.                 var mixed = (list[first] + list[second]) * 0.5f;
    178.                 list.RemoveAt(second); // the second index is always greater that the first => removing the second item first
    179.                 list.RemoveAt(first);
    180.                 list.Add(mixed);
    181.             }
    182.         }
    183.    
    184.         private float GetWaterLevel(float x, float z){
    185.             //    Get the Wave height from Ceto Ocean System
    186.             return Ocean.Instance.QueryWaves(x, z);
    187.         }
    188.    
    189.         private void FixedUpdate(){
    190.             forces.Clear();// For drawing force gizmos
    191.        
    192.             foreach(var point in voxels){
    193.                 var wp = transform.TransformPoint(point);
    194.                 float waterLevel = GetWaterLevel(wp.x, wp.z);
    195.            
    196.                 if(wp.y - voxelHalfHeight < waterLevel){
    197.                     float k = (waterLevel - wp.y) / (2 * voxelHalfHeight) + 0.5f;
    198.                     if(k > 1){
    199.                         k = 1f;
    200.                     }
    201.                     else if(k < 0){
    202.                         k = 0f;
    203.                     }
    204.                
    205.                     var velocity = rigid.GetPointVelocity(wp);
    206.                     var localDampingForce = -velocity * DAMPFER * rigid.mass;
    207.                     var force = localDampingForce + Mathf.Sqrt(k) * localArchimedesForce;
    208.                     rigid.AddForceAtPosition(force, wp);
    209.                
    210.                     forces.Add(new[] { wp, force }); // For drawing force gizmos
    211.                 }
    212.             }
    213.         }
    214.    
    215.         private void OnDrawGizmos(){
    216.             if(voxels == null || forces == null){
    217.                 return;
    218.             }
    219.        
    220.             const float gizmoSize = 0.05f;
    221.             Gizmos.color = Color.yellow;
    222.        
    223.             foreach(var p in voxels){
    224.                 Gizmos.DrawCube(transform.TransformPoint(p), new Vector3(gizmoSize, gizmoSize, gizmoSize));
    225.             }
    226.        
    227.             Gizmos.color = Color.cyan;
    228.        
    229.             foreach(var force in forces){
    230.                 Gizmos.DrawCube(force[0], new Vector3(gizmoSize, gizmoSize, gizmoSize));
    231.                 Gizmos.DrawLine(force[0], force[0] + force[1] / rigid.mass);
    232.             }
    233.         }
    234.     }
    235. }
     
    Last edited: Oct 18, 2015
    twobob, scrawk, Fenris2 and 1 other person like this.
  27. pixelquaternion

    pixelquaternion

    Joined:
    Jun 28, 2014
    Posts:
    122
    Hi John,

    Thank for uploading this i will have a look at how it work later on this week.

    cheers
     
  28. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    @ John G.
    Thanks for the script! ...how to fix error even if not using the script?
    ...I am really having fun with Ceto!
    Ceto_Megalodon1a.jpg




     
  29. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    One more thing I noticed, with the scene and game tabs on the same dock, I'll see the ocean in the game tab, switch to scene (no ocean) then back to game tab and the ocean is gone from there, too. Then I'll stop and press play and it's good again, just no switching back and forth. Maybe it's a setting I'm missing?
     
  30. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,119
    You can change the class name on line 7 to something else like BuoyancyCeto and rename the script to same.
    Or else delete the original buoyancy script that was included in Ceto if your not using it, but first option would be safest.

    Will edit the post above to reflect change.
     
  31. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Yer, there is something a bit funny with the ocean when using the scene view.

    I will add it to the list.
     
  32. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    To fix this error set the camera far plane to any value greater or equal to 2000.

    The default 1st person far plane value is 1000 which is causing a issue with the under water mask.

    A proper fix will be in next update.

    EDIT - looks like the issue is the OCEAN_BOTTOM_DEPTH value in the underwater script.
    Its set to 1000 and looks like if its smaller than double the far plane value this error will occur.

    Change the OCEAN_BOTTOM_DEPTH to 500 will also fix the issue if you need the far plane to 1000.


    UnderwaterFarPlaneError.jpg
     
    Last edited: Oct 19, 2015
  33. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Hi,
    Bought this yesterday after reading the glowing reports here.
    I've been tweaking for a number of hours and with an audio file playing I feel like I've been at the ocean for the day.
    Here's a video of my scene right now, but the video robs the real beauty of how it really looks here in Unity.
    I still have not learned how to mask the waves at the shoreline to make them more realistic. Is there any way to make the waves leave a different texture that fades after a few seconds on the areas of terrain it covers and then uncovers?

     
    RavenOfCode and John-G like this.
  34. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Here's Ceto working with the Gaia terrain creation tool and truesky for added oomph.. no camera tricks

     
    AdamGoodrich, John-G and scrawk like this.
  35. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Thanks Don,

    The shoreline stuff is still a bit experimental but this is what Ive been doing..

    - Add a game object and add the Ceto/AddShoreMask script.

    - Center the object on your terrain and set the width and height to match the size of your terrain. There will be a yellow box draw by the script in the editor.

    - You can then add a mask texture to the slots on the shore mask script. The main one you want is the height mask. This can mask the waves near the shore to make them smaller and not poke up through the terrain. The white areas of the texture will mask the waves to flat and black will be the normal height.

    - It can be hard to make the mask to fit your terrain. There is a rough helper script to do this included. If you add the ExportShoreMask script to your terrain it will save a texture that matches the shore line. You need to run the scene and it will save the texture to the file name. A editor script would be better but thats all Ive had time to do so far.

    - Once you have the mask you can edit it photoshop by softening the edges if you want. Its the alpha channel Ceto reads from so you need to tick the Alpha from grey scale in Unity. You also need to tick the read/write enabled if you want Ceto's height Queries to take the modified wave height into account.

    - The other mask slots do the following...
    • The Normal mask will smooth out the normals. Use the same mask tetxure as the height mask uses works best.
    • The edge foam will add the foam texture where its white and the foam mask will remove the foam on the wave tips (the spectrum foam).
    • The clip mask will cut a hole in the mesh where its white. Good for if you need caves.
    If that sounds like to much work you can have a look at the terrain engine Gaia which has some support for add shoreline to Ceto.
     
    AdamGoodrich and John-G like this.
  36. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,104
    Having some strange colors in the demo scene (imported to existing project), windowsdx11 demo build works fine. (using 5.2.1p3).

    demoskene.jpg

    Still the ocean prefab seems to work fine when added to my scene, so no problems.

    *edit:
    Some issue with speedtree, water not drawn behind those branches:
    speedtree_ceto.jpg
     
    Last edited: Oct 19, 2015
  37. Uli_Okm

    Uli_Okm

    Joined:
    Jul 10, 2012
    Posts:
    94
    Hi Scrawk,
    i'm using Ceto here at my company after months of antecipation, and it really is amazing!
    Just 2 bugs i found here in my tests:
    - When i warp my camera object too far (just using something like: transform.position = x,x,x), the ocean is not properly drawn in the new location, unless i change any property of the ProjectedGrid script. Like changing the grid groups for example. You can replicate this issue in the DemoScene just pausing the game, and setting the ship position for example to 30000,0,0
    - When doing this exact test above, you also get a MASSIVE drop in FPS due to something happening in the foam trail scripts. Disabling, warping, and reenabling them also don't work. I think that maybe the foam trail is trying to draw all the way since its old position, because chaning the duration of the trail objects to 0 and after the warp restoring the old values fix the issue
     
  38. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,119
    have you got the depth made set to
    USE_OCEAN_DEPTH_PASS or
    USE_DEPTH_BUFFER, Speedtree does not work with depth pass.
     
    mgear and scrawk like this.
  39. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    heh heh, does sound like a lot of work, probably easier once some time is put into it.
    Looks like the Gaia engine is not yet released?
    Any idea on pricing for this and release date?
    Thanks for the info!

    :)
     
  40. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    @mgear: Not sure why the project looked like that when imported sorry. Speed trees have that issue when the underwater mode on the underWater script on ocean is set to USE_OCEAN_DEPTH_PASS. To fix this you need to remove what ever layer the trees are on from the ocean depths mask on same script or you can set the mode to USE_DEPTH_BUFFER.

    The reason is the ocean depth pass uses a replacement shader and Unity have not added a render type for the speed trees so I cant get them to render in the pass.

    @Uli_Okm : Thanks. Will add those to the list. I dont think they will be to hard to fix and will be in next update.

    @Don Gray : Yes, sorry It is a bit fiddly but does work. Im not sure when Gaia will be out. Best ask @AdamGoodrich. I think it will be out soon.
     
    mgear likes this.
  41. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,777
    Thanks for the shout out guys :)

    Gaia will be submitted to asset store this week - finalizing documentation now.

    More info about Gaia here.
     
    scrawk and Don-Gray like this.
  42. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Same scene without Scion post processing effect, looks mostly the same.
    Going for a darker atmospheric effect, which is why the water is so dark.

    :)

     
    scrawk likes this.
  43. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    @sadicus: The underwater bug occurring when the ocean is being viewed from both the scene and game at the same time has now been fixed and will be in next update.

    SceneAndGameViewFix.jpg
     
    John-G, moure and Don-Gray like this.
  44. Imhotebkin

    Imhotebkin

    Joined:
    Feb 10, 2015
    Posts:
    18
    Hello scawk! Is there a way to check if a ship actually touches the water? I've tried out your movement script and due to the fact that there is no check for water my ship can ride beaches and even climb mountains. Is there any bool value that say that the ship is actually in the water?
    And another question: is there a built-in way to interact with the water? So that the ship doesn't just pierce a wave but push it down with bouyancy spheres, and actually affect the physics and view of the water?
     
    Last edited: Oct 20, 2015
  45. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    @scrawk
    I've not been able to get even a little underwater effect working,
    anything in my settings I am missing?



     
  46. Imhotebkin

    Imhotebkin

    Joined:
    Feb 10, 2015
    Posts:
    18
    put the Underwater Post Effect on the camera
     
    scrawk likes this.
  47. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    Whoops, thanks! :)
     
  48. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    _invalidusername, scrawk and Beennn like this.
  49. clickmatch

    clickmatch

    Joined:
    Dec 3, 2012
    Posts:
    58
    Sorry to dwell, but I was playing with the Advanced Shooter Kit, which has a player camera and a weapon camera. So since the weapon camera is a "near" camera, it should have a very low near clip, just to keep your hands and weapons visible. The other cam handles the rest. With the underwater and post effect I was playing around. If I put it on the reg cam, it doesn't show at all. On the near camera, the player is either completely blind (depth buffer) or has semi transparent weapons (ocean pass). I know you mentioned a fix would be in, and my guess is that this addresses it, but I just wanted to convey my experience so it can help you with your big picture, if that makes sense.

    @John G. I tried to drop your script in, and it didn't seem to work. Is there some set up I need to be aware if? I just dropped it on the object I wanted to float.. do I need to have it in a hierarchy or something?
     
  50. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Thanks. The fix for the semi circle bug in underwater has to do with the far plane of camera not the near plane so I think they maybe separate issues.

    I will have the update up in about a week and see if that solves your issues. If not I will get a copy of the Advanced shooter kit and have a look to see what the issue is.