Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

SUIMONO 2.0 - Interactive Water System

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

  1. Game_DevKH

    Game_DevKH

    Joined:
    Jun 11, 2017
    Posts:
    23
    Hey, do you have water flow system like R.A.M in this plugin?
     
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @Game_DevKH No, there is not a river flow system. However you can import your own custom river meshes and water will "flow" according to the UV layout.
     
    Game_DevKH likes this.
  3. Migueljb

    Migueljb

    Joined:
    Feb 27, 2008
    Posts:
    562
    Whats the highest version of unity this still works and looks good in? 2019.3 - 2019.2 - 2018.4 LTS etc.
     
  4. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Works as expected with all release versions of Unity (I've personally tested up to 2019.2.11), as long as you are using standard/default renderer. (does not currently work with URP or HDRP render pipelines).
     
  5. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    An addendum to the above. Suimono has been tested in Unity 2019.3, just released today and all is working as expected. The new UI changes in 2019.3 seem to all have transitioned as expected.
     
  6. Radu392

    Radu392

    Joined:
    Jan 6, 2016
    Posts:
    210
    Hi, I'm trying to make the water surface completely opaque, meaning that if the camera if above water, one cannot see what's underwater. I've been playing around with lots of settings, but none seem to accomplish this. Any help is appreciated!

    I tried making every colour field have a transparency of 1 on the surface object. I've also tried every other field from its min to max value but you can still see objects underwater from above.

    When 'overall transparency' is set to 1, you can still see rocks:

    https://puu.sh/F6ndS/8718ce0594.png

    When it's set to 0.5 (just for comparison):

    https://puu.sh/F6nfS/73b13e3a4b.png

    Some objects seem to completely disappear, others not but all of the objects in the pictures use the same standard unity shader. What's more is that this slider doesn't affect distant objects:

    https://puu.sh/F6nj1/1194bc4050.jpg

    That big rock is still behaving as if the setting was set to 1. I should specify that I'm also using Tenkoku.
     
    Last edited: Feb 2, 2020
  7. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Hi @Radu392 If you want to turn off all transparency then the best thing to do is to simply disable the transparency function on the module, as that has the benefit of removing the extra transparency processing going on in the background.

    However if you want to make the water opaque on an individual surface basis, then under the 'Water Surface' tab I recommend setting the following settings to 1.0...
    - Edge Blending
    - Depth Absorption
    - Shallow Absorption

    Then you can control the water color using the Surface Overlay Color, and also setting that alpha to 1.0.

    This should give you opaque water with only a slight feathered edge when looking into from outside the water surface.
     
  8. Radu392

    Radu392

    Joined:
    Jan 6, 2016
    Posts:
    210
    Setting the alpha on the Surface Overlay Color indeed does make water opaque in the demo scene, but not in my scene. Looks like I'll have to do some debugging. Thanks for the help.
     
  9. markent94

    markent94

    Joined:
    Dec 5, 2019
    Posts:
    1
    Hi, I've got a project with a remote controlled robot displaying multiple cameras at once. Some cameras will be underwater while others will be above water. Right now all cameras are affected by the scene camera object. Is it possible so that some cameras show above water while others show underwater?
     
  10. Efril

    Efril

    Joined:
    Aug 31, 2013
    Posts:
    82
    Hello @chingwa . I faced a problem with Suimono where the system throws the 'Screen position out of view frustum (screen pos 256.000000, 0.000000, 1000.000000) (Camera rect 0 0 256 256)' (and no call stack at all) error. This happens when the main camera is a child of the ship object and ship swinging on the waves (so camera moves as well). In the test project I was able to reproduce this error when main camera slowly rotating around world Z axis:

    The error definitely related to Suimono reflections camera. It disappears if I turn 'Scene Reflections' off. The position of the main camera is not far from zero position so floating precision points errors is not the reason I think. Near/Far clip planes of the camera is 1/1000 which is also fine. I was able to catch matrices of Suimono reflection camera just before the error occurs:
    worldToCameraMatrix:
    0,5830247 -0,04912727 -0,8109677 1758,125
    0,2422689 -0,9422461 0,2312531 -510,3803
    -0,775492 -0,3312986 -0,5374508 1027,592
    0 0 0 1

    projectionMatrix:
    1,299038 0 0 0
    0 1,732051 0 0
    -0,1143878 -2,193924 0,2286052 -126,111
    0 0 -1 0

    They looks fine to me as well.
    Important note that this error not catched by try/catch block so I can't simply ignore it.

    There are 2 themes on this forum addressing 'Screen position out of view frustum' errors. But most of the complaints are about orthographic 2d camera or Unity editor scene view. None of them are similar to my case. Did you faced similar errors in the past? Maybe you have some thoughts how to fix it?
    Thanks in advance.

    P.S. The similar error appears with Ultimate Water System reflections (their code related to reflections seems very similar to Suimono) but in that case Unity shows me the call stack (but ignores try/catch block as well):
    Code (CSharp):
    1.  
    2. Screen position out of view frustum (screen pos 256.000000, 0.000000, 1000.000000) (Camera rect 0 0 256 256)
    3. UnityEngine.Camera:Render()
    4. UltimateWater.PlanarReflection:RenderReflection(Camera, Camera) (at Assets/Ultimate Water System/Scripts/PlanarReflection.cs:341)
    5. UltimateWater.PlanarReflection:OnWaterRender(WaterCamera) (at Assets/Ultimate Water System/Scripts/PlanarReflection.cs:151)
    6. UltimateWater.Water:OnWaterRender(WaterCamera) (at Assets/Ultimate Water System/Scripts/Water.cs:469)
    7. UltimateWater.WaterRenderer:RenderEffects(WaterCamera) (at Assets/Ultimate Water System/Scripts/WaterRenderer.cs:71)
    8. UltimateWater.WaterCamera:RenderWaterEffects() (at Assets/Ultimate Water System/Scripts/WaterCamera.cs:839)
    9. UltimateWater.WaterCamera:OnPreCull() (at Assets/Ultimate Water System/Scripts/WaterCamera.cs:540)
    10. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    11.  
     
    Last edited: Jun 19, 2020
  11. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @Efril Thank you for the detailed breakdown. I HAVE seen this bug at intermittent times in the past, and it seems to be caused by a few different issues, either relating to scene camera or in-game cameras. It's always been difficult to track, and fix due to it not being reliably reproduceable.

    However I've made a couple edits to the reflect camera code (after searching around the internet again) which might help... please download/unzip the following unitypackage and install on top of your current Suimono install:

    http://www.tanukidigital.com/suimono/misc_files/SuimonoReflectCamFix_1.zip

    This will replace the 'cameraTools.cs' code with the updated version. Let me know if this helps or if you still continue to see this particular issue.
     
  12. Efril

    Efril

    Joined:
    Aug 31, 2013
    Posts:
    82
    @chingwa , the issue is still clearly reproduceable after updating cameraTools.cs. I see no changes. Fortunately it seems not crashes my builds.
     
  13. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @Efril Hmmm.... Is it possible for you to send me a small ZIP'd project reproducing this? I can't get it to happen on my end currently, but with a reproducing project I could almost certainly isolate the code and do a fix or workaround. Otherwise I am just guessing, unfortunately.
     
  14. Efril

    Efril

    Joined:
    Aug 31, 2013
    Posts:
    82
    @chingwa I sent a link to a test project to yout Tanuki Digital email. It is the same project as you can see in the video in my first message.
     
  15. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Thanks @Efril I'll download and get back to you ASAP.
     
  16. Deleted User

    Deleted User

    Guest

    hello again : ), I forgot where to set "none" ? where exactly ? °°
     
  17. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @w0rksgame Go to your SuimonoSurface object, and then all the way at the bottom under the "presets" tab you should see "none" at the top o' the list.
     
  18. Deleted User

    Deleted User

    Guest

    https://ibb.co/QQj5L0h

    I don't know where ? °°
     
  19. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    ...where it says " - NONE - " at the top of the list.
     
  20. Deleted User

    Deleted User

    Guest

    OMG !! : o I overlooked that all along, now I feel pretty stupid : D thanks !!
     
    chingwa likes this.
  21. Deleted User

    Deleted User

    Guest

  22. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    I don't know what that line is, is it part of the skybox? Does it appear at different angles?
     
  23. Deleted User

    Deleted User

    Guest

    I was able to fix it, It was the Surface Blend Color : )

    I Love this Asset very much !!
     
  24. Deleted User

    Deleted User

    Guest

    will there be updates in the future ? or is it already done ?
     
  25. Deleted User

    Deleted User

    Guest

    can i move the folder "SUIMONO - WATER SYSTEM 2" to another folder without problems ?

    is that already possible ?

    would interest me, I don't dare to try it because I am not sure if there will be any problems then ^^
     
  26. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    No, don't try it, it will likely throw errors in your project. This is something I have plans to fix in a future update.
     
  27. Deleted User

    Deleted User

    Guest

    that would be very, very use & helpful ! : )
     
  28. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @chingwa !!!! Are there plans for a SUIMONO 3.0 (more realistic) in HDRP ????
     
  29. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Hi @ftejada There are plans for a 3.0 with many improvements in rendering and features. However HDRP support is still undetermined at this stage.
     
    Shodan0101 likes this.
  30. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
  31. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    374
    It is certainly a question already asked. But I haven't found it.
    What is the best performing function to know when the camera is underwater?
    A bool would be enough for me.
    I can not only use the height of the camera but also if the camera is really in contact with the water.

    I need it to remove gravity from the player (first person) to slow down his movements etc ...
    Are there any functions specifically dedicated to this?
     
  32. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @WILEz1975 Check out page 16 and 17 of the documentation here:
    http://www.tanukidigital.com/suimono/documentation/suimono2_documentation.pdf

    You can use the SuimonoGetHeight() function using the "object depth" string in order to get the wave/water height at that position. If the returned float value is positive, then that indicates the depth below the water (so anything greater than 0 would be underwater), and conversely if the value is negative that indicates the object height above the water.... so for example this pseudocode here:

    Code (CSharp):
    1. Suimono.Core.SuimonoModule moduleObject;
    2.  
    3. void Start(){
    4. moduleObject = GameObject.Find(“SUIMONO_Module”).gameObject.GetComponent<Suimono.Core.SuimonoModule>();
    5. }
    6.  
    7. void Update(){
    8. Vector3 testPosition;
    9. float waterHeight;
    10.  
    11. testPosition = this.transform.position;
    12. waterHeight = moduleObject.SuimonoGetHeight(testPosition,”object depth”);
    13. }
     
  33. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    374

    Thank you.
    Is SuimonoGetHeight() expensive? Is it to be avoided in the Update?

    GameObject.Find(“SUIMONO_Module”) not ideal for me, I may have more "SUIMONO_Module" in scene. My scenes is additive on loading etc... but this is not a problem.
     
  34. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Yes, you should avoid doing it when you don't have to. If you need constant checks you should probably limit the check to a lower frame rate of 10 updates a second.

    I don't recommend having multiple SuimonoModules, regardless of additive loading. However if that's the best choice for you then you should make a more explicit link, instead of the above generic example :)
     
  35. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    374
    I can make notDestroyAtLoad the module.
    But I didn't understand a thing.
    The guide says "Access specific data of the water surface" but the method is of the module and not a specific surface. Can I access a specific surface or just the module?
    Does this mean that the method takes into consideration all the surfaces on stage?
    It means that each scene can only have a surface?
     
  36. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    You can access and change visual settings on a specific surface by referencing Suimono.Core.SuimonoObject class for that object... However the function for determining height is accessed globally through the Module... this will work given any world position and will return the height based on any surface that happens to be at that position.

    I only recommend one module per scene, however you can have as many surfaces in a scene as you want. Just be aware one limitation of checking heights is if you have multiple surfaces at a single position (for example, two stacked on top of each other at different heights) and do a height check, it will reference only the top-most surface at that specific position.
     
  37. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    374
    Another thing (yes I know I will break you).
    "object depth" seems to me to return position in relation to the surface. Regardless if the object is within a surface.
    But I have for example cavities (caverns) in the scene that go lower than the water level but where there is no water ...
    I will look in the scripts for a trigger/bool that activates the "underwater" effect.
     
  38. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    Yes that is correct... there is only "underneath" there is no "within", at least not in the current system. The module has a public bool variable called "enableUnderwaterFX" that will force the effect off (on all scene surfaces). OR you can possibly just turn off the relevant water surface object once you are inside the underwater cave.
     
  39. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    356
    The SUIMONO_Surface/object/objectscale keeps setting it's layer to 8 which is my "Soil" layer. I can't get it to go to the Suimono_Water layer.
     
    chingwa likes this.
  40. Razputin

    Razputin

    Joined:
    Mar 31, 2013
    Posts:
    356
    nvm this fixed it for me.
     
    chingwa likes this.
  41. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @Razputin Glad it's working for you now. Let me know if you run into any further trouble.
     
    Razputin likes this.
  42. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    @chingwa I have recently purchased this as a part of the unity bundle. I am struggling to get the shore waves working. I have set up my shorelineObject. I have tried fiddling with all the options i could but I have been unable to get shore waves working. The help file is useful for telling what each option does, but i'm not sure what I should be doing to get the optimal results. I have a tropical archipelago where the islands are all close to each other. should I have a unique shorelineObject for each island or one for the whole map? If i have them per island there will be overlapping. Is this going to be an issue?
    Are there any online tutorials showing how to set up shorewaves? I would like to have something like this in your video.


    Also if I change the Wave Scale (Beaufort) in the SUIMONO_Surface prefab then when i hit play it reverts back to what it was before. How do I get my changes to stay? I've been able to work out the preset saving. Still no idea about how to get the shore waves to appear
     
    Last edited: Nov 7, 2020
  43. vertexx

    vertexx

    Joined:
    Mar 18, 2014
    Posts:
    379
    To keep changes...Click on the ...None... button on top of those presets tabs. Then do your changes..then add it as a new preset. Or after modifying a preset..click the "none" tab and do the same.
    I would like to know how one lights up the underwater scenes.. Mine are all very dark under the water. Very dark.
    How does one light it up to see underwater further than a few metres?
    EDIT: Should add this...You can also modify an existing preset and when done simply click the "+" button to the right of the preset name to update it. Clicking your preset will load it into the scene.
     
    Last edited: Nov 8, 2020
  44. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @whidzee For the ShorelineObject in your case it's probably best to have multiple objects (one for each island for example?) instead of one large shorelineObject that covers everything. The larger you stretch the ShorelineObject then the lower the internal computed resolution is available for wave heights, which is perhaps part of the problem you are seeing. I believe overlapping is best to avoided if possible... but this isn't critical as long as you don't see any negative side effects in the wave generation.

    For changing settings in Edit mode, @vertexx gives good advice here...make sure the selected preset is set to none (otherwise it will load that preset when you play and not load your custom settings), or what is most recommended is to make a new preset while playing and change settings to get the look you want in Play Mode, then save or update (with the + button) your custom preset before stopping.

    @vertexx For underwater darkness I would say tip #1 is to make sure your scene Directional Light is set in the SuimonoModule config settings, and then make sure the 'light factor' is set to 1.0 in the surface underwater settings. This will then adjust the underwater fog based on that light color/intensity. Also in the underwater settings you can brighten the "fog color" to perhaps artificially impact the perceived brightness underwater. Also you may want to expand the depth darkening range to the max(500?) to prevent the system from darkening the water any further.
     
  45. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    166
    No matter what I do I cannot get the shore line waves to work. I have even tried loading the demo beach scene that comes with Suimono and the shore waves are not working there either. I've tried tweaking any settings i could find and still not having any luck. Is there something I am missing?
     
  46. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @whidzee I've confirmed that there is a bug in Suimono 2.1.9 which is preventing expected shoreline wave rendering. I will be releasing an update to fix this soon.
     
  47. Euromancer

    Euromancer

    Joined:
    Aug 21, 2017
    Posts:
    11
    Hi, I wonder if this is a known issue which can be fixed easily. This is Suimono where the water reflects the player fully to the horizon, so it's basically acting as a mirror instead of a stretched out water surface.

    Possible conflicts would be that I'm using Enviro. Also I've made some global shader keywords local using the Shader Control asset so perhaps it has something to do with that..

    But if you recognize the problem it would be great if there's a quick fix.

    SuimonoMirror.png
     
  48. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,789
    @Euromancer Does this appear to be a constant error, or does it occur only when moving? If it's only when moving then it's possible there is a timing error between Suimono's reflection generation and your camera update. In those cases setting a manual render order in Unity preferences usually fixes that proble, (i.e. putting SuimonoModule.cs and/or CameraTools.cs above your camera or controller component in the render order list).

    Suimono does not use Shader Keywords so I don't believe that editing global keywords should have an affect. It's possible there's some kind of Enviro bug, but I would rule out cameras and controllers first.
     
  49. Euromancer

    Euromancer

    Joined:
    Aug 21, 2017
    Posts:
    11
    Thanks loads, yeah it's only when moving. Tried to add the scripts in Script Execution order, was that what you meant? Didn't help unfortunately.

    It did go away at one time when I deactivated cam_SuimonoTrans. It immediately auto activated itself (at least the checkbox didn't go away)and after that the reflection was gone. I tried re-adding the module and water surface and the problem was back.

    Now I deactivate and activate cam_SuimonoTrans in update after teleporting the player which seems to fix the problem.
     
    chingwa likes this.
  50. Euromancer

    Euromancer

    Joined:
    Aug 21, 2017
    Posts:
    11
    Ok now another question. I searched and looked for glitter here but couldn't find anything.
    How can I turn down this glitter and blooom effect? Is it related to that the surface is 5000x5000?
    upload_2020-11-19_13-11-28.png
     
    Last edited: Nov 19, 2020