Search Unity

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

SUIMONO - Customizeable Water System [RELEASED]

Discussion in 'Assets and Asset Store' started by chingwa, Aug 11, 2012.

Thread Status:
Not open for further replies.
  1. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    Wow! That looks really amazing and its exactly what I'm after but your boat is just floating, whereas mine needs to be driven by the player and has sound effects and so on connected with this, I would really like to find a way to make this work!
     
  2. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,751
    John G. - I doubt you need to worry about increasing/decreasing the tesellation values, they are all distance controlled anyway. As the camera moves vertical and the distance between it and the hi-res surface increases the tesellation automatically decreases, and should save on performance.

    The hi-res surface doesn't actually change size, it stays set regardless, and the distant surface isn't tiled, it's just enlarged/scaled to fit the camera distance. I see what you mean though when the camera goes high in altitude the ocean is no longer spreading to the horizon. Hmmm... let me take a look at that and I'll see if I can build in a fix. (care to share the code that you had set up previously? :D )

    Edit...
    The horizon scaling function is the same as I suggested to gxmark, a few posts above this one...
    http://forum.unity3d.com/threads/su...r-system-released.147111/page-13#post-1875072
     
    Last edited: Dec 6, 2014
    John-G likes this.
  3. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,751
    RHD - yeah, in the video it's just floating. The demo does have a boat controller example... you can drive the boat around and it reacts to the waves as expected The controller is just a demo though, and I don't actually consider it to be a part of the suimono system.

    As long as the boat object has Suimono buoyancy_fx objects attached to it then it will react correctly to Suimono waves regardless of where the boat is. So... conceivably you could use your current boat keyboard/movement controller... you just wouldn't need to setup a buoyancy plane like you show in your video.
     
  4. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    The buoyancy plane is necessary to the current script which has great sound effects when driving the boat.
    I am not a great scripter myself and and worried it won't work.
     
  5. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,751
    RHD - I got your PM...
    your boat controller would need to be modified a bit because they are combining custom buoyancy code (which you won't need in suimono) and other code such as steering, drag, and sound functions.

    The Suimono demo has a controller example with audio etc (and propeller function too) but it's pretty specific to the demo boat and is really only meant as an example... not as plug-and-play type of code for any project... It actually looks a bit more advanced then the boat controller that you're using, but a little coding might be required to really fit into your project.
     
  6. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,751
    John G. - I wonder... is the real problem that the camera far distance clipping-plane needs to be increased as the height increases?
     
  7. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
    That would be great, not at home for a few days but will forward on the changes I had previously.
     
  8. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
    Yes, in my previous solution I had a second disabled camera with Suimono script with the far clip set to default.
    Them the main camera had a far clip art to 50000, this allowed the ocean render to the horizon while not causing the huge lag when using greater then 1000 far clip.
     
  9. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    If I buy your Water, which looks wonderful, but I can't manage to port my boat and driver script across to work on it by myself, would you be able to help sort it out?
    Thanks a lot.
     
    Last edited: Dec 7, 2014
  10. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,751
    RHD - honestly, you may want to wait for the full version of 2.0 to hit the asset store. 2.0 is going to be submitted to the store sometime this week, with an updated/expanded demo scene that has a boat controller example, as well as a character controller example. There should be a webplayer example as well so you can "try before you buy".

    I can't commit to rewriting someone elses controller code, but I intend to support the boat controller that I've made for the demo. Seeing as how your current controller isn't very complicated anyway, you may elect to just switch to the one I'm including in the demo.

    Oh, and the 2.0 final release thing is a secret, don't tell anyone else :D
     
  11. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    "I can't commit to rewriting someone elses controller code," - I felt terribly guilty even asking you but I'm fairly certain I wouldn't be able to hack it by myself and I really want to use Suimono!

    That is terrific news, I will wait for version 2.0 and absolutely won't tell anyone! :rolleyes:
     
  12. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
    Hi Justin sent you a mail with the script changes I had implemented, may be of some use to you.
    The method I used to get around The FarClip issue and poor render performance if it was set greater then 1000 was:
    To attach a second camera as a child of the main (Main Cam farclip = 50000 : Second Cam farclip = 1000) this camera is the disabled.
    Then under SUIMONO_Module set the camera for both Scene Camera Object and Scene Track Object to the Second Disabled Camera. This allowed waves and water to be rendered to the horizon with full FPS.
     
  13. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    I love the underwater effects. Do you have any plans to provide some kind of swimming controller, or example script to help us along?
     
  14. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    I'm running Suimono beta 0.90 in Unity Pro 4.6.0f3, on Windows 7 Pro.

    I'm noticing some issues with the edge of underwater areas. These seem to be related to the camera being near the water plane, while my character is underwater, near the water's edge.

    Issue 1: Sometimes I can see some vertical blurring errors near the top of the screen.
    underwater top vertical blur.png

    Issue 2: Depending on the camera's angle, sometimes the bottom of the water simply disappears.
    underwater bottom missing.png

    Issue 3: While looking at the shore, sometimes trees that are NOT in the water appear to be in the water, perhaps due to refraction error?
    underwater trees showing in water.png

    Thanks for any advice or assistance. :)
     
    Last edited: Dec 21, 2014
  15. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,751
    Yes, there will be a basic swimming controller included in the final 2.0 version.

    Issue1) Does lowering the underwater refraction have any effect on this? Or is it just stretching out these pixels all the time? I can say it is almost certainly related to the refraction, as I get some of this on my end too at the edges, but not quite this extreme.

    issue2) right, when you get close to the water edge you might see this because suimono doesn't render the underwater portion until the camera is actually underneath the water. You can alleviate this somewhat by lowering the near clipping plane on your camera (though this may contribute to other issues elsewhere). In the next update I've added a "going-into-the-water" transition effect that might reduce this problem... but the functionality is still the same. If it continues to be a big problem in your project let me know and I'll look into making some changes in a future version.

    issue3) this one is a mystery to me. Are you saying the tree doesn't actually intersect the water? I've made some changes in the next version regarding trees, but this was for surface reflections, not underwater. It's possible, as you say, the refraction is pulling the tree down. You can try increasing the underwater fog attributes to hide this.
     
  16. Arcanor

    Arcanor

    Joined:
    Nov 4, 2009
    Posts:
    283
    Thanks Justin. Here are my responses:

    Issue 1. Yes, you're right. It is refraction related. If I set the Underwater->Refract Amt to 0.00, the problem goes away. The height of the vertical blurring distortion at the top of the screen is directly proportional to the Refract Amt setting. Essentially what is happening is that the refraction is "pulling down" the top pixel row. However, this only seems to happen when the camera is slightly above the water surface, and a wave occurs (I'm using Infinite Ocean, scale 5), temporarily making the camera underwater (for the duration of the wave swell), and then it quickly goes back to normal as the wave subsides.

    Notably, a similar problem to Issue 1 also occurs on the bottom of the underwater area, pulling UP the bottom pixel of the underwater shaded area when there's a wave that swells. However, strangely, if Refract Amt is set to 0, the vertical blurring distorion on the bottom of the underwater area do NOT disappear. So I'm not sure if this is the same problem or a different one. However, they both seem related to wave swells, with camera near the water surface.

    Issue 2. I've disabled the Suimono Module's Transition Effects in my project, because I don't feel the droplets on the camera are suitable for my RPG (breaks immersion). I can possibly use scripting to keep the camera underwater whenever the player is underwater. If I understand correctly, this would probably prevent the "lake bed" from showing without the underwater effect? Of course, the above "wave swells" issue could make it difficult for my camera control scripts to ensure the camera stays underwater.

    Issue 3: Yes, the tree is "on shore" (by quite a bit, maybe 10 meters). If I set the Underwater->Refract Amt to 0.00, the problem goes away. As I look at an upward angle with the in-game camera from underwater, any setting above 0.00 causes objects "on shore" (trees, rocks, or whatever other objects or terrain features) to be increasingly shown as apparently underwater (even though they're not). I'd rather not change the fog settings, as I intend for there to be underwater adventuring in my game, so I do need the player to be able to see at a reasonable distance while underwater.
     
    twobob likes this.
  17. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,751
    John-G likes this.
Thread Status:
Not open for further replies.
unityunity