Search Unity

SUIMONO 2.0 - Interactive Water System

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

  1. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @nipoco @norby An Updated Mac demo has just been posted :)

    Teila - Thank you, glad to hear you enjoy it! Maybe I should market it as stress relief and release it on iTunes :D

    twobob - I got your emails, looking through them now, thanks.
     
    twobob and Teila like this.
  2. nipoco

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    Unfortunately I can't open it for some reason.

    OSX 10.10.1
     
  3. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    nipoco - ugh... I'll look into it...
     
  4. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Unity 5 beta 20 is out... I'm downloading now and will be running some tests on Suimono compatability. Should know more information later today...
     
  5. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    OK, Things are looking much better :)

    With Unity 5 beta 20 I was able to get everything back in 99% working order. It doesn't work out-of-the-box, as I had to make a few adjustments in code. I'll be releasing an update later today that fixes all these issues. And besides Unity 5 compatibility there have been some major speed improvements implemented thanks to some intrepid code-digging Suimono users. These speed updates will be forthcoming today as well.

    Stay Tuned.
     
  6. Archania

    Archania

    Joined:
    Aug 27, 2010
    Posts:
    1,662
    That is fantastic news. Can't wait.
     
  7. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Congrats on your 1000th post chingwa ;)

    (Ignore the scarily slow numbers - this is the old unoptimised 2.0.03 version)

    Check out the nice new physics information breakdown in U5.

    Awesome!
    newPhysicsInformation.JPG
     
    Last edited: Jan 16, 2015
  8. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @twobob - whoooooooooooooo! 1000 posts!!! I didn't even notice... thanks for pointing it out or it would have just flown by me today! :D Thanks for the profiler from 5.... I also noticed that physics hits are now almost nil in 5. The future is looking very bright for Unity :)
     
  9. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Hello All,

    Suimono version 2.0.04 is now ready for download...

    Download Here: http://www.tanukidigital.com/download

    With Today's release of Unity 5.0 beta 20, the underlying bug that was hampering Suimono visuals has finally been fixed. This update addresses a number of little Unity 5 related issues that were left over, and overall rendering in Unity 5 beta 20 is now 99% back where it should be!

    Also in this update you'll notice a rather large framerate increase, and in some cases this could give up to a 200% performance boost! Special thanks go out to those intrepid code-mining individuals who pained through compiler spikes and obtuse code to find little nuggets of optimization gold! (you guys know who you are :D)

    Usually I would wait to add a few more big fixes or improvements to release a new version, but so many of you have been waiting for Unity 5 I thought it best to have a whole new release. Happy Friday!

    -----------------
    Water Scale note... When using the infinite ocean setting, please double check the new "Ocean Scale" setting for your water surface (it used to be named "infinite scale"). This setting is now active, and lets you control the overall size of the detail area of the infinite ocean. By default this should be set to1.0, but you can raise this up to whatever scale you need. Please note that the larger the scale, the more tesellation you will need to use to fill-in detail areas.

    BetterSkybox note... There's a new folder called "_EXTRAS" and inside you'll find a work-in-progress asset called Better Skybox. This is a new asset I'll be selling on the store eventually, but I'll be including it for free for Suimono users. It replaces the built-in Unity skybox with it's own rendered skybox in order to fix some inherent depth deficiencies in the Unity skybox function. This may now be necessary for those using the infinite ocean setting in order to prevent the default skybox from bleeding over into the water. Please read the "readme" notes located in the BetterSkybox folder, and see the implementation of it in the demo scene (under the main scene camera) for more info.
    -----------------

    As always, let me know if you have problems/questions/feedback etc, either by email or on the forums!


    UPDATE: 1/16/2015 - Suimono Version 2.0.04
    ---------------------------------------------------------------------------
    - FIX - Unity 5.0 (beta20+) Compatibility Updates!
    - FIX - Massive Performance increase due to code optimizations.
    - FIX - Infinite Ocean rendering no longer displays "double image" of ocean in DX11 mode
    (DX9 fix still forthcoming).
    ---------------------------------------------------------------------------
     
  10. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    I get a compiler warning about the U5 shader on import to 4.6
    Hardly surprising. Thought I would report it.

    It runs really fast now.


    I had a little hickup with Suimono_flowGenerator:SetUpdate() (at Assets/SUIMONO - WATER SYSTEM 2/SCRIPTS/Suimono_flowGenerator.js:108) I set Resolution scale to 2048 (seemingly a stupid value)....

    will shove it in U5, see it fly..

    About the presets.
    If I wasn't to use them "at all" would an option to not even have a "preset module" be an option?
    My water won't change and if I can trim performance via sacrificing flexibility I won't use I am all for that. A toggle would be great.

    The thing about presets is some idiot will abuse/break them...

    erm, not sure what I did here.
    (importing it into existing 4.6? clean project works okay)
    oops.JPG


    erk.JPG
    They dont look good :\
    Will have to try to fix them at some point.



    and then there are the unexpected side effects

    AbusingPresets.JPG


    it's effort to remove all the "Features"
    (switch preset to a less high wave one, and be above ground to activate "flying swim" mode ;) )

    A button to not use them would be great
     
    Last edited: Jan 17, 2015
  11. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @twobob - an on/off switch for the preset system sounds feasible... I'll look into it for the next update. For the messed up preset files I recommend just reimporting the preset data files (.txt) into Suimono2/Resources... Not sure what's going on there in your screenshot :D
     
    twobob likes this.
  12. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Just a note to let you guys know that the demo downloads are now updated to the 2.0.04 version. This should show much better framerates overall, but especially on lower end cards/computers.

    @nipoco @norby the Mac Demo has been updated to the latest as well. I tested the download here using my admittedly ancient mac (I'm running OSX 10.6... don't laugh!) and all works well. Let me know if you still have any difficulties.
     
    twobob likes this.
  13. nipoco

    nipoco

    Joined:
    Sep 1, 2011
    Posts:
    2,008
    Great man! Now it works. I guess the rar file was corrupted, or something.

    I'll check it out later.
     
  14. eskovas

    eskovas

    Joined:
    Dec 2, 2009
    Posts:
    1,373
    Fantastic update @chingwa :D

    I did notice improvements on the performance, which is much better when close to the water, although it can still be a little performance heavy, at least on my game. If i'm near water and disable suimono, i gain about 50-60 fps. ( even when i'm not using tessellation or dynamic reflections ).
    Near the water i get around 50-60 fps, but with suimono disabled i get 110 fps. if i'm far from the water, i get around 70-80 fps. ( this while not using tessellation or reflections)

    I'm also using Unity 4.6, but i'll be updating it to 5 beta soonish. Very happy that Suimono finally works with 5.

    If you want, i can look at some numbers from the profiler and see if i can find some interesting stuff.
    Is it also possible to have a few more performance options to Suimono? like less heavy physics calculations, things like that?
    I also can't seem to get the waves to work :/

    So i don't end this post with this performance talk :p here's a screenshot i took using Suimono ( I cranked up the tessellation quite alot for this image :D ).
    Needless to say that Suimono has incredible visuals. It's also 10x better in motion :)

    image1.jpg
    I had a better screenshot, but i saved this one of top of it by mistake :(
     
    DesertRaven and chingwa like this.
  15. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    "I had a better screenshot, but i saved this one of top of it by mistake" ROFL. If I had a dollar.

    Not as fundamental as "I had a better version of the game but I saved this on top of it by mistake."

    There are a couple of improvements that are still in the pipeline; around the presets; also a stray yield statement.
    I, personally, would be very grateful of any lumps you could spot when in certain scenarios, it is tough to cover all those scenarios, individually or even severally, teamwork is key to knocking off hidden corners in projects of this nature.

    Much obliged. Nice visuals. Don't suppose the pixel error on your terrain is really low? Could be a renderStage3 lock up on the part of the rendering system, doing something bonkers whilst culling the partially obfuscated seaFloor (large transparency overlay, + reflection pass + culling a bazzillion hidden points. Only profiling will tell if that is the case... but might explain the "waters edge" effect. Just guessing.
     
  16. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @eskovas - Thanks for sharing the screenshot, that is beauutifuull!! :)

    Yes, as @twobob said, there are still some optimizations that are being looked into and I hope to be able to improve the GetHeight()/Physics calculation in particular quite a bit. A little time will tell. Of course if there's any insight you can provide from your end from Profiler digging I'm sure it could be very helpful as well.

    (damn, that screenshot makes me wish I wasn't in cold rainy NYC right now... )
     
  17. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    @chingwa (damn, that screenshot makes me wish I wasn't in cold rainy NYC right now... )
    snow, that's all I'm saying.
     
  18. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Made some additional updates to the Suimono documentation today, more coming tomorrow, Can finally see the end light at the end of the documentation tunnel. Feel like I'm getting good writing experience though, maybe I'll start writing cookbooks after this... o_O

    http://www.tanukidigital.com/suimono/documentation/

    Also have some more small changes, optimizations, and bug fixes for the next update, soon-ish...
     
  19. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    README: (needs updating, this is the 2.0.04 version)

    Go to: "Assets -> Import Package -> Custom Package..." in the Unity Menu. Then select the "Suimono_watersystem_v2beta.unitypackage" file. This will open an import dialog box. Click the import button and all the Suimono files will be imported into your project list.​

    Worrying Observation:
    The 2.0.04 version, No matter what I did I COULD NOT get the presets to work.
    I utterly erased all remnants of the previous folder. Including any and all amendments I might have made.
    reinstalled 2.0.04 and my presets still do not show up as I expected.

    Did this several times, various permutations, including shutting down the gui, totally erasing the files from outside and totally erasing the files whilst inside. blah blah.

    So, as a last resort I disabled the cache server. and did the 2.0.04 install again.

    This time it worked.

    CONCLUSION:
    Something in your stuff is upsetting the CacheServer r20, now, whilst this is not of your doing, it is a major headache going forward.

    I am going to actually wipe my entire cache servers cache and start from scratch.
    But, just so you know, here there be dragons. And not necessarily yours.


    Two days of frustration over, I shall continue.
     
  20. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @twobob - Readme file is now fixed for future versions, thanks!

    Cache Server.... what exactly is the cacheserver doing that disabling allows correct operation? Does it host asset/ files in an external location for team access, or does it host metadata changes of files from a variety of local sources? Just trying to wrap my head around what/why of this happening.
     
  21. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    CacheServerScreenshot.JPG
    Yes, it runs a binary compare (AIUI) much like say... The build cCache system on a unix build... and if the asset "exists" it serves up the stored one, rather than having to import it all again. (uses node.js to achieve this)

    here is a file being added (In unity, this is the log in cache server)
    FileIsAdded.JPG


    On larger projects, where one has to switch between Target Platforms to check the impact of code amendments, this basically is the difference between waiting up to an hour and a minute. So, pretty important.
    the complete write up is here.

    http://docs.unity3d.com/Manual/CacheServer.html

    I am /fairly/ certain that this /might/ never actually affect your end users.
    Please note the amount of qualifiers in that previous statement.

    Hopefully it never will. But if you ever get screenshots of totally mangled presets.... (much like the ones I posted before) I think cache server will have eaten your txt files and refuse to serve up good versions. I have absolutely no idea why that might be the case. utter mystery.

    Just thought, due diligence, let you know.


    Also, just so you know, this was the SECOND project mangled in this fashion after the "hickup" that I mentioned a few posts ago. This was on 5.0 the previous one I mentioned was 4.6 and in the middle I had actually had a project "work" but only when utterly "virgin", imports over old projects did this weirdness. HENCE: It may not ever affect your end-users, certainly not "new" ones I don't think, and then, of those left whom it may affect, only the Pro users - WITH A TEAM LICENSE - as they have cache server, and even then it would only affect those who messed with making a new custom preset.

    Not a huge percentage. Like probably zero. but potentially a problem. So I am letting you know. Hope it helps.


    (for the record, we have already internally abandoned ASSET SERVER so it not a meta-data issue, UT really should spend a few quid on making that /actually/ work, if some UT tech ever reads this... 3000 euro minimum spend for a versioning system that everyone knows does not work is insulting :\ ) however cache server has always been solid, until now.

    It is the sole reason I own a team license. without it Unity is a true pain to switch Build Targets.
     
    Last edited: Jan 21, 2015
  22. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Another quick two questions. Do Overall Transparency, Edge Foam or Foam Scale do anything on the 5.0 version with 3d waves?

    They don't seem to make a visual difference o_O

    And: What is the best practice for covering huge areas with water.
    (3d waves, ocean style with shore)

    I tried the typical "Iinfinite Ocean" setup you suggested and either got horrible blocky edges where it met my low resolution terrain, which disappeared into better edges as you got close.

    so I tried 4 strips of "3d waves"
    4blocks.JPG

    and I have all the same problems only I also now have nastily scaled foamed to boot (that won't seem to scale back), and weirdly transparent water (pictured)... meh
    allPrettyHideous.JPG
    I am struggling to get decent results. any clues?

    Here is Deep Dark Ocean. Note how oddly transparent it is?

    deepDarkOcean.JPG


    Would I be better off trying the infinite ocean and playing with the scale???

    OceanScale.JPG

    Much obliged.

    EDIT: I went with infinite Ocean at 50x scale

    But I still have these horrible edges... Do I need to put the terrain on a certain layer for the blending to work? Unsure. thanks.

    Infinite50.JPG



    Finally, I am not sure if this is intentional, but the SuimonoObject prefab has a surface you can walk on? thanks.
     
    Last edited: Jan 21, 2015
  23. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    walkable prefab. Should that be a trigger?

    because obviously under the new system that will be a problem
    NpShape::setFlag(s): triangle mesh and heightfield triggers are not supported!

    PrefabHasASurfaceYouCanWalkOn.JPG
     
  24. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Well they SHOULD.... Just tested in 5.0 on my end. Works fine in Unity Pro mode, doesn't work right in Unity (free) mode! Another bug... thanks for bringing to my attention. Most be a unity 5-specific thing...:( Other settings in Unity free look like they work OK.

    For a massive water area, it's likely your best bet is the Infinite Ocean mode. The 3d waves versin would need to be scaled pretty high, and if the waves could be made to look correct (w/ tessellation etc.), they probably aren't going to match up edge to edge. It isn't really meant to be tiled manually.

    The Ocean Scale setting in infinite ocean mode increases the size of the detailed near-camera ocean plane... this gives you a larger area of detailed waves near the camera. BUT without tessellation the larger this setting the more "lo-res" the ocean vertices will appear... because the entire detailed plane is set to a larger size.

    The best way to reduce the blockiness of the terrain is to set a higher terrain resolution scale (or lower the pixel scale, maybe). If this isn't appropriate, then using tessellation on the infinite ocean or 3d waves setting should help alleviate it. if tessellation isn't appropriate, then using the infinite ocean at a 1 "ocean scale" setting is probably your best solution.

    I've also noticed some weird camera issues in 5... when I have the camera Render Path set to "Use Player Settings" it often doesn't render depth/foam/color properly. When I set this explicitly to be forward or deferred everything renders as expected (sometimes this has to be done while playing). Not sure what that's about... I haven't noticed it in Unity 4.x.
     
  25. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Unity no longer supports triggers on Mesh Colliders in 5.0... Suimono gets around this by changing the Physics setting for the water layer from interacting with other physics layers. If you need it to actually be walk-on-able, then I think changing the game layer of the Suimono_surface object should work. (or I can't remember if it automatically sets this layer... it might... in which case I'll have to get back to you! :D )
     
  26. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    cool, pretty much as I had figured.

    physicsFoof.JPG
    Not sure you are catching them all... but maybe I am reading that wrong. will test further at some point. EDIT: hmm seems like my stuff is interacting with your layer "unexpectedly" - I'll have to figure out why,. probably the ray cast hitting your collider.?

    EDIT: It only happens when you jump out of the water and land back on top of it!


    Well. I have to say that I really WAS struggling to get a decent result :\
    However I have managed to get a bit of a better one.

    not much, but better, will keep on it. got a decent edge (kinda) and figured out why the particle effects (undersea debris) wont work.

    OH! and upgrading to enlighten (and disabling the suicidal real-time baking) fixed the weirdo see-thru water. EDIT: And the Overall Transparency now works too
     
    Last edited: Jan 21, 2015
  27. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Waters Edge Effect Performance hit effect.

    Seems to be a bottleneck going into the GPU (If I remember that waitForPresent issues details correctly)

    this is running from 20 meters away quickly into the sea over about 10 seconds (to exacerbate the effect).

    pretty nasty spike there!

    WatersEdgeEffect.JPG

    You can see the bottleneck ramping.

    I suspect this may go away a lot more when the "looping over presets, making garbage" fix is in.
    But, yes, there does appear to be a measurable, marked, and pretty large "slow-down" when entering the water.

    EDIT: Hmm.. I think it is something to do with the surface rendering.

    For the interested reader if you want to "see" the overhead
    Go Underwater:
    Look Up, See Profiler Spike
    Look Down, See Profiler Trough.
    Look direction shoved on high tech graph.
    headDirection.JPG

    As approaching shore/ entering water would in fact pretty much FILL the screen with that data... I think that is /part/ of the problem.

    So, Re the Waters edge thing... Could it be that you shove a bunch of stuff to the shader at that time (water entry) too? (like maybe depth data or something?) That might hold it up when added to the additional overhead of suddenly doing reflection/refraction/aberration passes?

    Since the GPU report appears to have several LOD objects?
    I was trying to get my head around if a http://docs.unity3d.com/ScriptReference/Renderer.SetPropertyBlock.html variation would be quicker but looking through your code it seems you just set lots of stuff on one material...

    Guess I need maybe to break out Pix or maybe NSight can glean a light.
    Bottlenecks, gah. bane of banes.
    EDIT: Okay so I did some more digging:

    as you can see hanging around near the waters edge appears to upset the rendering as outlined here:
    GPUlock.JPG

    Whereas the moment you transition to underwater it all goes away.
    underwaterOkay.JPG
    refraction calculations maybe?


    Hope it helps.
     
    Last edited: Jan 21, 2015
    judah4 likes this.
  28. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    So final Update:

    Getting things to not look too bad on a huge ocean with 15 pixels error on terrain, that DOES NOT sit on a flat axis in any direction. (so worst case scenario, as usual from me)

    I disabled all of your position tracking and "Magic Number" positioning/rotation for the Object
    Code (csharp):
    1.  
    2. function Awake(){
    3. if (typeIndex == 0){
    4. // this.transform.eulerAngles = Vector3(0.0,183.2475,0.0);
    5.  
    6. .....
    7.  
    8. if (Application.isPlaying){
    9. if (typeIndex == 0){
    10.  
    11. // this.transform.eulerAngles.y = 183.2475;
    12.  
    13. ....
    14.  
    15. // this.transform.position =
    16. //Vector3(moduleSplashObject.setCamera.position.x,this.transform.position.y,moduleSplashObject.setCamera.position.z);
    17.  
    18. ....
    19.  
    20. //update position
    21. //this.transform.position = setUsePos;
    22.  
    That done, I scaled the sea to about 20 in the Ocean Scale (this gives us 100 since oceanUseScale = 5.0; )
    and positioned it where I actually wanted it.

    I then fiddled with the edge foam until I got something plausible (really low value)

    I moved the caustic and debris emmiters to be parented to a proxy that follow my main player around.
    (the debris emitters somewhat errantly presume that the camera will not tilt willdy in the Up/Down axis, which mine does, I will amend that to suit my camera better later I think. The current one disappears into the floor if you "look down")

    I added global fog with a relevant colour, that I will hookup to the isUnderwater thing at some point. (since the built-in fog does not work as far as I can see on 5.0)

    I lowered the wave speeds to both 0.01ish (there really is no getting better than that with the horrible terrain error, however that does look decent, like slowly lapping shore movement kinda)

    So, in precis, disabling all motion, and attaching the emmiters to the player looked a lot better than the "track the camera around" system, and had the added bonus of not going horribly wrong when parented in a "Rotationally Offset" gameObject, which mine is.

    might be a decent thought to add a "DON'T MESS WITH THE SETTINGS AT ALL" option for the Infinite Ocean along these lines. (maybe with a better name)

    ManuallyAddedGlobalFog.JPG

    edgeFadeNotTooTerrible.JPG

    Whilst far from perfection, this method represents a very easy-to-understand and hard-to-get-wrong way of doing things. I also don't see a great deal of loss of functionality compared to the other method. And it is certainly cheaper.

    If there is some drawback I don't see to a simple static surface in the type of "Extreme usage" scenario I would very much appreciate any insight.

    SimpleStaticSurface.JPG

    It's the best I have managed to come up with so far. For cheap.
     
    Last edited: Jan 21, 2015
  29. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    The infinite ocean tracking/rotation settings are there for the most general use case of a large scene that needs to be traversed around... and in general they work very well. Getting into specific cases is a different story, and if turning off the tracking and your other edits are more suitable for your own project then by all means use them :)

    Chopping the terrain into multiple pieces each with a higher res could help alleviate the terrain edge issues? (though of course multiple terrains are more expensive to render).

    Also again thanks for the compiler tests! The water edge performance is maybe the most performance intensive aspect, as the shaders are performing their maximum possible effects there (surface refraction/blurring/caustics/fogging etc.) Turning down some effects can have a bit of improvement... I'll do some testing along these lines here.
     
  30. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    My run through in b20 seemed to be ok, I don't seem to be experiencing the above issues, but I am still not getting the shoreline to align with my terrain. It is still 180degrees off. The specular for my levels directional light is also not placed correctly and appears to be a 180 off too. I have not had a lot of time to dig into it, but I did see that the object itself shows a rotation on Y.



    Possibly related or is that normal?
     
  31. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @CaptainMurphy - the rotation is correct for the infinite ocean setting. The problem is the flowmap generation object isn't rotating correctly when it generates. I thought I had this fixed... I'll take another second look at it!
     
  32. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Hi. Thanks. I will consider other options then.

    possibly amending my terrain to not require offset water.

    Thanks

    EDIT: I reverted all my changes and will await the shiny update.

    Got the fog, effects and stuff working now. :)
    reversion.JPG
    Only with your provided camera and model though, which was probably the problem before, trying to get an alternate camera and character running and debug all at the same time.

    I'll try it one step at a time.

    EDIT:

    Okay, the key was to use your camera / camera handler and weld in my (animator driven) movement controller for my character, replacing the (animation driven) movement controller that is provided.

    UseYourCamera.JPG

    EDIT as you can see the Default U5 shader draws fog in front of the character. a custom rim shader does alleviate this at the expense of pbr shading.
     
    Last edited: Jan 23, 2015
  33. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Just to make sure it wasn't my project, I started a clean project, imported 2.0.4 and set the preset for ocean with shoreline. I ran the "Advanced Demo" scene and went under the ocean object and regenerated the shoreline map. Here is what I was seeing:


    Here is the shoreline texture:

    For laughs and grins I rotated the Suimono_Object item under the Surface_Ocean to 180 and then offset it to align the island pattern that was visible with the island texture. As I got it close you could see the outline of the island get near alignment:

    However, when fully aligned, you could see the patterns in the water for shoreline do not line up at all:

    If you look at the texture2d above, you will be able to make out those same patterns in it. It looks like one of the textures is aligned but the other is not. I am going to look into it some more and see if I can isolate more of the cause.

    Edited:

    What is the timeframe on conversion to C#? I want to use my own buoyancy system with ships and cannot for the life of me get the surface height of the water at an X/Y for some reason.
     
    Last edited: Jan 22, 2015
  34. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I converted it to C# yesterday (well actually most of yesterday and some of today, somewhere around 16 hours) and it is around 90-95% working now. Maybe now I can dig in and see what is getting off on that shoreline system.
    @chingwa, get with me and I can get the code to you... might trade it for that nice sky system you have coming out!
     
  35. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    pretty sure it's the amount of parameters being pushed to the GPU via the shader.

    Unsure if it is possible to block send the data more effectively via a Renderer ParamaterBlock (I noted multiple LOD objects) - or if indeed it is being sent via that path at all. However, that is my gut instinct, too much meta-data.

    It has to be said, when he trimmed the buoyancy and removed the GC noise from the presets, this system, not using realtime reflections is very fast now :)

    gc.JPG
     
    Last edited: Jan 23, 2015
  36. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    I have tested, double tested, triple tested, tried to work around blah blah blah, I just STILL can't get the Standard Assets "Third Person Controller" to not walk on the water without SPECIFICALLY hacking the layer out of the hit results in code.

    Changing Physics settings has no effect. For the future person who may be confuzzled and thinking it is just them I am posting this for posterity. It's not just you. IIRC I did get it working in the end with a code level addition.

    Just so you know.
     
  37. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    I just tried the standard first-person and third-person controllers here on my end without any trouble. What game layer is the controller in your scene on?

    Edit: OK I was able to reproduce this when the controller is explicitly on the water layer ... which makes sense(hint: don't use the water layer :D), but I haven't tried it using custom layers yet.
     
    Last edited: Feb 4, 2015
  38. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    ah. that is it :) Nice one.

    Don't use water layer, got it.



    Possible bug: as reported here http://tanukidigital.com/forum/index.php?topic=493.0
    The bubbles that escape the players lips are only visible whilst overlaying the players head in a direct line to the camera.

    Once the bubbles are outside that bounds they are overdrawn by the fog and not rendered correctly.

    it was a bit of a nightmare to get a screenie for proof but here one is.
    As you can see 50% of the bubble is rendered - the other portion isn't.

    View attachment 126138

    So that needs looking at.

    cheers


    "Request for Buoyancy Manager" (or something)
    As a mild aside the current buoyancy calculation times are killing me.

    I would happily take less costful - more granular readings - as an option.
    The demo is dragged down to 40ish FPS based on these calcs OOTB.
    Setting the buoyancy on something as distant as a boat - that is WELL out of camera range seems a total waste. Perhaps an option to use a distance based disabling system would make more sense.

    In the below screenshot I am a bazzilion miles from the boat (okay, quite far), underwater (so best case scenario currently for your gpu woes), just looking at 4 plants (on a very cheap shader) but the boat calculations cripple the performance anyway.

    View attachment 126139

    There are 50 ms over two frames of buoyancy calculations and then this bottoms out for 4 frames to a useful value and the cycle repeats.

    Which makes me think that the boats buoyancy objects - and perhaps some of the others - are all doing their work on the same frame - is this the case? I thought, probably errantly, that you were going to auto-smear them based on a quick "list all the buoyancy objects and make sure they start on staggered frames" principle.

    "Buoyancy Manager"

    Also centralising the "Update Period" for all buoyancy objects into a "Buoyancy Manager"
    would ensure no overlaps in cycles (since they would all be updated at the same rate), would simplify the "list all the buoyancy objects and make sure they start on staggered frames" issue considerably, and would provide a central place to implement the "Disable by /n/ distance from main camera" tweak that would be a real performance boon.

    Additionally, currently when disabling an object the buoyancy calculations are still performed (since your engine does not know to "tell" the queued buoyancy calculation Invoke to stop calculating) this could be handled either by "just returning" if the parent object is disabled - or - more properly these buoyancy objects' statuses would be updated in the manager as "disabled" and some other, lower cost, status check could be started until the object was made live again. Seems like disabling buoyancy "on the fly" is something that should certainly be doable, and moreover, disabling buoyant items should not have a performance cost beyond checking for reactivation. Finally items removed from the scene should never leave InvokeRepeating junk floating around. That's just asking for pain.

    Thanks.


    Anyways, this nasty "Spikey Cycle" looks a classic for better load balancing FWIW.
     
    Last edited: Feb 5, 2015
  39. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    @twobob - I'll take another look at the buoyancy thing. They are being "smeared" (yup! just double checked!) across frames, so I think the issues are A) the number of FPS they execute B) executing when they don't have to (range, view-frustrum) and C) general inefficiencies on the height detection function.

    They should be ceasing any height update functions when they are disabled... i.e. the invokes are being cancelled OnDisable (I'll double check this on my end) but I agree a more central buoyancy manager could be helpful.

    But here's a question... what happens to the object when the buoyancy is disabled, say for example if you're out of a set range? Currently when you disable the buoyancy your game object will sink to the bottom like a bunch of lead bricks(!) I could code it to automatically disable the object's rigidbody component (or set it to be kinematic), so it will stay at whatever the last position it was in. However in general I don't like to explicitly set things like this because inevitably there are situations where this would be undesirable. If not in Game A, then definitely in Game B. Granted, I can't think of any other solution between "let it friggin' sink!" and "I will force my rigidbody will over all!". :D
     
  40. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    My buoyancy system allows to skip frames and uses a formula to adjust the mass/force components to match the frame skipping. Also, when out of frustum mine simply returns the base y height without making calls to the suimono class and stops calling for actual buoyancy updates until back in frustum. That keeps it close enough to the surface and still has the ability to have adjusting of mass for damage/sinking even out of view and can 'catch up' to the wave when back in view. I do this for the entire object though a list of buoyancy points, and don't use the individual buoyancy components attached to the object.
     
    chingwa and twobob like this.
  41. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Cap'n Murphy provides an excellent fail-over route above, this would certainly be a better option
     
    Last edited: Feb 5, 2015
    chingwa likes this.
  42. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    oh... yeah that's perfect! :D

    @twobob - I'm going to be putting out an update later today (bug fixes, shader updates, etc) and I'll see if I can squeeze in some improvements to the buoyancy system as well... at least a view cull and range cull... this will be a start for better optimizations in following updates.
     
    twobob likes this.
  43. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Well anyways, just as a "Let's see" I tried shoveling together a few effects /outside/ of suimono to see what chromatic aberration, blur, vignetting, global fog (Y + distance), Unity Fog, and a few custom RTP shaders (for the water on the rocks on the floor)

    So total cost came to 19 draw calls (5 of which are for the dolphin, 11 of which are for the floor and rocks) - in at circa 200 FPS,
    19DrawCalls.JPG
    6msTotalTime.JPG
    I wonder if "I'm only using the underwater don't render the surface" option might not hurt To reach these kind of numbers "in-game" with suimono, anyways, playtime over, thought I would share the rough findings.
     
  44. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    In tests here the Suimono underwater effects (speaking of just the fx plane itself) only take 2 draw calls. I'd be interested to see a confirmation of this on your end... i.e. only using the "effect_refract_plane" object that get's parented to the camera during play, without all the other suimono system stuff. I imagine it would be a similar low footprint.

    The Dolphin is flippin' awesome.
     
  45. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Hello All,

    Suimono version 2.0.05 is now ready for download...

    Download Here
    : http://www.tanukidigital.com/download

    There are various bug fixes and optimizations included in this release, however the main new feature is that all the Suimono water shaders have been rewritten to use standard PBR / PBS based rendering algorithms. This gives an overall improvement to the water rendering (sometimes subtle, sometimes dramatic) and has unified some errors like specular position calculations and such. So, overall there should be a nice visual boost to your water :)

    Because of the shader changes above there were a few changes made in the bundled presets as well, and if you're using your own custom presets you may need to go through and do a little color tweaking. One particular setting to look out for is the "Hot Specular Amount" slider. This now acts essentially equivalent to a roughness/smoothness setting in the PBR world, and in general you'll want to keep this setting at or near "1.0". Please take a look at your custom presets with this in mind.

    -----------------
    BetterSkybox note... There's a new folder called "_EXTRAS" and inside you'll find a work-in-progress asset called Better Skybox. This is a new asset I'll be selling on the store eventually, but I'll be including it for free for Suimono users. It replaces the built-in Unity skybox with it's own rendered skybox in order to fix some inherent depth deficiencies in the Unity skybox function. This may now be necessary for those using the infinite ocean setting in order to prevent the default skybox from bleeding over into the water. Please read the "readme" notes located in the BetterSkybox folder, and see the implementation of it in the demo scene (under the main scene camera) for more info.
    -----------------

    As always, let me know if you have problems/questions/feedback etc, either by email or on the forums!


    UPDATE: 2/5/2015 - Suimono Version 2.0.05
    ---------------------------------------------------------------------------
    - NEW - All water shaders now based on researched Physically Based Rendering algorithms.
    This now improves the water rendering to be more believable, and fixes errors in specular positioning
    Presets have been updated with specular setting adjustments because of this.
    - NEW - Improved back scattering function to simulate light ray penetration through wave surfaces.
    - FIX - 3D Waves is now the default setting for Suimono water prefabs when dragged into a scene.
    - FIX - Default settings for flowmap generation changed... was causing unexpected performance hit in some scenes.
    - FIX - Addressed intermittent "Null Reference errors" with GetHeight functions and flowmap generation.
    - FIX - Manual caustic objects no longer turn off when "enable caustics" is unchecked. These are handled "manually".
    - FIX - Manual caustic objects can now ignore scene lighting by unchecking the "inherit lighting" option.
    - FIX - Changed internal function name from "SetPreset" to "SuimonoSetPreset".
    - FIX - Overall Transparency setting now works properly in Unity 5 for all shaders.
    - FIX - Foam Scale settings now work properly again on Unity basic shaders.
    - FIX - Unity basic shaders now have proper reflection and specular again.
    - FIX - Overdarkening in blur setting on dx11 shaders.
    - FIX - Changed internal preset handling to optimize background resource load.
    - FIX - Introduced variable checking in code to reduce internal calls and speed up latency.
    - FIX - Added range and frustrum culling to help optimize fx_buoyancy calculations.
    - FIX - Disabling fx_buoyancy objects now correctly cancels buoyancy function invokes.
    ---------------------------------------------------------------------------
     
  46. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    You're on, I'll have a look.

    EDIT: So here was attempt #1 with 2.0.0.5 (which is a miles better release btw)

    UtterlyStrippedWithVisibleHierarchy.JPG

    Attempt #2:

    StrippedToEightCalls.JPG
    Got it down to 8 draw calls. And a very decent FPS. I probably missed something along the way, doubtless can be improved.

    This really is a MUCH faster release.

    Nice one.

    Re: Mammal: The dolphin, It's the Unluck Software relatively lo-poly dolphin with a bidirectional reflectance distribution function shader applied.
     
    Last edited: Feb 6, 2015
  47. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
  48. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    I set up Suimono water (very latest version) in a scene, tweaked the settings just how I wanted them. But now, two days later, when I open the scene, the water looks quite different, and most noticeably, it is reflecting the sky and terrain, but in a weird way, not realistic. It's like the reflection is inverted or separated or something. I can't really describe it. See screenshot. Any tips?

    thanks
    Dave
     

    Attached Files:

  49. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    Check whether or not your camera is set for forward rendering or if it changed to or from HDR at any point. For some reason it causes havok if the camera settings change. I have had the best luck with deferred/linear but if you apply some post camera effects it causes the issue you are showing to occur almost every time.
     
  50. chingwa

    chingwa

    Joined:
    Dec 4, 2009
    Posts:
    3,790
    Also, if you're in forward rendering, try checking the "use uv reversal" setting on the Suimono_Module object. Forward is notorious for these types of errors though I've rarely if ever experienced them in deferred.