Search Unity

Graphics Hydroform Ocean Renderer [RELEASED]

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

  1. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    I am no expert but that sounds like a setting somewhere for the culled/render distance. I used it on a large map 8x8 2km tiles and never had that issue. I dont use it now as its not HDRP compatible.
     
  2. goldwyn11

    goldwyn11

    Joined:
    Apr 8, 2019
    Posts:
    12
    Oh nice, fiddling with clipping plane distance did it. Sorry for the late reply, your response went to a new thread page and I didn't notice. I've been refreshing page 19 for over a week now xD

    Anyways, you saved the day, thank you for the help c:
     
    Hawk0077 likes this.
  3. Hawk0077

    Hawk0077

    Joined:
    Nov 6, 2017
    Posts:
    788
    lol. It ssoundss crazy when someone says I helped because I don't really have a clue. lol
     
  4. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    111
    Hydroform gives an error in Unity 2020.2.2
    Assets\HydroForm\Scripts\HydroformComponent.cs(12,19): error CS0234: The type or namespace name 'VR' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)
     
  5. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thanks for letting me know. I'll take a look at it, but it is probably an easy fix as they just renamed something. Perhaps related to this:

    https://forum.unity.com/threads/hydroform-ocean-renderer-released.385545/page-19#post-6142734

    You have the latest version of Hydroform I assume?
     
  6. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    111
    Yes I use the latest version (1.39a)
    And it is an easy fix (I just commented out
    Code (CSharp):
    1. //using UnityEngine.VR;
    Since I'm using Unity 2020.2)

    But I thought you would like know this and provide a neater solution ;)
     
  7. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    OK, the quick fix is simply to comment out the line "using UnityEngine.VR;" at the top of HydroformComponent.cs. I'm working on a solution that will work with all Unity versions, hopefully have it up soon...

    EDIT - ah you beat me to it haha
     
  8. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Here's an idea that came out of the blue you might be interested in trying for those users who are asking for a HDRP and URP version:
    The shader graph system in HDRP/URP is pretty cool and so why not jump in there and play around with it and see if you can make a decent water shader using the nodes it has. If successful you can add it as part of a free update or something which should provide those who use URP and HDRP at least something that should shut them up haha.
    I know you are an industry professional and so you would probably breeze through it easy.
     
  9. 3dmars

    3dmars

    Joined:
    Jan 3, 2016
    Posts:
    52
    Xix-Interactive, just to let you know, the Asset Store link doesn't seem to work in the first post.
    I'm getting the error:
    default backend - 404
     
  10. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thank you so much for telling me! Fixed!
     
  11. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    That is a good suggestion and I may well jump in and do it. There are some things I'd like to support and fix that I just can't accomplish with the standard pipeline, like certain fog and lighting support, that should be possible with the new pipelines. It will take a lot of time though. It's all the testing that burns a lot of time, so many Unity versions, and even within Unity there is forward rendering vs deferred, and then PC vs Mac vs Linux.
     
    SilverStorm likes this.
  12. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    111
    I'm having a strange problem with Hydroform in Unity 2020.2.6f1 (tested it also with 2020.2.4f1)
    If I close an Unity project with a Game Tab active (so not behind the Scene Tab but in front of it or next to it, or on another monitor) and a Hydroform Ocean in the Scene. The next time I try to open the project it hangs on 'Finish Loading Project' for ever.

    And I have to kill Unity with the Taskmanager

    If I delete the CurrentLayout-default.dwlt file from the Library, the Layout is reset and the Project loads.
    Something is going wrong with the initialisation of the shaders I think.
    I can send you the project if you want.
     
  13. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I'm able to reproduce the issue. Not sure what, if anything I can do about it, seems like a unity problem.
     
  14. mgrugl

    mgrugl

    Joined:
    Mar 1, 2017
    Posts:
    23
    Has anyone had any luck rendering this beautiful water in VRPanorama? The water displays correctly in Game mode, but when rendered it turns black. This happens even with all reflections turned off. The manual indicates a solution for the water showing up black in the Troubleshooting section, but no solution seems to be provided there. Using Unity 2019.4.20f1 Standard Render Pipeline.
     
  15. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    111
    Have you found a solution for this problem ?
    Or did you file a bugreport to Unity ?
     
  16. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I'm going to dig into it soon, hopefully next week..
     
  17. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    This sounds like it may have conflict with another asset you are using. Try and disable all other assets and see if it continues to do this. You could also try and disable more features in Hydroform like ShoreFX to see if that changes the behavior.
     
  18. mgrugl

    mgrugl

    Joined:
    Mar 1, 2017
    Posts:
    23
    Thanks very much for your timely reply. I have created a scene with just Hydroform and VRPanorama. The water starts to show up in the stereo rendering now, albeit much darker than it does in the Game view. Attaching 2 screenshots. One from Game view, the other showing part of the rendered 360 image. Shore line effects are turned off.
    https://ibb.co/qmcxGpX
    https://ibb.co/hLssfsH
    Edit, addendum: Tested a 360 stereo recording with the Unity recorder. There, the Hydroform appears as a flattish polygonal surface with a plain looking color, similar to the skybox. Hope someone can help. Would love this water in 360 videos.
     
    Last edited: Mar 26, 2021
  19. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Oh it's doing 360 rendering? Hydroform has problems with those, probably because it needs to update the viewing frustum when the camera pans across - the VRPanorama would need to do that, assuming it's doing 3-4 captures, it would need to update the Hydroform script each time it rotated to the next capture position.
     
  20. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Good news, I have found the problem and the fix is relatively easy. I'll try and get a new build up with the fix tomorrow.
     
  21. Kagami12

    Kagami12

    Joined:
    Aug 9, 2015
    Posts:
    6
    I've been trying to implement this asset with a floating world origin, as approximately outlined here:
    http://wiki.unity3d.com/index.php/Floating_Origin

    I've looked in to some way of moving the water to a new origin, but can't really find any way to do it-

    Any idea on how to fix this?

    Thanks
     
  22. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442

    Hydroform essentially does this automatically - translates the mesh vertices near the camera every frame. You can only control the water level height.
     
  23. SylvainChague

    SylvainChague

    Joined:
    Nov 20, 2012
    Posts:
    8
    Hi. Great work on this plugin.

    There is an issue with the UnderwaterFilter in VR (tested with Unity 2019.4.10f1, both with the legacy "Virtual Reality Supported" mode (both Oculus and OpenVR) and the new XR Management system. It seems the stereo rendering is not computed correctly when we are below the surface of the water. This is particularly visible when leaning the head left and right and looking at the horizon (see image below from the "boxes" scene, which show the left and right images). I'm using the default camera in the "boxes" scene.
    This issue is present both in Single Pass and Multi Pass. Any idea?

    Issue.JPG
     
    Last edited: May 18, 2021
  24. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I'm not sure what the issue is there. Unfortunately I'm stuck in Taipei with no access to a VR rig so I can't debug. I'm so sorry I can't support this issue, PM me if you would like a refund.
     
  25. SylvainChague

    SylvainChague

    Joined:
    Nov 20, 2012
    Posts:
    8
    Thanks for the quick reply. You can reproduce the issue without an actual VR rig by using the "Mock HMD" feature. In Unity 2019.4, you can find it in "Player" settings.
    HydroBug2.JPG

    With Mock HMD enabled, enter in play mode in one of your demo scene (e.g. boxes in the scene below) and bring the camera below the surface of the water. You will notice the stereo-vision discrepancy between the left and right image (brighter blue line at the horizon on the left image in the screenshot below).

    HydroBug.JPG
     
    Last edited: May 19, 2021
  26. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thanks for info on Mock HMD.

    Looks like this is not a quick and easy fix. I don't have time right now, but I'll address it if I do a URP version of Hydroform.
     
  27. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    111
    Which setting controls the transparency of the ocean ?
    If I disable 'Enable refraction' I have no transparency at all. But I do want some transparency, only less.
     
  28. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Look under ShoreFX/Water Clarity
     
  29. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    111
    Yes! indeed
    (I didn't look that far down :oops:)

    Thank you
     
  30. Adherbal

    Adherbal

    Joined:
    Dec 4, 2012
    Posts:
    12
    Judging from the demo the effect looks great, however it's probably not suited for a top-down game? Considering the effect appears to "circle around the center of the camera", it doesn't look great when there is a high camera looking down upon the water.

    Is there a solution for that? I have not purchased yet but certain will if there is :)
     
  31. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Yeah it's probably not best if only viewed from top-down. It would burn some processing time on the waves, which you could mitigate, but still not as efficient as a simple flat plane water.
     
  32. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    531
    I'm also trying to implement a floating origin scheme to hydroform water, and I've got the water height parameter being offset by the origin shift, which does seem to work.

    The problem however is that there is still a visible twitch when the origin moves, because the waves aren't being offset with the origin (in the XZ plane)

    Here I'm going through the code, trying to follow the implementation of the water height offset, but it's not clear at all how this is being done.

    Is there a way to control the UV displacement of the water somehow? Or rather, what should I be looking for to offset the water field without breaking the whole thing?

    I'm not trying to move the water meshes.. That does already follow the camera nicely in worldspace. I'm just trying to offset where the 'waves' are.

    Thanks in advance!

    Cheers
     
  33. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    111
    I'm using the XRRig prefab that comes with the XR Legacy Input Helpers Package. And have placed the HydroCamMultiComp on the camera object in this prefab. But it doesn't show the ocean in my VR glasses (Vive)
    I also get an error message:
    Shader error in 'Hydroform/Brim': undeclared identifier 'sampler_CameraDepthTexture' at Assets/_Tools/HydroForm/Resources/WaterFunc.cginc(594) (on d3d11)
     
  34. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    111
    And as soon as I turn on Initialize XR, Hydroform ocean disappears even for a 'normal' (non tracked VR) camera

    Screenshot 2022-03-21 120122.jpg

    Using Unity 2020.3.20
     
    Last edited: Mar 21, 2022
  35. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Hmm, I am not sure what could be causing these issues. Are you using the standard pipeline? Does the same scene work without the XR plugin? It may just not be compatible.
     
  36. Wilbert-Blom

    Wilbert-Blom

    Joined:
    Aug 13, 2011
    Posts:
    111
    I use the standard builtin pipeline.
    This is the same scene with XR off and XR on:
    XRoff.jpg
    XR off

    XRon.jpg
    XR on

    You don't need a VR set test this
     
  37. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Yeah it looks like some other people are having similar issues with XR, but I'm not seeing any solutions posted. Maybe try to rebuild your Library.
     
  38. silentpundit

    silentpundit

    Joined:
    May 2, 2020
    Posts:
    26
    @Xix-Interactive love the asset, thanks for continuing to support it. Was wondering if you think you'll ever have a look at getting planar reflections working in VR? Would be so nice. The reflection is appearing in both eyes, it's just not lined up correctly and rotates oddly with head motion. Seems like it's so close!
     
  39. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Unlikely to happen soon, sorry! I'm just basically doing bug fixes for it now if it's broken by a new version or something.
     
  40. knobblez

    knobblez

    Joined:
    Nov 26, 2017
    Posts:
    223
    Does this asset work with universal render pipeline? If so, how do I configure it so that it will? If it's not too much to ask :)
     
  41. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    As far as I know it does not work with URP. I'm sorry I don't know how to configure it to do so, last time I looked it was a non-trivial amount of work.
     
    knobblez likes this.
  42. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    What about HDRP?
     
  43. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Same thing, it is a considerable amount of work to port to the other pipelines.