Search Unity

Graphics Hydroform Ocean Renderer [RELEASED]

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

  1. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
    Thanks, that's an easy enough fix!
     
  2. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
    I've noticed that sprites are not visible through the water. If there is a sprite below the surface and the camera is above the surface, the sprite is not drawn at all (regardless of clarity setting). Similarly, if the camera is below the surface and the sprite is above, the sprite is not drawn. If the camera and sprite are both below the surface, the sprite is only visible above the horizon line. Is there an easy fix for this?

    On an unrelated note: in the inspector for the HydroformComponent, the "Deep Foam" setting is nested under "Shore FX". This seems like a mistake; there doesn't appear to be any direct relation between the two and Deep Foam works even if Shore FX is disabled.
     
    Last edited: Mar 7, 2020
  3. zffzunity

    zffzunity

    Joined:
    Mar 12, 2020
    Posts:
    2
    Hello,guys, I brought your Ocean plug-in named as "Hydoroform Ocean" in Unity Asset Store , because I need the Ocean range is 400 kilometers by 400 kilometers to use in a big scene, in your example named as "TropicIsland" ,I try to change the "Main Camera",change its x coordinate to 200000, z coordinate to 200000, y coordinate to any other numbers, and Rotate the x-axis to 90 degrees, there will be a white square in the game, I want to remove the white squares, can you have a solution? thanks!
    upload_2020-4-13_16-49-53.png

    upload_2020-4-13_16-50-4.png
     
  4. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Hi yeah I got your email, thanks for letting me know. I'm able to reproduce, the issue appears to be floating point precision error due to the high numbers involved. I'll try and see if I can do anything.
     
  5. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
    The SkyCapture script has this code in the update function:

    Code (CSharp):
    1.  
    2.         float curTime = Time.timeSinceLevelLoad;
    3.         float diff = curTime - mLastUpdateTime;
    4.         if( diff > UpdateFreq )
    5.         {
    6.             Capture();
    7.             mLastUpdateTime = curTime - (diff - UpdateFreq);
    8.         }
    9.  
    This doesn't seem to work the way you want it to. The condition
    diff > UpdateFreq
    is always true and the Capture() function runs every frame regardless of the UpdateFreq setting. The last line should probably be
    mLastUpdateTime = curTime;
     
  6. zffzunity

    zffzunity

    Joined:
    Mar 12, 2020
    Posts:
    2
    Thank you for your quick reply, please inform me as soon as possible after your correction.I really hope to get it fixed as soon as possible, because I really need it ,and add the ocean to my scene is really very very important.
     
  7. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I sent you an email, check your inbox...
     
  8. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    You are correct, thanks much for letting me know! I'll try and get a new version up today.
     
  9. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
    Would still like a fix for this, if possible.
     
  10. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
    Would appreciate at least getting an answer one way or another!
     
  11. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Ah so sorry, I missed your original comment. The water is opaque, so anything drawn below the surface will be hidden by the water. In the case of shallow water that is translucent, it does a screengrab before the water is drawn and then mixes that into the color when the ocean is drawn. If the sprite isn't drawn before that screengrab, it won't be visible in shallow water. You could try and get the sprite drawn before the screengrab, but note with the standard Unity drawing model you don't have much control as to when that screengrab happens, especially if there are other assets in the scene that do a screengrab. This is beyond my control.

    You could try and change the sort order of things such that you draw the sprite after the terrain but before the water, and then draw it again after the water (in case it's above water level).
     
  12. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    Will this ever be HDRP compatible?
    Thanks
     
  13. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Probably not in the short term. It will be a lot of work to support all of the pipelines that are now possible with Unity. I'm not sure how much they are adopted by users either. IIRC some of them (all of them?) require a deep understanding of shaders and rendering to even use them.
     
    Hawk0077 likes this.
  14. twiggyash

    twiggyash

    Joined:
    Nov 7, 2013
    Posts:
    45
    Hi, with the new update has been fixed the known issue: 'The height query does not work properly close to shore (doesn’t take into account wave damping)' ?
    Thank you.
     
  15. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    That has not yet been addressed, sorry!
     
  16. twiggyash

    twiggyash

    Joined:
    Nov 7, 2013
    Posts:
    45
    Ok. And when do you think will it be addressed? Thank you.
     
  17. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I am not actively developing it, so maybe in a few months? Not any time soon.
     
  18. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    223
    Hi Xix,

    Love the asset so far! I need to add buoyancy for boats and other objects. Do you plan on selling a buoyancy add-on? I've been googling for hours trying to figure it out so I'd definitely purchase that.

    Thanks for the asset!
     
    Last edited: Jun 30, 2020
  19. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thanks for the kind words, glad you are liking it!

    Take a look at the 'boxes' demo, that will show you how to do a query for the height of the water at a given x/z point. There isn't an included script specifically for buoyancy, but if you google "unity buoyancy script" a bunch will come up.



    -Brian
     
    knobblez likes this.
  20. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
    IIRC there is an included script called "BuoyController" that handles basic buoyancy (object floating at surface of the water). If you're looking for more complex physics-based buoyancy (e.g. objects sink lower when you add weight), that's not included.
     
  21. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Yes, thanks there is a BuoyController script. It sets the height to whatever the water height is. It's a good starting point for adding proper physics if that's what is needed.
     
  22. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    223
    True. It is off quite a bit at times (the boat going underwater or floating above). I'm sure I can modify it to do what I need it to. Thanks
     
  23. OneManEscapePlan

    OneManEscapePlan

    Joined:
    Oct 14, 2015
    Posts:
    222
    What I ended up doing was creating a slightly more sophisticated class based on BuoyController. Instead of only checking the height of the water at the GameObject's center, it checks at the front, center, and rear of the boat, averages these to get the boat's y-coordinate, then pitches the boat forward/backward according to the difference between the front and rear.
     
  24. Kareeem

    Kareeem

    Joined:
    Mar 1, 2013
    Posts:
    37
    getting this error in 2020.1.0f1

    Assets\Plugins\HydroForm\Scripts\HydroformComponent.cs(633,14): error CS0619: 'VRDevice' is obsolete: 'VRDevice has been moved and renamed. Use UnityEngine.XR.XRDevice instead (UnityUpgradable) -> UnityEngine.XR.XRDevice'
     
  25. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thanks Kareeem for letting me know!!

    That's weird it's allowing that old line to persist and cause an error for you. I just downloaded 2020.1 and it auto-updated that line so it works, but with a warning. Hydroform runs fine, but there are some other warnings I need to clear up. I'll try and do that tomorrow.

    In the mean time, replace line 633 with this and you'll be up and running:

    if( !UnityEngine.XR.XRDevice.isPresent )
     
  26. Magic73

    Magic73

    Joined:
    Jun 23, 2015
    Posts:
    132
    Hi,
    does it work with URP?
     
  27. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Unknown, probably not.
     
  28. unity_Zoysi0LQ8HxL_Q

    unity_Zoysi0LQ8HxL_Q

    Joined:
    Mar 15, 2018
    Posts:
    2
    I'm trying to have a Spotlight on the water (dark scene at night and a boat, the aim is to have a single spotlight light the boat's way), but the Spotlight doesn't show up on the water (or possibly the shader?).
    Directional light does affect the light level of the water, but obviously that's scene-wide so not the effect I want.

    Is this something that Hydroform supports?

    Would be awesome if the water created reflections from the Spotlight too, but this isn't something that's absolutely required (just that the Spotlight can be seen on the water and that it lights up that area of the water).
     
  29. unity_Zoysi0LQ8HxL_Q

    unity_Zoysi0LQ8HxL_Q

    Joined:
    Mar 15, 2018
    Posts:
    2
    Was checking exactly this out yesterday, really simple but it works really nicely too.
     
  30. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Unfortunately it does not I'm afraid. I don't think it would be super hard to hack in if you have experience in coding shaders - have the pixel shader check whether it is within the spotlight cone and shade accordingly.
     
    unity_Zoysi0LQ8HxL_Q likes this.
  31. vampir26

    vampir26

    Joined:
    Mar 29, 2010
    Posts:
    108
    Hi

    I just bought Hydroform and it was very easy to setup.The endless ocean is great and it's also great to see it in editor window. The frame rate is just awesome!

    I'm a littlebit disappointed of the quality near the ocean in first person. I'm not sure, but probably Hydroform is created for RTS, flight sim and other "looking from far away" to the ocean games.

    I could not adjust the foam tile amount. No silder is created and changing the tile size in material take no effect.

    A also don't like the "spikes" of the waves. I can clearly see the generated "mesh" or grid.

    Can you please give me some hints to improve quality?
     
  32. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Hey man, thanks for your support with Hydroform! Sorry the quality near the ocean isn't what you hoped, let me try and give you some tweaks to make it better.

    I'm not sure what you mean by "foam tile amount"? If you want more or less foam, try modifying the "Depth low freq" and "Depth High Freq" values under ShoreFX/Shore Foam in the ocean component.

    For the wave shapes, look under Wave Settings and modify the Amplitude for wave height and Frequency for wave frequency. Also take a look at the Chop value.

    If, by "spiky" you mean "low poly", you can increase the amount of geometry in the waves under "Wave Construction/Vert Density". Higher vertex density will result in better looking waves up close, but also lower performance.

    You should NOT be seeing the generated mesh or grid, that sounds like maybe there is a problem. If you could post a screenshot I may be able to help.
     
  33. wrestlerVR

    wrestlerVR

    Joined:
    Feb 15, 2018
    Posts:
    1
    A couple of bugs.

    Unity 2019.2.6f1
    When using planar reflections, reflected objects are not being affected by fog

    upload_2020-8-12_12-15-5.png


    Unity 2020.1.1f1
    SSR reflections are rendering with odd slices through them
    upload_2020-8-12_12-18-10.png
     
  34. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thanks for the info!

    The SSR reflection is meant to be fast, but inaccurate, so it has artifacts like you show sometimes, but looks fine when distorted.

    I am scratching my head about the lack of fog in the planar reflection. Tried a few things with it today, made sure the rendertexture has a depth buffer, etc. Doesn't make sense.
     
  35. carlosmotaa

    carlosmotaa

    Joined:
    Jan 1, 2018
    Posts:
    8
    Hi! this asset looks pretty nice, the water support networking?? i mean, the waves can be synchronized? ty :)
     
    Last edited: Aug 23, 2020
  36. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thank you!

    Yes, the waves can be synchronized by making sure the same random seed is used on all the clients and then setting the start time at the same time on all the clients.
     
  37. carlosmotaa

    carlosmotaa

    Joined:
    Jan 1, 2018
    Posts:
    8
    That´s perfect, ty :)
     
  38. bresz

    bresz

    Joined:
    Jun 8, 2017
    Posts:
    4
    Hi,
    I've been using the asset for a while and it works very well for me. Now I have added a second camera to my scene. I also added the "Hydro Multi Cam Comp" script to this camera. Both cameras render in different displays at the same time. Unfortunately, the water is only visible in one game view, although it should be visible in both cameras.
    Only when I move the position of the second camera close to the first camera will the water also be shown on the second camera. What can be the reason?
     
  39. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Sorry for late reply here:

    The way the ocean works is an active camera will clip the ocean so that it only renders what is in that camera view. To have two simultaneous cameras, you would need to have two oceans running, and then make sure that the ocean prefab passed into HydroMultiCamComp (via inspector) is different for each camera. I think that might work.
     
  40. buas-cradle

    buas-cradle

    Joined:
    Feb 3, 2017
    Posts:
    2
    Hi,

    I got the Hydroform package, and it looks realy good. But, I faced a problem, I am attempting to run it within SteamVR. I am using Unity 2019.4.2f1 LTS, and it does not render the Ocean under the VR camera.

    I attempted to follow the steps on the manual, but, the manual seems they are a bit outdate since the XRRig gameobjects do not reference Camera(eye) or Camera(head).

    I quickly took a look at the code, it seems that the VR part is mainly constraint under the Unity version 2020. When I altered from UNITY_2020_1 to UNITY_2019_4 all the code seems to work as normal, and the HydroformComponent is able to detect the VR and obtain the VR camera. Still, it didn't render the ocean, please advise on what to do, to be able to run it in VR.

    Thanks in advance,
     
  41. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Sorry, I'm not sure what to do to fix. I don't currently have access to a VR rig to test. All I can say is look at existing Hydroform code and try and adapt it to the current Unity API - I don't think it's much code.
     
  42. Grzzld

    Grzzld

    Joined:
    Aug 4, 2014
    Posts:
    12
    Hi Xix,

    Really nice asset, great job. I am looking for a way for the waves to leave a wet trail that decays as it recedes into the ocean. I searched but could not find if it was answered already. Apologies if this has already been addressed.

    Link to another's system that has the desired effect.
    https://twitter.com/Cyanilux/status/1242154529241604101

    Thanks and be well.

    Grz
     
  43. Grzzld

    Grzzld

    Joined:
    Aug 4, 2014
    Posts:
    12
    We have it working in VR. Maybe you did not attach the script to the camera? We attach it to the CenterEyeAnchor...
     
  44. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thank you, glad you like it!

    Doing a wet trail would be tough. The shape of the water on the shore is determined by the intersection of the water mesh and the shore mesh in 3D. To retain that shape for the wet look, the shape would have to be recorded from above and projected back onto the shore somehow. It would likely require rendering both the water and the shore twice to accomplish this.

    -Brian
     
  45. Grzzld

    Grzzld

    Joined:
    Aug 4, 2014
    Posts:
    12
    Hi Brian, Thanks for the quick reply. I wonder if it can be faked in some way. Maybe there is an edge or buffer that the user can set a length, color, gradient and alpha slider to. It would be the first on the shore and the last to leave. Maybe throw in a little randomness to make it more fluid like. Just a thought!
    Keep up the great work!
     
  46. goldwyn11

    goldwyn11

    Joined:
    Apr 8, 2019
    Posts:
    12
    EDIT: Nevermind, the code that you wrote above seems to have worked, just had to change the line that it was on.

    Hello, I haven't had an issue with hydroform since I first downloaded it, but I downloaded some new particle effects from the asset store and now it's giving me a console error similar to one posted above but it looks like the lines in the script code have changed a bit since your last posted fix.

    Assets\HydroForm\Scripts\HydroformComponent.cs(658,14): error CS0619: 'VRDevice' is obsolete: 'VRDevice has been moved and renamed. Use UnityEngine.XR.XRDevice instead (UnityUpgradable) -> UnityEngine.XR.XRDevice'

    Some of my assets aren't VR compatible so I don't need anything VR related to be working in this. Is there an easy fix to this before I start trying to mangle code on my end?
     
    Last edited: Sep 10, 2020
  47. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    The latest version of Hydroform should have fixed that error. Let me know if it's still there in the latest version.
     
  48. garrett456

    garrett456

    Joined:
    Mar 13, 2013
    Posts:
    6
    Our teams has had troubles with other water assets running in Ubuntu, and I saw you had a linux demo. Figured I would try that before purchasing, and after figuring out which packages to install, I got it to run up to the splash screen, and then it quits with the last line stating "Aborted" just after assigning the joystick. Do you have and idea what might be causing that? (this is not a super high end laptop with a meh video card, but its all we had laying around)

    Thanks
     
  49. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Unfortunately I don't know why that is happening. It should run on Linux in theory, but I haven't tested it ;)
     
  50. goldwyn11

    goldwyn11

    Joined:
    Apr 8, 2019
    Posts:
    12
    Hello there, sorry for the basic question but a search of the word "cull" didn't return any results that seemed helpful in this thread. I've got the ocean all tweaked and set up all pretty, but it goes around a rather massive island, probably bigger than Unity is normally used for. When the player is on the island the ocean in the distance gets culled and just shows the sandy beach. Is there a way to keep the ocean constant?