Search Unity

Physics Water 2D Tool - GPU based ripple water, realistic buoyancy, water flow & animation

Discussion in 'Tools In Progress' started by Nicrom, Feb 23, 2015.

  1. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi. Is this the effect you are looking for?

     
  2. Almakos

    Almakos

    Joined:
    Dec 13, 2013
    Posts:
    179
    Hey Nicrom,
    I am having some difficulties with physics based buoyancy.
    With linear buoyancy seems working OK, but as soon as I switch to physics based my object just goes through water with no buoyancy effect at all. ripple on water appear though.
    I've tried to tweak parameters but they seem to have no effect in physics based mode for me.
    Any hints?
    Thank you

    edit: using latest version from the store 1.4
     
  3. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi. Can you make a screen shot of your scene with the floating objects and the water, as well as the inspector of the water object. You can send them to my email johnq002@gmail.com
     
  4. Almakos

    Almakos

    Joined:
    Dec 13, 2013
    Posts:
    179
    Sure, just sent you an email. Along with my invoice and one more question.
    Thank you
     
  5. sergioschiavo

    sergioschiavo

    Joined:
    Feb 11, 2014
    Posts:
    28
    That is awesome! yes that is what I'm looking for :)

    When will it be available? :)
     
  6. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Its almost finished. At the moment I am working on making the generated garbage by the water object as small as possible. For the most part I managed to reduce it to 0 Bytes. The scrip I am using for real time water reflection is based on the Unity water4 Planar reflection script and it generates around 0.6KB of garbage per frame. I hope to reduce it to 0.
     
    overthere and sergioschiavo like this.
  7. zero_equals_zero

    zero_equals_zero

    Joined:
    Jun 7, 2014
    Posts:
    89
    This water system has evolved so well! Absolutely am in awe!
     
    Nicrom likes this.
  8. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Progress Update
    Hi. It’s been some time since the last Progress Update. Once again I realised just how bad I am with meeting my own deadlines. Over the past month I lost count of how many times I thought everything works the way it should only to find something broken or an unknown bug in the code, a little later. I guess I should have expected this considering that this update has introduced some major new features and changes to the code.

    Before I go into details about all the new features and how they work, I would like to say my thanks to Samuel Johansson from www.phaaxgames.com, for sending me his improvements of some of the Water 2D Tool code. It really helped me find and remove many of the shortcomings of the previous versions. Also, I would like say my thanks to petersvp for his advice's.

    This is going to be a really long post :). If you don’t like long explanations skip to the end, where you will find a summary of all the new features and changes.

    • New Ripple Water that runs on the GPU – The ripple simulation runs in a shader and is based on the Hugo Elias Algorithm where 2 height maps are used to store the current and previous state of the water. In this case render textures are used. There is a little CPU work involved, but most of it is done by the GPU. You can find more info about this topic in this article. The new GPU water comes with many features:
    1. Dynamic Water Size with no Ripple Stretching – You are not limited to a fixed water size. For example you could make the water width (X axis) 100 and water length (Z axis) 10 or any other size you need and get the same round ripples. The resolution of the render textures are calculated based on the current width and length of the water as well a variable that you can customise and which tells Water 2D Tool how many render texture pixels should fit in one unit of Unity space.
    2. Multiple Ways to Interact with the Water – You can interact with the water using dynamic objects. This can be a physics based character that you control or you can just drop a dynamic object in the water and it will generate ripples. Another method of interaction is to use a Ripple Sources. There are 2 ways to use a ripple source: you can place it in the water objects Inspector, in a list, or you can attach the Ripple Source script to a kinematic object. There are 3 options that control when a ripple is generated by a ripple source: when an objects moves, at random intervals of time or fixed intervals of time. You can also interact with the water with the mouse arrow, but only if the water object uses a 3D collider.
    3. Ambient Waves - The simulation of wind like waves. You can make the waves uniform along the Z axis or make them fade.
    4. Dynamic Obstructions – Objects that have a Box Collider or a Sphere Collider and are on the dynamic objects layer mask, will prevent the ripples from passing through them. This objects can be moved in the water and the obstruction region will move with them. Currently there are some restrictions to this feature. You can use only 5 objects with Sphere colliders and 5 with Box colliders. If there are more than 5 of each type, they will be ignored. Another restriction is that the objects with box colliders should be rotated only around the Y axis and only by 0, 90, 180, 270 or 360 degrees. This is because the bounding box of the collider is used to calculate the obstruction region.
    5. Texture Obstructions – You can use a texture where white means the ripples can move freely while black means that they can’t pass through that region and will be reflected back.
    6. Texture Obstruction Creator – This is a tool that will allow you to create texture obstructions from complex polygons right inside Unity. To create a new obstruction texture all you have to do is create an obstruction shape and arrange its points to form the polygon you need, open the Texture Creator Window and place the water object for which you want to create an obstruction texture as well as the polygon shape in the appropriate fields. After that you just press Create Obstruction Texture button and the texture will be created for you.
    7. Rain Simulation – Self-explanatory.
    8. Height Animation - Because of the way the ripple simulation works it is possible to animate only the top edge of the water. The right and left edge animation is disabled because to animate them would require the destruction of the height map and the reconstruction of the water mesh every time the water size changes. If the water mesh has 10000 or more vertices, recreating it on every frame will result in some major performance drops.
    9. The Ripple Simulation Doesn’t Depend on the Number of Vertices the Mesh has – Because the ripple simulation in performed in a render texture, a low or high quality mesh will not make the ripples move faster or slower, or reduce the quality of the normal map.
    10. Large Water Areas – You can create water objects with a width and length of several meters or several hundred of meters.
    11. 3 Ripple Shaders – There will 3 shaders that support the new ripple water. 2 advanced, one surface shader the other is an unlit vertex shader. The advanced shaders have the following features: realtime reflection, water depth, edge blend, specular light, water surface distortion, foam, per pixel and per vertex normal. The third shader uses just a cube map reflection with no other features.
    • Performance ImprovementsThe GetCommponent() calls have been reduced to a minimum, new arrays are no longer created, but are reused where possible, lists are now used in places where arrays are impossible to reuse. As a result of all of those changes with exception of 2 unavoidable cases the garbage generated by Water 2D Tool is now 0. The first case when a small amount of garbage is still generated is when an object that has a Polygon Collider 2D floats in the water. The second case when garbage is generated is when Polygon Clipping option is set to Complex in the Buoyancy options group. I’ll look into it and see if I can find a way to make this 2 cases generate 0 garbage too.
    • Prefabs and Duplicates – Now you can create prefabs from water objects you have in your scene as well as duplicate those water objects.
    • Collider Layer Mask – You can now tell Water 2D Tool to ignore objects that are on certain layers by disabling those layers in the new Collider Mask field.
    • Partial Support For Ray Cast Based Character Controllers – Players that use ray cast based character controllers now can interact with the water surface and generate ripples. To enable this option, in the water objects inspector set Character Controller field to Ray Cast Based. This option works with the new GPU water as well as the old water that uses spring simulations. One thing to note, even if the player that uses a ray cast based character controller can generate ripples, the Water 2D Tool physics based and linear buoyancy will work only with physics based character controllers. If you are using Corgi character controller, than you can use their player buoyancy to make the player swim while the dynamic objects can use the Water 2D Tool buoyancy.
    • On Exit Player Ripple, Particle System and Sound Effect – You can now specify whether you want Water 2D Tool to generate a ripple, instantiate a Particle system and play a sound effect when the player exits the water. This applies to the new GPU water as well as the old water that uses spring simulations.
    • Manually Generate Ripples – If you need a ripple to be generated some ware on the surface of the water you can now call the method GenerateRippleAtPosition(). This method expects you to provide a world position of where the center of the ripple should be, initial ripple width, velocity that should be applied to the water line vertices, and whether you want a particle system to be instantiated and a sound effect played. This method if found in the Water2D_Simulation script so you will need to get a reference to this script to be able to call it.
    • Collider Detection – When a dynamic object is near the surface of the water a ray cast if performed for every vertex that is inside the bounding box of that collider. This is done to find if a particular vertex is inside that collider and not only his bounding box. If the vertex is inside the collider, his velocity is changed based on the velocity of the dynamic object. This is not a problem on PC, but on mobile devices performing ray casts every frame, even for a limited number of vertices may not be the best idea. So now you can disable the ray cast by setting Collider Detection in the miscellaneous group to Bounds Based.
    • Player Settings Have Their Own Group – All the player settings in the Water2D_Simulation have been moved to their own options group.
    • Mesh Info - The current number of vertices, Mesh grid size as well as the resolution of the render texture are now displayed in the water object inspector.
    • Meshes and Naming – When you enable 2.5D water mode, the top mesh is now placed on a separate game object instead of being a sub mesh. This will make it possible to set the layer and order in layer of the front and top mesh individually. The top mesh game object is placed as a child of the front mesh game object in the hierarchy Window. The materials that come with Water 2D Tool and must be used only on the top or front mesh now have _TM and _FM at the end of their name.
    Now for the things that will be removed:
    • Per Vertex Particle System Instantiation – I’m not sure why I have even added this option in the beginning since it’s not very performance friendly.
    • Control Point Waves – This option basically allowed you to offset the position of the top left or top right vertex. The idea was that you would change the position of one of those vertices, than the neighbouring vertices would fallow because of the spring simulation and you would end up with ripples. The problem was that you had to use the animator to offset the top left or top right vertex and the ripples you got were not the best looking.


    Features Summery.
    • New Ripple Water that runs on the GPU with the following features:
    1. Dynamic Water Size with no Ripple Stretching.
    2. Multiple Ways to Interact with the Water.
    3. Ambient Waves.
    4. Dynamic Obstructions.
    5. Texture Obstructions.
    6. Texture Obstruction Creator.
    7. Rain Simulation.
    8. Height Animation.
    9. Large Water Areas.
    • Performance Improvements
    • Support for Prefabs.
    • Collider Layer Mask.
    • Partial Support for Ray Cast Based Character Controllers.
    • On Exit Player Ripple, Particle System and Sound Effect.
    • Manually Generate Ripples by calling GenerateRippleAtPosition().
    • Added Support for Capsule Collider 2D.
    I updated the WebGL and PC demo scenes. I recommend you to download the PC demo scenes as the performance on the WebGL is not very good. Right now I am working on new promotional videos and updating the Water 2D Tool guide. If you want to try the new update before its posted on the Asset Store, send your invoice number on my email johnq002@gmail.com and I'll send the latest update to you.
     
    Last edited: Dec 30, 2017
    Zehru, Almakos and overthere like this.
  9. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Progress Update

    Hi. Made a promotional video for the new GPU Water.

     
    Zehru and overthere like this.
  10. Almakos

    Almakos

    Joined:
    Dec 13, 2013
    Posts:
    179
    This looks really nice!
    Thank you for supporting this asset and making it better with each release.
     
    Nicrom likes this.
  11. BACALL

    BACALL

    Joined:
    Feb 21, 2017
    Posts:
    87
    Thank you so much for these huge updates!!!
     
    Nicrom likes this.
  12. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Water 2D Tool v1.5 is now published on the Asset Store.
     
    Zehru, Lars-Steenhoff and overthere like this.
  13. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526
    Thanks for the update!
     
    Nicrom likes this.
  14. AlcyonGames

    AlcyonGames

    Joined:
    Sep 16, 2016
    Posts:
    39
    Hi!, this update is just mindblowing. I didn't think this asset would get updated again and with so amazing feature. We have to update our project to 5.6 in order to use it so first I have some questions.
    - I'm making a 2d game with sprites. Is it necessary to write the sprites to the Z Buffer in order to use the 2.5D water?, because with sorting layers the horizontal water will not display correctly.
    - Does it have the old features like random splashes on water? or just the sine waves?
    - Is it possible to pass a normal map to the horizontal/vertical water (as with the previous version) in order to have a more dramatic distortion?, because from what I see this new water with (the amazing) new GPU shader looks too calm and is only distorted by physics objects.
    - Is it possible to change the amount of distortion on the water? When you click the water or use physics objects the distortion is not so notorious. could be more dramatic.
    Thanks!
    We will be updating our project and obviously a lot of these questions will be automatically answered. Thanks btw for the amazing update! ;)
     
    Nicrom likes this.
  15. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi. I'm glad you like it :).

    - Starting with v1.5 the top and front mesh are on separate objects and their sorting layers can be set individually. This fixes the sorting order problem that was present in the previous versions. You can use sprites that do not write to the Z buffer, but there are some limitations. Look at this demo video I made some time ago.

    As you can see there is no edge blend where the water intersects the Ferr2D terrain. In this video the terrain in on a layer that is above the top mesh and bellow the front mesh. For example if you have, Layer 1, Layer 2 and Layer 3, the top mesh would be on Layer 1, the sprite on Layer 2, the front mesh on Layer 3. Another problem is that if the sprite is on a layer above the top mesh, the sprite segment that is bellow the water is not visible because the sprite is rendered after the top mesh is rendered. In the video above I fixed this problem by creating a duplicate of the terrain and placing it on a sorting layer that is bellow the top mesh, Layer 0.
    -The old surface waves are not compatible with the new GPU water, but there are new options, like rain simulation and ambient waves. Look at the WeGL or PC demo.
    - Yes, you can. The distortion level can be increased in the shader settings.
    - You can control the ripples height by changing the value of a field called Strength.
     
  16. AlcyonGames

    AlcyonGames

    Joined:
    Sep 16, 2016
    Posts:
    39
    Amazing, thanks for the fast answer!!
    One last thing. I can write the sprites to the Z Buffer with a custom shader. If I do that, then I think I'm not going to have problems with the sorting layers. Anyways, is a nice solution what you just mentioned if I can't write in the end to the Z Buffer. THANKS!
     
  17. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    If your shader writes only the opaque pixels to the Z buffer and ignores the transparent you should not have problems. Another solution to the sorting layer and edge blend problem would be to use a Cutout shader.
     
    AlcyonGames likes this.
  18. AlcyonGames

    AlcyonGames

    Joined:
    Sep 16, 2016
    Posts:
    39
    Amazing!, yes. It only writes the opaques pixels. I'll look into using a cutout too to try!
    Thank you ;)
     
    Nicrom likes this.
  19. Shiggam

    Shiggam

    Joined:
    Jan 29, 2018
    Posts:
    4
    Hello again, i ended updating unity to the 5.6.5f1 version to use the new things from the asset, but after updating the asset an old problem appeared, im getting again the error "Missing Reference Exception" from when an object is destroyed inside the water, the method "RemoveCollider2DFromList" is already added and called, so im a bit confused here, before that all was working fine.
     
  20. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi. You no longer need to call the method RemoveCollider2DFromList. Water 2D Tool will remove null references for you. Make sure you have Water 2D Tool version 1.6. Also if you have in your scene water objects created with Water 2D Tool v1.4, its best to delete them and create new water objects.
     
  21. Shiggam

    Shiggam

    Joined:
    Jan 29, 2018
    Posts:
    4
    I have the 1.6 Version, i reimported the asset to be completly sure and erased the old water and replaced with new one and the problem persist, i don't know what can be wrong here.
     
  22. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    That's weird, this problem should have been fixed. Its possible there is a bug a have not discovered. Can you create a copy of your project, remove everything you don't want other people to have, like textures, scripts, shaders etc. and sent it to my email johnq002@gmail.com
     
    Last edited: Feb 13, 2018
  23. jeffweber

    jeffweber

    Joined:
    Dec 17, 2009
    Posts:
    616
    Hey Nicrom.

    It's been a while since I've checked this asset out. Wow, you've made a ton of progress.

    I especially liked:
    I will def. grab the latest and play around with it.

    Great Job!

    -Jeff
     
    Nicrom likes this.
  24. AlcyonGames

    AlcyonGames

    Joined:
    Sep 16, 2016
    Posts:
    39
    Hi! I have a question for a 'bug'.
    In the scene window the water looks totally transparent except from what I think is a specular reflection. When I hit play the water starts to work and it can be seen in the scene window too. But after I stop the game mode, the water again turns Invisible. It doesn't fix even if I place new water from the create menu or GameObject menu in the same scene or in a new one.

    Without Play Mode:


    Within Play Mode:


    Btw it didn't happened when I imported the asset, it just started happening from nowhere and now I can't get it to work back. Re-importing the asset solves the issue btw.

    Thanks! ;)
     
  25. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi. From what I can see you are using the GPU water. I think this happened because in Editor mode the camera was no rendering to the depth texture. If you get this problem again, add the script CameraDepth to your camera.
     
    AlcyonGames likes this.
  26. AlcyonGames

    AlcyonGames

    Joined:
    Sep 16, 2016
    Posts:
    39
    That solved the problem!, any hint at why now is required to add that script? I didn't need it before.
    Many thanks for the fast response btw! ;)
     
  27. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    In order to work correctly the advanced shader needs the camera to render to the depth texture. I'm not sure why this is happening, but sometimes in the Editor the option to render to the depth texture gets disabled. By the way, after you add the script CameraDepth to your camera and the water shader is visible again, you can remove it from the camera.
     
    AlcyonGames likes this.
  28. AvGaz

    AvGaz

    Joined:
    Dec 21, 2012
    Posts:
    82
    Is it possible to float objects without blocking rotation? Inorder to ride waves the objects really need to be able to rotate.
     
  29. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi. I assume you are talking about objects that have 3D colliders. Even if the colliders are 3D, internally Water 2D Tool treats them as 2D colliders when it calculates where to apply the buoyancy. As a result, the rotation around the X and Y axis must be locked to prevent the objects from moving in weird directions. You do not need to lock the rotation on the Z axis.
     
  30. neifiblue

    neifiblue

    Joined:
    May 24, 2017
    Posts:
    1
    Hello.
    I just found that when I put the asset "Anima2D" in project,
    the 2.5D water ripples doesn't work.
    The cause seems in the "Anima2D/Scripts/Editor" folder.
    I removed the folder, then the ripples worked.
    It works in build as well without removing the folder, so I think this is not so much problem for me.
    I told just in case some people in trouble like me.
    Thank you for really good asset:)
     
  31. AlcyonGames

    AlcyonGames

    Joined:
    Sep 16, 2016
    Posts:
    39
    Hi, I have a question, this is more of a tutorial needed than an issue with the asset. I want to know how to change the specular reflection direction. I know that in the TM shader I can change the position of the "sun" but I don't know what coordiantes do what. I think it's supposed to be rotating the source of the specular light, but I can't set it up how I want. Could you add a screenshot or something telling how the axis rotate the source? Or how to achieve that look. Also, are there plans to add caustics inside the water, and more control over reflections, like shinyness of reflection when there is light, etc. For now is a reflection with distortion, but emissive materials or light don't make the water shine. I would even pay if it were an addon for the water shader, that is custom for the script you made.
    THANKS!

     
  32. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi. I assume you want to achieve something like this.

    The values I used are X: -0.19, Y: -0.75, Z: -0.97.
    X value moves the specular reflection to the left/right, Y value changes it's width, Z value rotates the specular reflection around the X axis.

    Currently I am working on another project, so I'm not sure when I'll add new features to Water 2D Tool.
     
    AlcyonGames likes this.
  33. AlcyonGames

    AlcyonGames

    Joined:
    Sep 16, 2016
    Posts:
    39
    Ok, thank you for the fast answer!!
     
  34. AlcyonGames

    AlcyonGames

    Joined:
    Sep 16, 2016
    Posts:
    39
    Also, any words on your other project foliage 2D, we want to add dynamic foliage that moves interacting with players, explosions, wind, etc. But don't have the time nor the skills to do it ouselves, and I haven't find any other solution on the internet. I found your asset, but don't know if it's updated and it seems abandoned?. Thank you!
     
  35. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    I plan to eventually add new features to Foliage 2D, but I'm not sure when that will be.
     
    AlcyonGames likes this.
  36. Rubakai

    Rubakai

    Joined:
    Aug 27, 2015
    Posts:
    32
    Hi Nicrom, firtst wanted to say thanks for all your work. The asset is great and your feedback and updating is amazing.

    I am using your tool on a mobile game and was wondering if you could provide your list of recommendations for improving the performance on mobile and which are the most effective improvements (or point me to a list if you have done one already)? Below is a list I have come up with so far..

    • Unlit
    • Linear buoyancy
    • Collider detection to bound based
    • Reduce mesh quality
    • Raycasting?
    Any tips would be greatly appreciated! FYI I need to use the 2.5D version (lakes etc)

    Thanks again.
     
    Last edited: Mar 30, 2018
  37. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi.

    There isn't much I can add, your list contains all the major points that should be considered when trying to improve the performance.
    • Mesh Quality - This can be controlled by changing the value of the field Segments to Units from the Mesh Properties group of options in the water objects inspector. I think a value of 1.5 should be just good for a mobile device. Another reason why it it recommended to have a mesh with fewer vertices is because Water 2D Tool performs a series of mathematical operations on the surface vertices, when it simulates wave propagation. So fewer vertices will result in less math operations and better performance.
    • Buoyancy - I recommend the Linear Buoyancy as it is very cheap in terms of performance.
    • Collider Detection - For mobile devices I recommend to set this option to Bounds Based.
    • Animation - When the left or right edge of the water is animated, the mesh is rebuild (the UVs and vertex positions are recalculated). If the water mesh has many vertices, on mobile devices it can cause some performance problems. If possible animate only the top or bottom of the mesh as this will cause the mesh to only be updated and not rebuild.
    • Shaders - To get the best performance I would recommend you used some kind of Unlit shader. If you want to use the GPU based water than use the Basic shader shown in SmallLake_Unlit_Basic demo scene.
     
  38. Almakos

    Almakos

    Joined:
    Dec 13, 2013
    Posts:
    179
    hi Nicrom.
    Finally I got time to get back to my project.
    I am using 2.5D waves.

    I have couple questions:
    1) Wave 3 in ambient waves doesn't seem to work (at least I see no visual changes no matter what settings I put).
    2) Is there any way to adjust threshold at which sound and particle effects are being triggered? As currently it happens almost every second. Some sort of velocity filter similar to what we have for ripple?

    Thank you.
     
  39. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi.

    1 - You are right, it doesn't work the way it should. It seems there is a bug in the code.
    2 - In the water object's inspector, Water2D_Ripple script, there is a field called Velocity Filter that is used to determine if a dynamic object should generate ripples. I'll make some changes so that this field is used for the particle system and sound effects too.

    Can you send me a message on my email johnq002@gmail.com, I'll send you the scripts with the fixes. Also what version of unity are you using?
     
  40. Almakos

    Almakos

    Joined:
    Dec 13, 2013
    Posts:
    179
    Sure, just replied via email.
    Also I am using Unity 2018.1.0b13 but I have older version as well somewhere if newest is not supported.
    Thanks.
     
  41. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Hi Nicrom!!

    I just bought you amazing Asset! I am working on a 2.5D game. Its going to be an undersea exploration game. I am really excited to start using it in my game. I tried to copy the Water objects from some of your scenes, but when paste it into my scene I dont see it having the same effects? Am I doing something wrong?

    Is there a manual where it tells what properties to set to make the water look like say, Sea. What parameters to tweak to create waves. Also I am not sure what the "Lit" and "Unlit" materials are. Should I start with a Normal Water or GPU?
    Would be great if the manual spoke about these :)
     
  42. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi.

    The shader used in the GPU based water is more for calm lake like water. For a sea like look i would recomend you to modify the unity water4 shader and use it with a CPU based water object.

    Have you tried to enable the Ambient Waves option for the GPU based water?.

    Unlit means that the light in the scene will not affect the water while Lit means that it will.
     
  43. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Thanks for the quick response :)

    Featurewise what the difference between CPU and GPU based water? My game is going to be completely submerged in water (except few areas). Will there be any performance issues?

    I saw few demos where you change direction of water to push objects. It it CPU or GPU water?
    I need this behavior in my game too.
    Sorry I am asking them all here because I could not find a comparison between these two type :)
     
  44. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    When a water object is CPU based the mesh deformations, waves are calculated by the CPU. When a water object is GPU based this calculations are performed by the GPU. Also the shaders that are used by the GPU based water can't be used by the CPU based water objects.
     
  45. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Water Gap.PNG
    @petersvp Could you please guide me how you used the Water4 with this asset? WHen I apply it to my Water Object The Vertical and Horizontal planes' waves dont align anymore! I am very new to Unity so really not sure how to add texture to material. Right now all Materials provided with this asset gives me a cartoony look (both Normal and GPU water). I am looking for something that looks like Sea surface. Any help would be greatly appreciated by you and the Author!
     
  46. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Thank you for the information! I will experiment with both types and see what best suits for me. Unfortunately I have another query for you: :)

    Is there a way I can stop by character from sinking downwards when he is on surface(because I run the SurfaceFloat animation). I have a variable to check if he is on Surface or not (bool isOnSurface). When this is true can I make him remain on surface? And when he submerges, he should remain underwater until I take him upwards.

    I tried setting the Buoyancy settings, but I am not getting required results :(
     
  47. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Currently I am staing in the hospital with a leg injury and dont have access to my working PC so at the moment I cant give you any conclusive advice in this case. I'll contact you with a solution as soon I can. I hope to get out of the hospital in about a week.
     
  48. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Hi Nicrom! So sorry to hear that :eek:

    Please take care and wish you a speedy recovery! Thanks again for all your support
     
  49. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Hi Nicrom!
    Hope you are recovering well! :)

    I am not expecting an immediate response. Just wanted to know if the Water Asset support objects with Ragdoll mechanic? I apply it to my Character (with all Default setting), when I dropped him into the Water, he just starts flying into the air forever :D

    Is there anything I need to change to make him work in the water?
     
  50. Nicrom

    Nicrom

    Joined:
    Nov 17, 2013
    Posts:
    421
    Hi.

    I have not tested Water 2D with ragdoll physics so at the moment I'm not sure if it works or not. I'll get back to you with this problem as soon as I can.