Search Unity

Graphics Hydroform Ocean Renderer [RELEASED]

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

  1. basil3

    basil3

    Joined:
    Dec 3, 2015
    Posts:
    29
    Hey,

    That seemed to do the trick for the underwater artifacts. I had to raise it to 0.85 to hit the sweet spot without any other noticeable issues that I can see.

    The shader/mesh between the under/over water line still has the artifacts though.

    Hardware is:
    Processor AMD Ryzen 7 1700 Eight-Core Processor, 3300 Mhz, 8 Core(s), 16 Logical Processor(s)
    Name NVIDIA GeForce GTX 970
    16GB 2133 Mhz RAM

    Unity version: 2017.2.0f3

    Ste
     
  2. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I'm not sure what you mean there, could you post a picture?
     
  3. basil3

    basil3

    Joined:
    Dec 3, 2015
    Posts:
    29
    Here you go:

    Line.png Line2.png
     
  4. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    OK thanks, and that was happening before you increased the value to 0.85?
     
  5. basil3

    basil3

    Joined:
    Dec 3, 2015
    Posts:
    29
    Hey, sorry I've been away for the weekend.

    Yes it was happening before increasing the value.

    Thanks,

    Ste.
     
  6. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    No worries, thanks for reporting back. I've discovered the problem, was able to reproduce and I have fixed it, will go up in the next update
     
  7. basil3

    basil3

    Joined:
    Dec 3, 2015
    Posts:
    29
    Great news, thanks a million!

    Ste
     
  8. hedgefield

    hedgefield

    Joined:
    Jan 1, 2014
    Posts:
    39
    I've been eyeing Suimono for a while, but I'm glad I picked Hydroform, it's much better!

    On the topic of buoyancy, I've had some success using Fast Buoyancy (free) out of the box to make boats bob on the water, better than the included script for sure, but it still has some weird moments when a wave completely covers it or the boat seems to float. Do you think a large boat would somehow be better affected by multiple small buoyancy colliders, or is there a way to do one large collider and it just needs some more sophisticated calculations? I'm wary of buying any of the other buoyancy toolkits if they all work more or less the same. Realistic Water Physics 3 looks good for example, and has support for all the other ocean assets on the store, anyone have experience with it? I tried the community one but I couldn't get that to work. It's strange that Unity doesn't have a script for that, when there is one for 2D.

    Another interesting thing is that the ocean seems to trigger the Postprocessing Stack v2's motion blur in a major way, the whole screen gets blurred even when the camera itself is not moving.

    I'm enjoying playing around with Hydroform a lot so far, trying the different settings and creating new looks. ShoreFX is such a killer feature too! Oceans clipping through terrain was a real eyesore.
     
  9. Dark-Muppeteer

    Dark-Muppeteer

    Joined:
    Feb 24, 2013
    Posts:
    26
    Was there any resolution for this?

    I'm seeing the issue even while just moving around the in the scene view, I have no reflection probes at all, just a basic island, and the standard skybox using Unity 2018.1.0f2.
     
  10. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I fixed the issue with reflection probes, can't remember exactly what the problem was, but it may fix your issue as well. That fix will be in the next update coming soon. Think I'll shoot for it sooner rather than later now, possibly this week.
     
    Mark_01 and Dark-Muppeteer like this.
  11. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    How can I get foam arround a mesh in the water, like a rock?
     
  12. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    First, check the culling mask on the Height Cam. If you haven't changed anything, then meshes should render to the height field. Next, is the rock in shallow water? The foam draws depending on how deep the water is at any given point. So if you want foam around a rock, you need terrain or other rocks underneath where you want the foam to show up. You'll probably want this anyway as rocks tend not to float by themselves (tropic island demo aside :p).

    You can change the depth at which foam shows up via the Shore FX/Shore Foam panel. Look at the DepthLowFreq and DepthHighFreq values.

    If this still doesn't suit your needs, let me know, with a bit of scripting you can have more control and I can get into that.
     
    Mark_01 likes this.
  13. Goobles

    Goobles

    Joined:
    Jan 10, 2018
    Posts:
    17
    I've been trying to get some kind of foam effect working around moving objects like boats - any ideas? I've tried a few third party decal projection assets but they don't play nicely with hydroform.
     
  14. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Yeah I'll probably have to code something up specifically to do this - unfortunately it would involve re-rendering an ocean patch where the projector would be which would be non-trivial, though I do it with the underwater
    'cage' mesh.

    I think 3rd party projectors don't work because, although Hydroform renders to the z buffer, it also queries the depth buffer and this somehow doesn't allow it to store depth info in there, so other apps can't read the ocean depth from it. Stupid Unity stuff that's beyond my control. 2018's new render pipeline may allow a lot more control over that type of thing, I'm hoping, though it may be a ton of work to take advantage of it.
     
    Mark_01 likes this.
  15. Goobles

    Goobles

    Joined:
    Jan 10, 2018
    Posts:
    17
    If it ends up being a whole lot of extra work I think it's safe to say that me and other people would be willing to purchase a system like that as a separate add-on to hydroform.
     
  16. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I don't know what your budget situation is, but I am a freelance programmer so I could do it via contract if you need it right away. In terms of priority it's a few months off at best. I've got volume culling essentially done, then I've got to hunt down some bugs and then add some day/night/dynamic sky support, take a look at VR, etc.
     
    Mark_01 likes this.
  17. Stickeyd

    Stickeyd

    Joined:
    Mar 26, 2017
    Posts:
    174
    Does this asset have some sort of texture water projector available? Can I project the texture I want on the ocean? Also, does it support breaking waves, whirlpools, tornadoes, and water manipulation to create water magic effects?



    I want to create some sort of water magic effect. Like, creating a graphical wave, or creating a big water spike. But the main requirement is that it will be graphically the same water. Not done with particles. Also, is it possible to make this water effect stop in the air? For example, I want to create a water spike which will not move after created. I'm okay if it will be only graphical, no physics
    This is the scene I'm talking about:

     
    Last edited: Jun 6, 2018
  18. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Sorry, no projections at this time and no it doesn't support breaking waves, etc.
     
  19. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I just uploaded an update that includes Volume Masking/Culling, so you can now poke holes in the ocean or block it from the inside of boats, etc. I also fixed a problem with reflection probes messing up the shoreFX, and another problem with noise in the underwater fx has also been fixed. The update should go live soon, probably today.
     
    eaque, Goobles, Akshara and 2 others like this.
  20. Goobles

    Goobles

    Joined:
    Jan 10, 2018
    Posts:
    17
    you are a magician
     
    eaque likes this.
  21. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Haha, a very slow but dedicated magician ;) Thank you!
     
  22. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I am trying to get the VolumeMasking demo working, but for me it only shows a white material when running the scene. I followed the directions by creating a VolumeMask layer and assigning to VolumeMaskBox object and its children. But here is the result:

    upload_2018-6-9_13-24-56.png

    I checked the shaders and they don't have any compiler errors. I am using Unity 2017.4.3f1 and PC platform.
     
  23. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Oops, I forgot to mention to set the culling mask on the camera such that it doesn't render the VolumeMask layer.
     
  24. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Thanks. That was it. It works now.
     
  25. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Very nice news about volume masking. Can I ask what needs to be done for VR still?
     
  26. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I'm not sure what needs to be done for VR just yet, I'm focused on fixing some bugs and then I'll look at it. Again, feedback has been mixed, some people run VR no problem, others do not. Looking forward to getting to the bottom of it.
     
    Mark_01 and ekergraphics like this.
  27. unfungmz

    unfungmz

    Joined:
    Jul 29, 2017
    Posts:
    162

    Any idea to fix the reflections here? They're very ugly
     
  28. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Try changing the distortion amount. If you are using screenspace reflections, consider switching to planar, which look better, but can be a lot slower - though you can do a few things to optimize planar reflections.
     
    Goobles and Mark_01 like this.
  29. basil3

    basil3

    Joined:
    Dec 3, 2015
    Posts:
    29
    Hey,

    Thanks for the latest update! All integrated now... The issue with the under/overwater mesh having those artifacts still seems to be present. It is only visible when enabling underwater mode. What was the fix you found so I can see if something is impacting this?

    Also - is there a way to grab the height of the ocean to be able to dynamically update my under/overwater transition?

    Thanks!

    Ste.
     
  30. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    The issue that I was seeing was that the cage shader was using world position to calculate the per-pixel face normal. This is a problem when the camera is far away from the origin. I switched it to use a position relative to the camera rather than relative to the origin and it fixed the issue on my end. The change was completely in Cage.shader, you could probably just drop in the new one rather than merge it.

    Yes, you can grab the ocean height via WaveQuery.GetHeightAtPoint() - take a look at the box demo.
     
  31. andre-ivankio

    andre-ivankio

    Joined:
    Mar 29, 2010
    Posts:
    53
    Hi, I'm getting 3 errors when trying to build to UWP (WMR). Any hints on that?

    Shader error in 'Hydroform/Octave': Compiled shader code uses too many instruction slots (972). Max. allowed by the target (ps_2_x) is 512. at line 1 (on d3d11_9x)
    Compiling Fragment program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_MOBILE UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_RGBM_ENCODING


    Shader error in 'Hydroform/Octave': Compiled shader code uses too many arithmetic instruction slots (972). Max. allowed by the target (ps_2_x) is 512. Consider increasing optimization level to reduce instruction count. at line 117 (on d3d11_9x)
    Compiling Fragment program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_MOBILE UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_RGBM_ENCODING


    Shader error in 'Hydroform/UnderwaterFilter': texlod not supported on this target at line 134 (on d3d11_9x)
    Compiling Fragment program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 SHADER_API_MOBILE UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_RGBM_ENCODING
     
  32. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Try adding:

    Code (CSharp):
    1. #ifndef SHADER_API_D3D11
    2.     #pragma target 3.0
    3. #else
    4.     #pragma target 4.0
    5. #endif
    To the octave and underwaterfilter shader files. That's super annoying that it tries to compile for ps2.

    If that doesn't work, then you can just try

    #pragma target 3.5

    That's what water.shader is doing and it sounds like that shader is in the clear for your compile.
     
    andre-ivankio likes this.
  33. basil3

    basil3

    Joined:
    Dec 3, 2015
    Posts:
    29

    Hey,

    I've got the new shader file in the project but it still has the same issue.I can see your comments in the file regarding the issue so it's definitely the right one. I wonder if there is something else causing this for me?

    Ste.
     
  34. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Possibly. Have you tried a clean install of Hydroform? You should remove the mods we talked about before where you tweaked the thresholds.
     
  35. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    Hello, what are your plans with HDRP? Is it currently supported?
     
  36. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Going to be working on more basic features before high end rendering.
     
  37. Liminal-Ridges

    Liminal-Ridges

    Joined:
    Oct 21, 2015
    Posts:
    256
    Can i achieve huge waves and realistic ship movement?
     
  38. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I'd say 10 feet or so is about the max wave height that looks realistic with Hydroform, so no huge waves.

    The "Realistic Water Physics" asset is working on seamless Hydroform integration and will hopefully have that running soon for some good physics.
     
    Liminal-Ridges likes this.
  39. basil3

    basil3

    Joined:
    Dec 3, 2015
    Posts:
    29
    I've made sure all files are patched to the new version and the Cage shader facenormal.y has been set to the original value of 0.1.

    It is definitely less than it was and it only happens when I enable underwater on the ocean script. If disable that it doesn't have any artifacts on the water surface. I'm doing a bit more testing by disabling various other camera scripts to see if there is something conflicting but not been able to nail it down so far.

    I will let you know if I discover the source of the issue, cheers for the help so far!

    Ste.
     
  40. JazZRocK

    JazZRocK

    Joined:
    Dec 17, 2015
    Posts:
    32
    Hello :)

    Any info about compatibility of Enviro and Hydroform Ocean System ?

    Because i have 2 issues:
    1.Ocean only rendered where the terrain is. (Easy to "resolve" with giant low poly plane under the terrains).
    2.The moon shape (dark circle) is visible on the ocean when under the horizon.

    Enviro_Hydroform_RenderIssue.jpg

    Any tips ?

    Thanks you :)

    Edit: Solved by creating a new "Moon" layer and set up the layer at "Moon" in "Rendering Setting" in "EnviroSky" prefab.
     
    Last edited: Jul 4, 2018
    Xix-Interactive likes this.
  41. JazZRocK

    JazZRocK

    Joined:
    Dec 17, 2015
    Posts:
    32
    Good news !!
    And with "Dynamic Water Physics" asset ?

    I can call the water height function from your script in the "Dynamic Water Physics" interface and the floating boat work great but i'm not able to simulate the swell of the sea to dynamically move the boat accordingly to the height of each waves :s

    Here the script to place in your ocean prefab:

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using Hydroform;
    5.  
    6. /// <summary>
    7. /// Attach this script to your non-flat water system.
    8. /// </summary>
    9. public class WaterInterface : MonoBehaviour {
    10.  
    11.     // Replace "WaterSystem" with your type.
    12.  
    13. //     WaterSystem myWaterSystem;
    14.     HydroformComponent myWaterSystem;
    15.  
    16.     private void Start()
    17.     {
    18.         // Replace the following line with the one corresponding to your type.
    19.  
    20.         myWaterSystem = GetComponent<HydroformComponent>();
    21.     }
    22.  
    23.     /// <summary>
    24.     /// Return water height y in world coordinates at world point x, z
    25.     /// </summary>
    26.     public float GetWaterHeightAtLocation(float x, float z)
    27.     {
    28.         // Replace the "return 0" statement with the function from your water system, e.g:
    29.  
    30.         // return myWaterSystem.GetWaterHeightAtLocation(float x, float z);
    31.         return myWaterSystem.waveSettings.waterHeight;
    32.  
    33.         // Do not forget to uncheck "Flat Water" under Additional Options of FloatingObject.
    34.  
    35.         return 0;
    36.     }
    37.  
    38. }
    39.  
    And sorry for my english and i'm ultra novice in coding.
     
    Last edited: Jul 4, 2018
  42. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    Thank you much for posting your solution!
     
  43. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    I don't know about the Dynamic Water Physics asset. Hydroform just exposes the ocean height at a given point, physics is not supported natively, so it's up to whatever physics is running.
     
  44. JazZRocK

    JazZRocK

    Joined:
    Dec 17, 2015
    Posts:
    32
    Ok Thanks you :)
     
  45. Ardinius

    Ardinius

    Joined:
    Oct 4, 2015
    Posts:
    57
    Hi all,
    I had a search of these forums but has anyone come across a issue with Hydroform with Aura?
    https://assetstore.unity.com/packages/vfx/shaders/aura-volumetric-lighting-111664

    I uploaded some screen shots of the issue here https://imgur.com/a/ohEkFQU

    Basically if i disable aura Aura script on the main camera the problem goes away!

    As the screenshots show, if i increase the strength of the aura light the problem is more pronouced, lowering the strength starts to remove the artifact.

    I am using Unity 2018.2 in deferred rendering mode, Aura ambient density 0.01 ambient anisotropy 0. 1 directional light in scene with aura light.cs strength 0.5 (varies depending on time of day from).
     
  46. Xix-Interactive

    Xix-Interactive

    Joined:
    Aug 26, 2015
    Posts:
    442
    You might want to ask this on the Aura forum as well. I don't know why it would interact with Hydroform like that, but the other asset developer might.
     
  47. Ardinius

    Ardinius

    Joined:
    Oct 4, 2015
    Posts:
    57
    Ok i shall, fingers crossed.
     
  48. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    Hi!
    Aura can be applied in two ways :
    1. In a post process pass on all the opaque objects
    2. In custom shaders (for transparent objects)
    I guess the water is a transparent shader so its shader needs to be modified to take aura into account. See the "Custom Shaders" section of the Starting Guide.pdf to learn how to do so. ;-)
     
  49. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Would there be anyway to get the water to fit within predefined boundaries for example the water within a bathtub or inside a boat?
    The volume test example scene has a good idea but there's still an ocean well outside the cube, how to disable that so only what's in the volume is rendered?
     
    Last edited: Jul 20, 2018
  50. franky_li

    franky_li

    Joined:
    Aug 8, 2016
    Posts:
    163
    Hi Brian,
    I have continuously these errors in the editor:

    Screen position out of view frustum (screen pos 0.000000, 512.000000, 937485.312500) (Camera rect 0 0 512 512)
    UnityEngine.Camera:Render()
    Hydroform.HydroformComponent:UpdateReflection() (at Assets/HydroForm/Scripts/HydroformComponent.cs:1861)
    Hydroform.HydroformComponent:OnDrawGizmos() (at Assets/HydroForm/Scripts/HydroformComponent.cs:1099)
    UnityEngine.GUIUtility.processEvent(Int32, IntPtr)


    Windows 10 64 bit, Unity 2018.1.6f1
     
    Last edited: Jul 22, 2018