Search Unity

Ceto (Scrawks Ocean)

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

  1. FractalCore

    FractalCore

    Joined:
    May 15, 2009
    Posts:
    151
    Just wondering if anything in Ceto 1.1.0 fixes the night time brightness issue. I noticed it happens with the foam too, doesn't get darker.

    At first I thought it was a Linear vs Gamma thing. But even in Gamma mode you can still see it adding a brightness from nowhere.
     

    Attached Files:

  2. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    No sorry. I'm aware of the issue but don't have a fix yet.
     
  3. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    44
    Upgraded, getting an error:
    Assets/Ceto/Scripts/Spectrum/Buffers/InitDisplacementTask.cs(29,46): error CS1061: Type `Ceto.WaveSpectrumCondition' does not contain a definition for `Size' and no extension method `Size' of type `Ceto.WaveSpectrumCondition' could be found (are you missing a using directive or an assembly reference?)

    Unity 5.3.2f1
     
  4. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Make sure when you upgrade that you delete the Ceto folder entirely and then import it clean.
     
  5. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    44
    Thanks Capt'n, that fixed the error.
     
  6. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    I moved some scripts to a new folder so if you don't delete the original you end up with two copies of the same script (the old and new) which gives you that error.
     
  7. InfiniteDice

    InfiniteDice

    Joined:
    Jun 30, 2015
    Posts:
    44
    One more thing I'm wondering about is when the wave peaks are steep we get that rolled over - strange inverse shader effect. Besides reducing the peaks because I really want peaky waves... are there any ideas which might allow detection of these. The goal would be to perhaps spawn a particle effect at those locations - Wave peak detection with some kind of coordinate that can be polled... I made up a buoy that records maximum wave heights in game so I can tune the water to match and be somewhat realistic. I'm not really looking for a solution from you directly, but perhaps some way to facilitate this on my own if possible.

    The ocean foam must be looking at this already, to know where to generate, so even piggybacking somehow on that might work.

    My game has no combat, so the focus is very much on the environment (pve - obstacles/storms).

    See this shot of Lake Erie:

     
  8. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    Hello,

    Ceto looks promising. I have few questions regarding it:

    1) Does the ocean render from underneath? I want my character to be underwater and I was wondering if that's possible?

    Take a look a the image: http://www.imgbase.info/images/safe-wallpapers/photography/water/18166_water_underwater.jpg

    2) Does it support dynamic lighting refraction (can be seen on the image)

    3) What's the maximum size the ocean can get before running into performance issues?

    4) You have mentioned that ocean is rendered only within a camera frustum. Does it work with more than 1 cameras? If part of the ocean is obstructed by a mesh, will that part of the ocean stop rendering?

    5) Is it possible to have rigid bodies floating on water and be affected by waves?

    Thanks in advance! :)
     
  9. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    If the choppiness is to high you get that rolled over effect. Theres not a lot I can do to fix that. You just have to try and reduce the choppiness until it does not happen. I might try and have a look at the math to try and reduce it but it may not be possible.

    I was thinking of trying to add a effect that spawns particles at the wave peaks. I have added a function to the ocean that returns the wave normal in the new version ( Ocean.Instance.QueryNormal(x,z) ).

    I think if you try and detect when the normal flips direction quickly you might be able to spawn a particle then.

    The foam does know where the peaks are sharp but its all done on the GPU and in the wave frequency domain. It would be very hard to use this information to spawn particles. You would probably have to use compute shaders.


    Hi,

    1 - The ocean does render from underneath and it kinda looks like the image you posted. On the asset store page you can download some demos and you can move the camera under water if you want.

    2 - Yes the ocean has refraction. It uses a grab pass in the shader to get what is under the ocean.

    3 - The ocean uses a projected grid that is infinite in size. You can adjust how many verts are in the mesh. Theres low, medium, high, ultra and extreme. High is the default and runs fast. It should be enough for most applications.

    4 - Yes the ocean should render with multiple cameras. No the ocean mesh will not stop rendering if obstructed by part of a mesh. The projected grid makes this complicate and I have not found a solution yet.

    5 - Yes you can have rigid bodies float. There is a buoyancy script to do this. The buoyancy scripts are being re-written in the next version. The current ones are rather crap to be honest.
     
  10. _alphaBeta_

    _alphaBeta_

    Joined:
    Aug 8, 2014
    Posts:
    38
    I'm still back on 1.0.9 for the moment, but I'm having some sort of shadow / reflection issue. Pictured below are railings with Ceto Ocean in the background. There's some kind of shadow effect that takes place around the railings (any all other geometry on the object) that becomes very noticeable with larger waves and/or fast moving railings. I've isolated the issue to the underwater script and whether the objects are included in the ocean depths mask. It's desirable for the overall object, and its railings, to have visibility when partially under water, though this screenshot and example are entirely above water. Any ideas?

     
  11. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Yep, that's a bug in 1.0.9. It was fixed in the new version.
     
  12. Tony-Lovell

    Tony-Lovell

    Joined:
    Jul 14, 2014
    Posts:
    127
    How do we get Ceto 1.1.0? Asset Store is still showing me 1.0.9
     
  13. _alphaBeta_

    _alphaBeta_

    Joined:
    Aug 8, 2014
    Posts:
    38
    Yep, we're good on 1.1.0; apologies for the outdated report and bug duplication.
     
  14. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    If you just go into your asset store account and re download Ceto it should be the latest version. There's a version file in the Ceto folder you can check to see what version it is.
     
  15. Tony-Lovell

    Tony-Lovell

    Joined:
    Jul 14, 2014
    Posts:
    127
    I did that -- it gave me 1.0.9 (I had deleted my old Ceto folder before downloading).

    tone
     
  16. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    I don't know why that's happening.

    I will just send you a copy of the new version when I get home from work.
     
  17. Tony-Lovell

    Tony-Lovell

    Joined:
    Jul 14, 2014
    Posts:
    127
    Thanks, Scrawk.

    tone
     
  18. Kiwi-Hawk

    Kiwi-Hawk

    Joined:
    Jul 17, 2015
    Posts:
    288
    May I ask? Is this primly an open ocean water or can I set it to a inland water/river and lake the wave just don't fit when
    way up river tho I'm loving the underwater and ocean setting's drop in right outta the box, great thank you. I been looking for the wave settings but not sure what wording you used
     
  19. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Its the wind speed on the spectrum that controls how big the waves are in case that was what your asking.

    Its primary for open ocean at the moment but you can use a mask to make the waves smaller in inland areas.

    In the new version you can export the masks for your terrain.

    Go to Windows->Ceto->ExportShoreMask.

    Select your terrain and click the export button.

    Then go to your terrain and add Cetos AddShoreMask component. Set the width and height to your terrains width and length value and set the x and z offset to half your terrains width/length values.

    Then put the exported height mask on the height mask, normal mask and foam mask slot, the edge foam on edge foam slot and the clip mask on the clip mask slot.

    Then open up the height mask texture in photoshop. The mask should be white where its under the terrain.

    Your river/lakes areas should be black as they will be unmasked. You can then brush the river areas with the mask you want. For example if you brush these areas with 50% grey then the waves in your river areas will be half the wave height in the open ocean areas.

    This way your river/lake areas wont have waves as big as the ocean areas but when the spectrum wind speed changes the waves will still get larger or smaller.
     
    elbows likes this.
  20. Sarudan

    Sarudan

    Joined:
    May 21, 2011
    Posts:
    65
    Hi scrawk, are you planning on adding edge blending? Your add-on looks good, but without edge blending it's not suitable for us.
     
  21. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    There is a edge fade that gives soft edges around objects like the terrain if that's what you mean.

    EdgeFade.jpg
     
  22. Sarudan

    Sarudan

    Joined:
    May 21, 2011
    Posts:
    65
    That's what I was wondering yes.

    It may be worth mentioning that on the asset store page, as neither the screen shots or the demo you've provided show edge blending.
     
  23. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    I can`t see any of the prefabs in the editor (scene) window, is this normal ? I am using UnityPro 5.3.3p1.
     
  24. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Be nice if there was an edge fade depth factor or something to control how quickly the edges fade before getting deep looking... or is that controlled somewhere else? sorry if I missed it.
     
  25. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    I should have. Didn't think of it when writing the description.

    The ocean will only show up when the scene runs. Does not run in the editor. Is that what you mean?

    I probably should have set it up to run in the editor but I didn't when I first started and now its a bit hard add.

    Not 100% sure what you mean but don't think there is a setting for it.
     
  26. Imhotebkin

    Imhotebkin

    Joined:
    Feb 10, 2015
    Posts:
    18
    Hey, scawk, is there any way to make the water recieve light? I have some spotlights on the shore that light the water a bit. But ceto only renders the light reflected from the building and when you point light to the water, the water doesn't light up. Any solution to this?
     
  27. unicat

    unicat

    Joined:
    Apr 8, 2012
    Posts:
    425
    It is not important, just more fiddling around to set it up on my terrain.
     
  28. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    I hope this hasn't been asked and answered before, but after combing through 28 pages of forum posts, I may have just missed it. I'm seeing a weird reflection issue when I move my camera. It's like the reflection gets culled at certain camera angles. Here's a video that illustrates the problem:



    I've removed everything from the scene except a bare terrain, Ceto, and a skybox. I've turned off fog and all camera effects. I'm using Unity 5.3.1, the latest version of Ceto, the standard Ocean_TransparentQueue prefab, and deferred linear rendering. Any ideas what's causing this? Is there a reflection culling setting somewhere I need to tweak? Thanks.
     
  29. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    I have disabled the forward add in the shader by default as it can be expensive for the shader. With out the add pass you only get the one directional light.

    If you go into the transparent/opaque top side shader add remove the 'noforwardadd' tag the spot lights should show up.

    Its been a while since Ive checked this but it should work.

    I think I know what this is but I just need some more info from you.

    Do you use cull distances for your camera? Do you have 'copy cull distances' on the ocean PlanarReflection script ticked?
     
  30. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    Yes to both. The camera was set to 0.1 for near and 6000 for far culling distance. I've tried setting them at 0.5 and 1000 as well, with no change in the symptoms. I've also checked and unchecked 'copy cull distances', thinking it might have some bearing, with no effect. I have my main player camera and a vehicle camera I might be using, but even with that disabled, and just the main player camera in the scene, I get the same thing. :(
     
  31. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    moure likes this.
  32. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Agreed. I had to pick shore waves from on the left list, but once I started watching I was amazed at how simple it was yet it looks SO good.
     
  33. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    scrawk likes this.
  34. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    In the last version I add the option for the reflection camera to copy the culling distances from the camera.

    But there is a issue with it as you noticed. Since the reflection camera uses a oblique projection matrix the culling distances used don't end up with the culling being the same as the camera so the reflections get culled at a different time. I set the reflection culling mode to spherical and it seemed make them better match but its still off.

    At the moment if you uncheck the 'copy cull distances' option while the scene is running the distances have already been copied so you wont see any difference. If you untick it and run the scene the issue should go away (??) but then the reflection's are not being culling which you probably want.

    I have also added a new script that you can use to manually adjust the culling distances on the reflection camera. You might be able to increase the distances until the issue goes away.

    To use it add Cetos Camera/ReflectionCameraCullingDistances component to your camera. There will be a float array with 32 entries. These will be set to the reflection camera Ceto creates for that camera. These setting are independent to the distances used for the camera.

    So try leaving 'copy cull distances' untick then run the scene and the issue should go away and try using that script and it should change the culling distances for the reflections. If either of those things don't work its a bug with something else.

    Very interesting. If Unity adds Nvidias WaterWorks to the engine I guess I am out of work.

    Funny they said they do the FFT on the GPU and read back the data. They said on DX11 there is no stall but in Unity there is.
     
  35. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    OK. I've fixed it, but the solution leaves me scratching my head a bit.

    I tried turning off 'copy cull distances' and adding the ReflectionCameraCullingDistances component to my camera as you said, and it made zero difference. I couldn't find any documentation, but I'm assuming the 32 entries represent scene layers? Anyway, I tried leaving them all at 0, and then tried setting what I assumed was the default layer to match my camera far culling distance, but it made no difference.

    I finally made a new scene, created a simple terrain, and added Ceto. Everything looked fine. No reflection issues at all. So I made a prefab of all the items that were still active in my scene, and added it to a new scene, and the issue was gone as well. So it must have been some 'mystery' scene setting that was wonky, and starting from scratch made it go away.

    While I'm left a bit puzzled by it all, at least I can move on now. Thanks for the help. :)

    PS. Is there any info available on tuning the colors? I'm flailing away at it now, but there are a lot of combinations of reflection and absorbtion colors, transparency, scattering, and other settings that might effect the final appearance, so it's a bit of a crap-shoot trying to get a specific look. This is complicated by the fact that you can't actually see the results in real time while adjusting them in the Editor, or is there a way to do this? You might even want to add a few common presets, like 'deep ocean', and 'tropical lagoon', to get people started.
     
    Last edited: Feb 28, 2016
  36. rgrlee71

    rgrlee71

    Joined:
    Sep 11, 2012
    Posts:
    37
    Hi,

    I need a little help accessing the new "Translate" function in the AddWaveOverlayBase script. First off, I'm an old amateur VB programmer and I know a little C#, but not proficient at it at all. I'm building a submarine game and most of it has been done in Playmaker.

    I have come across a PlayerRecenter script that relocates the player back to 0,0,0 when he travels outside a predetermined distance from origin. It cycles through all the scenes game objects and offsets their positions equally based on how far the player has moved from the origin. It also handles the particle emitters. My problem (being a c# novice) is that I don't know how to access the "Translate" function since the script is not attached to a game object. My normal method does not work in this case.

    I have the Vector3 needed to offset the Ceto overlays, I just can't figure out how to access the AddWaveOverlayBase script, from my script, to pass it along.

    The reason this is important is that the shadows on my submarine go crazy when the sub goes outside 1000m or so from the origin. They start to vibrate badly.

    I would be willing to share the finished script. Any help would be appreciated.

    Thanks.


    Here's a pic to show you guys what I'm up to (even though it doesn't highlight my problem :)

     
    Fera_KM, John-G and hopeful like this.
  37. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Im not sure whats going on there but glad its working now.

    Yes, the 32 entries are the layers.

    I know its a bit hard to adjust the colors. I will be adding a section on this to the manual soon and I will add some pre-sets at some point.

    If the scene is running you should be able to adjust the settings in real time but no, Ceto does not run in the editor. I will try and make it do so at some point.

    Its only really the Absorption RGB, Absorption scale, inscatter scale and inscater color that needs to be changed.

    This is how I normally adjust the colors.

    Run the scene with the camera look down on the ocean.

    Set the above inscatter scale to 0 so the under water fog is gone.

    Adjust the Absorption RGB sliders to get the color you want. This is based of real world water absorption. The default is sea waters absorption. You might be able to look up some absorption values for certain types of water (ie dirty river water, algae rich lake water, etc). I will add some tables with different absorptions to the manual.

    Then adjust the above absorption scale to adjust how transparent the water is.

    Then increase the inscatter scale from 0 until the fog starts where you want.

    Then adjust the inscatter color to what you want.

    If the camera is going to go under the water you need to adjust the below setting the same way.


    Hi,

    You only need to translate Cetos AddFoamTrial script. The rest of the wave overlays are attached to game objects and they will be offset when you move there game object.

    The AddFoamTrial creates overlays that are not attached to any game object which is why you need to manually call the translate function.

    in the PlayerRecenter script you just need to add some code to grabs all of Cetos AddFoamTrial script on start and then move them when the scene is offset. You also need to offset the ocean.

    Heres a example script.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. using Ceto;
    5.  
    6. public class TranslateTest : MonoBehaviour
    7. {
    8.  
    9.  
    10.     AddFoamTrail[] foamTrails;
    11.  
    12.     Vector3 totalOffset;
    13.  
    14.     void Start ()
    15.     {
    16.  
    17.         //Grab all of Cetos foam trail scripts in the scene.
    18.         //Will not grab inactive components.
    19.         foamTrails = FindObjectsOfType<AddFoamTrail>();
    20.  
    21.     }
    22.  
    23.     /// <summary>
    24.     /// Call this when you want to translate the foam trails.
    25.     /// </summary>
    26.     /// <param name="offset"></param>
    27.     void OnOffset(Vector3 offset)
    28.     {
    29.  
    30.         foreach(AddFoamTrail trail in foamTrails)
    31.         {
    32.             trail.Translate(offset);
    33.         }
    34.  
    35.         totalOffset -= offset;
    36.  
    37.         //You also need to offset the ocean so the shader
    38.         //will render the waves in the correct world position.
    39.         //This needs to the the total amount of offset.
    40.         if (Ocean.Instance != null)
    41.             Ocean.Instance.PositionOffset = totalOffset;
    42.  
    43.     }
    44.  
    45. }
     
    Last edited: Mar 2, 2016
    FargleBargle likes this.
  38. Imhotebkin

    Imhotebkin

    Joined:
    Feb 10, 2015
    Posts:
    18
    Hey scawk! I tried removing the "noforward" and now it shows my spotlights but only in reflected light. I also tried removing "nolightmaps" (whatever that does) but nothing changed. Also found this odd issue with the spotlight reflections
     
  39. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Looks like its just the specular thats showing up.

    I don't know if theres a bug with the diffuse lighting or if since the waters a much darker color than the concrete area the diffuse is not very visible.

    I presume that other issue is that rim lighting around edge of boat? Not sure whats causing that.

    I will have a look at it but don't have a fix at the moment.
     
  40. rgrlee71

    rgrlee71

    Joined:
    Sep 11, 2012
    Posts:
    37

    Thanks for the code. Last night I took elements from the old script and merged it with your example to get something that works. It has one little issue in that when I offset the ocean itself (the first time) you can see the move. All subsequent times it's seamless. I'll post the code this evening and see if anyone can see why.

    It's not elegant but it does do the job.
     
  41. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    You should be able to get it seamless from the start. Its probably just a update order issue or something like that.
     
  42. rgrlee71

    rgrlee71

    Joined:
    Sep 11, 2012
    Posts:
    37
    Ok, this is what I have. I commented everything to try and explain the method to my madness. Everything works as expected except the ocean showing the first move in the cycle. Maybe you guys can fix it or even clean up the code to make it more professional. It would be a nice addition to the Ceto package itself. I'm sure many of your customers are going to have this same janky floating point problem.

    place this script on the player parent object.

    UPDATE: The following script now functions correctly. Enjoy.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using Ceto;
    4.  
    5. public class PlayerReset : MonoBehaviour {
    6.  
    7.  
    8.     public float distance_limit = 750.0f; //max distance from origin.
    9.     AddFoamTrail[] foamTrails;
    10.     Object[] objects;
    11.     Vector3 origin = new Vector3 (0,0,0);
    12.     Vector3 totalOffset;
    13.     Vector3 playerPOS;
    14.  
    15.  
    16.     void Start()
    17.      {
    18.      Ocean.Instance.PositionOffset = origin;
    19.      }
    20.  
    21.  
    22.     void Update(){
    23.  
    24.         playerPOS = gameObject.transform.position;
    25.         playerPOS.y = 0f;
    26.         float x = playerPOS.x;
    27.         float y = playerPOS.y;
    28.         float z = playerPOS.z;
    29.         Vector3 offset = new Vector3 (x,y,z);
    30.  
    31.  
    32.  
    33.         //if the player is beyond the distance limit,from origin, reset all scene objects.
    34.         if (playerPOS.magnitude > distance_limit)
    35.         {
    36.  
    37.  
    38.             //offset the Ceto foam trails.
    39.             foamTrails = FindObjectsOfType<AddFoamTrail>();
    40.             foreach(AddFoamTrail trail in foamTrails)
    41.             {
    42.  
    43.                 offset = origin - playerPOS;
    44.  
    45.                 trail.Translate(offset);
    46.  
    47.             }
    48.  
    49.             totalOffset -= offset;
    50.                                
    51.  
    52.             //offset the Ceto ocean grid
    53.             Ocean.Instance.PositionOffset = totalOffset;
    54.  
    55.  
    56.             //offset all game objects.
    57.             objects = FindObjectsOfType(typeof(Transform));
    58.             foreach(Object o in objects)
    59.             {
    60.                     Transform t = (Transform)o;
    61.                     if (t.parent == null && t.gameObject.layer != 5) //ignore UI layer
    62.                     {
    63.  
    64.                     t.position -= playerPOS;
    65.  
    66.                     }
    67.              }
    68.  
    69.            
    70.             //offset all particles and particle emitters
    71.             objects = FindObjectsOfType(typeof(ParticleEmitter));
    72.             foreach (Object o in objects)
    73.             {
    74.                     ParticleEmitter pe = (ParticleEmitter)o;
    75.                     Particle[] emitterParticles = pe.particles;
    76.                     for(int i = 0; i < emitterParticles.Length; ++i)
    77.                     {
    78.                         emitterParticles[i].position -= playerPOS;
    79.                     }
    80.                     pe.particles = emitterParticles;
    81.             }
    82.  
    83.  
    84.  
    85.         }
    86.     }
    87.  
    88.  
    89.  
    90. }
     
    Last edited: Mar 2, 2016
    John-G likes this.
  43. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Sorry, forgot that the ocean needs to be offset by the opposite amount (subtracted if your adding) but I see you worked that out.

    I checked your code. It works fine. I found the issue was with Ceto. The position offset does not get set to the shader until the first time the property setter is assigned to. I thought that Unity would zero the value used by the shader until then but I guess not.

    I have fixed the bug in Ceto but until then you can by ass the issue by setting the offset to zero in your PlayerReset scripts start function.

    Code (CSharp):
    1.  
    2. void Start()
    3.     {
    4.         Ocean.Instance.PositionOffset = new Vector3(0, 0, 0);
    5.     }
    The only thing I would change is not calling FindObjectsOfType in the update. Its quite expensive to call if your scene is large but its up to you.
     
    rgrlee71 and John-G like this.
  44. rgrlee71

    rgrlee71

    Joined:
    Sep 11, 2012
    Posts:
    37
    Thanks!! I'll try it out tonight. I put the FindObjectsOfType into the Update to make sure any new spawned objects would be picked up each time the player hit the distance limit. Do you think it would be that much of an expense even though that part of the code runs for only one cycle after the player trips the limit? It would be more than a minute between resets with the submarine, on the surface, running at full speed.

    I would still have to call it somewhere after a new game object is spawned (like a torpedo) right? I'm not really sure what would be the proper solution for that, but this will work for now. If I get too many objects I may have to revisit it.

    Thanks for your help!!

    PS: I updated the script above with your change in case anyone else wants to use it.

    PS2: Anyone using this script will have to use "local" simulation space for your particles. "world" space allows the particles to float with the wind or movement of the parent object. When the script relocates them the particles are visually scattered from the movement force. This sucks because I like the damage fires set on Destroyers to bend with it's movement and their smoke as well. I haven't found the solution for this yet, maybe someone here will know one.

    UPDATE: Works perfectly thank you again!!
     
    Last edited: Mar 2, 2016
  45. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    No prob.

    With the FindObjectsOfType in the update if you don't notice a jerk in the frame rate then I am sure it will be fine.

    Just might be something to keep a eye on in the profiler.
     
    rgrlee71 likes this.
  46. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    FYI, I finally figured out what was causing the flickering reflections earlier. The problem disappeared when I created a new scene previously, and I wasn't sure why. I just tried baking occlusion into the new scene, and the problem came back. It seems to be the result of clunky occlusion culling on Unity's part. Fortunately, clearing the baked occlusion data fixed it, but I guess I'll need to find other ways to optimize my scene now. :rolleyes:
     
    scrawk likes this.
  47. Kiwi-Hawk

    Kiwi-Hawk

    Joined:
    Jul 17, 2015
    Posts:
    288
    Kia ora
    Is it possible away with using Ceto and Aqua in the same project. For lakes and rivers does'nt it have a visible plane (until runtime) to see the correct height for lakes above sea level that form the source for waterfalls. or a way to use more than one instance of Ceto
     
  48. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    You can only have one ocean instance at the moment. Im not familiar with Aqua so I don't know if they will work together. Don't see why they wouldn't however.

    To see what the ocean level would be in the editor so you can position stuff I normally just create a big plane and put a blue transparent material on it. I then set the y transform to be the same as the ocean level. I then put a script on it to disable it during run time. Not ideal but works fine.
     
  49. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    I'm currently using Unity's native Water4 for a lake located above sea level, and it gets along with Ceto just fine. Unless Aqua does something really different than most other water assets, it should too. ;)
    Grab 20160304024510 w1280h720 x-710y367z333r190.jpg
     
    Sabathius likes this.
  50. Imhotebkin

    Imhotebkin

    Joined:
    Feb 10, 2015
    Posts:
    18
    I don't think you really understood what I meant. I'll be more clear. The problem is that the water should light up like this picture
    Here you can see a reflection from the spotlight of the helicopter (in the right side. Removing -noforward adds that reflection so that works right now) and the water also lights up from the spotlight itself (on the left side. The area lights up from direct light and it will be brighter no matter where we look at it from. This is what currently isn't working). In the reflection being darker there is no proble, that works totally allright.
    Sorry for bothering so much=)
     
    scrawk likes this.