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. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    And another one:

     
  2. TryHarder

    TryHarder

    Joined:
    Jan 1, 2013
    Posts:
    121
    Hello,

    Sorry for another question, ok so I'm on Android and all is working fine now, following your pool tutorial, except the caustics dont seem to do anything using the mobile shader, but thats ok as my water is pretty dirty and looks amazing as it is thank you so much. My problem though is how do I add underwater effects using the mobile shader ? You dont jump in the pool in the tutorial. When I do the water disappears as you'd expect below the plane, I'm not look for anything too fancy just some kind of underwater effect.

    Thank you.
     
  3. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    You can add the underwater effects using the AQUAS Quick Setup, but consider that the underwater effects use image effects, which are generally too heavy for mobiles. High-End devices like an S7 Edge might be able to handle it somewhat but you'll have to remove individual image effects from the camera to get an acceptable performance.
    As for the water, you have to use one of the double sided materials if you want to be able to see the water from beneath, otherwise it'll only show the upper face of the waterplane. Here also keep in mind, that the double sided shaders weren't originally meant to be used on mobiles, so prepare for a considerable performance hit.
     
  4. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    Hi.

    I picked Aquas up a while ago, but I've only started using it seriously recently. First off, great asset. It's handling most of the things I need it for perfectly. I do have a few questions though.

    1. I'm seeing light outlines around objects in the water, presumably from some kind of foam or water distortion effect, especially around my player. Is there any way to turn it off? I've tried setting foam and distortion to 0, but it doesn't get rid of it. As you can see, it looks pretty blocky, and I'd rather not see it when my player is swimming if possible.

    Aquas Outlines.jpg

    FYI, I'm using deferred linear rendering, and DX11.

    2. I have 2 Aquas water bodies in a scene, but rather than being side by side as usual, one is on top of the other as shown:
    Aquas Overlap.jpg

    Is there any way to limit the lower extent of the underwater effect from the top pool, so I can walk under it without seeming to be (literally) underwater? I can't just disable the effect completely when I enter the cave, as I still need it for the second pool. My workaround is to attach two separate UnderWaterCameraEffects prefabs to my camera, and enable/disable them individually using colliders. But since you've got that nice Water Planes array available in the Lens Effects script, it seems a shame not to be able to use it as intended. If possible, a lower limit parameter for the water effects would make this clunky workaround unnecessary. :rolleyes:

    3. River flows have already been mentioned, but can you think of a way to make an Aquas water surface fade out as well? I have a stream coming off an Aquas water body, and running off a high cliff. Due to the height, I'd like it to just dissipate into spray before reaching the ground, but can't find a way to gracefully fade the Aquas shader out as it drops, leading to a very noticeable cutoff.

    I know the last two are really fringe cases, so if they're not easily doable, just let me know, and I'll try to find answers elsewhere. I'd really like to solve the first one though. :eek:
     
  5. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Can't you just make a collider trigger or something that turns on/off the effect?
     
  6. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    Assuming you're referring to my question 2, yes. In fact (as I stated already) I'm already doing that. I was just asking if there was another way to do it, without attaching a stack of separate Underwater effects prefabs to my camera for each water plane. Aquas' Lens Effects script includes a handy Water Planes list to allow it to work with multiple water bodies, but not if you need to have separate instances of the script for each one. Like I said, it's not really a big problem, as I have a workaround already. I was just looking for a more elegant solution.

    Or were you talking about something else? I may have misunderstood. :confused:
     
    BackwoodsGaming likes this.
  7. TryHarder

    TryHarder

    Joined:
    Jan 1, 2013
    Posts:
    121
    Ahhh, yes of course thank you, and I'm targeting the Nvidia Shield so with desktop shaders I was getting 36 - 42fps but with the Mobile Shaders I'm getting a solid 60 fps, my problem was i needed to add the Vignette camera filter, it all works perfectly now, thank you !
     
  8. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    I get it, but why do you have several effect scripts? Cant you just enable/disable the same one regardless of where you are? Or do you have different settings for them? If you have different settings i cant see how you could get around having 2.
     
  9. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    Good point. I hadn't thought of that, but I actually do use different settings for the different waterplanes, such as fog color, density, and caustic tiling. I don't suppose that would work either if they were all handled by the same Lens Effects script. No worries then on that question. Like I said, I've already found a solution, and it's probably as good as any other. I'd still like to know what to do about my other questions though. :(
     
  10. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I would say this is the responsibility of your game design to handle this. I would say just change the water plane value to a new value when you enter the cave.
     
  11. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    @FargleBargle sorry for the long delay. The outlines you're seeing are an unintended effect from the refraction effect in the shader. I know of them, but as of yet still struggling to find a solution to it. It's possible to milden the effect by reducing the "refraction" parameter in the material settings, but when in partly transparent water with the light shining from behind for the moment, this effect will occur one way or the other - will post as soon as I get it sorted out.

    The thing with the water planes that are stacke upon each other: I don't know if you do programming stuff, but AQUAS simply checks if you're within the area of the waterplane and then checks if you're below the waterlevel for that plane. The script iterates through all the planes in the array to do that. It would be neccessary to add a float array with the max. depths for each water plane and instead for only checking if within an infinite depth, one would have to check if the y-position of the camera is between 2 values. I haven't implemented that, because as you say, it's a fringe case and I thought it would only unneccessarily bloat up the script further, but maybe I have to add that in an Update or so. :rolleyes:

    AQUAS fades out when using the depth transparency parameter, but it only does so based on the distance to intersecting geometries, so a simple fade-out at a certain point of desire isn't possible just like that. I spent only little time thinking about that, but will surely do so in the future, because I plan to develop a realistic waterfall that works with AQUAS, so that raises the same question.
     
  12. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    No worries. As long as you're working on a fix, I can wait.

    I wouldn't bother changing the code in that case. I've already got a solution as I said, so no point fixing it if it isn't broken.

    Cool. I'll await further developments then.

    Thanks for the reply. Better late than never. :)
     
  13. jammer42777

    jammer42777

    Joined:
    Apr 21, 2014
    Posts:
    116
    I made a very basic terrain, and setup aquas and alloy.


    (I still have to iron out issues with skymaster, but that will come later)
     
    dogmachris likes this.
  14. thegamerguynz

    thegamerguynz

    Joined:
    Apr 1, 2016
    Posts:
    20
    Hi, i just want to say thanks for your asset, it looks amazing and i cant wait to get it working......
    just one issue, when i try and use quick setup, when i click add water, a console error occurs saying object trying to instantiate is null.

    i tried reimporting the asset to no avail. help!
     
  15. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    Have you used AQUAS-Lite before you got AQUAS?
     
  16. thegamerguynz

    thegamerguynz

    Joined:
    Apr 1, 2016
    Posts:
    20
    No i have not,i went straight into the full version.
    I'm using unity 5.4 personal.

    *EDIT:
    i got it working, Aquas has to be directly in the Assets folder, i had it stored in a child folder to keep things tidy.
     
    Last edited: Jun 10, 2016
  17. thegamerguynz

    thegamerguynz

    Joined:
    Apr 1, 2016
    Posts:
    20
    Thanks so much for this post, Helped me with using UFPS
     
  18. joostbos

    joostbos

    Joined:
    Feb 4, 2015
    Posts:
    64
    AquasWaterProblem.png I'm sorry if this question has been asked before, I'm in a terrible rush to create a mobile water demo so I just expect that if I buy an asset it works as explained in the tutorials.

    I have a small pond so I expect that I can use the same steps as foor the pool tutorial. Create a plane, duplicate the AQUAS mobile one-colored water material and apply that duplicated material to my plane.

    But in my case I see a black plane in the game window and nothing in the editor. See attached screenshot.

    What's going wrong?
     
  19. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    hi,

    May not work but I would make a copy of the aquas prefab for mobile and just swap the mesh for your own. If that doesn't work then check your normals for the mesh they may need fixing.

    Just a thought:)
     
  20. joostbos

    joostbos

    Joined:
    Feb 4, 2015
    Posts:
    64
    Well, which prefab for mobile???? :) In AQUASPrefabs I see AQUASWater, Bubble, Primary CausticsProjector, SecondaryCausticsProject, SmallBubble, UnderwaterCameraEffects. But nothing mobile

    I tried the AQUASWater prefab and it looks as if I'm only seeing the foam, because if I set foam visibility to 0 I see nothing, but if I set it to something other than 0 I do see waves moving. But no reflection. And even if I change the water main color to red, nothign changes.
     
  21. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Thought the mobile version was in there I must have got mixed up. You can use the standard Aquas prefab and change the material to one of the mobile ones then swap out the mesh. If you are not getting any error messages and this doesn't work then I'd be looking at trying it in a clean test project to make sure everythings ok. After that I am at a loss.
     
  22. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    @joostbos if the water is invisible, it's mostly for one of two reasons:

    1. Check if you have the "AQUAS_Camera.cs" script attached to the camera. It's required when working with graphics APIs other than DX11.

    2. Make sure your Editor doesn't operat under the DX9 API. It's excluded from the supported APIs.

    If the water is black it's usually because it doesn't receive light. Do you use a directional light or do you have everything lightmapped and working only with ambient light?
     
  23. Deleted User

    Deleted User

    Guest

    Is there a infinite ocean option? If not, is it possible to make it very very big without problems? Is there gonna be a wave option to make them bigger? Thanks, sorry for the questions - just curious.
     
  24. ReignOfDave

    ReignOfDave

    Joined:
    Oct 22, 2015
    Posts:
    51
    hey, i am having an issue when i build the game the water turns invisible. any ideas how to fix this!
    Only have dx 11 and i have the aquas camera script attached to the camera.
     
  25. terapong

    terapong

    Joined:
    Mar 5, 2013
    Posts:
    17


    Hi, I have a rendering problem when I use halo. As you can see, the water was rendered in front of halo. Do you know how to solve it?
     
  26. terapong

    terapong

    Joined:
    Mar 5, 2013
    Posts:
    17

    I found another problem. The water can reflect only three point light at a time. How can I increase the amount of point light the water can reflect?
     
  27. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    There's no built-in solution for an infinite ocean, however there's possibilities, depending on what you want to do:

    1. You can scale the waterplane really large (up to 16 million with one camera shouldn't be a problem), however that's not infinite.
    2. You can create water tiles and use a simple script to relocate the tiles so that the center tile is always below the camera. That would effectively work like an infinite ocean. Here's a video to show how to make water tiles with AQUAS:


    Wave options are one for the future, but as of yet, I can't say when it's gonna happen.
     
  28. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    That's strange. Are you building for windows?
     
  29. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    This comes from objects that don't use the depth-buffer to determine the render order. The render order then is being determined by a given queue. AQUAS has a high render queue, thus it can happen, that there's objects with a lower render queue in the scene, then AQUAS get's rendered on top of them. You can use a simple script to adjust the render queue for AQUAS.

    Attach this script to the waterplane:
    Code (CSharp):
    1.     using UnityEngine;
    2.     using System.Collections;
    3.    
    4.     [ExecuteInEditMode]
    5.     public class RenderQueueWaterEditor : MonoBehaviour {
    6.         public int renderQueueIndex = 2800;
    7.         void Update() {
    8.             gameObject.GetComponent<Renderer>().sharedMaterial.renderQueue = renderQueueIndex;
    9.         }
    10.     }
    11.  
    The script overrides the render queue in the shader and sets a new one. Lower the render queue index until AQUAS gets rendered behind your halos. Keep in mind however, that the halos will then always be drawn on top of the water, even when you're underwater. To revert the render queue to default, simply swet the render queue index to -1.

    Go to your quality settings and increase the pixel light count to whatever amount of lights you wanna use. Keep in mind though, that especially when working on mobiles, high counts can have a considerable performance impact.
     
  30. ReignOfDave

    ReignOfDave

    Joined:
    Oct 22, 2015
    Posts:
    51
    Yeah i am. I have tried deleting and re-importing the asset but that did not fix the issue.

    EDIT;

    I fixed it. i dont quite how it got fixed but i turned off static light map on the terrain off and i think that fixed it but that makes no sense haha.
     
    Last edited: Jun 17, 2016
  31. Dracones

    Dracones

    Joined:
    May 31, 2016
    Posts:
    27
    I'm using AQUAS on Vive with SteamVR and it seems to be working well for me. I'm doing the normal Gaia import into my terrain. I've used other water solutions which have had many problems for me in VR. With AQUAS I don't think I'm noticing any drop in frames when I'm using it and the rendering looks quite good.

    A few things on the underwater part though. For VR AirLens and WaterLens work better near 0.1. Also I'd recommend a disable option for the BubbleSpawner() call. The bubbles drastically tank FPS in VR. Without them though I can get fantastic frames underwater even with fog and caustics.

    The stock distortion on the WaterLens is probably a no go for VR. It's something that I think would end up making people sick. I even tuned down the material quite a bit, yet even the smallest distortion sort of triggers the brain's "You sick bro?" reaction. An option to disable the setAtive(true) on this would be nice for non-scripting VR users. Or optionally include another sort of underwater materal(maybe a tint color?) that VR devs could choose to use instead.

    Via Gaia setup worked perfectly for me. The scripts/lenses got thrown onto my Camera(head) object on setup which is working fine. After I play around with it some more I'll put up a VR oriented review on it.
     
    dogmachris likes this.
  32. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    @Dracones lmao, I didn't think of that, sorry :D :D
    You can select the underwater lens and in the material inspector set the distortion to 0, that should get you rid of the "ebriety" effect.
     
  33. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Hi @dogmachris, any update regarding flow map support for rivers?
     
  34. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    Hope to be able to submit in about one week from now.
     
    cygnusprojects and jonfinlay like this.
  35. jonfinlay

    jonfinlay

    Joined:
    Aug 25, 2015
    Posts:
    535
    Aquas looks great with this Star Nest Skybox after a bit of tweaking, definitely worth checking out.
     
    dogmachris likes this.
  36. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Oh my!!! That picture bothers the geologist in me so much! :eek:

    What you want is a perched water table above the cave. @dogmachris Making water blocks with depth would be awesome for many reasons.
     
  37. Deleted User

    Deleted User

    Guest

    I bought the asset, however, I'm not getting the water lens when leaving the water, I thought I fixed it, I was wrong.
     
  38. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    Did you use the quick setup to set up the underwater effects and if so, may I ask the value of the near clipping plane of your camera?
     
  39. Deleted User

    Deleted User

    Guest

    I did originally, then I modified a few things, and then the water lens when coming out of the water randomly stopped working, also the box thingy when underwater isn't big enough for some resolutions, is there a way to fix? The near clipping is 0.3 on the camera, I checked and its the same for the FPS that is in the demo. This is strange.
     
  40. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    The picture was for illustration purposes only, and not intended to be entirely realistic. ;) You could also have a hotel for instance, with a swimming pool on the ground floor, and another on the roof. In my game, I have a floating mountain (think Avatar) with a large water reservoir inside. and a small reflecting pool on top (with the whole thing floating in the air over a large ocean below). Since both pools are artificial, and the entire floating mountain defies known physics, normal geology isn't an issue. :rolleyes:

    But since I can only ever see one or the other at any given time, I solved the problem by simply disabling them and their associated camera effects when not visible.
     
    Last edited: Jun 20, 2016
    dogmachris and Teila like this.
  41. Tiny-Tree

    Tiny-Tree

    Joined:
    Dec 26, 2012
    Posts:
    1,315
    there is no option Enable fog on mobile shader?
     
  42. Deleted User

    Deleted User

    Guest

    I'm getting a new error, its strange.
    Assets/AQUAS/Scripts/AQUAS_LensEffects.cs(70,5): error CS0246: The type or namespace name `GlobalFog' could not be found. Are you missing a using directive or an assembly reference?

    I have GlobalFog in my directory.
     
  43. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    Hm... does it work in the demo scene? The lens objects are actual planes that are positioned in front of the camera, they're not image effects, so my first guess would be, they either don't match your field of view by scale, or they're not in the correct position for some reason.

    This is because Unity's GlobalFog class isn't public. Make it public, that should do the trick. For more info see the Manual (first point in "Troubleshooting").
     
  44. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    Uhm... indeed it's not available as an option for the mobile water - funny, I can't remember why I didn't put it in there, it was probably because I thought people weren't gonna use z-buffer-based fog systems such as TOD or Tenkoku on mobiles. I'll make sure to include that option with the 1.3 update.
     
  45. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    Hello Dogmatic,

    I am currently using AQUAS Water Set for a mobile project and it has been working great, but I have stumbled upon one error.

    When running the scene, I get the error in the image below over and over.

    I am not sure what it means and the game runs fine and looks fine so I don't think it is interfering with anything. It looks like it might have something to do with the UnityEditor windows. The only thing that I have that manipulates the windows in the Unity Editor is the XArm plugin from the asset store.

    Thank you for your great asset and please get back to me with some information on this error,
    BloodHound92
     

    Attached Files:

  46. tequyla

    tequyla

    Joined:
    Jul 22, 2012
    Posts:
    335
    1/ edit file named GlobalFog.cs

    2/ update line number 9
    Code (CSharp):
    1. class GlobalFog : PostEffectsBase
    to
    Code (CSharp):
    1. public class GlobalFog : PostEffectsBase
    3/ save.

    ==> solved.

    ++
     
    dogmachris likes this.
  47. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    This is an editor problem rather than a problem with AUQAS, but it usually occurs either when the waterplane is veeery big or, when using multiple cameras. You might consider using water tiles instead of one big plane?
     
    StenBone likes this.
  48. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    Thank you for the reply. I am scaling up the water plane by 90000 so this could very well be the problem. Would you briefly describe how to replace the default water plane with water tiles?
     
  49. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,375
    90000 shouldn't be a problem at all - I was talking about something greater than 15 million or so. Are you using more than one camera?
     
  50. StenBone

    StenBone

    Joined:
    Dec 21, 2013
    Posts:
    42
    I searched everywhere through my scene and all I can find is one camera.

    I don't know how much help it would be to you in solving this problem, but I am going to post a screenshot of the settings for my AQUASWater game object.

    Aquas2.png