Search Unity

SUIMONO 2.0 - Interactive Water System

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

  1. NicBischoff

    NicBischoff

    Joined:
    Mar 19, 2014
    Posts:
    127
    Thanks for the very quick reply. I urge you to add this to 3.0 to as good a quality as possible. If you search these forums and online there are many many people looking for a decent ortho water solution (there are none). I think it would be a good selling point.
     
    chingwa likes this.
  2. mwituni

    mwituni

    Joined:
    Jan 15, 2015
    Posts:
    345
    Thank goodness (re 3).
    There's not been updates for ages ... no doubt that's why!
     
    chingwa likes this.
  3. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @mwituni Yes it has been a number of months without an update, but have no fear, Suimono is not abandoned. I do think the current system design has reached an "end of life" stage where it doesn't make much sense to keep pushing updates to (unless major bugs are found of course). For version 3.0 I've started the water over from scratch using different methods, and progress so far is very promising. :)

    I do keep running into technical hurdles, which prevent me from opening up and talking much about what version 3.0 will bring. I am usually able to get over these issues eventually (after a lot of frustration, gnashing of teeth, and pulling of hair :D) but new ones keep popping up.

    I want to nail down all the basic functionality first before giving news/screenshots. Hopefully that will be soon!
     
    mwituni likes this.
  4. hooraypublic

    hooraypublic

    Joined:
    Feb 8, 2014
    Posts:
    13
    Hi,

    Bought the asset a few days ago along with Tenkoku. Liking them so far. But I have some questions:

    Is Suimono compatible with river or waterfall tools, particularly River Auto Material?

    Are there plans for more object interaction effects, such as trail and underwater bubbles?
     
  5. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @hooraypublic I have not tried RAM personally, so I can not tell you for sure. :( You can use custom mesh with Suimono, which may be something you could save out from RAM or another river builder. You would first need to be able to sae the river as a mesh in your project, and Suimono will expect the UV's to be in a top-down planar orientation.

    I have tried EasyRoads3D, but it did not put the uvs in the expected format thus did not work properly.

    As for effects, I would like to add some specific effects like trails/ship wakes as part of 3.0, but I have not made any prototypes for it yet.
     
    mwituni likes this.
  6. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    121
    Hi @chingwa, first off, great asset--like always, appreciate the support.

    I don't have a lot to go on here, but our water was working fine in Unity 2017.2. We've recently updated to 2017.4, however, and all water is now completely black. Nothing is jumping out at me, although I need to do a deeper dive (pun intended.) My question is whether or not, off the top of your head, there is something quick we might be able to check to get this working properly again or if you've heard of any issues like this using 2017.4? Or if completely black water is something that might have an obvious cause (or causes) we can look into.

    In the meantime, I'll dig into it a little bit more, but just wanted to check!

    Thanks!
     
  7. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @Multithreaded_Games To be honest I was not even aware that 2017.4 was available. :D It's kind of hiding away from the main download page. Suimono works just fine in 2017.3, and I wouldn't expect 2017.4 to introduce any breaking bugs, but I will download and test on my end just to be sure.
     
  8. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    OK after downloading and testing I haven't noticed anything wrong with playback in 2017.4... I doubt it is the upgrade alone that is causing a problem, but perhaps there is some obscure issue that I'm not experiencing in my test project. I might suggest turning off all non-suimono camera effects, and or switching between forward/deferred, just as a test?
     
  9. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    121
    @chingwa No problem--I actually didn't realize it was so new and only upgraded yesterday. I've tried both disabling the post processing stack as well as switching the camera rendering mode, but nothing changed. I'll dig a little deeper whenever I get the chance.
     
  10. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    121
    @chingwa,

    One of the other members of my team performed the same update to Unity 2017.4, and has the following error messages:

    Shader error in 'Suimono2/surface': failed to open source file: 'SuimonoFunctionLibrary.cginc' at line 64
    Shader error in 'Suimono2/surface': failed to open source file: 'SuimonoFunctionLibrary.cginc' at line 82

    Not super well-versed in shaders, but that sounds like that could definitely be responsible for what's going on. Do you have any idea what would cause this? I should also note that we're using Suimono 2.1.3, but I've always been wary of updating (although we did it for Unity against our better judgment...). Do you think it'd be worth a shot in this case?
     
  11. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    Look in the Suimono "Shaders" folder and make sure you still have the SuimonoFunctionLibrary.cginc file in there. You could also try re-importing just that single file to see if it helps. It certainly sounds like something happened to that file during the upgrade process, and without that file running correctly none of the suimono surfaces will render properly.

    I do recommend upgrading to the latest version (2.1.3 was released over a year ago), but I don't know if it will fix this particular issue.
     
    Multithreaded_Games likes this.
  12. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    121
    @chingwa,

    Not gonna lie, I have no idea how this happened (if only I had even a nickel for every time I've said that.)

    Even reimporting that folder did not bring the file back into the project, but I was able to snag it from source control. Thanks again for your help--all seems to be working now.
     
  13. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    Excellent glad things are back to normal :D
     
  14. hooraypublic

    hooraypublic

    Joined:
    Feb 8, 2014
    Posts:
    13
    Hi @chingwa

    I'm encountering two problems and upon investigation it seems to be related to Caustic because they disappeared along with caustic when I disabled the CAUSTIC FX in Suimono Module.

    1. The water plane is blending in views from another camera in the scene both in Game view as well as in Scene view. They disappeared after disabling CAUSTIC. (See pic 1-3) This doesn't happen all the time, and usually shows up after a lot of camera movement

    2. The depth effect of the water doesn't transition smoothly when the camera moves, but instead they show up as "blocks". For example see pic 4, in the area I marked with red square, after I moved the camera slightly, a whole block of depth effect shows up as in pic 5. I've tried adjusting the clipping of the camera as well as turning on and off many other settings, but this seems to be a consistent problem, and will only disappear along with the CAUSTIC FX turned off.

    SuimonoBug01.jpg SuimonoBug02.jpg SuimonoBug03.jpg SuimonoBug05.jpg SuimonoBug06.jpg
     
  15. hooraypublic

    hooraypublic

    Joined:
    Feb 8, 2014
    Posts:
    13
    And now I think it has something to do with SuimonoDepth.cs or the SuimonoDepth.shader but I'm not sure exactly which part in the code.

    Also I'm using Gaia and the Suimono water is generated from its manager as a plugin, if that makes a difference.
     
    Last edited: Apr 6, 2018
  16. Kybernesis

    Kybernesis

    Joined:
    Dec 3, 2013
    Posts:
    27
    I stumbled upon a problem when building with Suimono. The build fails every time and I get the following error:
    Code (CSharp):
    1. [Error] Error building Player: Shader error in 'Suimono2/effect_splash': Fragment program 'frag_surf': Unrecognized sampler 'samplerunity_lightmap' - does not match any texture and is not a recognized inline name (should contain filter and wrap modes).
    2. (on d3d11)
    3. Compiling Fragment program with LIGHTMAP_ON SHADOWS_SHADOWMASK
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    I found this thread that proposed this fix:
    But that did absolutely nothing for me. I also tried tweaking those Lightmap Modes, but to no avail.
    I tried building in Unity 2017.3.1f1 and today I updated to 2017.4.0f1, but the issue persists.

    Any idea why this is happening and how I can fix it?
     
  17. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @Kybernesis I just tested a build in 2017.3 and it worked fine here on my end (PC). What build target are you using?
     
  18. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @hooraypublic Just FYI reflections will not look correct in the Editor window while playing your scene. This isn't a bug really, it's just an artifact of how the system renders reflections. However you should not see weird reflections in the play window... that is odd indeed.

    There is a long-known Unity bug where having two cameras might cause a RenderTexture issue such as this. Usually it occurs if both cameras are set to deferred. In my experience if the lower camera is set to Deferred, then the second/top camera has to be manually set to Forward, otherwise strange stuff tends to happen. This is not just with Suimono but is a Unity-wide problem. Do you think this has anything to do with your situation?

    As for the distance/depth issue, I'm not sure really. Is the transparency distance on the module large enough to generate transparency/depth out that far? Does switching between Deferred/Forward have any impact?
     
    D4N005H likes this.
  19. hooraypublic

    hooraypublic

    Joined:
    Feb 8, 2014
    Posts:
    13

    Increasing the transparency distance does solve the patchy transition issue!

    For those weird reflection even though I deleted all other cameras in the scene, it still persist. My camera is following a bird flying through the scene and whenever there's visible water surface in view, the surface area will show a doubling of the bird (not a reflection, because the bird is super high in the air. It's more like a low-res double-image and it only shows up when there's movement, as if it is too slow to catch up with the camera movement or the bird's movement). This issue will disappear if I exclude the default layer from the Transparency rendering.
     
  20. hooraypublic

    hooraypublic

    Joined:
    Feb 8, 2014
    Posts:
    13

    Also, I'm wondering if some of these issues are related to the Cinemachine system which I'm using. When Transparency is enabled, which allows the shallow part of the terrain to show, and a cinemachine camera is moving near the shore, the water surface seems to move up and down, as if the transparency detection is not able to catch up with the cinemachine camera movement. This issue doesn't show when I'm moving a normal Unity camera.
     
  21. Kybernesis

    Kybernesis

    Joined:
    Dec 3, 2013
    Posts:
    27
    Build target is Windows standalone. Could it be related to my baked lightmaps or something?
     
  22. Kybernesis

    Kybernesis

    Joined:
    Dec 3, 2013
    Posts:
    27
    Tried some more stuff:
    Cleared baked lightmaps - Build failed
    Tried non-additive scenes setup - Build failed
    Removed Suimono from the scenes - Build succeeded, but that's not exactly a solution :p
    Tried re-adding Suimono - Build failed again
    Tried removing Suimono asset from project and importing from Asset store - Build failed...

    Edit:
    Okay... So I just noticed that I've only been testing with a custom preset that we made for the water. So I tried changing it to one of the built-in presets and voila! It worked....So I guess I need to troubleshoot our custom preset now :p

    Lightmapper Edit:
    And now I tried to bake in the lighting again and we're back to build failed, same error... :\
    Hmm I'm using Progressive(Preview) Lightmapper, will try Enlighten and report back.

    Lightmapper continued:
    Tried Enlighten Lightmapper, but no change...
     
    Last edited: Apr 7, 2018
  23. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @Kybernesis Very strange! I'll try some tests on my end and see if I can figure out the problem. That shader does not have anything to do with lightmapping, but perhaps Unity is compiling something specific behind the scenes in your project which I'm not seeing. I'll get back to you ASAP.
     
  24. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @hooraypublic Just FYI, when I check with a cinemachine camera I also get the same errors in my tests scene. It seems to be a timing issue between whatever transforms cinemachine is making to the camera and when the Suimono transparency camera is running. So it's grabbing the scene just a step behind the cinemachine camera updates. I will investigate.
     
  25. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @hooraypublic OK, as I expected, Cinemachine is artifically delaying it's updates to the camera. If you got to Edit-->Project Settings-->Script Execution Order You'll see cinemachine execution is delayed until after the main unity loop.

    You either need to move cinemachine so it executes first (and suimono and other cameras will recognize the changes it makes) OR you need to add the Suimono CameraTools script into the order list so it executes AFTER cinemachine. Either one should fix this:

     
  26. Kybernesis

    Kybernesis

    Joined:
    Dec 3, 2013
    Posts:
    27
    I think I figured it out! I had a Directional Light with Mode set to Mixed, I changed it back to Realtime and voila, fixed! Tested switching it back to mixed and build failed, switched it to realtime again, build succeeded. So seems like it's an issue with baked lightmaps with Directional Lighting set to mixed mode. (I haven't tested baked mode yet)
     
    Last edited: Apr 7, 2018
    chingwa likes this.
  27. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    I've tried a bunch of stuff on my end but I can't recreate the build error. It's likely some macro that Unity runs behind the scenes during a specific lighting configuration. I've never even heard of "samplerunity_lightmap" before. If it continues to happen I could try editing the shader and send you an update to test, but I would basically be editing blind and only guessing.
     
    Kybernesis likes this.
  28. hooraypublic

    hooraypublic

    Joined:
    Feb 8, 2014
    Posts:
    13

    Thank you! This solves the problem entirely.
     
  29. Kybernesis

    Kybernesis

    Joined:
    Dec 3, 2013
    Posts:
    27
    As long as I don't use mixed mode on my directional lights with baked lightmaps, it seems to work fine. Avoiding mixed is fine for now, but iif you stumble upon a solution, do shout it out :)
     
  30. nikix22

    nikix22

    Joined:
    Jan 16, 2015
    Posts:
    20
    Hello :)
    I have question about reflected lights. How to achieve this effect on water?
    I looks like lights are not reflected in my scene... where I can set it up?

    Anyway, water looks fantastic!

    Greets!
     
  31. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @nikix22 The water surface should react with all light sources. If you have a light source that isn't reflecting properly, try going to the light "render mode" setting and set it to "auto". If it still doesn't work then set it to "important". This ought to fix most lighting issues.
     
  32. nikix22

    nikix22

    Joined:
    Jan 16, 2015
    Posts:
    20
    Thanks for help! :) it is working now.
    Just one question more about one constant error in unity which I am getting.
    Error is :
    Assertion failed on expression: 'ptr == NULL || !HAS_ROOT_REFERENCE(GET_CURRENT_ALLOC_ROOT_REFERENCE()) || GET_CURRENT_ALLOC_ROOT_REFERENCE() == GET_ROOT_REFERENCE(s_MonoDomainContainer, kMemMono)'
    UnityEngine.GUISkin:OnEnable()

    I am only getting this only once on startup and when object with suimono system is enabled. I am using Unity 5.6.5f1.

    And second question is about tweaking underwater animated light effect on surfaces. It looks when I move view faster then usual like effect is moving a little causing small artefact.

    Thanks in advance! :)
     
  33. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @nikix22 I have no idea where this error would be coming from, it doesn't really give any info relating to Suimono. The only thing that is intelligible is the GUISkin, but Suimono does not use this code anywhere. Are you sure this is Suimono related error? It's also possible it's related specifically to Unity 5.6.5...

    For your second question, are you referring to caustics? It's possible that the camera controller you're using and suimono are having a timing issue. This is usually the source of delay render issues. You can see a similar problem (with solution) in this post about unity cameras:
    https://forum.unity.com/threads/suimono-2-0-interactive-water-system.289311/page-22#post-3453864
     
  34. nikix22

    nikix22

    Joined:
    Jan 16, 2015
    Posts:
    20
    @chingwa Yes, it looks like issue with this Unity version, I was hopping someone faced with this issue in this version of Unity with Suimono system, will try to figure out from where it comes...

    For second, yes, I noticed that with caustics, will try you suggestion which you mentioned.

    Thanks!
     
  35. TalkieTalkie

    TalkieTalkie

    Joined:
    Jul 5, 2012
    Posts:
    120
    Will Suimono 3.0 be a free upgrade to current owners?
     
  36. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    Efril and TalkieTalkie like this.
  37. TalkieTalkie

    TalkieTalkie

    Joined:
    Jul 5, 2012
    Posts:
    120

    Sweet.

    Is there a roadmap (like Trello page) for us to gawk over meanwhile? :D
     
  38. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    No not currently. I'll be posting a list of features / improvements [somewhere] once I get to a more final stage of development. I'll probably do a closed/open beta period as well since 3.0 is a complete redesign.
     
    Efril, TalkieTalkie and Rotary-Heart like this.
  39. SureSight

    SureSight

    Joined:
    Aug 2, 2013
    Posts:
    58
    D4N005H likes this.
  40. D4N005H

    D4N005H

    Joined:
    Oct 12, 2013
    Posts:
    334
    @chingwa Hello. I have a mattering question and I would like to know the answer, please.
    Now that Unity 2018.1 came with a new feature called SRP, I am heavily redesigning my whole project and due to that fact I have completely removed SUIMONO and Tenkoku and also some shader assets temporarily because I have no clue how to make them compatible with the SRP feature. Would you please clarify if there is going to be a support for the SRP and new Unity shader features? if yes, when? if no, how would I be able to make them Unity2018 compatible?
     
  41. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @SureSight yes I do have plans to do an integrated river generation mesh. I have done some experiments, but It's too early for me to give details though.

    @D4N005H I will support SRP eventually, as it will at some point become the requirement/default for Unity. Currently however, SRP is an experimental feature that is still in flux and development and is still undergoing lots of internal changes. I do not have plans to support SRP in the near term.

    To be honest, SRP is a burden on asset developers and many of us are unsure of how we should proceed with it.Some publishers have suggested charging those customer who want SRP some sort of upgrade fee. I don't really like this idea, personally, but it is worth discussing. Even the Asset Store itself is still unsure of how and what asset developers should make available, or how they should organize SRP assets. It really is a feature that has been pushed out before it was ready.
     
    D4N005H likes this.
  42. Efril

    Efril

    Joined:
    Aug 31, 2013
    Posts:
    36
    Hello @chingwa . I'm tried to integrate Suimono together with Tenkoku dynamic sky in my project and faced a problem with correct lighting. In the first attached screenshot you can see Tenkoku configured to almost clear sky and nice sun reflections on the water as expected.
    TroubledWaters_UI_2018-05-10-23-02-53_1024x768.png
    On the second screenshot you can see completely cloudy sky (Overcast amount set to 1) but ocean looking almost the same.
    TroubledWaters_UI_2018-05-10-23-02-27_1024x768.png
    Can it be fixed somehow?
    Thanks in advance.
     
  43. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @Efril First make sure that you don't have any extra directional lights. Tenkoku will contain it's own sun/moon directional light, so you should disable any others that may already be in your scene. Also make sure that under Tenkoku weather tab that 'Overcast Darkening' is all the way to 1.0. This should then alter most of the ambient lighting as the cloud and sky gets darker.

    Also, if it isn't already set, you'll want to drag the Tenkoku-->SkySphere-->LIGHT_World object onto the Suimono Module's 'Scene Light Object' setting.
     
  44. Efril

    Efril

    Joined:
    Aug 31, 2013
    Posts:
    36
    @chingwa thank you for quick response. Playing with Overcast Darkening gives much better result. Will tune these settings together when configuring weather. TroubledWaters_UI_2018-05-11-00-19-55_1024x768.png

    Another issue I faced related to buoyancy. Ship seems to be dancing on the waves. Transitions are sharp and looks unrealistic. Is there common way to increase 'smoothness' of buoyancy? I tried to increase drag coefficients of rigidbody - looks just a bit better but still very far from reality. Ship still jumping up-down in short period of time.
     
    Last edited: May 10, 2018
  45. Efril

    Efril

    Joined:
    Aug 31, 2013
    Posts:
    36
    And another (hopefully last at this point) noobish question. What is the secret of default ocean normal map/heighmap textures so waves height for camera and buoyancy is exactly the same as visible waves height?
    I found a good normal map for turbulent waves, created a heighmap for it using Crazybump software and set it as alpha channel of texture PSD file. Import settings of this file in unity are exactly the same as import settings of default textures. I set this file as custom texture for turbulent waves. Remaining slots of 'Custom textures' section was set to default calm and rolling waves texture files. And now if camera appears inside big wave it looks like it between 2 layers of water and no 'underwater mode' turned on of course. TroubledWaters_UI_2018-05-11-14-10-36_1024x768.png
     
  46. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @Efril I did a test with custom textures this morning and it appears there might be a bug with the custom texture height projection. Custom textures seems to work properly on the calm low level waves but the larger rolling waves do seem to have an issue. Let me look into this a bit and I'll get back to you ASAP.
     
  47. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    It certainly sounds like you are setting up your custom texture correctly. I would caution though that it's usually better to convert from Height-->Normal rather than from Normal-->Height. It's sometimes unclear how programs like CrazyBump are generating their heightmaps, and inevitably they may not be able to generate proper height when it has to guess through missing texture data. I'll look into the code later today and see if I can figure out where the problem is, but I'd also request you send me the custom texture you're using, just so we are both in sync... You can send it to me directly at konnichiwa@tanukidigital.com
     
  48. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,155
    @Efril OK I found the issue. There is nothing wrong with your texture, you set it up exactly as is expected. The problem is actually a design oversight on my part. The waves are calculated on the GPU, but the buoyancy/height check is calculated on the CPU. By dragging your custom texture onto the surface slot you are telling the GPU to use the appropriate texture, but the CPU is not updating this info. What you need to do is to open up the module and also drag your texture onto the 'Tex Normal R' slot in the 'Lib' component...



    This will fix the wave offset and underwater camera switch issues you were seeing above. This is the only way of fixing this for now. I will look into a more proper fix for the next update.
     
    Efril likes this.
  49. Efril

    Efril

    Joined:
    Aug 31, 2013
    Posts:
    36
    Thank you! Of course my texture have to be tuned a bit but this solution definitely works!
     
  50. Efril

    Efril

    Joined:
    Aug 31, 2013
    Posts:
    36
    Hello again @chingwa . A new important question arose. In my scene I have infinite ocean and ships can be very far one from another (up to 12 kilometers at this point). I'm using a bit modified Dynamic Water Physics asset for ships to behave on waves nicely.
    Now imagine that I immediately switch camera from one ship to another (which is far away as I wrote). Waves simulation for the second ship was not performed untill that moment because of distance. Now waves immediately appears around the ship above its waterline and fair simulation of Dynamic Water Physics pushes it up with force much larger than its common buoyancy force. Large ship starts jumping like a beach ball for some time.
    This can be resolved with setting very big value of Ocean Scale in SUIMONO_Surface object but this reduces performance a lot.
    There is no way to create a small isolated area where waves are simulated even without rendering at this point, right? Is something similar planned for 3.0 version of Suimono?
    At this point I see only one workaround to deal with this - set drag values of Rigidbody to large values in the moment when camera switched to second ship and slowly decrease them in coroutine to normal values. Maybe you can advice something better.