Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Realistic Water

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

  1. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    I tried to make a shadow. Although that water is an opaque object (RenderType = "Opaque"), I can't add shadow.
    Alas, the correct water must be drawn with queue 3000+ (Queue = "Transparent"). And the shadows do not work when the queue more then 2500.
    I also tried to add an additional pass, but all did not affect on shadows and queue.
     
  2. vbs

    vbs

    Joined:
    Sep 8, 2014
    Posts:
    24
    I just purchased the script and it seems theres some Unity5 issues... when I dragged the prefab into my scene I only see some effect, no water...
     

    Attached Files:

  3. vbs

    vbs

    Joined:
    Sep 8, 2014
    Posts:
    24
    I'm also getting all these errors and warnings, I've attached a screenshot.
     

    Attached Files:

  4. vbs

    vbs

    Joined:
    Sep 8, 2014
    Posts:
    24


    Hi it seems like I have a similar issue, but I can't find any water plane FBX file...
     
  5. Dragon_AV

    Dragon_AV

    Joined:
    May 8, 2015
    Posts:
    5
    I had a similar issue. Check the mesh filter of the prefab, and if it says missing mesh you should look for a plane called kraut_plane and put that in the mesh filter
     
    Last edited: May 19, 2015
  6. scarpelius

    scarpelius

    Joined:
    Aug 19, 2007
    Posts:
    966
    I am trying to create a more still water, the kind you can see in a cave with no success. Is there a way to make the water less agitated?
     
  7. Dragon_AV

    Dragon_AV

    Joined:
    May 8, 2015
    Posts:
    5
    Are you considering Oculus Rift support?
     
  8. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    Try reimport package.
    Warnings "obsollette" I'll fix in the next version.
    You want to reduce the force of the waves? Reduce the setting of water waves (Wave amplitude).
    I have not oculus, but i have 3d monitor with tridef3D driver.
    You can see this screenshots.

    0001-ab.jpg

    0002-ab.jpg

    Only reflections not worked. I do not know how to fix it.
     
    florianalexandru05 likes this.
  9. vbs

    vbs

    Joined:
    Sep 8, 2014
    Posts:
    24
    OK thanks, that seems to have fixed it.

    There are other weird issues though, It seems that the underwater light waves are reflected on other meshes that are not related to the water, in the screenshot you can see them applies to huge meshes in the distance... why is that, and how can I prevent that? I think effects should be limited to a small area related to the water.
     

    Attached Files:

  10. vbs

    vbs

    Joined:
    Sep 8, 2014
    Posts:
    24
    I re-imported the script but I still get this error:

    NullReferenceException: Object reference not set to an instance of an object
    SetDepthCamera.Start () (at Assets/RealisticWater/Scripts/SetDepthCamera.cs:8)

    How can I fix this?
     
  11. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    Depth buffer as standard works for deffered rendering of unity4 and forward/deffered render of unity5, and there is no need to use it. You can remove this script.
     
  12. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    This water is nice for small ponds and maybe an ocean, I haven't tried it. But for a river, it doesn't work. It also doesn't scale well. I get this weird bubbly pattern on the surface that looks more like fast moving lava than water waves. :) The caustics are beautiful for a Caribbean pool of water, but probably isn't the best choice for most applications. I still haven't found my perfect water. :)

    I will use it though because it is nice if not scaled.
     
  13. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    To scale, in proportion to the need to increase / decrease the tiling of textures and wave scale.

    You can increase/decrease orthographic size of projector (water->caustic).
     
  14. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Yeah, didn't help with mine. :) That is okay though.
     
  15. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi,

    about 10 ms CPU is quite slow for just water, if it runs on the main thread. Does it run in a thread? This water asset is probably the best one for my purposes. How am i setup the water for my scene? Water+ has a feature for it, creates a water map easily. The worst way would be to make this by myself.
     
  16. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    I have very old pc of 2008 year (amd athlon x4 and ati 4870 512mb). My cpu and gpu is so slow. What about standart water4? How many ms you have? My water have similar perfomance. Water not have any scripts with thread. Only camera for reflections. (But camera can't have other thread).
    Also, i have ~70% Gfx.waitForPresent in the profiler. So, cpu is not loaded and wait gpu 70% of time. And real cpu loading is 3ms. For water need more powerful graphics card.

    What a water map? Flow map? In the current version is no flow map support. You can adjust only the direction of flow and flow speed. (Also, the wave amplitude, wave frequency and other settings).
     
  17. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Hi,

    I bought your asset, you use another approach to paint the foam at the beach. Water+ cut (bake) the mesh optimized for the terrain, so there is no underground water mesh. Is there any way in your water solution to enlarge the water mesh? You have a very little part of water in your demo scene, is it ingame capable? I need about 50x bigger water mesh. Is the non visible water mesh well optimized? Don't seems to be...

    I guess it will be to slow for my game...
     
  18. georgesdimitrov

    georgesdimitrov

    Joined:
    Feb 4, 2013
    Posts:
    50
    Hi,

    I just bought the asset to try it out. It seems good so far although I haven't yet tested fully the different options to see how much it works well with custom meshes. Just using the prefab however, I get these artifacts, essentially the whole water turns pure CYMK/white in certain camera angles, what may be causing this?

    Quick vid: https://www.dropbox.com/s/j6xe2wp46y8jk5i/ddUnity_waterProblem.m4v?dl=0

    I'm using Unity 5.0.1 with deferred rendering, linear color space, Direct3D 11.
     
  19. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    Hello,
    Huge space for the ocean with the optimization made either with or tessellation or with projected grid. I have not found a way to make the projected grid. A tessellation only dx11, alas.
    So you need to use multiple tiled meshes or 1 large mesh. Although it is not optimized.
    I note that the pixels do not get on the screen will not be drawn. It will therefore be drawn vertex shader unit. But pretty quickly.
    Also, if you increase the size of 50 times, it is necessary to increase the tiling textures and wave scale in the material properties of water.

    Hello,
    Hm.. Can you do the demo for me? (web or standalone). What your a pc configuration? Demo scene have problems?
     
  20. georgesdimitrov

    georgesdimitrov

    Joined:
    Feb 4, 2013
    Posts:
    50
    Hmmm, the demo works fine, and for some unkown reason, the water stopped doing that color thing after I moved the depth transparency property a couple of times. No idea why, really.

    Anyway, seems good for now!
     
  21. vbs

    vbs

    Joined:
    Sep 8, 2014
    Posts:
    24
    OK thanks,

    What do I do about the water reflection being all over the place, including on meshes that have nothing to do with the water/surface near the water? (see previously posted screenshots)

    -- UPDATE

    I figured out how to stop the projection on the meshes I don't want to have it be on, I made new layer and added the background meshes to that layer. I also found out the Caustic object in the water object hierarchy and there's an "Ignore Layers" setting there, I added the new layer that I wanted ignored to this list.
     
    Last edited: May 26, 2015
  22. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    What a render path of unity? Forward or deffered? Maybe it's problem with depth buffer or with camera's posteffects with hdr.
    Yes, caustic have ignore layers. You should set up the layers.
     
  23. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,221
    It looks very nice, does it also do contact foam?
    (feature requests keep piling up ;)
     
  24. Iguanapl

    Iguanapl

    Joined:
    Mar 11, 2014
    Posts:
    23
    Good job with the asset.
    I must ask the same question as above. Is there foam effect with contact with the terrain/object?

    Second question, silly one. Where I can get this ground sand texture you are using in your demo snapshots? What asset is that?
    Thanks in advance for reply
     
  25. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    Hello,
    1) Yes.
    2) http://www.cgtextures.com/
     
  26. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,221
    Nice,
    How do you do the foam? Shader trick or runtime mesh generation like the unity island demo?
    And depth coloring, how do you do this? Grab depth from camera? Add to shaders of immersed objects?
    I'm testing the waters for a game that does voxel landscape on iOS.
     
    Last edited: May 29, 2015
  27. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    On mobile depth buffer not working. So i can't do foam and water depth for mobile.
    Foam and depth worked only for pc. Foam it's just texture multiplied with depth buffer and wave mask. Water depth it's lerp (grabpass texture, depth texture, tranparency).
     
  28. Rinoa_Heartilly

    Rinoa_Heartilly

    Joined:
    Jun 26, 2014
    Posts:
    85
    Oh my gosh the water is so great and can play with the demo all day :D
    I have a tropical ocean in no time thanks to the sliders :D

    o.jpg

    i wanna jump right in and swim and dive and catch fishes I love the caustics cast on rocks
    just awesome!
     
  29. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,288
    Hi,

    Does the water cover for depth fading ? If the pool has a very deep part, will it still be visible ?

    Thanks
     
  30. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    Hello,
    You can change water depth transparency. See the demo.
     
  31. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,288
    I will check it out, thanks
     
  32. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @ kripto289,

    Really considering buying this. Just a few questions:-

    - the webdemo doesnt seem to allow for underwater/depths caustics and darker colours (per posts above too)? Does it? Can it?

    - could I deploy this to cover off larger water scenes like deep ocean? or directed flow water like rivers and streams?

    - does it do waves breaking, tidal, foam etc?
     
  33. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Duffer, it is a great water for small bodies of water and possibly for oceans, but I found it didn't work well for rivers, not uncommon since most solutions do not. You could create a flow map yourself and use any water technique. I actually made a mesh for my river but this particular water did not scale well, especially when the scale was not uniform, which can happen with a river. I could have increased the subdivides on the mesh but wanted to keep it rather low poly.

    So, it might work depending on how you do it but it really shines as shallow water lakes and ponds. As a tropical pool, it would be amazing. I am sticking it on the back burner to use it later in my game.
     
    Last edited: May 31, 2015
  34. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @ Teila - very helpful - thank you.
     
  35. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,221
    Gotcha, didn't know depth buffer was broken on mobile, 5.1 might solve that with the unified GL
     
  36. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    @kripto289 ,

    Couple of questions before I buy:-

    - Can you do caustics - with different light and murk at various depths underwater. ?

    - If you look up from underwater do you get the surface rippling?

    - Can you recolour and change wave size and frequency to the extent you can make water look like Sea or Oceanic?

    - Finally, can you create river effects ie. flow all in one direction?
     
  37. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    Hello,

    -The caustic have depth transparent and solid color (no diferent light).
    -Yes
    -Water for the ocean is quite complicated, and l did not get to do something like that.
    However, color, amplitude, wave frequency and other you can change the same as in the standard water.
    -In demo scene you can see flow, but it is not very fast. You can configure it.
     
  38. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    Thanks Kripto289
     
  39. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    I'm looking for a water solution that is not so taxing, yet looks great for many different bodies of water (puddles, oceans, rivers, sewer water, etc.). I have purchased a few things and nothing really fits my needs. Either they're too intensive and use up a lot of graphic resources, or they just don't look good at all in my game. Before I purchase this one, I'd like to know what kinds of things is it good for and are there any other examples besides the demo?
     
  40. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    My water performance as a standard Water4 perfomance. In the current version to create an endless ocean is not possible (because of this it is necessary to use not mesh, need to use projection grid). In the next version, I will try to add support for the projection grid.
    But if you want to use the water for rivers, lakes, pools and other things, then it is fine. Water with distortions and reflections (but without depth and foam) works even on mali400 mp1 (about 20-25fps). So for mobile and pc version water fast enough.
    Alas, is only one demo. You can wait a few weeks, I will try to add a new demo and ocean support.
     
  41. Duffer123

    Duffer123

    Joined:
    May 24, 2015
    Posts:
    1,215
    A few more demos and a video on how easy it is to implement would definitely go down well... ;)
     
  42. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Thanks for responding. I'll wait to see how things are shaping up in the next few weeks. I appreciate the fast response.
     
  43. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    Harder to find water in Unity asset store, as in the desert... Especially if it comes to linear color space, which going to be a must to have in unity. Unity water itself is a joke in my opinion, not able to configure transparency, no foam, nothing. I don't know why Unity makes half finished assets... At the middle of the game development non of the Unity assets can be used in my game.
     
  44. marked_one

    marked_one

    Joined:
    Jun 21, 2015
    Posts:
    16
    @kripto289
    Поигрался с водой. Для моих нужд размер пришлось увеличить в 100 раз. В принципе, сама вода выглядит и работает весьма неплохо. Но каустику для такого скейла я так и не смог настроить. Плюс, получил проблему, когда пена рисуется вокруг всего объекта, а не только там, где он пересекает воду. Видимо, еще какой-то параметр нужно уменьшить в 100 раз. Поэтому, хотелось бы, чтобы все настройки работали относительно Transform.scale, и при его изменении внешний вид воды менялся автомагически. Еще было бы неплохо включить в ассет подготовленный круглый меш и скрипт для плавания предметов на поверхности воды. Также заинтересован в возможности создания бесконечного океана.

    In English:
    Played a bit with the water. Scaled it up 100 times for my needs. Looks good enough, but I failed to adjust caustics to the new scale. Additionally, got the problem, when foam is drawn around the whole object instead only where it crosses the water. Probably I need to reduce some more parameters hundred times. Thus, it would be nice to have all the settings relative to Transform.scale and so the water changes automagically when the scale changes. It would also be nice to have prepared round mesh included in the asset besides the square one, and also a buyoancy script. Am waiting for the possibility to create endless ocean too.
     
  45. marked_one

    marked_one

    Joined:
    Jun 21, 2015
    Posts:
    16
    Я хотел попробовать просто увеличивать скейл и менять цвет по мере удаления от берега. Но, да, скорее всего это будет смотреться не слишком хорошо, согласен. Я так же думаю и о других решениях, Suimono и NeoOcean, но вроде как ни одно из них тоже полностью не реализует нужного мне. Моя проблема в том, что мне интересен эффект как в Assassin's Creed III - IV, когда вода у берега почти ровная, а чем дальше - тем сильнее волны. Вот пара скриншотов:
    https://www.dropbox.com/s/wqli8rbd3fy8pqt/2015-06-22_00001.jpg?dl=0
    https://www.dropbox.com/s/8j2qnnicor5a8xx/2015-06-22_00002.jpg?dl=0
    У берега вода как раз очень похожа на Вашу (по крайней мере, больше, чем на все другие в сторе). А дальше она достаточно плавно переходит в океан. Я так же нашел статью про воду в третьем Assassins Creed: http://www.fxguide.com/featured/assassins-creed-iii-the-tech-behind-or-beneath-the-action/ , там написано про смену цвета и прозрачности по мере удаления от берега, но нет про то, как реализован именно переход в геометрии. Возможно, у них есть карта высот для волн, которая передается в шейдер и влияет на высоту волн в различных зонах? Возможно ли такое сделать?
     
  46. marked_one

    marked_one

    Joined:
    Jun 21, 2015
    Posts:
    16
    На самом деле, конкретно сейчас мне и нужен большой пляж, так как делаю бухту на тропическом острове. Другое дело, что потом из бухты нужно будет выплывать. Но основной геймплей все же на берегу, так что вода у берега пока важнее.

    Насчет глубины есть в статье про Assassin's Creed, и там они накрутили довольно сложную систему с целью оптимизации и улучшения внешнего вида.

    А подождать я готов и пару месяцев, главное, чтобы результат был хорош. Океанская вода мне, естественно, тоже интересна. Особенно если она при приближении к берегу будет плавно переходить в красивый пляж :)
     
  47. EDarkness

    EDarkness

    Joined:
    Feb 1, 2013
    Posts:
    506
    Because Unity knows you can just find a solution on the Unity Store. Unfortunately, I find that many of the solutions just don't fit various needs and there's no way to know for sure if it'll work for you until you buy it and try it. By then, it's too late. I just wish Unity had a good water solution out of the box that looked great and had good performance.
     
  48. mkgame

    mkgame

    Joined:
    Feb 24, 2014
    Posts:
    592
    @EDarkness
    You can have a refund (always with a reason) for assets where you cannot know how they work before you buy them. That means, for all assets, which are based on source code. For art assets like music, sounds, meshes which are well shown before, you must have very good reasons to get a refund from Unity.

    In this case i will not do that, because the water looks good and i have hope for improvements.

    @kripto289
    By the way, the russian language (not because russian, because you sell this asset world wide) lower your thread and so your asset. I would recommend you to hold it in english and remove or translate the russian posts, because you disclose all the other countries and that it abusive.
     
  49. Deepestblue

    Deepestblue

    Joined:
    May 11, 2009
    Posts:
    48
    Hi,

    first I imported your asset into my project (Alloy Deferred Shader) and it will only show caustics, no water/colors/distortions at all. I tried all 4 waters (I use the latest Unity 5). Does it not work with the Alloy renderer?

    Then I imported your asset into a brand new, empty project and get the below - there's a line above which the water will not render, it turns with the camera.

    Any ideas?

    Thanks!



    pic.jpg
     
  50. kripto289

    kripto289

    Joined:
    Feb 21, 2013
    Posts:
    501
    Hello,
    Rather, in 1 case you have lost the reference to mesh "oceanplane.fbx".
    In case 2, I found the bug with the forward mode. Switch to deffered, or write me an email, I will send you a rewrited shader. (In the next update it will be fixed).