Search Unity

AQUAS Water/River Set - Water & Rivers for Mobile, VR, Web, Desktop

Discussion in 'Assets and Asset Store' started by dogmachris, Jan 8, 2016.

  1. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Won't really be a game but rather small ecosystems where the player will control a turtle from an upcoming 4 pack from Junnichi Suko, with other animals controlled via Ice Creature Control. Here is the web demo of his soon to be released Alligator Snapping Turtle which I'll add to the wetlands. He includes a character controller with all his models so it's easier for me to get up and running.
     
  2. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    Can't run Webplayer demos anymore. :(
    Do you have a WebGL demo?
    What platform will it be for?
     
  3. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    It will just be for PC. I usually just use FireFox to open webplayer demos and haven't got a WebGL demo. He should have it on the store by the end of the week, usually priced quite cheap as well.
     
  4. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    Make sure to send me a link then, I'd love to try it! :)
     
    jonfinlay likes this.
  5. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Late to the party as usual. Looks great Chris, on my list now.
    Any plans for ocean waves or flow for rivers/streams?
     
  6. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @Whippets Ocean waves are definitely on the agenda, and I plan to have them ready by summer (hopefully).

    River streams are also on the agenda, but as of yet it's rather uncertain what the approach will be. We plan on using flowmaps, but since that also requires some work on the terrain part, I don't think AQUAS will be able to build rivers in the standalone version.

    However since AQUAS is already integrated into Gaia, it might be possible, that AQUAS and Gaia can generate rivers together with Gaia generating flowmaps for the terrains created and pass them to AQUAS which will simulate the actual river flow based on those maps - But I cannot promise anything at this point, we'll have to see.
     
    Shawn67 and Whippets like this.
  7. Whippets

    Whippets

    Joined:
    Feb 28, 2013
    Posts:
    1,775
    Excellent on both counts. Adam can't be that busy, so you can both crack on now XD
     
    Shawn67 likes this.
  8. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    He might not be, but I am atm... :D :D :D
     
    Shawn67 likes this.
  9. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hi, here is a short video showing Aquas using the 3D Volumes feature of Amplify. Basically, Amplify allows cube colliders to be set up which activate a different LUT, which I used for both entering the water and also going through a patch of murky water. It would have looked better if there were a 'cloud of sand' particle effect but couldn't find one on the asset store. The scene looks fantastic in Unity but I had to down-sample it to make the video, especially the sound quality. A very nice effect is that it looks like the underwater plants are swaying which I think is a result of Aquas' water lens, it's especially noticeable towards the end. In fact all the vegetation was static.



    One thing that would be great would be if Aquas could automatically reduce the far-clipping camera distance when it submerges and returns it to the original value once the camera leaves the water. The best would be if these values were included in the Underwater Effects settings. Hopefully if it could do this then the underwater effect wouldn't be any more resource hungry than the above-water camera.
     
    Last edited: Mar 22, 2016
    dogmachris, Whippets and Arganth like this.
  10. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    As long as nothing else tempts me at the time, I should have the cash to get this next month :D
     
    Whippets likes this.
  11. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    Hey Jon,

    splendid video there! :)

    In AQUAS v1.2.1 there's an easily accessible interface that allows you to grab the informationon on whether the camera is underwater or not, straight from AQUAS, so it'll be an easy thing to just grab that info and set the clipping planes based on that. I'm not sure however if it's a good idea to add this to AQUAS as a default feature (don't wanna pack the inspector) - maybe if some more people request it? :rolleyes:
    It should be online soon and I'll do a video tutorial on how to add custom underwater code and trigger the wet lens effect at will (in about 2 weeks).

    Cheers!
     
    Last edited: Mar 22, 2016
    jonfinlay likes this.
  12. bigbrainz

    bigbrainz

    Joined:
    Jul 21, 2015
    Posts:
    85
    The demo runs just fine in a new project for us, but when we import it into our existing Project, the water is not visible. And when we assign your shader to our existing water object, it disappears as well. Any idea where we should start looking to troubleshoot? Thanks! We're also apparently missing a tree prefab if that helps provide a clue.
     
  13. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @bigbrainz check for 2 things:

    1. Are you working on DX9? - AQUAS uses effects that are not supported on DX9, thus it doesn't work on DX9.

    2. Do you have the AQUAS_Camera.cs script attached to your camera? It's recommended that you do, if you're working in forward rendering mode.

    There's also a trouble shooting section in the documentation.

    Cheers
    Chris
     
  14. scarpelius

    scarpelius

    Joined:
    Aug 19, 2007
    Posts:
    954
    Hi @dogmachris
    I have an annoying problem in the editor: if the water body is active, I cannot select anything in scene. Any idea? Sry if this was asked and answered before.
     
  15. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @scarpelius ugh, that's a weird behaviour, don't know if anyone had it yet (?). I didn't.
    What do you mean by active? Selected? Enabled?
     
  16. scarpelius

    scarpelius

    Joined:
    Aug 19, 2007
    Posts:
    954
  17. scarpelius

    scarpelius

    Joined:
    Aug 19, 2007
    Posts:
    954
    Is the AQUAS_Reflection script. If I disable it I can select on mouse click, if is enabled mouse click does not select anything in the scene.
     
  18. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    Very weird... :confused:
    Does it also behave like that in a fresh project?
     
  19. scarpelius

    scarpelius

    Joined:
    Aug 19, 2007
    Posts:
    954
    Yes, same problem in a new project with just aqua imported.
     
  20. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hey Chris,I'm still having problems changing to a square plane. Basically when I change to a square plane, the waves become so large and vastly different from the default values that it makes it impossible to recreate the original water settings. However when I change it to the Quad, it works fine except the quad is in a vertical rotation. I tried creating a new plane but I couldn't drag it into the Aquas slot and so I'm using the default one included in the Unity resources. Any ideas what I can do? Thanks..
     
  21. terapong

    terapong

    Joined:
    Mar 5, 2013
    Posts:
    15
    Edge of the lamp post seems to be distorted by water behind. Do you have any fix to this?

    test.gif
     
  22. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @jonfinlay I know about the square plane requiring different parameters. That's due to the UVs of the Unity standard plane being set up differently from the ones on the waterplane, which is of course circular. If you need to use squared planes, I'm afraid there's no other way, than playing around with the material parameters until you get it to look the way you need it. I think the tiling values should be approximately the ones you use on the waterplane times hundred.

    Another possibility would be to create your own squared plane, as you rightly guessed (just don't forget to set up UVs for it!), but what exactly do you mean, when you say, you couldn' drag the plane you created into the AQUAS slot?
     
    jonfinlay likes this.
  23. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @terapong The edge of the post for some reason becomes part of the reflection on the water, which is of course being distorted. I've seen this bihaviour before, but unfortunately couldn't find a viable solution for it yet. However you can reduce this effect by reducing the the reflection distortion on the water material. Reducing it to 0 will most likely rid you of the effect alltogether, but reflections will then have no distortion at all. I'm sorry, there's no better solution to this atm.

    Cheers
    Chris
     
  24. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    489
    I'm having a bit of an issue with this asset. My player is way above the water, but as soon as I look down the underwater effects are getting turned on. My guess is it thinks the water level is higher than where it actually is. How do I fix this?

    EDIT:
    Nevermind, I figured it out. The child object of the camera for the effects was far away from the parent object.
     
    Last edited: Apr 1, 2016
  25. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    Glad you could already figure it out. Just wonder how that could happen though... :rolleyes:
     
  26. VeNoM79

    VeNoM79

    Joined:
    May 13, 2014
    Posts:
    9
    Hello dogmachris,
    sorry to bother you but i'm trying the lite version of your package and i'd like to know if it's possible to increase the saturation of the main color.
     
  27. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    Hi @VeNoM79 you're not bothering me. :)
    The main color is only the color that is being absorbed, so ideally you don't see it at all. The only color you actually can see below a deepnes treshold is the deep water color, which is just a normal 3-channel color. The only way I see to inceasre its saturation would be by using an image effect for that. Was that your question?
     
  28. VeNoM79

    VeNoM79

    Joined:
    May 13, 2014
    Posts:
    9
    Yes, because i'm trying a flooded room, so the water level is very low (only feet of player are inside the water plane). What kind of image effect are you talking about?
     
  29. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @VeNoM79 the Unity Standard Assets contain a set of image effects. One of them is a color correction script, that you can attach to your camera. However it will saturate your entire image, not only the water. AQUAS itself doesn't have a feature, that allows to manually adjust the saturation.
     
  30. VeNoM79

    VeNoM79

    Joined:
    May 13, 2014
    Posts:
    9
    @dogmachris thanks a lot for the help, meanwhile i just bought the regular version of Aquas (excellent work). Thanks again :)
     
  31. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @VeNoM79 very glad you like it! :)
    Please contact me, if you need any help.

    Cheers
    Chris
     
  32. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    489
    Running into another issue. Every time I play the game in Unity, these files keep getting modified:
    Assets/AQUAS/Materials/Caustics/PrimaryCaustics and SecondaryCaustics.
    What keeps changing is the guid for the texture. How can I resolve this? Quite annoying to have git keep telling me files are changed that I have not modified, and will result in a lot of merge conflicts for my team.

    EDIT:
    I forgot to mention a couple other files that keep saying they are being modified:
    Assets/AQUAS/Materials/Water/Desktop&Web/2SidedTripleTextured and 2SidedTripleTextured2.
     
    DougRichardson likes this.
  33. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Hey Chris, another fine job with the update! One question though, basically I manually change the layer of Aquas Waterplane to "Water". However, when doing so there are two things which happen that makes me think that for some reason it isn't being assigned to the Water layer, even though it says it is.

    1. When I use a prefab brush, to paint only on the Water layer it doesn't paint even when I directly paint on the water plane. However, it paints on every other layer correctly.

    2. Ice Creature Control has a function to avoid water (by identifying the water layer) however even when switched on the animals continue to go into the water.

    Have you been able to test whether aquas works when assigned to the Water layer? Cheers
     
  34. l3mon

    l3mon

    Joined:
    Jan 25, 2016
    Posts:
    15
    Is there any android demo demonstrating the underwater effects as well as the wet lens effect?
     
  35. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    489
    Why would my performance degrade from a lot of objects in the scene? With a few hundred trees in the game my performance goes down a lot with the water on. With the trees off, or the water off, my performance is fine. Both together though the performance is bad.
     
  36. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @emrys90 I'm not sure I understand what your problem is exactly, but the material properties of the caustics material are indeed being accessed and adjusted by the AQUAS_Caustics script to blend in well with the environment. Also it's the script that updated the current caustics texture that is being displayed, so it's required for moving caustics. Without it, caustics would only be a static image. Is that, what you wanted to know?

    The water materials, that you mentioned are being modified as well are being modified by the underwater effects. This is neccessary to - among other things - switch between underwater and afloat mode on the water material.
     
  37. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @jonfinlay I haven't used Ice Creature Control yet, but object detection is in many cases realised by checking for nearby colliders. Since the water doesn't have one, it might be the reason, why the water cannot be found, even if on the correct layer. Does it solve the problem, if you add a mesh collider to the water?

    As to the painting: I don't know how this is being done exactly, but doesn't painting on a mesh require a specific shader? Does it work for instance if you change the shader for a Standard Unity Shader?
     
    Shawn67 and jonfinlay like this.
  38. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @l3mon Nope, there's no such demonstration, because the underwater effects are not meant to be used on mobiles. I haven't really tested that in depth, but as of my knowledge, image effects are generally too expensive for mobile devices, that's why I didn't even design AQUAS to use its underwater effects on mobiles.

    I'm very sorry for the confusion, I just now realised, That I haven't mentioned that anywhere, but I'll update the FAQ and the description right away.
     
  39. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @emrys90 Assuming you're using trees that were created by the Unity Tree Editor (e.g. Speed Tree trees), I'm not an expert on them, but in the past people have repeatedly reported performance issues when using lots of such trees. The thing is, that AQUAS's reflection functionality takes everything that would be rendered by the camera through a mirroring object and draws it with a flipped projection matrix on the water surface, effectively resulting in a doubling of the trees to render.

    As far as I know this kind of performance problem is limited to trees created by the Unity Tree Editor, other objects shouldn't be affected if not present in extreme numbers.

    Does recuding the amount of trees solve the problem?
     
  40. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    489
    Yes, but that is not an option for me. I found part of the performance problem: You are doing a GameObject.Find every frame in AQUAS_LensEffects. That's horribly inefficient, got a few frames back when I removed that. I lose about 10fps still from the reflection, haven't been able to figure anything out for that though.

    Something else I am noticing is you do a lot of GetComponent calls every frame. It's more efficient to cache the references to them.
     
  41. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @emrys90 of course you're right, the Gameobject.Find method is extremely costly, @kilju already pointed out that there was a performance problem due to that bit of code and I wasn't aware I left it in there (especially since it's not even required in a lot of scenarios) - sorry for that. However I've fixed that in v1.2.1, so it's now in the start method storing the object of interest in a variable.

    The GetComponent method on the other hand can easily be called millions of times per second on today's CPUs, since it's not really expensive (as long as components are not being accessed by their string name), so optimizing that out wouldn't make a noticable difference.
     
  42. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Thanks Chris, maybe it is because the water doesn't have a collider. I might try and add a plane with a collder at the same height of Aquas and tag it water to see if that fixes it, Cheers!
     
  43. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    It might be sufficient to simply add a collider component to the waterplane - keep in mind though, that depending on how your camera control is set up (e.g. an FPS controller), the collider might prevent the camera from going underwater and instead define it as solid ground - you might have to tell your camera controller to ignore colliders on the water layer.

    Cheers! :)
     
    jonfinlay likes this.
  44. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    489
    From everything I have read, GetComponent in an update loop is a bad idea. It's okay to use GetComponent for occasional lookups, but for something that happens every frame it should be cached for better performance.
     
    Shawn67 likes this.
  45. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @emrys90 You're right, it's bad practice. I'll have it changed with the next update.
     
  46. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,677
    There are issues with the new version that is supposed to only use the various underwater camera effects if they are attached to the camera. Here is the code:

    Code (CSharp):
    1.      //--- image effects (if attached to the camera)
    2.      
    3.         defaultSunShaftsEnabled = gameObjects.mainCamera.GetComponent<SunShafts> ().enabled;
    4.         defaultBloomEnabled = gameObjects.mainCamera.GetComponent<Bloom> ().enabled;
    5.         defaultBlurEnabled = gameObjects.mainCamera.GetComponent<BlurOptimized> ().enabled;
    6.         defaultVignetteEnabled = gameObjects.mainCamera.GetComponent<VignetteAndChromaticAberration> ().enabled;
    7.         defaultNoiseEnabled = gameObjects.mainCamera.GetComponent<NoiseAndGrain> ().enabled;
    Your comment says (if attached to camera). However, in every instance, you are actually accessing properties of those components. So, if they are not attached to the camera then you get a null reference exception. You need something more like the following for each item:

    Code (CSharp):
    1. Bloom bloom = gameObjects.mainCamera.GetComponent<Bloom> ();
    2. if (bloom != null)
    3. {
    4.     defaultBloomIntensity = bloom.bloomIntensity;
    5. }
    And there are assumptions that they are attached elsewhere. I first attached all the effects just to eliminate the errors and just have them disabled, but they still took effect when actually running. And as another poster said, all the Find component calls you have in Update are not good. I suspect there is much more that could be optimized about this, but I don't have time to dig deeper so I'll leave that to you.
     
  47. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @magique I was just rewriting the script to cache the component references, when I realised that. Of course some component parameters are still being accessed without checking for a null reference exception - stupid me.
    I'll go through the scripts and rewrite all sloppily written code - if I can get it all done today, the update should be live by beginning of next week.
    Sorry for the inconvenience everyone.
     
    Shawn67 likes this.
  48. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    3,677
    Thanks. I look forward to the update.
     
  49. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    875
    Any Apk
     
  50. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,202
    @emrys90
    Hey guys, I've just submitted v1.2.2. I cached as many method calls as I could and respectively call more expensive methods only when REALLY neccessary. However as far as I can see the biggest impact on performance is still being caused by the image effects (especially blur and noise), but I think it was worth it anyway, especially since lavish method calling is an ugly practice, even when not very expensive.

    @magique
    I've fixed the issue with the null reference exception and tested it. In v1.2.2 it should be possible to leave out image effects at will without getting errors.

    Thank you for the input guys, sorry for the inconvenience and please tell me if there's anything else I can do to help.
     
    Last edited: Apr 6, 2016
    Shawn67 and magique like this.