Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

RealWater -Realtime Water Surface Simulation Package

Discussion in 'Assets and Asset Store' started by blaze237, Sep 6, 2015.

  1. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56

    RealWater is a fully interactive water surface simulation package for the Unity game engine.

    RealWater can greatly increase the realism of any scene where water is used with its realistic wave simulation algorithm.

    RealWater includes two modes of operation. The first works by manipulating the vertices of a high poly mesh, the second works by manipulating the pixels of a normal map or height map, which can then be applied to a material to show the wave simulation

    The new normal map mode allows for much larger scale water planes than can be achieved with the mesh version. Meaning you can now create large interactive bodies of water such as lakes .

    The water plane can be disturbed via mouse input, multitouch input and via objects in the scene and the simulation supports any material/shader you want to use.

    WebPlayer Demo
    Standalone Demo
    Android Demo

    Summary of Features:
    • Highly efficient and optimised for mobile usage (Nexus 7 2012 : 40-50 FPS on medium quality, OnePlusOne: 60 FPS on high quality).
    • Supports mouse, multi touch and objects input to water planes.
    • Full source code and extensive documentation included.
    • Ability to obstruct areas of the water based on local geometry and/or a stencil image. Waves will not pass through these areas and will reflect off of the boundaries.
    • Ability to indent the water plane based off of a stencil image.

    RealWater also includes an ambient mode setting, which serves as an alternative to a shader based solution for generating non interactive ambient waves. This effect is able to produce very pleasing results, even with a low poly mesh.

    Note: RealWater is intended to be used to simulate small/medium bodies of water such as pool/pond. It will not look good at very large scales.


    RealWater is available now for $25 : Asset Store
     
    Last edited: Jan 24, 2019
    carking1996 likes this.
  2. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    302
    Wow looks amazing. I will definitely check this out
     
  3. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Thanks :)
     
  4. carking1996

    carking1996

    Joined:
    Jun 15, 2010
    Posts:
    2,605
    Tried the demo, worked very well, but may I ask the difference between the 3 highest settings? It seems to simply have a greater resolution, so more waves, am I correct?
     
  5. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,918
    DrewMedina likes this.
  6. Tovrin

    Tovrin

    Joined:
    Jul 15, 2015
    Posts:
    70
    Interesting. Does this asset also do underwater?
     
  7. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Yes the higher the quality the higher the resolution of the mesh (custom resolutions are also supported).

    The higher the resolution of the mesh the the greater number of points used in the simulation, this will allow more individual waves on the plane as well as improving the appearance of all waves.
     
  8. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    I assume you mean whether or not you can see the plane moving from underneath? If so then yes, as long as you are using a shader with BackFace Culling disabled (an example one is included).

    If you mean underwater effects such as fog/caustics then no, but these are relatively easy to implement if you want them and you could probably find some tutorials on how to do so online.
     
    Last edited: Sep 21, 2015
  9. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56

    As I don’t own a copy of this asset I cant say for definite whether RealWater has better performance, but from having a look at that assets Android demo and comparing it to RealWater’s I believe RealWater's core simulation is definitely better for performance.


    Setting the mesh resolution to max (same resolution on both) and the speeds as close as possible, RealWater hovers around 30-40 frames per second at idle, whereas this asset hits about 5fps unless the ‘Fast Normal's’ option is enabled, which allows it to perform about on Par with RealWater.


    In terms actual use you may not notice much difference in performance if you use that assets fast normal option, but the fact that this asset requires fast normal’s to match RealWater's performance means that the core simulation of that asset is much more performance intensive, which may lead to issues if you have a lot of other cpu intensive stuff going on in your scene.


    RealWater's core simulation is very lightweight and runs purely with integer arithmetic (which is good for performance), it also has specially optimized obstructions which can be enabled to cut the performance cost of obstructions almost in half.

    In terms of extra features over that asset:

    • RealWater supports full 10 finger multi touch which this asset doesn’t seem to support.
    • RealWater also has scalable and specially optimized obstruction textures (I don’t know whether this asset has that or not).
    • RealWater has indent textures.
    • Finally RealWater has the ambient mode, and in the next update I will be changing ambient mode such that it is interactive (i.e you can make waves on the water in addition to the ambient waves).


    If you have any other questions then I’m happy to help. :)
     
    SenthilKumaranC, nasos_333 and twobob like this.
  10. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    We are intersted but would like to see a larger demo.

    That is a very small pool.
     
  11. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Unfortunately RealWater will not work well on very large scales, as Unity only supports meshes up to a maximum resolution, and scaling this to something like a lake or ocean really doesn't look great.

    That being said, the higher the quality setting used (and hence the higher the mesh resolution) the larger scale you will be able to achieve without it looking unacceptable.

    In addition to this, RealWater also supports any custom rectangular mesh, and included are meshes up to a 1:4 length ratio, such high length ratios can allow for much longer planes (although at very extreme ratios the limited horizontal resolution of the mesh may begin to affect the appearance.)

    Looking forward I do have a couple of ideas in the works which would allow for infinitely sized water planes (one of which would use normal maps rather than actually adjusting the mesh vertices, like with Skyrim's water) but for now ideas are all they are unfortunately.

    I will try to upload a demo later today showing the different rectangular meshes and a larger scaled pool to see if that would suit your needs, but if you're looking for something very large such as lake/ocean then unfortunately RealWater in its current form would not be suitable for your needs.

    EDIT: For extreme quality the simulation looks ok up to around 5 times the scale used in the Demo.
     
    Last edited: Sep 22, 2015
    twobob likes this.
  12. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    That is very good of you.

    We can run the Simulation up to "Very High" on our current equipment before experiencing frame drop.
    I was thinking if maybe it would be possible to do a "blend" with larger flatter bodies and simply fade out the local area into the larger inert body... Unsure - will think on that.

    Much obliged
     
  13. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Thats quite a good idea actually, you could use a depth buffer to cut out a hole in a large inert plane and then have the interactive Real water plane above it.

    Of course you'd also have to ensure the interactive plane follows the player somehow but it's defintley a good staring point for a quasi infinite plane.
     
    twobob likes this.
  14. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Indeed, if you were to provide a sigmoid rolloff for the edges (height back to 0? or visibility?) that would be helpful?

    Perhaps most properly handled via a "border" value, since you appear to focus on quadrilateral mesh arrangements. With an optional "use Radius rather than border" for making it fit logically into cameras' plan view shots or larger bodies that are circular.?

    Thoughts on that?
     
    Last edited: Sep 22, 2015
    blaze237 likes this.
  15. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    That could definitely work, and using a roloff function on the wave heights would help to mask the border wave reflections as well, which would look weird when using an "infinite" plane (there is no way of disabling these outright as they are built in to the core logic of the simulation unfortunately).

    Using a rolloff on the visibility of the RealWater plane would be even better, but would likely require a custom shader to do so. Unfortunately I don't really have much experience when it comes to writing shaders, but it is something i could look into none the less.

    Of course if you know how to make a shader like this yourself or you find a shader online then it will work with RealWater as RealWater supports any shader.
     
    Last edited: Sep 23, 2015
  16. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Oh Yeah, I keep thinking of this as a shader... Doh.
    Hmm.. I probably should get an actual eyeball on the code before I make any more assumptions... will think on it.
     
  17. Tovrin

    Tovrin

    Joined:
    Jul 15, 2015
    Posts:
    70
    I picked up RealWater last night and have been giving it a bit of a try. So far so good.

    I'd like to try something a little adventurous. Would it be possible to do solids (cubes, rectangular solids, spheres) using this asset?
     
  18. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    The short answer is no. The long answer is maybe.

    RealWater's simulation essentially functions using a virtual grid of points, each point on the grid corresponds to a vertex on the plane. The height of these points/vertices is then manipulated in order to simulate a wave.

    In theory there is no reason that this couldn't be extended to objects other than a square plane, as a cube is just six planes put together, and a sphere could be thought of as one plane wrapped around on itself.

    The problem comes in determining vertex positions, as with a simple gird/plane this is quite simple to do, but with a 3d shape this becomes more complicated.

    Even then, if you manage to work out a way of determining vertex position in a meaningful way on some 3d shape, you have to consider the fact that Unity has a limit on the maximum number of vertices on a mesh (64516). For a cube this means that each face can only have a maximum resolution of about 100x100 on each face of the cube, which is about equal to the medium setting included with RealWater.

    Therefore even if you do get over the problem of determining vertex/ grid position for a 3d shape, the resulting simulation would be very limited in terms of quality, and so its probably not worth the time of working out how to do so (if it is even possible at all).
     
  19. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    However. it is to be noted that most humans only have two eyeballs, so three sides is generally plenty :p
     
  20. Rtyper

    Rtyper

    Joined:
    Aug 7, 2010
    Posts:
    452
    This looks really interesting, I've been needing a decent water simulation like this and at this price it's a steal! I agree with twobob though, some way of blending the waves down at the edges would be really useful (I'm needing to do large bodies of water too).
     
  21. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,237
    +1 for lake sized bodies of water.... :)
     
  22. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    That's definitely something im planning to implement.
     
  23. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    I have a few ideas in the work that may allow for this, hopefully one of them will work but no promises! :p

    I think the best solution is probably going to be using a normal map system like in bethesda games.

    The kind of large scale water mesh deformation seen in games like the witcher 3 however is a lot more difficult, and likely uses tessellation. I admittedly don't know much about tessellation but i will look into it nonetheless.
     
  24. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    I received an email from a customer asking for a way to make waves exert force on objects in the water in order to push them around.

    Ive managed to come up with a quick solution which you can see in action here. You can download the script here.

    Just thought I'd post this on here in case anyone else is interested in having this functionality, it's not perfect and as i said I haven't spent a massive amount of time on it but it seems to working quite well.

    I'll likely add it in as a proper feature in a future update but if you want it now then here it is.

    EDIT: For this to work you'll need to open up RealWater.cs and change line 237 from private int[] BufferCurrent; to [HideInInspector] public int[] BufferCurrent;

    EDIT: Alternate version that is more sensitive to distant/small waves : LINK.
     
    Last edited: Sep 28, 2015
    SenthilKumaranC likes this.
  25. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    12,918
    Great, the performance is a vital factor so i will be buying for sure
     
  26. Plutoman

    Plutoman

    Joined:
    May 24, 2013
    Posts:
    257
    If you're ever adding tessellation, and I assume, water that can be used on non-rectangular meshes, I would definitely be interested. For the amount of puddles I have, generally, the simulations are too intensive for the quality I need (the artifacts are noticeable at 1080p on a desktop generally, for larger bodies of water, unless it's at the absolute maximum quality level).

    I've got an existing tessellation solution but it doesn't look quite as good as I'd like, and the simulation seems too fragile. It's rough, though, as compute shaders, in my case, wouldn't run properly inside the same frame, back-to-back, so the simulation seemed capped to the frame rate. It works for now though.
     
  27. kokkorollo

    kokkorollo

    Joined:
    Jan 16, 2013
    Posts:
    9
    can you tell me if there is a way to change the inclination of water?
    I want to simulate water in a tray, and if I tilt the tray I want that the water react to inclination.
    do you think it is possible with this asset?

    let me know and I will buy it!
    thanks!
     
  28. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    You may be able to simulate this to a very limited extent with RealWater by using indent textures with a grayscale gradient, this would cause the water plane to slope in different directions.

    But transitioning between different textures and hence different directions probably wont look all that natural, in addition the water would be non interactive if an indent texture was being applied to the whole surface.

    At the end of day RealWater isnt a 'proper' fluid simulation, it only simulates the surface of the water by treating it as a grid of 1 dimensional waves. This is very good for performance but unfortunately means that the type of full scale fluid simulation that you're looking for is not really possible.
     
  29. Zedinex

    Zedinex

    Joined:
    May 26, 2015
    Posts:
    51
    So this would not work as an ocean ? P.S really cool asset
     
  30. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Afraid not. Thank you very much for your interest though :)
     
  31. SenthilKumaranC

    SenthilKumaranC

    Joined:
    Jun 10, 2013
    Posts:
    4
    Awesome Fluid Package. Just I want to simulate a pond with some interaction.

    I am ready to buy if we can interact with water when we are in ambient mode.
     
    Last edited: Mar 15, 2016
  32. SenthilKumaranC

    SenthilKumaranC

    Joined:
    Jun 10, 2013
    Posts:
    4
    Just saw the you tube video. Awesome.
     
  33. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56

    As of right now this is not possible. Although i do have a testing version that currently implements it.

    However you can expect the feature to be added within the next 2/3 weeks max.

    You should be aware though that there is a performance impact to interactive ambient, as it essentially involves running the simulation twice and combining the two.

    You can either wait till then or if you do want to get it now then you can send me an email with your invoice number and ill send you the current beta version of the interactive ambient. Up to you :)

    Although wouldn't be able to do so till the end of this week as wont have any spare time till then.
     
  34. SenthilKumaranC

    SenthilKumaranC

    Joined:
    Jun 10, 2013
    Posts:
    4
    Just now I have bought. I have sent the invoice number.
     
  35. Pandur1982

    Pandur1982

    Joined:
    Jun 16, 2015
    Posts:
    275
    i have a question,work that with character controller or only with rigidbody?And can i change the Watercolor / Texture?
     
    Last edited: Apr 6, 2016
  36. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Apologies for the (very) late reply, i though i had notifications for this thread turned on but apparently not :/.

    With regards to your question RealWater supports both character controllers and rigidbodies. And you can use any shader you like with it.
     
  37. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    UPDATE

    In the next couple of days the new version of RealWater will be released. This new version adds the ability to have interactive waves when using ambient mode. It also features a large amount of code refactoring. For the average user this doesn't really matter but for people digging in to the source code this should make your lives a lot easier :p.

    Moving Forward

    Now that this update is done, i have begun work on implementing a heightmap mode for RealWater, this heightmap can then be used for tesselation or refraction (normal map generation may happen, its a lot more complex to do).

    The 2 main benefits of this over the way RealWater functions currently (i.e, manipulating high poly mesh) are

    [1] Improved performance (Potentially massively so).
    [2] The ability to have very large scale water planes, as the issue of max mesh size is no longer an issue.

    Once this feature is implemented, RealWater will really become a whole new package, hopefully allowing for large scale simulation ala skyrim. As such, the price of RealWater will be increased, however existing users will recive these new features at NO extra cost.

    As far as an eta on this its very hard to say. Ive made some pretty good progress, but there is still a lot left to do. And idealy i would like to implement normal map generation as well as heightmap. I would tentatively say a couple of months, but dont hold me to it.
     
    ElectroMantis, wetcircuit and gurayg like this.
  38. Unity-Gripkiste

    Unity-Gripkiste

    Joined:
    Jul 13, 2016
    Posts:
    3
    Hi there!

    Could I use this asset to fill a (small) room with water during runtime? You know, like a trap in a dungeon? Or when the room is filled and I would remove a wall - would the water flow into the next area?

    regards,
    J.
     
  39. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Im afraid not, RealWater is only a water sufrace simualtion, for somthing like that youd need a full simulation along the lines of this (https://www.assetstore.unity3d.com/en/#!/content/19139). Note that i don't own this asset so can't comment as to whether it is definitely what you need.

    If you're willing to sacrifice water flowing into another room, then you could simulate the room filling up by simply slowly raising a RealWater plane from beneath the ground.
     
  40. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Quick update on large scale simulation.

    I have made some fantastic progress with implementing large scale simulations, with full normal map generation at real time. Performance seems very reasonable, being able to use a simulation of 1024x1024 at around 30fps, on my old 2012 ultrabook, and 2048x2048 at 60+ fps easily on my pc (That's 16 times the current simulation area of 256x256!). And this performance is very tweakable, as you can adjust how much of the water plane is actually being simulated at a given time, to avoid unnecessarily simulating a flat area.

    Right now the majority of the work is complete, and now comes the boring part of cleaning it all up, looking for bugs, and porting back to the current release version.

    As i said before this will be a free update for current users, and once released the price of RealWater will go up, so buy now for a discount :p

    Ill be sure to keep you all updated on my progress and in a few days Ill post some screenshots and videos here.
     
    Last edited: Jul 18, 2016
  41. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    could you post screenshots or demo of your update so at least we get an idea what comming next
     
  42. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Yes of course I'll post a video tommrow. Apologies I completely forgot I said I would post some.
     
  43. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    As promised heres a few videos of the new large scale simulation.

    Heres a video of a 2038x2048 simulation:


    Heres a test with refraction:


    And heres the normal map being generated in real time:
     
    twobob, blackbird and gurayg like this.
  44. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    i bought your realwater asset and i m using unity 5.3p4 but when i try to make the water to react to my third person controller but was not successful .... even i checked the scenes the one with Ethan the model walks above the water anyway can u do me a pm i will send the third person controller that i m using ?
     
    Last edited: Jul 20, 2016
  45. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Set the water planes mesh collider to be a trigger and the character will be able to walk through it.

    This was actually how it originally worked but unity 5 screwed up how triggers work meaning you have to instead mess with the collision matrix.

    But as your using an old version of unity you should be able to just set the water plane to be a trigger to solve your issue. Let me know if that works.
     
    blackbird likes this.
  46. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    i did what you told me but still the water doesn t react to the character samething for the scene with Ethan

    edit i found your email adress
     
    Last edited: Jul 20, 2016
  47. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    Ok shoot me an email and attach your unity scene and I'll take a look at it and get back to you tomorrow. If you can it would also help if you can upload a recording of the issue so I can see exactly what's happening.

    It May be an issue with using an old unity version. If so I believe I did a conversion for another customer some time ago so that shouldn't be an issue.
     
  48. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    on unity forum i was not able to send you the file where i can cotact you .... and sorry i was meaning unity 5.3p4

    edit i found your email adress
     
  49. blaze237

    blaze237

    Joined:
    May 31, 2014
    Posts:
    56
    You can get my email from my publisher page on the asset store or it should be in the manual of RealWater. Can't post it here in case of spambots.

    Ahh in that case we probably just need to set up your collision matrix. Have you followed the quick start guide. You have to do the first few steps for any object collisions to work. Its awkward but there's no way around it in unity currently.
     
    blackbird likes this.
  50. blackbird

    blackbird

    Joined:
    Aug 9, 2011
    Posts:
    588
    oh i send you alreadyy an email hope you have look at it