Search Unity

Mobile Ocean Water

Discussion in 'Assets and Asset Store' started by KuangZheng, Oct 9, 2013.

  1. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    $ocean1.21.jpg
    $ocean1.jpg
    ------------------------------------------------------------------
    Version:
    1.2.1
    - Shore line foam effect optimized
    - Make shore line intensity editable
    - Make reflection intensity editable
    - Make wave move speed editable
    1.2
    - Added Shore line effect
    1.1
    - Added mirror reflection for Unity Pro
    ------------------------------------------------------------------


    Mobile Ocean Water is a water example for mobile devices,requires Unity 3.5.5 or higher, and runs on iPhone 4s or better devices. It contains a material, a mesh and a prefab that can be directly used in the scene.

    *Shore line effect

    *Mirror reflection (for Unity Pro)

    *Good performance in mobile

    *Colored by directional light

    contact me: kuangtoby8105@gmail.com

    Notice:To reflect skybox you need use 6 textures cubemap skybox.


    Web Player Demo


    Android Apk Download



    Go To Asset Store
     

    Attached Files:

    Last edited: Jan 11, 2014
  2. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    apk with fps counter demo?
     
  3. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    OK,I will provide it as soon as possible.
     
  4. norby

    norby

    Joined:
    Jul 10, 2006
    Posts:
    277
    looks nice

    Norby
     
  5. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Thanks!
     
  6. arkon

    arkon

    Joined:
    Jun 27, 2011
    Posts:
    1,122
    Is it just a shader or does it deform the mesh too?
     
  7. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Just a shader. The mesh is made of 2 triangles.
     
  8. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
  9. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    man there is no way to download that apk, it sends you through sites in Chinese and when we download the apk we get some kind of spam application
     
  10. Mementos

    Mementos

    Joined:
    Sep 25, 2012
    Posts:
    79
    His link worked fine for me. Tho il understand that its may dfficult witohout understanding some chinese, so i reuppd it on xup. Hope mirroring is ok, if not, just tell me ;)

    http://www.xup.in/dl,14092054/oceanApk.apk/
     
    Last edited: Oct 14, 2013
  11. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
  12. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Thank you very much! The mirroring is unavailable for the moment. I'm still working on it .
     
  13. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Hi,Mirror reflection is available now :D
     
  14. jelenmaciej

    jelenmaciej

    Joined:
    Sep 10, 2013
    Posts:
    30

    optimize by dystanse from camera men.
    cost 20 fps on nexus7.
    Looks great thow. I think best ocean, i have seen for now.
     
  15. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Thank you! You are right. If your scene is not too big,you can reduce the farClipPlane of the camera to optimal performance.
     
  16. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
  17. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    can you place it on near land? so we can see the cut and if you have shore lines
     
  18. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    No problem! Please try again. Press w,s,a,d to move camere and upArrow,leftArrow,downArrow,rightArrow to rotate camera. :D
     
  19. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Oh, I read your words wrong. I thought you want to near water. It don't have shore lines now.
     
  20. Uzumaki Naruto

    Uzumaki Naruto

    Joined:
    Nov 13, 2013
    Posts:
    1
    Excellent program, the effect is pretty good. I hope you can add a shore line effect in the future. :D
     
  21. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Thank you! The shore line effect is in progress.
     
  22. yezzer

    yezzer

    Joined:
    Oct 30, 2009
    Posts:
    143

    I just bought this, runs well on target hardware. Looking forward to the shoreline effect!
     
  23. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Thank you for bought it! I'll tell you when I finish it.
     
  24. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    The shore line effect is available in new version. :D
    $111.jpg
     
  25. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    do you have it on a webplayer so see it closer?
     
  26. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
  27. feracon

    feracon

    Joined:
    Mar 4, 2013
    Posts:
    84
    Hello,

    I bought this shader to use for water in a stream, but I cannot tile high enough to get the texture small enough.

    Also how do I slow it down?
     
  28. feracon

    feracon

    Joined:
    Mar 4, 2013
    Posts:
    84
    _Tiling ("Tiling", Range(0.00025, 0.1)) = 0.25

    Edited the max range to a larger number, looks beautiful. No need to slow it down. THanks for a great shader :).
     
  29. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Thank you feracon! You got a good idea. :D
     
  30. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Thank your support, feracon! :D
     
  31. matt-crz

    matt-crz

    Joined:
    Oct 2, 2013
    Posts:
    2
    Hi,

    I just bought this off the asset store. I would like to make the ocean look a little more unrealistic, like in the attached image, is there a way to re-create the textures being used (wave1,wave2)?

    Best Regards,
    Matt
     

    Attached Files:

  32. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Hi,matt-crz:

    This package cannot re-create the textures. But you can make normal mapping by modeling tool,then replace wave1 and wave2 to your own textures.
     
  33. matt-crz

    matt-crz

    Joined:
    Oct 2, 2013
    Posts:
    2
    Thanks for the reply, it looks like the textures need to be made in a certain way to get a decent looking effect. What I was hoping for was a little insight on how to use the modeling tool to create the normal mapping in a way that is nicely compatible with this shader.
     
  34. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Sorry,I can't tell you too much about how to create a normal mapping,because I'm not good at it too. But I know there are some tools like NDo2 that can generate a normal mapping from a ordinary picture. You can have a try.
     
  35. ASMach

    ASMach

    Joined:
    Nov 26, 2011
    Posts:
    43
    Amazing package! It means we can finally have reflective water in our mobile games without having tons of excessive polygons everywhere, which is a major leap forward.

    Unfortunately, when I try to use Unity 4.3's occlusion culling system to try to further reduce my polygon counts (mobile games need to maintain less than 100,000 polys/frame on current hardware), reflections of certain objects (such as sections of my terrain) cut in and out depending on the camera's position. Moreover, some dynamic game objects no longer get reflected in the water if I use occlusion culling. Does anyone have any occlusion culling tips for this plug-in?

    MachCUBED
     
  36. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Hi MachCUBED,
    I‘ve never tried Unity 4.3's occlusion culling system before. I will focus on your problem and see if I can solve it. And it will take some times.

     
  37. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    420
    Hi,

    Is there any way to add transparency to this water effect? I know it will impact performance but I would like to be able to see items under the water with varying levels of opacity.

    -JJ
     
  38. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Yes,just add several lines of code to the ocean shader.

    1. Add "Blend SrcAlpha OneMinusSrcAlpha" before all "Pass{"
    2. Replace "Queue"="Geometry" to "Queue"="Transparent"
    3. Add "col.a = ?" before "return col;", the ? is the alpha value you want,from 0 to 1,0 is transparent,1 is opacity.

    Hope it helps you out ;D
     
  39. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    420
    That's great, thank you!

    Few more questions:
    1) Is it possible to make underwater objects near the surface to be more visible, while deeper objects are less visible (less transparency at greater depths)?
    2) Underwater particles using Mobile/Particle or regular Particle shaders don't show up through the water (ie: bubbles), is there a way to adjust the water to allow particles to be seen through it?
    3) When I add the water to my scene I notice that there are 9 tiles that have the water shader on them as children of the parent water object. What is the best way to scale the water to cover a large area? Should I duplicate the tiles over and over to cover the entire area or can I use just 1 tile and stretch it to fill the map?
     
    Last edited: Apr 18, 2014
  40. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Hi,
    1)Sorry,"deeper objects are less visible" is not available .
    2)To solve your bubbles problems, you need add code "ZWrite Off" after "Lighting On".
    3)Do you need shore line foam effect? If you need it,you should duplicate tiles. The density of vertices will effect shore line foam,so you'd better DO NOT stretch it too large.
    But if you don't need shore line foam, you can use the "Ocean_LowQuality" prefab. It has the same effect except shore line foam and with only one tile,so you can stretch it.
    Notice, "Ocean_HighQuality" and "Ocean_LowQuality" has two different shaders. Edit the one you are using.
     
  41. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    420
    Ah ok, thank you. In my game the map is very large (because the scale of objects is large) so in order to cover the entire area I will need to have hundreds of tiles (yes I would like to have the shoreline effect) the width of my map is around 15000 unity units (meters). Is there any way to rapidly duplicate the tiles or alter the shoreline code so that larger tiles could be used?
     
  42. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    The ocean prefab is about 1500 unity units width,duplicating several times is enough. You can select all "Water" gameObjects and duplicate them,so the width became 3000, then select all them and duplicate again, the width became 6000. Repeat it. Just duplicate the "Water" gameObjects but not "Ocean_HighQuality" gameObjects.

    This is indeed a bit inconvenient,so I will try to add a new function at the next version that you can set the width before generating ocean.
     
  43. Deleted User

    Deleted User

    Guest

    Hi. We just bought the package a few days ago, and everything works fine for the most part, but we encountered a slight problem on Android. We made a build with low quality water with reflections and installed it to a few different devices, including Nexus, Galaxy S3 and S4 and two Galaxy Tabs. It worked fine on all of the devices except for S3, where we got some strange artifacts (the water got pixelated and distorted). Then we made a build with high-quality water, and it worked fine on S3, but we got less FPS than we wanted to. How do we fix this?
    $Screenshot_2014-04-22-11-27-55.png
     
  44. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    Hi. I don't have a S3,so I can't debug it on device. These maybe the problems:
    1.The normal map's max size or format is been changed.
    2.Something wrong in your QualitySettings,I'm not sure.Did you set the Texture Quality to Full Res?

    The different between high-quality shader and low-quality one is only the shore line effect,less than 10 lines codes.Can you show me the screenshot of hight-quality water on S3? I really have no idea what's the problem of S3,but I guess maybe the S3 makes the normal map compressed or something else.
     
  45. Deleted User

    Deleted User

    Guest

    The thing is, we don't change any quality settings specifically for S3. We installed the same build on all of the devices. I also tried changing the quality settings afterwards, but it didn't have any effect. The normal maps are uncompressed with mip maps off.

    This is screenshot of hight-quality water.
    $Screenshot_2014-04-22-15-56-17.png

    It works fine, but we got les FPS than we need.
     
  46. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    I see.

    And I find sth. here :
    http://forum.unity3d.com/threads/152966-Shaders-falling-back-on-Galaxy-S-3

    How about replace all "half" to "float" in shader ?
     
  47. Deleted User

    Deleted User

    Guest

    How about replace all "half" to "float" in shader ?[/QUOTE]

    We tried this option, but it does not help.
     
  48. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    We tried this option, but it does not help.[/QUOTE]

    How about reduce the wave scale,maybe it will look better?
     
  49. Deleted User

    Deleted User

    Guest

    We tried to change the wave scale, but it does not help. Artifacts on the water are still visible.
     
  50. KuangZheng

    KuangZheng

    Joined:
    Feb 25, 2013
    Posts:
    75
    There's one last chance.
    To delete codes of shore line effect in high quality shader :
    Code (csharp):
    1.  
    2. half4 shoreLineCol = tex2D(_ShoreLineTex, IN.uv+(worldNormal.xz)*0.05+float2(IN.tilingAndOffset.z,0));
    3. col.rgb += _ShoreLineIntensity*(1-IN.color.r)*shoreLineCol.rgb;
    4.  
    Then use high quality ocean, it will get higher FPS.