Search Unity

Realistic Water

Discussion in 'Assets and Asset Store' started by kripto289, Mar 21, 2015.

  1. jason-fisher

    jason-fisher

    Joined:
    Mar 19, 2014
    Posts:
    133
    Can this be made to work with a spherical planet that has a water sphere?
     
  2. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Alas, no.
    Only the mesh, which has an angle less than 180 degrees.
     
  3. pdgames

    pdgames

    Joined:
    May 27, 2015
    Posts:
    43
  4. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Water worked on mobiles (but foam and depth not supported, because opengl es have problems with depth buffer)
    You can see the demo for androin in description.
     
  5. pdgames

    pdgames

    Joined:
    May 27, 2015
    Posts:
    43
    Oh k. Thanks kripto.
     
  6. Deepestblue

    Deepestblue

    Joined:
    May 11, 2009
    Posts:
    48
    Thanks so much for the quick answer, kripto, solved both my problems immediatelly. (Was so happy about the quick reaction that I just bought all three of your Realistic Effects Packs too, need them anyway for the project. :) )
     
  7. jason-fisher

    jason-fisher

    Joined:
    Mar 19, 2014
    Posts:
    133
    How about a way to define a new 'up' instead per mesh/instance? Then I could manage the spherical grid and instantiate each as needed?
     
  8. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    I do not quite understand what you mean.
    I tried using the sphere instead of plane. There is a problems with distortion in uv-unwrap.
     
  9. koberko

    koberko

    Joined:
    Nov 10, 2013
    Posts:
    18
    Hi.
    Is there any example of this used for large water plane, like sea or ocean? I need it for mobile ship simulator.
     
  10. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Hello,
    The current version does not support ocean mesh (via projected grid). You can increase the size of the current plane, and create multiple planes in a grid. (Including using lod).
     
  11. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings kripto289,

    I have been considering this asset but had a question first. We use procedural terrain and unity water4 to make water in our game. Of course with their water we have issues and are looking for a different solution. Specifically, I wonder about reflections. With Unity water4, reflections do not work correctly because we have multiple pools of water throughout the world, also on different levels (rivers, waterfalls, shallow ponds and small lakes), and the water doesn't change color with the light changing color (day/night cycle).

    With your asset, would reflections work correctly with multiple bodies of water in the scene on different levels? Even if reflections would not work it would still be in improvement over Unitys water4 which does not support changing light conditions, as your water changes with the changing light.
     
  12. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Hello,
    I use reflection as well as the standard Water4 water.
    I'll try to include ssr reflected in the next update (if I can understand how it works). Perhaps it will solve the problem.
     
    Tethys likes this.
  13. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Just tested the web demo and the tropical whatter really feels great.

    BUUUt, I miss a couple of things that ruing a bit and not so bit the experience.

    Soreside foam. Kmon! this is a must! otherwise the coastline feels really dull.

    And some more advanced stuff like flowmaps as other package do have, this two things would make this a must buy assets.
     
  14. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    This is foam.

    sdfsdf.png

    You can see all water settings in the readme. https://www.googledrive.com/host/0B...G5fbGdsQUJ6OV9vaTBxOWNpSEFWM0hqMGc/Readme.pdf

    I do not put readme in the description, because my english is not very good and readme is written in bad English:oops:.
     
    marked_one, SAOTA and Don-Gray like this.
  15. Xoduz

    Xoduz

    Joined:
    Apr 6, 2013
    Posts:
    135
    This is looking better and better, @kripto289 - only reason why I haven't bought it yet is because I primarily need water for rivers, which means I need a flowmap of some sort, to get water flowing along river boundary. Anyway, great job! But you should post about and advertise your 2.0 release! Had no idea it was out already :)
     
    EDarkness likes this.
  16. Don-Gray

    Don-Gray

    Joined:
    Mar 18, 2009
    Posts:
    2,278
    This water is looking better and better! :)
    Not seen foam like this before, meets the assumed appearance for shoreline foam in the picture.
     
    hopeful likes this.
  17. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    DarkBorder.jpg DarkBorder1.jpg Hello kripto289,

    First of all let me say that this is the BEST WATER SOLUTION!!! for Unity hands down!. What a great product you have made here! I am very happy with it. I already tested it in XBOX ONE, so if anyone need the best water for Unity Console this is it.

    Now to the point I need your help with. How can I remove the dark borders you see in the following pictures, left of the screen and bottom of the screen? This kind of looks weird. That is pretty much everything I had problem with.

    Regards,
    Carlos DarkBorder.jpg
     
  18. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Hello,
    Can i have water material? I want test it.
    Try to change "perVertexDistortion". For example "1000".
     
  19. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello kripto280,

    How can I send you the water material? I will try the perVertexDistortion to a high number to see if that fix it.

    Regards,
    Carlos
     
  20. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    kripto,

    Here is the water material with the settings I am using for the beach. Keep in mind that my game has underwater gameplay.

    Regards,
    Carlos
     

    Attached Files:

    • Sea.zip
      File size:
      1.5 KB
      Views:
      431
  21. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    I do not have this problem. Your material worked correctly.
    You have same bug with default water settings? Try change other parameters?
    Also, this bug on pc or xbox one? What a unity settings? (rendering path, directx)
     
  22. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Greetings kripto!

    Love the asset so far, great new changes in the update.

    I mentioned earlier that we have voxel terrain that is procedurally generated. I have many of the features of your water working well now but I have found two funny problems that you might be able to help me with. There is another level of voxel water generated along the ground below the water. This creates a water volume for our players to interact with

    So as you see in the screen shot (not everything is enabled) The water looks relatively fine:


    However, when I turn the camera and look at the same spot of water, from the opposite angle it looks like there are holes punched into the water surface:


    I get this all over where water is generated. Upon closer inspection I can see the water surface is indeed there just as it looks in the other angle and I can swim on it, so it is a visual bug.

    With Unity Water4Advanced water shader, this visual artifact/bug that looks like a hole in the surface does not happen - and so I took some more screen shots to illustrate the effect (it seems to be a render depth thing maybe, but not sure so I thought I would ask). Here is what looks like a hole on top of the water surface:


    But it is actually water volume directly below, and for some reason is showing through the top - here I have stayed in the same spot and simply gone underwater:


    I have noticed that anywhere there are ridges with the water volume being rendered below, at certain angles it seems to error out and show through the top water surface, making it looks like a hole in the water. :p



    The other issue I have run into is that the water shows through the billboard LOD trees in the distance. When I was using the default water4 shader this would not happen, which makes me think again that there is some strange depth render issue here. I tried this in both my bare bones terrain package and my current game project and ran into the issue on both (both use the voxel terrain engine for the world generation). Thanks in advance if you have any idea, and thanks also for the great asset so far. In my game I have all the features working, and at certain angles when I don't get the punch through the water looks AMAZING!
     
    Last edited: Sep 20, 2015
  23. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Greetings Tethys!
    You need open the shader "WaterPC.shader" and change line
    GrabPass {
    "_GrabTexture"
    Tags { "LightMode" = "Always" "IgnoreProjector"="True" }
    }

    to"GrabPass { }"

    Also, you can try to change line "Queue"="Transparent+1"
    to "Queue"="Transparent+2" or on ""Queue"="Transparent-1". Underwater shader should have other rendering queue.
     
  24. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Thanks kripto! I tried both suggestions but neither one fixed the hole in the water visual effect nor the water drawing in front of my tree billboards.
     
  25. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Can you do the test scene for me? Also, go to skype "scar289", if you want.
     
  26. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    Your included demo scenes work fine, this is just an issue with our particular setup. I just thought maybe I would probe you to see if you had any ideas why this drawing/sorting/depth issue is happening. I just added you on Skype, will catch up wiith you in a little bit, thanks again!
     
  27. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Hey, as an early buyer i was extremely surprised when i saw v2 and tried it and it really is something - give your thread a bump and a new title when you do a big update!

    Main interest was the new river example it was excellent, soneone mentioned a flowmap control and i might add to this a wish for a control texture to control wave size over an area, and im assuming we can use our own meshes for the water (can shape it properly and uv properly for control textures)? I have no idea how much you are willing to implement what i suggested but i think a few people on the forum might be crossing their fingers
     
  28. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Hello,
    In the next update I will try to add support for "flow map" and "waves map".
    Maybe I'll try to add the oceanic water (huge waves, ssr translucent, etc.).
    But it will not soon.
     
    radimoto, marked_one and Xoduz like this.
  29. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    I am also having an issue where if I have Global Fog for me environment, either turned on in the Lighting tab or using the image effect on my camera, when I drop this water asset in my scene it blows out the scene to have fog everywhere and all my leaves and some of my bushes are all blown out to be the color of the fog. If I turn the water off it fixes it, or if I remove the fog from the scene it fixes. I would like to be able to use this water with the Unity Global Fog... is this not possible?

    I also compared your shader code to the Unity water shader code, which does not have that bad visual/depth bug where it shows water below the surface as being on top of the surface, but have not been able to fix your shader to work like Unity's water shader in regards to ignore water below the water. I fixed your water shader pooping in front of other developers tree billboard shaders by removing +1 or -1 from Transparent and simply leaving it as "Transparent". If you have any other ideas about the render issue I am all ears - tried to add you on Skype but I am not seeing you still. Since this is for a live project on Steam I am putting your water on the shelf until we can fix it and will go back to using Unity's Water4Advanced for now.
     
  30. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    I do not quite understand what you mean. Can i have screenshot with fog problem?
    Standard fog "lighting tab-> fog" works properly with water. Perhaps some problems with the "underwater post-effect"? Try to deactivate "UnderwaterPosteffect.cs" in the water prefab.

    Standard "Global Fog" post-effect does not work with transparent objects. (which queue 2500+).
    Even the standard water not worked.
    You can try change queue of water like that:

    Code (CSharp):
    1.  
    2. _WaveScale ("Waves Scale", Float) = 1
    3. _TexturesScale ("Textures Scale", Float) = 1
    4. }
    5.  
    6. SubShader {
    7.  
    8. GrabPass { "_GrabTexture" }
    9. Tags {"Queue" = "Transparent-500" "IgnoreProjector" = "True" "RenderType" = "Transparent"}
    10. Cull Off
    11. ZWrite Off
    12.  
    13. Pass {
    14.  
    15. CGPROGRAM
    You can use "Tags {"Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent"}" it it work correclly.
    Transparent+1 i'm use for unified grabpass optimisation. So, you can remove "_GrabTexture" and use just "transparent". Like that:
    Code (CSharp):
    1.  
    2. GrabPass {  }
    3. Tags {"Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent"}
    4.  
    Also, try to send me message in the skype again. Skype have some problems with network.
     
  31. Hanssteffen

    Hanssteffen

    Joined:
    Oct 25, 2012
    Posts:
    2
    Hi,

    water Looks really great! i there any hope that water depth/transparent water and/or foam is supported for the latest generation of mobile devices (ipad air/Iphone 6/s6 etc.)?
     
  32. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Hello,
    Alas, i not have ios devices and can't test it.
     
  33. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    Using the latest version of Unity (5.2), when I import this I get the error in the first picture. I imported the package again, and now I get the errors in the second picture.
     

    Attached Files:

  34. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Hello,
    It's standart unity post-effect.
    About first error. You have "sunshaft.cs/js" copy in other folders? Use only one script.
    About second error. Just after import, apply unity's script auto-changes.
     
  35. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    Thanks for the reply. I did those things, and now I get this error.
     

    Attached Files:

  36. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Now you have remove some file associated with the sunshaft. This file is "SunShafts.js"?
    If you have problems with standart posteffect, you can change code in the script "UnderwaterPosEffect.cs"
    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class UnderwaterPostEffects : MonoBehaviour
    5. {
    6.  
    7.     public Color FogColor = new Color(87f/255f, 190f/255f, 219f/255f, 1);
    8.     public float FogDensity = 0.05f;
    9.  
    10.     private Camera cam;
    11.  
    12.     void OnEnable()
    13.     {
    14. cam = Camera.main;
    15.         var underwater = cam.gameObject.AddComponent<Underwater>();
    16.         underwater.UnderwaterLevel = transform.position.y;
    17.         underwater.FogColor = FogColor;
    18.         underwater.FogDensity = FogDensity;
    19.     }
    20. }
    21.  
     
    Last edited: Sep 25, 2015
  37. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    Thanks for the help so far Kripto. It is looking great, but I am still getting errors.
    1) I am getting the error in image Z3, no matter what camera object I link to, I have tried several.
    2) When I look at my scene window, the water is correct, but when I run the scene, then the water plane seems to move to another place.
     

    Attached Files:

    • z1.jpg
      z1.jpg
      File size:
      426.2 KB
      Views:
      931
    • z2.jpg
      z2.jpg
      File size:
      23.5 KB
      Views:
      766
    • z3.jpg
      z3.jpg
      File size:
      49.5 KB
      Views:
      925
    • z4.jpg
      z4.jpg
      File size:
      360.8 KB
      Views:
      938
  38. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    Ignore the second error, I have managed to fix that. Now it is only the error in image Z3 that I am struggling with.
     
  39. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Sorry, some bug :)
    I've fix the code above.
     
  40. helgarddebarros

    helgarddebarros

    Joined:
    May 10, 2014
    Posts:
    169
    Thanks, working great now. Looks fantastic!!! A really great product.
     
  41. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    a.jpg Hello Kripto,

    How can I avoid the water rendering above my tree planes?

    Regards
    Carlos
     
  42. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    b.jpg Kripto,

    I also found that the caustic doesn't cover the parts of the bottom underwater. How can I fix this? See picture, how the caustic is showing only on some square areas.

    Regards,
    Carlos
     
  43. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Hello,
    If i understand correctly, you want optimize scene? Add for "reflectionCamera.cs" "far distance" for camera and use this, for exclude tree planes.
    You use mobile caustic? Why caustic above the terrain on the screen?
    If you use pc caustic, then just increase projector parameters. In the water prefab "Prefab->water->ripplesCaustic", change settings "orthographics size" and "far cleap plane".
     
  44. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello Kripto,

    I use PC caustic since my game is for Xbox One. I don't understand what you are telling me to do when you say:
    "Add for "reflectionCamera.cs" "far distance" for camera and use this, for exclude tree planes". Could you explain me better how to avoid the water rendering on top of my trees?

    Regards,
    Carlos
     
  45. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    Do you want to remove the reflection of trees?
    If you want to remove any reflection, then simply delete the script "reflectionCamera.cs".
    If you want to ignore the reflection of trees then is not possible. Trees are in layer "Default". You can't ingore only trees.
     
  46. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    No Kripto, he is having the same issue I have because transparent on the shader should not be Transparent+1, it needs to just be transparent so other developers tree planes LOD's properly render in front of your water shader(seems to be a depth issue). At least, that is what I found to be the fix - if you remove +1 and change it to just say Transparent after Queue instead of Transparent+1 tree billboards will render in front of water when they are supposed to. Hope that helps!
     
    hopeful likes this.
  47. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    505
    My english not very good. I misunderstood. Thanks you :)
    ps It will be fixed in the next update.
     
  48. Tethys

    Tethys

    Joined:
    Jul 2, 2012
    Posts:
    672
    My pleasure, you have been so great with support I could only return the favor. :)
     
  49. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello kripto and Tethys,

    Thank you Tethys for the advice on removing the +1 on the shader. Unfortunately it didn't help. Now everything underwater, for example a wooden dock I have in the game, is totally visible as well as the end of the terrain plain that is underwater. Any other way to make the tree planes render before the water?

    Regards,
    Carlos
     
  50. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    296
    Hi guys - I just picked this asset up - but having an issue with flickering water when looking at it a certain way it seems.
    Can see from here:



    I have uSky and some other image effects on in the video but I've disabled them and tested and still have the same issue. Any idea what this might be?
     
    Tethys likes this.