Search Unity

Graphics Hydroform Ocean Renderer [RELEASED]

Discussion in 'Tools In Progress' started by Xix-Interactive, Feb 11, 2016.

  1. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    Cheers on the new version! The horizon fix worked perfectly for me.

    Vondox has been offering a few suggestions on the Enviro thread about the masked/overdrawn horiozons issue. Here's the latest:

    https://forum.unity.com/threads/rel...nd-weather-system.317986/page-64#post-3783679
     
  2. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Hydroform doesn't render to the camera depth texture because that would require an extra pass which would be bad performance-wise. You can try and force it though and see if it resolves the issue.

    Set the Queue to "Opaque" and then you will need to set up a shadow caster pass, according to these docs:
    https://docs.unity3d.com/Manual/SL-CameraDepthTexture.html

    Also remove the line "ForceNoShadowCasting" in Water.shader - if you're lucky this might be all you need to do.

    This page mostly shows how to set up a shadowcaster pass:
    https://answers.unity.com/questions/1001603/shader-lightmode-shadowcaster-question.html
     
  3. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    438
    @Xix-Interactive I've experimented with your suggestions for a shadowcaster pass, but am still experiencing this issue. I'll PM you a link to an assetbundle with my test project in case you have a chance to take a look.

    Unity 2018.2.5f1 (64bit) - DemoScene.unity - Hydroform and Enviro - .jpg
     
  4. hedgefield

    hedgefield

    Joined:
    Jan 1, 2014
    Posts:
    39
    Ahoy, it seems Hydroform doesn't play too well with the Unity PostProcessing stack v2, specifically (only) the motion blur effect. When it is enabled and you start the game, the screen is blurred nonstop, as if the camera is moving, even when you are standing still. This only happens when a Hydroform ocean is in the scene.
     
    Xix-Interactive likes this.
  5. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    It probably has something to do with using GrabPass. Does this occur when you turn off refraction in the ShoreFx tab?
     
  6. hedgefield

    hedgefield

    Joined:
    Jan 1, 2014
    Posts:
    39
    Ah, yeah you're right, turning off refraction stops the unwanted behaviour. The ocean doesn't blend so nicely with the shore now, but it's better than constant blurring!
     
  7. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    Hey guys, is there a simple way to get more control over the Volume culling/ ShoreFX feature?
    My use case consists of multiple islands (shores) so I am making use of the shore wave dampening settings and need to keep these in play.
    However I have collision enabled ocean vehicles, I don't want the ocean waves to get affected by these vehicles, at present I have these visually unappealing ocean 'sink holes' under all my boats. I'd assume I can pull this off with layers and culling but.. clueless.
     
  8. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Hey, sorry for the late reply. You basically want to set up the 'HeightCam' (located under the ocean prefab), such that the culling mask will cull out your boats. Ie, put your boats on a layer and then cull that layer out with the culling mask on HeightCam.
     
  9. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    Ahh, I knew there was something akin to that in here somewhere, easy fix thank you! Amazing asset never dissapoints*.
     
    Xix-Interactive likes this.
  10. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thanks for the kind words, glad you are digging it!
     
  11. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    My refraction setting seems to cause some weird artifacting/ outlining around my character, regardless of my distance to the water. Any idea how I stamp this out without turning off refraction? https://imgur.com/a/FQhQTc3 Can be quite hard to see at times (because we have a day / night cycle) but, more so during night when it is visible, it's very blatant http://puu.sh/C8HNf/c6b919aad6.jpg
     
  12. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Hmmm, that is odd and should not be occuring.

    Here's a quick fix - look in WaterFunc.cs, go down to getRefractColor(), then change the 'distortion' value to 1.0 from 0.9. That should help that artifact.
     
    Hummy91 likes this.
  13. Koodetat

    Koodetat

    Joined:
    Apr 11, 2014
    Posts:
    14
    Hello everyone. I am looking for a buoyancy (boats) solution compatible with Hydroform. Does it exist? (paid or not). thank you.
     
  14. ekuNNN

    ekuNNN

    Joined:
    Sep 3, 2013
    Posts:
    22
    Is it possible to use raycasting on the ocean to get the wave normals? My raycast doesn't seem to be able to hit the ocean object so far, but maybe I'm missing something.
     
  15. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
  16. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Raycasting does not work with Hydroform. If you want a normal, you can do 3 GetHeight() queries and then calculate a normal from that. Sorry this isn't better supported :(
     
  17. ekuNNN

    ekuNNN

    Joined:
    Sep 3, 2013
    Posts:
    22
    Ah, no problem. Thanks for the quick response so I didn't try too long :] Great asset!
     
    Xix-Interactive likes this.
  18. blanxdev

    blanxdev

    Joined:
    Apr 4, 2018
    Posts:
    4
    Hi, is there someone with the same error in VR?
    bug1.PNG bug2.PNG

    When I look around the Volume Mask starts moving. Depending on the angle only in the left or right eye.
    HydroMultiCamComp is on the Main Camera with Single Pass rendering.
    Multi Pass has a similar error but the mesh just moves a bit differently.

    The Mask is for the Interior of the ship, so it's basicly under me. When I'm inside everything works fine. Just from the Exterior I get these Mask errors

    Anyone got a solution for this?
     
  19. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I'm so sorry, but volume masking does not work in VR at this time. Please contact me for a refund if you are unhappy with the asset.
     
  20. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I just realized that I forgot to include the latest manual in the latest build. It has instructions for setting up in VR. I've attached the new one to this post.
     

    Attached Files:

  21. blanxdev

    blanxdev

    Joined:
    Apr 4, 2018
    Posts:
    4
    Is there any other way to deactivate the ocean on runtime. Or just make it invisible?
     
  22. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Yes, if you deactivate the HydroMultiCamComp on the camera, it will no longer render the ocean.
     
  23. ProtoPottyGames

    ProtoPottyGames

    Joined:
    Dec 18, 2015
    Posts:
    77
    Hi!
    Just curious to know if the documentation readme was up to date. I'm one of those jerks trying to get skybox reflections to work in VR. I thought I had it licked last night but I was being 50% asleep and 50% regular old idiot me and deleted my test scene.
    Now I can't seem to figure out what I did to make it work. Are planars still not a thing? Could I be missing something having to do with my cubemap maybe? Any advice regarding skybox reflections in VR would be greatly appreciated. Thanks!
     
  24. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Could you clarify what the issue is? Maybe post a screenshot?

    The skybox / reflection settings are under the ReflectFX dropdown.
     
  25. ProtoPottyGames

    ProtoPottyGames

    Joined:
    Dec 18, 2015
    Posts:
    77
    Oh, sure...haha Sorry I guess that does sound a bit vague. :D
    I think I may have figured out an okay solution though. When I was trying to use the Planar reflections option the skybox reflection was moving around across the top of the water as I moved my head. Just setting up a cubemap seems to be working okay though? I think? To be perfectly honest I'm not entirely sure how it's working. XD
    If I can figure out what's going on well enough to articulate, I'll come back and explain my findings. ;)
     
  26. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    Thought I'd chime in with my 2cents on adding a daytime system. I've used my own daynight time system and also a few off the asset store whilst trying to find the right fit, and in order to adapt Hydroform to all of them, I came up with an easy way of doing so.
    If you can quantify your 'time' to a 0-1 value, you can just plug this into a gradient and use gradient.Evaluate. Doing so you can customize the water/subsurface colour over the course of the day. Or as someone else stated, use HSV, set the alpha of the gradient at different times and simply set the V of the HSV color to the alpha value of the gradient evaluation for smooth transitions.

    I'm personally using a white alpha gradient to adjust the V (brightness) of my ocean surface colour, whilst using a colour gradient to adjust the subsurface colour as I'm working on a more stylized look.
     
  27. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Ha OK, ya let me know. The planar reflection probably won't work in VR, but cubemap-only should.
     
  28. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thanks so much for the feedback on your technique. I have fallen woefully behind on getting that in. I focused the last update on fixes rather than new features, the next one will have stuff like this that I should have added ages ago. Thank you for your patience.
     
  29. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    I'm struggling a little with making use of volume masks to prevent the ocean from 'washing over' the decks of my boats. The volume mask demos works fine but It doesn't seem to work in my own scenes. I tried with custom meshes and then also with unity primitives (capsules/boxes) to no avail. Could this be because my vehicle meshes are made up of multiple pieces like floor/hull etc? I ask that because in the demo, the 'mask cube' stops masking and renders when moved away from the encapsulating mesh (bucket). Is it meant to work this way? As seen here: http://puu.sh/Cmy6N/dc870be2d2.jpg

    Although, annoyingly, i can't even get the mask volume to render like that in my scenes. I even tried prefabbing the working bucket example, slapping that in my scene and it wasn't masking the ocean out of the bucket at all, yet it works in the demo with all the same layers setup and same camera settings/masks. /Confused
     
  30. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    It should work fine with your custom meshes. Make sure that your volume meshes are in the VolumeMask layer, that they have the VolumeMaskMat applied, and that the camera that is rendering them has the VolumeMask layer unchecked in Culling Mask. That last one is probably why the test bucket isn't working in your scene. Also make sure the Underwater Filter is applied to the camera.
     
  31. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    Thanks for the help. Turns out it was an error on my part, I override the hydroform classes for networking purposes, one of my overrides wasn't returning the camera correctly and causing this without any errors as the original classes are still present while I test/tweak/develop.
     
    Last edited: Dec 30, 2018
    Xix-Interactive likes this.
  32. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thank you for reporting back on that!
     
  33. Hummy91

    Hummy91

    Joined:
    Jun 7, 2017
    Posts:
    67
    I've searched through the thread hoping to find a previous solution but failed. Can the ocean render transparency when underwater? I'm not in need of the fog settings that come out of the box as I'm using my own fog system for any cases where I need it, but for under water I'm going for a very simplistic visuals, and would look to be able to see out of the water with mild distortion.
    At the moment, when using the built in hydroform underwater settings, I can tint the ocean via fog, but this is all opaque, as for the 'underwater filter' component, not sure whats up with that, it just renders opaque black underwater no matter what I do with it, amidst some very hard to notice artifacting inside the opaque black. (Ran through the manual, and tried various tweaks to make the underwater filter work with no success).
     
    Last edited: Jan 1, 2019
  34. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    That doesn't sound right, can't think of why it would go black. There might be another asset that is causing problems, try and disable as many as you can and see if that makes a difference.

    If you don't need the fog, you should disable it in the Underwater.shader, hopefully that will have a positive effect on the issues you are seeing.
     
  35. gaiastellar

    gaiastellar

    Joined:
    Nov 8, 2013
    Posts:
    57
    hi,
    im looking for water that will work on a spherical mesh - eg a large planet (100+km radius). can this water work like this?

    many thanks

    paul / uk
     
  36. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442

    Hi Paul - it can not work on a sphere without significant modification.
     
  37. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    131
    I've bought this a while ago to evaluate it and I found that I've come back to it, mainly because of the performance. I think it's very good.

    I have been playing with the foam this evening and found the deep foam to be perfect. However, the shore foam could do with some additional parameters exposed, so we can fine tune the amount of it (not just the frequency) and also bring it into contact with the shore (currently there is a gap).

    Also, while on the subject of foam, I have been unable to produce foam effects around the vertical poles of piers and the hulls of floating vessels. Is this currently possible? It would be just great if it were.

    Finally, one more thing (to anyone reading). I've just purchased Azure to see if I can set up a global maritime scene. I would appreciate any tips on how to integrate these two assets!
     
    Last edited: Feb 2, 2019
  38. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Hey Jason, sorry for late reply. I have the gap in there because I think that having a "soft" contact between the water and the shore looks better than a "hard" one. Here is a comparison with / without the gap:

    upload_2019-2-5_17-41-7.png


    It's pretty easy to change though, take a look in WaterFunc.inc / getFoamColor(). Play around with the "intensity3" line and see if you can get it working better to your liking. These values will push it closer to shore than the default:

    float intensity3 = 1.0 - pow( max( 0.0, (0.2 - height) / 0.2), 2 ); // fade out all foam in very shallow water



    -Brian
     
    Jason210 likes this.
  39. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    131
    Ah- so now I understand. I'll have a go with those parameters, but yeah, I want to avoid that problem you pointed out.

    Can you think of a way to create foam / wakes for a large ship? Anything planned along these lines? (Volume culling is not vital since the interior will be another cell).

    /Jason
     
  40. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I'm thinking of adding "screenspace" foam that would be for more realtime objects or small ones that wouldn't be much affected by the current foam system. That's different than a wake that would extend quite far back from a ship. A projector would probably be the best bet there, but Unity won't allow my shader to write to the depth texture without doing an extra pass. So traditional projectors won't work. A custom projector written into the hydroform shader would work though.
     
    SCMcArthur likes this.
  41. Jason210

    Jason210

    Joined:
    Oct 14, 2012
    Posts:
    131
    I would welcome both those features. To my mind these are all that's needed in this ocean system to make it usable with ships and boats (with harbours). A customisable projector would be awesome.
     
    Last edited: Feb 9, 2019
    Xix-Interactive likes this.
  42. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I've finally found some time to work on Hydroform for a few days. The plan was to bang out day/night support and it took longer than expected, but I've added some interesting features to support that. It now reads the fog color from the skybox along the water edge, so it can blend nicely with the sky as demonstrated below. The top two images show the before and bottom two show the dynamic horizon fog.

    I've also got the water reflecting whatever skybox is in place rather than a static cubemap. You will have the ability to set the update rate so if you have fast/dramatic changing skies, the water can reflect that in realtime if desired. More coming soon!

    upload_2019-4-17_14-28-20.png
     
  43. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,527
    awesome update! Thanks
     
    Xix-Interactive likes this.
  44. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Version 1.38 is uploaded, waiting for approval.

    Release notes:
    - Added changes for day/night support
    - Added day/night demo scene
    - Added support for dynamic skybox reflections
    - Can grab color at horizon to use for fog
    - Added support for linear/exp/exp2 fog settings
    - Adjusted colors and reflection / foam texture reads for linear mode

    In addition to these changes I looked at fixing some underwater issues in VR as well as volume culling in VR. Unfortunately it's not trivial to fix these, but I know what needs to be done for the next time I go in for fixes. It will take much more time than I thought.

    I also looked at Enviro integration, but was not able to do so seamlessly unfortunately. I think I can probably get there with more time and some help from the dev (who is a nice guy and responsive). In the meantime, I believe Azure sky will work with Hydroform.



    upload_2019-4-30_14-58-6.png
     
  45. twiggyash

    twiggyash

    Joined:
    Nov 7, 2013
    Posts:
    45
    Hi, I'm thinking to buy this cool asset now on sale on Asset Store. I tried the demo but I do not understand few things.
    1) Does it support buoyancy and dynamic ripples?
    2) Does it have underwater camera effects?
    3) Does it support underwater Sun Light Shafts and Caustic?

    Thanks for help!
    I hope you can fix Enviro compatibily cause I'm using it too :)
     
  46. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Hey Twiggy, here are my answers:
    1) It supports a height lookup, but doesn't include buoyancy physics (they are possible using height lookup). It does not support dynamic ripples.
    2) It does support basic underwater fx for non VR apps. VR has some issues that some users have worked around. I haven't updated the demo since launch, so I need to get around to that.
    3) No underwater sun shafts or caustics on the ground

    Hope that helps!
     
  47. twiggyash

    twiggyash

    Joined:
    Nov 7, 2013
    Posts:
    45
    Thank you very much for reply. Ok, VR is not important for me.
    I hope that a day you could do something about ripples and underwater sun light shafts cause it would be amazing.
    Are you going to upload an updated demo soon?

    Thank you!
     
  48. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I'll look into updating the demos this weekend. There's a good chance I can't get to it though.
     
    NeatWolf likes this.
  49. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
  50. twiggyash

    twiggyash

    Joined:
    Nov 7, 2013
    Posts:
    45
    Thank you very much! ..Just bought it :) ..I really like your water! In my opinion, when you'll add any sort of underwater Sun Shafts it would be perfect! Much better then other assets. Now I'm trying to use your water with Enviro but I noticed that the water become almost invisible if Enviro is on. Is this normal at the moment?
    Thank you.