Search Unity

Easy Water 2.0 - Mobile Compatible [RELEASED]

Discussion in 'Assets and Asset Store' started by Grespon, May 3, 2012.

  1. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi Metaleap,
    Thanks for everything you're doing. I'll chek it all when I get back, right? There's a lot of info :)

    Btw, I couldn't open the attachments. It shows the message: "Invalid Attachment specified. If you followed a valid link, please notify the administrator"
     
  2. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Sure, take your time, no prob!

    That's so weird -- "attachments"? Yesterday I added them as images and they showed up -- strange forum software, this.

    So here is pic 1 and here is pic 2!
     
  3. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Just going through the older posts on this thread... hey it's a Sunday :D

    You mentioned you already have Unity Pro -- so you can easily import their WaterPro pkg, then ignore the "daylight/nighttime" prefabs and go into their Water4 sub-folder and you can play with that one: has a "Gerstner Displace" script that I suspect simply instructs their vertex shader to produce waves. I think this is one of the things vertex shaders excel at. Simply displace vertices according to some function -- should be not much overhead at all, and would be so cool :D

    But if I were to choose, I'd be more interested in y-flipped reflection, underwater and the gorgeous fake caustics first so yeah, no rush :D
     
  4. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
  5. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Got good news for us yet? :eek:
     
  6. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi metaleap. Not yet. I started working on it last night. I'll try to fix the CubeMap version today.
     
  7. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Cool, thanks for looking into these.. didn't wanna put u under pressure :D was just too curious if you haven't forgotten :p cheers!
     
  8. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi. I made a fix for the CubeMap version. If you want I can send u by email or by PM.
    I'm really considering to make all reflective shaders cubemap based, because despite what I thought it has better performance than the respective texture based shader on my Android. And the reflection is far better too. It's a work for some days, and after I convert all the shaders I'll be uploading to the Asset Store.
     
  9. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Well if you really want to remove them, I can't stop you. Personally I'd prefer if you don't -- you already support both already! As far as I can see, Cubemaps are essentially 6 textures while reflection textures are 1 texture, which is kind of enough info for me to know which one to pick... That's all memory bandwidth (despite your one-off 1-device testing ;) ) and I'm doing lots of gpu stream-in-out already so, I'm not just running the EasyWater plane in my app only and I don't want water reflection to cost more than one small-res rendertexture... :D So yeah, please don't remove reflection textures... is flipping your shader's sampling texCoords posing a challenge?
     
    Last edited: Oct 14, 2013
  10. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Ok.. I'll let them be. Will fix the texCoords. But anyway I'll make cubemaped versions. Maybe the calculations I'm using for the texture based reflection is not the best one. That's why the cubemaped version has better performance. I'll check it out.
     
  11. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    I needed a non-transparent version of exactly C2TBDR360 so I made one -- hope you can include it in the next update with the fixed reflection logic, tho -- how can I send it to you? Or should I just post the src here?

    Reason: I'll switch to the transparent shader only when the player is in the water or close to shore. Since I'm always rendering the water plane, 99% of the time in my game it will be wasteful to render a surface with a shader that uses Blending, is in the Transparent queue with a Transparent RenderType. Just changing the opacity slider wouldn't change that at all! The GPU doesn't know about our "opacity" custom user setting.. but I still needed C and 2TB and D and R and 360 (though I have my own C# instead of JS script for that by now, which also removes the "divide by 10" in Start() bug)...

    So let me know if you're willing to include that "new" C2TBDR360 shader in the package from now on? Of course would hope to have updated reflection code in there then ;) :D

    Also I noticed you have so many shader files, that's probably becoming painful with duplicate code and such -- any reason you're not using *.cginc #include files? I'm a ShaderLab noob (just got some GLSL experience from pre-Unity days) so there might be a good reason, let me know as I'm always eager to learn :D

    I got a pretty gorgeous water going on with EasyWater! Will post shots one day... btw. anyone who wants "foam" it's as easy as using a well-chosen foamy texture for texture slot 2 and tweaking uv-coords!

    Can't wait to post a glowing review of EasyWater on Asset Store! Ah guess I'll wait for the next update though... :D :D but it deserves it and will receive it. Oh you should really up your price... ;)
     
  12. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Haha Thanks for everything metaleap!

    Smart strategy using opaque water when far away from shore. Maybe I'll include an opaque verseion for each shader in the future.
    Send me the file to aruangrespan@gmail.com, please. I'll include in the fixed reflection update.

    I was not using *.cginc because I like to have control over the lighting and stuff. I don't remember if I changed something from the original lighting code though. But for example, the (to be released)underwater shader needs to have a custom lighting, because it receives the lighting from behind.

    I don't know if raising the price I would raise the revenue.. I tried to raise several months ago and just a few people bought it.. I'm happy you think it worths more than 15 U$.
     
  13. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Totally forgot I have Dropbox :D here goes!

    Best to diff it with the C2TBDOR360.shader version from the current package as it is in the AssetStore (not your local dev version). Just removed the one or two alpha/opacity calcs in there, and the alpha-related tags/properties..
     
  14. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Hi there,

    I think there are way too many shaders. I have no clue which ones to pick when I want to run it. I know there are there for options but I have no idea what the C 2T B O R 360 stands for, 2t i guess is 2 textures, everything else I'm lost. B is boyance? R reflection?

    Couldn't it be simplified? I think 7 shaders are more than enough and then do a transparent/non-transparent version if you want.

    Also, an example video on how to add foam would be great. And it would rock to have it shore lines.

    I'm using water4 pro right now, and the water looks great and seems to run fine. I'm trying to achieve the same on easy water but I'm not having much luck. Anyone willing to help how to set it so that it looks like my water 4 pro picture it would be great

    $water.jpg

    I'm hoping that easy water can achieve that quality and be faster than the standard w4pro :)
     
  15. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Hi creat, not the author here but let me chip in! It's all in the readme and it's really not that hard.

    - C is color (some blue usually)

    - T is texture, 2T is two texture slots mixed

    - B is bump map (or in the case of 2T, also 2 bumpmaps)

    - O is opacity

    - R is reflection

    - D is distortion (crucial for watery look!)

    - 360 sounds a bit confusing but is really just an extremely simple JavaScript attached that let you specify some "directional texture uv scrolling" speeds and then applies them in its own Update() to the material

    The large number of shaders is a big strength of this package! Everyone has different water needs and in Unity Pro you're always stuck with an expensive shader even if you don't need half its features. Sure, it takes 5 minutes to get up to speed with the logic behind how the shaders differ, but then you have a great arsenal of different water options for different needs for a lifetime! So in my opinion Grespon shouldn't "dumb down" the package. It being so versatile for so many different water needs is a big plus. Just like I wrote above, depending on cam distance to the water I can switch between more expensive or cheaper shaders, this is crucial for reasonable optimizations. Of course I'm going for mobile where we do need to worry about this, if you're targeting PCs it all doesn't matter but then you can just stick to Water4 anyway :D

    Everyone agrees but for everyone it's a different set of "7 shaders" :D

    As for your screenshot, in my opinion EasyWater can be made to achieve this look but you simply need to take the time to play with different water textures and bump maps. Don't limit yourself to those included in the package, there's plenty additional water textures out there. It's actually really easy to play with EasyWater (you'll agree after/if you watched the tutorial vid), just takes lots of fiddling and tweaking (ideally in Unity Editor's live Game Mode) which personally I find fun but not everyone might feel the same ;)
     
    Last edited: Oct 20, 2013
  16. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    ok, but the problem is that some of us want it "easy water". Meaning, drag and drop and looks amazing.
    All I did with water 4 was drag and drop it. I changed a bit the colors, that's all.
    If I get the 360 asset (which is supposedly the best quality one), drag and drop it... it doesn't look as good to me. So there must be a way to make it look great, but I've spent 2 hours without getting the same results... and as the name says, this should be "Easy" right?

    A tutorial on not just how to set it up, but to make different type of water would be great: ocean, tropical semi blue, dark atlantic deep blue, foam, shores...

    About the 14 textures, I seriously see no difference whatsoever in about 7 of them. Neither in the editor nor the mobile :/
     
  17. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Well maybe the name "easy" was a bit of an unfortunate choice... though it's still easier than writing the shaders yourself :D

    I always have a sweet spot for "power user" tools that let me tweak everything endlessly, but I get that's not everyone's cup of tea and yeah the name is probably misleading.

    Maybe it was "easy" in the very early days of the package.. ;)
     
  18. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi creat,
    I apologize for the misleading name. Back in the days when I made Easy Water, the only other option was SmartWater. I was making a water for myself and decide to put on the store, so, just like metaleap said, it would be "easier" than writing your own water shader. Many other options came after, I believe Water+ and Tasharen Water are more like drag'n drop, I never tested these myself.

    You're really right about the useless textures included. I end up not cleaning that folder. Those textures are there for demonstration. I really advise you to follow the video tutorial, go get that texture at cgtexture.com. I couldn't find any nice texture which could be distributed. They normally can only be used "hardcoded" inside a product.

    I am sorry but I have no intention to strip down the package to 7 shaders. It happens that everytime some user call me asking for different specific details, and I can't stop what I'm doing to make it. Metaleap, for example, just asked me a non-transparent version of the highest shader, some users want cubemaped reflections, some people want linear transparency over the whole plane. So, actually, my plans is to include even more options. What I can do is to think about a better way to organize it.

    metaleap,
    in case you are wondering, I made zero progress this week. I'm getting divorced and I passed these days finding a rented place to stay. I've just brought my MacMini, so I'll restart working on Easy Water from now on.
     
    Last edited: Oct 22, 2013
  19. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Edit: omg just now after posting the below saw your comment about divorce! Sorry to hear it.. maybe take a few weeks off if feasible.. here my original post:

    Btw, I think you can turn off backface culling for all shaders... once people do underwater, they need it off, and projects that don't want underwater means they never render from below the water so backface culling never happens anyway, so it's not an active/effective optimization for both scenarios ;) and for deep-water we'd just fog-it-out early..
     
  20. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    ouch about the divorce.

    as for easy water, i'm still unable to make it look good. I followed the video tutorial but it looks ok compared to water 4 pro which looks fantastic. You say we can achieve the same or better quality but i'm completely failing at it. Any help would be greatly appreciated.
    Also, shore lines would be an awesome addition, more than underwater effect since they are obviously in any lake/beach.
     
  21. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi creat,
    wait, I never said you could achieve same or better quality than Water4 pro... where did you heard it? I actually doubt my Easy Water can look as fantastic as that. We can chat someday and I can help you to tweak it, but don't expect it to look as Water4 pro.
    Shore lines are in the list, for sure.

    And thanks metaleap for the tips, I'll check it out.
     
    Last edited: Oct 26, 2013
  22. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Now I finally ran into the same issue on my HTC with Adreno 320! How did you fix this in the end? Did this fix ever make it as an update to the asset store? If not, could you dropbox or pastebin the relevant changeset please? Just wanna quickly patch this prob, no need for the other fixes/issues right now but this would be important..
     
  23. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Nevermind I got it... shader float precision stuff, oh my! :D
     
  24. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    It was supposed to be working..:eek: Did I forgot to fix any of the shaders ??
     
  25. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    Don't worry, I started tweaking the whole thing myself just for kicks ---got hooked after I fixed the reflectionUV-flipped--- and then shot myself in the foot :D user error, and resolved. ;)
     
    Last edited: Oct 27, 2013
  26. Foxxis

    Foxxis

    Joined:
    Jun 27, 2006
    Posts:
    1,108
    Hi, a couple of quick questions:
    Is all the code in the package easily editable? Ie. non-obfuscated?
    Also, it is reasonable well documented?

    Thanks in advance!
     
  27. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi Foxxis,
    All the shaders are editable and reasonably well commented.
    I think the documentation is not the best, but I think you'll be fine watching the tutorial.
     
  28. jeremiasz

    jeremiasz

    Joined:
    Feb 17, 2013
    Posts:
    53
    Of course it works not only applied to a simple plane, but also on a mesh surface of an e.g. primitive object?
     
  29. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    jeremiasz,
    It works, except by the reflection texture. The cubemapped reflection version should work fine after I correct the orientation issues.
     
  30. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi Metaleap,
    I was only able to start working on Easy Water today. Are you still having troubles with CubeMap reflection orientation? I tried here and it works fine with the Unity's builtin skyboxes. Look:
    $Captura de Tela 2013-11-05 às 22.29.52.png
     
  31. metaleap

    metaleap

    Joined:
    Oct 3, 2012
    Posts:
    589
    I never used cubemaps, only the reflection texture2D. Don't worry I have my own water shader going by now, having used yours as a starting point ;) so it's fixed at my end.
     
  32. jeremiasz

    jeremiasz

    Joined:
    Feb 17, 2013
    Posts:
    53
    Ok. I thought about putting it on a sphere :)
     
  33. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Several months ago, there was a guy asking the same question. At that time I made these shots showing how would it work.

    There will be some distortion on the juntions.

    $bexb3q.jpg
    $ru6zpl.jpg
    $1pgj77.jpg
     
  34. jeremiasz

    jeremiasz

    Joined:
    Feb 17, 2013
    Posts:
    53
    Junctions doesn't bother me at all. Happily there will be no junctions on a lake on a miniature planet :) Thanks for screens.
     
  35. Daniko

    Daniko

    Joined:
    Mar 24, 2011
    Posts:
    16
    I have one small request. If you could add "EasyWater/....." path to the title of all your shaders, to pack them into their own folder in the shader selection list, I wouldn't have to do it manually each time i update your package. :)
     
  36. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    I added "EWater" to the title some months ago.. You mean you would like me to chage to "EasyWater"? Or maybe you're having problems updating the package?
     
  37. Enuniq

    Enuniq

    Joined:
    Oct 17, 2013
    Posts:
    10
    Quick question!

    1. Does this support underwater?
    2. If it does, any pics?


    Thanks!
     
  38. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Underwater is not ready yet.
    I'm working on it... for now you can see a sketch here:
    http://aruangrespan.com/EasyWater/Underwater/
     
  39. Daniko

    Daniko

    Joined:
    Mar 24, 2011
    Posts:
    16
    Well, I apologize, as it turns out, i was having a problem updating, and wasn't even aware of it... :(
     
  40. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Actually, thanks. I thought this Asset Store updating problem was solved long ago..
     
  41. mmax

    mmax

    Joined:
    Mar 24, 2012
    Posts:
    13
    Hello,

    Im seeing such artifact, upper part of the trees are seen as they were behind the water, but it should be the opposite, because the trees are in front of the water.
    $trees_vs_water.jpg
    How can I correct it ?
     
  42. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi mmax,
    Try opening the shader code and changing this line:

    "Queue"="Transparent"

    to this:

    "Queue"="Transparent -1"

    Let me know if it works.
     
  43. mmax

    mmax

    Joined:
    Mar 24, 2012
    Posts:
    13
    It was already like you wrote "Queue"="Transparent -1".
    I solved it, by terrain settings, where I had to increase Billboard Start value.
     
  44. Weird-Beard-Guy

    Weird-Beard-Guy

    Joined:
    Nov 10, 2013
    Posts:
    26
    HI

    just bought this shader and it is awesome. the only thing I have problems with are particles :/
    check this out:
    $water_ripples.png
    Depending on the angle/ distance of the camera the particles disapear on the water.
    I use the standard mobile shader for this.

    how can i force them to be always in the forderground?
     
  45. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    At a guess read the posts directly above yours
     
  46. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Weird Beard Guy,
    Did the posts above yours help u ?
     
  47. Stephen Jobe

    Stephen Jobe

    Joined:
    Feb 11, 2013
    Posts:
    4
    Any news on making EasyWater11-14 compatible with iOS/mobile platforms? They are currently using pragma 3.0 and as such we cannot use them.
     
  48. RoloJo

    RoloJo

    Joined:
    Feb 26, 2013
    Posts:
    28
    My apologies if this has come up already.

    How applicable is this package for the purpose of making a river? This looks fantastic, but it seems more suited to a still body of water (eg lakes and oceans). Is it possible to make it look as if it is flowing. So far this is the best I have found and its not bad: http://unitycoder.com/blog/2012/02/12/fake-water-shader-refraction/

    Any chance of doing a quick demo of a river if it is applicable?

    Thanks :)
     
  49. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi, I'm out of time to make a river demo right now. I'm compromised with other stuffs. I think Easy Water would fit very well to a river like the example you gave. Note that it's a straight river.. I'm not sure how these shaders (Easy Water included) would look on a curvy river. I need to test it someday.
     
  50. DavidRDev

    DavidRDev

    Joined:
    Jul 19, 2012
    Posts:
    47
    Hey, we're having an issue with the EasyWater14_C2TBDOR360 shader not working on mobile. Is it possible for that shader to run on mobile? Right now it doesn't show up pink/black/white, the water just ends up showing up blue, only displaying the color attached to the shader, doesn't appear to be textured, normal mapped etc.


    Works great in editor. Is there a quality setting that needs to be enabled for this?

    Thank you for your help.