Search Unity

SUIMONO 2.0 - Interactive Water System

Discussion in 'Assets and Asset Store' started by chingwa, Jan 6, 2015.

  1. Wampster

    Wampster

    Joined:
    Jul 22, 2014
    Posts:
    7
    I am toying around with the buoyancy. I mocked up a warship model in Blender for experimentation, after having worked out the basics with small objects.

    I have the ship floating on Suimono with four buoyancyObject(s). However, even with the mass on the Rigibody set to 100,000 Kg, the ship bobs around on the surface like a small dinghy. How can I slow it down and give the appearance of a heavy vessel?
     
  2. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    I suggest to add more buoyancyObjects, I have 8 around a smallish boat and it responds very well.
    I gave up with trying to be scientific (re boat mass etc), and just played with the buoyancy object params till I had a good result.

    Suimono buoyancy is not perfect, but useable with some fiddling.

    I believe something like "Realistic Water Physics" may be an idea if you need really good buoyancy ... apparently Suimono support is in next version ... but thats been dragging on a while.
     
    chingwa likes this.
  3. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @Wampster Mass will only do so much to affect rigidbody performance. I suggest you also adjust the the drag upward a bit (like 0.25) and also adjust Angular Drag upward as well (perhaps as high as 10?) increasing these settings should definitely dampen the buoyancy behavior and keep the warship from looking like a toy.

    @mwituni I haven't heard any news from the Realistic Water Physics developer for over a year. But hopefully they'll be able to include Suimono support soon.
     
    mwituni likes this.
  4. Wampster

    Wampster

    Joined:
    Jul 22, 2014
    Posts:
    7
    Thanks for the replies, guys. I'll play around with the settings as you suggest later today.
     
  5. razo84

    razo84

    Joined:
    Jan 15, 2017
    Posts:
    21
    Hello everyone, I just purchased Suimono, and while everything seems to be clear, in Play mode caustics shows only for few frames, then disappears. I can even pause the editor, and caustics is still present, so it must be something turning it off. Anybody experienced this?

    Any help appreciated. Thanks!
     
  6. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    FYI: I pinged him on the forum, he says he's still working on it and the update is just about ready to release.
     
    chingwa likes this.
  7. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @razor84 I don't think I've ever heard of this happening, but it could be a bug of some kind. Do you have a 'Scene Light Object' designated in your Suimono_Module object? Does disabling the 'enable advanced caustics' setting (on the module) have any impact on this issue?
     
  8. razo84

    razo84

    Joined:
    Jan 15, 2017
    Posts:
    21
    Caustics works in the demo scene. But even if I drag all necessary GameObjects from demo into my scene, it acts same (appears in first frame, then gets disabled).

    All objects should be properly set, followed the manual and demo scene.

    Now I just found out that it's the actual WaterSurface "blocking" the projection. When I turn it off, caustics appear on the terrain.

    This seems like a occlusion mask issue on certain object?


    EDIT: OMG, something is setting the intensity of the caustics light to 0 :mad:

    Will probably work it out from here... Cheers.

    EDIT 2: Nope, I won't :) I can change the "mainCausticObject" light intensity when game is paused, in real-time it keeps getting intensity=0 from somewhere.
     
    Last edited: Dec 28, 2017
  9. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Intensity on that component is set directly from the Module object... is it set appropriately there in the caustics section?
     
  10. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    I would also ask whether Suimono has set it's layers properly or not in your project? It should have added 3 additional suimono-speciic layers to your project, and should be using them accordingly (for example, all water surfaces should be on the suimono water layer). In some cases this gets mixed up, and layers get confused... using the wrong layers for objects. This could cause a myriad set of issues.
     
  11. razo84

    razo84

    Joined:
    Jan 15, 2017
    Posts:
    21
    Ok, I think I found it.

    Layers that you mention are all set, those were assigned automatically.

    I just found in SuimonoModule.cs that something is forcing certain amount of "hFac" to the CausticModule, which in some other script results in "0" for that light? When I set it to "0.0f", my caustic light intesity is now 1.5 and caustics appear in realtime. I am no coder, so not sure if that can mess up with something else?

    Code (CSharp):
    1. if (suimonoModuleLibrary.causticObject != null){
    2. suimonoModuleLibrary.causticObject.heightFac = underwaterObject.hFac * 2.0f;
     
    chingwa likes this.
  12. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @razo84 Nice going hunting down that code. Setting this to 0.0f should not hurt anything else in the system. This is actually a part of some vestigial code that isn't even used much anymore. I will adjust this so it shouldn't happen to you in the future.
     
  13. razo84

    razo84

    Joined:
    Jan 15, 2017
    Posts:
    21
    @chingwa Thanks a lot for your help!

    Yep, everything seems to be working fine.
     
    chingwa likes this.
  14. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Hello all, just wanted to put a note here to let everyone know that my email account is currently down because of maintenance issues. If anyone has tried to contact me the last few days, I have not been able to send or receive any emails at all. Please contact me here in the forums until the problem is resolved

    Edit: All is fixed!
     
    Last edited: Jan 25, 2018
  15. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Hi @PeterB actually SuimonoGetHeight() is exactly what you need. You pass a specific Vector3 position to the function, as well as a string mode description. So for example to determine if the character is underwater you would want to use a Vector3 Position at the top of the character's head, to determine if completely submerged. You would probably want to use the mode string "object depth", which will return a float value < 0f if above water and >0f if below water. There are other mode strings available if you want different information...

    "height" - returns world height of waves.
    "surfaceLevel" - returns local surface level of water, including waves.
    "baseLevel" - returns base y-position of water surface.
    "object depth" - returns float value relative to water surface including waves. >0f for underwater, <0 for abovewater.
    "isOverWater" - returns 1f if above any water surface, otherwise returns 0f.
    "isAtSurface" - returns 1f if near water surface, otherwise returns 0f.
    "direction" - returns 0-360f showing wave flow direction.
    "speed" - returns float showing wave speed.
    "wave height" - returns float of wave height relative to base surface height.
    "transitionDepth" - returns transition offset value of water surface.
    "underwaterEnabled" - returns 1f if enabled and 0f if disabled.
    "causticsEnabled" - returns 1f if enabled and 0f if disabled.

    The function will take into account wave positions and height as well, if that info is related to the mode. The only thing it doesn't currently take into account is shoreline waves, if you are using a ShorelineObject in your scene.

    Here's an example:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class TestUnderwater : MonoBehaviour {
    5.  
    6.     public bool isUnderwater = false;
    7.     public float underwaterFac;
    8.     public Transform trackPosition;
    9.  
    10.     private Suimono.Core.SuimonoModule moduleObject;
    11.  
    12.  
    13.     void Start () {
    14.         moduleObject = (Suimono.Core.SuimonoModule) FindObjectOfType(typeof(Suimono.Core.SuimonoModule));
    15.     }
    16.  
    17.     void Update () {
    18.  
    19.         if (moduleObject != null){
    20.  
    21.             underwaterFac = moduleObject.SuimonoGetHeight(trackPosition.position,"object depth");
    22.  
    23.             if (underwaterFac > 0f){
    24.                 isUnderwater = true;
    25.             } else {
    26.                 isUnderwater = false;
    27.             }
    28.         }
    29.  
    30.     }
    31.  
    32. }
     
  16. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    Thanks. On the other hand, wouldn't a simple moduleObject.isUnderwater accomplish the same thing?
     
  17. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    That will tell you if the currently tracked camera is underwater. But if you want to track a specific position on your character then that might not be the same thing.
     
    PeterB likes this.
  18. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    Thanks, Chingwa! Another question: I'm running on Unity 2017.3. The water surface no longer animates. Caustics do, but the water surface is still. The only thing that seems to help – sometimes – is to remove Suimono and reinstall, but this doesn't always help. Any idea what causes this and what can be done to fix it?
     
  19. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @PeterB I have tested here in 2017.3 and have not noticed any issues, but I will keep my eye out for problems. I've not ever heard of the water stopping the way you describe. I'm not sure why that would happen, but I would double check the 'Wave Speed' setting just to make sure it isn't somehow getting changed while your scene is playing.

    If you have a small project that recreates this issue that you can send, I'd be happy to take a look and see if it continues on my end, you can send links to me directly at konnichiwa@tanukidigital.com
     
    PeterB likes this.
  20. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    I found it – network time sync had been turned off. Checking the checkbox fixed it.

    However, I have another occasional problem:

    I'm getting this on Unity 2017.3p2 (although it's been an occasional problem in quite a few versions before that one):

    Screen Shot 2018-01-15 at 12.50.53.png

    The black polygons flicker rapidly.

    Mac MBP 2017, High Sierra. Suimono 2.1.5. Metal, Deferred, HDR.
     
  21. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Is that your underlying terrain popping through the water surface?
     
  22. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    Absolutely not. This is purely a water surface problem.
     
  23. razo84

    razo84

    Joined:
    Jan 15, 2017
    Posts:
    21
    Hi everyone, just want to post my NEON Challenge submission, where I used SUIMONO pretty heavily. Great asset, solved tons of my problems! Happy for likes etc ;) https://connect.unity.com/p/homecoming
     
  24. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @razo84 Congrats, and thanks for sharing, that looks awesome! I especially love the mechanical-psychic-wtf-whales :D

    @PeterB I would be very curious to know, as a test, if changing deferred to forward and/or removing all other camera effects in your scene have any effect on these artifacts?
     
  25. reeushop

    reeushop

    Joined:
    Nov 15, 2016
    Posts:
    7
    Hello Chingwa

    I would like to know if there is a way to make large storm like waves in the current suimono system.
     
  26. reeushop

    reeushop

    Joined:
    Nov 15, 2016
    Posts:
    7
    Similar to this: Screen Shot 2018-01-29 at 4.56.24 pm.png
     
  27. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    366
    The flickering is only observable in Deferred mode, and even in the Preview subwindow in the Scene window. Effects don't seem to affect it.
     
  28. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @PeterB That's interesting. I don't typically see any problems between forward and deferred... the only exception I've seen is an issue with some Ambient Occlusion assets. Particularly I've seen issues with an older version of the Unity post-processing stack, but I believe these were fixed with one of their updates a few months back. This still happens in Deferred with all camera effects removed? Are there perhaps other assets in your scene that are injecting command buffers to the camera while playing? Are you using a sky system, or just a static skybox? (and if so does disabling the sky have any change on this issue)?

    @reuben31 Suimono can do large waves, and you can adjust the colors to somewhat match your reference, but it does not handle any weather/storm effects like the foam and spray you see in that image.
     
  29. montyjack

    montyjack

    Joined:
    Jan 10, 2014
    Posts:
    43
    Hi- I'm evaluating unity water assets for a project I'm working on. Suimono looks to be to most robust option, but I wanted to know how performance was when the ocean / water is being viewed from far away, as in a flight sim. I'd prefer something that has real waves, unlike a flat ocean shader, but I don't want to brick performance just for that. IIRC, you can set the detail levels of Suimono water meshes, but not for infinite oceans. Are infinite oceans optimized to be viewed from far away?

    Also, does Suimono have built in support for wakes / splashes or do I need to do that myself?

    Thanks!
     
  30. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @montyjack Sorry for the late reply. I've been away traveling and have not had adequate time to check in here for the last week. Performance when viewed from far away should be the same or better as when viewed up close. You're right that you can't set the mesh detail level for the infinite ocean setting, but you can set/adjust the tessellation level. Higher tessellation will look better at close distances but come at a performance cost... however at far distances tessellation should simplify itself automatically and in most cases should not interfere with distance viewing.

    Suimono has splashes/ripples, but wakes are not currently included.
     
  31. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    @chingwa Hi, there seems to be some problem with Suimono, it is not rendering in play mode. It's something camera related. If I (in Game mode) disable the camera, then re-enable it, it works. If I delete all Suimono objects from the scene, it works. It will not work if I just go into play mode, and test as normal. Any idea what's causing this?

    I'm on Unity 2017.1.0p4.
     
  32. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @Deckard_89 It sounds like Suimono is not able to find the camera when the scene starts for some reason. Is your camera part of the scene in the editor or does it get added after starting? Is the camera set with the 'MainCamera' tag?
     
  33. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    131
    Hi

    I can't seem to get the foam to look right - it looks overexposed. Any tips?

    /Jason
     
  34. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
  35. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    @chingwa Yes the Main Camera is in the scene and is tagged MainCamera. I also noticed that the Suimono underwater fog script keeps getting added to the camera whenever I hit play, even though I have underwater disabled in the surface settings, and so I keep manually removing it from the camera - before it gets re-added when I enter play mode. Could this be related?
     
  36. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @Deckard_89 Actually those two issues seem to contradict each other... if it's able to add the effects to the camera then it definitely knows which camera is the main scene camera. Hmmm. Is your main camera set to render the 'Suimono_Water' layer? After you press play (and the water disappears) is it STILL set to render the Suimono_Water layer? Perhaps there is an issue with layer assignments happening here...?

    If you don't want or need the underwater effects then you can disable 'set automatic FX' at the top of the module object, which will prevent it from being added to your camera during play/edit mode.

    Having underwater effects turned off ought also prevent this from being added as well, so I will add this to my bug-fix list.
     
  37. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Set to render the layer? You mean in the camera's culling mask? Yes. In play mode, Suimono water layer is still set to render, but Depth and Screen are disabled (I assume that's intended though).
     
  38. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Yes, I meant the culling mask. Depth and Screen should be automatically disabled so that seems to be working as expected. I'm unsure now what the issue would be... the Suimono Surface should also be automatically set to the Suimono_Water layer... so that is one last thing to check while in edit mode. Does Forward/Deferred rendering on your camera make any difference?
     
  39. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    316
    Suimono Surface is on the Suimono Water layer, and there is no difference in Forward or Deferred rendering... Really weird. It's not just Suimono that doesn't render when I enter play either, it's also my post effects and other components that don't render.

    Your demo works fine by the way - I even tried with the post fx and stuff that I'm using in my scene (Unity's PP stack and SSMS), and it works fine - and I tried your demo within the same project, so my own scene is just bugged somehow, or at least the camera is. o_O
     
  40. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    131
    Thanks for the earlier help.

    I'd like to try this out with TENKOKU - is there any documentation for doing this? Also, I'm think of testing it with realistic water physics. Impressed so far!
     
  41. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @Jason210 I haven't tried the new Realistic Water Ohysics version, though the dev says it works so I have to trust him! :D As far as Tenkoku integration, they are pretty much plug-and-play with each other. Just remember to remove any existing directional lights from your scene after installing Tenkoku (since it includes it's own).
     
  42. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    131
    THanks for your reply Chingwa. That was too easy! I could play around with this for hours exploring the possibilities. If wonder if you can tell me the best way to adjust the dynamic reflections of the clouds in the water so that they are less mirror-like? I've tried the GUI sliders and they do help, but ocean reflections tend to be much more diffuse.
     
    Last edited: Feb 28, 2018
  43. MoonShineInteractive

    MoonShineInteractive

    Joined:
    Feb 18, 2016
    Posts:
    1
    @chingwa Hi, I am using Unity 2017.1.0f3 and Suimono 2.1.5 to develop an PC standalone app. There is a weird problem with underwater fog. The underwater fog looks fine while playing in Unity Editor. fog1.PNG

    But the fog looks like this in the built PC standalone player. fog2.PNG
    The are only few things in the scene: camera, directional light, suimono object, suimono surface and a water tank model. Is there anything in your mind that might cause the problem?

    P.S the graphics API is Direct3D11
     
  44. SveinEven

    SveinEven

    Joined:
    Sep 25, 2014
    Posts:
    99
    Hello good sir!
    I am currently creating a big world for a game, and is using water4 at the moment.
    But Water4 uses a lot of resouces, and is a bit clumpy to modify.

    How is this performing compared to Water4Advanced?
     
  45. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @SveinEven I'm not sure how much performance improvement you would see as compared to Water4. Suimono uses similar ways of calculating reflection and much of the performance in Suimono can be linked directly to the complexity and performance of the rest of your scene. If you have a well optimized scene then you should not notice any performance problems with Suimono. If however you already have a big performance load then Suimono will exacerbate this. There are of course a myriad of ways to optimize Suimono features so they are lighter and have less impact, and the visuals are far and away superior to Water4.
     
  46. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @MoonShineLab Sorry, I'm not sure how I missed this question. I'm not aware of any issues that would cause a build discrepancy like this. It almost looks like the camera is cutting off early in the build version, but it's hard to say. Are you still experiencing this problem?
     
  47. GXMark

    GXMark

    Joined:
    Oct 13, 2012
    Posts:
    514
    Transitioning not working it displaces the character in the 2.1.5 Version.

    Ignore the blue circle thats something else nothing related to this issue.

    upload_2018-3-21_8-24-10.png
     
  48. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @GXMark Isn't the displacement due to the Transition effect? What about it isn't working? Perhaps the refraction is too strong?
     
  49. NicBischoff

    NicBischoff

    Joined:
    Mar 19, 2014
    Posts:
    204
    Hi. A prepurchase question. Does this work with an orthographic camera? Does the shoreline sample the delete correctly with the ortho setup? Thanks.
     
  50. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @NicBischoff Using Orthographic cameras is possible to a degree, but to be honest Suimono isn't designed for it and does not work fully. You can get a water surface to render pretty well, but underwater does not work, shorelines do not work, foam is more difficult to tweak, and a number of default settings need to be adjusted in order for water to display correctly. Below is an image from the included demo scene where I switched to Ortho and then tweaked some settings.



    Also, just for the sake of full transparency, I am working on the next generation of Suimono with version 3.0, and I haven't been able to get orthographic cameras to work in my experimental builds at all. I may be able to get it to work before it 's finished but it isn't currently a priority. (I will add it my testing list)
     
    Rotary-Heart likes this.