Search Unity

Aubergines Water Shaders

Discussion in 'Assets and Asset Store' started by aubergine, Dec 2, 2012.

  1. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Will be on the assetstore soon for a very reasonable price.
    Features:
    * Reflective And/Or Refractive with Cubemaps (Mobile friendly)
    * Reflective And/Or Refractive with Cubemaps with Flow Maps(Mobile friendly)
    * Reflective And/Or Refractive with Cubemaps with Transparency(Mobile friendly)
    * Reflective And/Or Refractive with Cubemaps with Transparency and Flow Maps(Mobile friendly)
    * Reflective And/Or Refractive with Realtime RenderTextures (Mobile friendly Pro Only)
    * Reflective And/Or Refractive with Realtime RenderTextures with Flow Maps(Pro Only)
    * Reflective And/Or Refractive with Realtime RenderTextures with Transparency(Mobile friendly Pro Only)
    * Reflective And/Or Refractive with Realtime RenderTextures with Transparency and Flow Maps(Pro Only)
     
    Last edited: Mar 16, 2015
  2. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,263
    :)

    Would like to see a video or something.
    Pictures looking good.

    I do not understand the flow maps, can i go true the water and make waves after me (the player) and that on mobile?
    Would be great :)
     
  3. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    I am trying to upload a webplayer since the morning without luck. My ftp server has gone nuts.
    I even bought a new hosting plan with godaddy today and same thing happens there.
    Anyhow, i will upload it tomorrow.

    Flow map defines the direction which the uvs are distorted against. There are some software available to create one, such as this
    But i may (or may not) provide a map creator with the pack as well in a future update.

    Waves behind the player on a mobile platform is possible, but i wont provide it with this pack. It will be too heavy, and the mobile friendly water shaders are already mathematically heavy enough for the sake of beauty. Not much space left for optimisations here.

    Maybe in a future update again.
     
  4. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Initial web demos added to the first post. This is just a test demo, there may be glitches here and there.
     
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,472
    when will this be ready?
     
  6. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,961
    Looks cool . )
    You probably know already you have the most annoying webpage ever : p
     
  7. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    By the way, i have to mention this. If you already bought the Aubergines Shader Pack, it will also include this water package as well. So you dont have to pay twice.
    For this individual pack, i am considering for an initial price of 10$-20$

    This week i hope.

    I am aware, i just bought a paid hosting service yesterday. Trying to set it up.
     
  8. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,435
    FYI, links to your webplayers aren't working and your screenshots aren't being displayed.
     
  9. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,472
    Cool I look forward to it, and since I already have the shaders pack I'm glad to hear this will be included!
     
  10. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,472
    the web player works for me, one thing I hope can be added is a fade along the shoreline.
     
  11. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,435
    Yes, working here now also. Must have caught it will it was being updated.
     
  12. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    Add texture blending on the borders to make soft shores and you gonna make tons of monies.
     
  13. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Ive already added this in 2 different solutions.
    1. You need to supply a grayscale mask image (unity free doesnt support depth maps, and generating a custom depth for mobile is very unnecessarily expensive)
    2. automatic fading with the cameras depth image (obviously for desktop builds only)

    Ive also decided to add this feature, now that suddenly i realised it would be an easy task.
     
  14. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    Images from solutions 1 and 2 please :)
    Im on iPad, cant check webplayers.
     
  15. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,263
    :)
    Graet, please make it so it works on mobile/ios and desktop if it is possible.
     
  16. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Below is the image from solution 1 (i didnt pay much attention to the mask image so it may not look great here).
    Sorry i couldnt do it before, real life job takes time and im trying to get my new website up and running which is driving me nuts.
    Couldnt spare any time for this yet.

     
  17. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,472
    This looks very promising, so this solution should work well on iPad 2 and up?
     
  18. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Sure, anything capable of gles2.0 will run these shaders unless mentioned otherwise as in the first post.
     
  19. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,472
    Just to be clear, flow map + shore blending will work on mobile?
     
  20. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Yeah, with cubemap reflections only(with variations).
     
  21. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    Wow, I will add this asset to my wish list.
     
  22. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Today i finished the reflective refractive with Crysis like fresnel calculations shader. I think i will make this exactly like Crysis water (if i can :p)
    First image no refractions, second image full refractions.
     
  23. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    Hello Aubergine,

    This looks great !

    I am looking to achieve the kind of shallow water like the one in Mario Galaxy. Is this possible with your shader ?

    Example:
     
  24. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    This pack is about realistic water, not toony visuals.

    But what you want is easy, do you want it for mobile or for a desktop game?
     
  25. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    Looking for mobile game if possible.
     
  26. kinl

    kinl

    Joined:
    Jun 1, 2008
    Posts:
    355
    Count me in for this... :)
     
  27. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    It looks like this now.
    First image no refraction, second image full refraction. And still works on mobile and Unity Free :p
     
  28. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    You should check my Aubergines Shader Pack, the water shader in that pack does what you want.
    This pack will also be included in Aubergines Shader Pack as well, so you dont pay twice.
     
  29. kinl

    kinl

    Joined:
    Jun 1, 2008
    Posts:
    355
    When are you releasing?
     
  30. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    I will submit the package tomorrow. I spent this weekend to prepare a nice webplayer, i will upload it tomorrow as well.
    Meanwhile, here is a screenshot from the webplayer with the simple water.

     
  31. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,472
    looks very dark .. maybe add some lights
     
  32. kinl

    kinl

    Joined:
    Jun 1, 2008
    Posts:
    355
    Awesome, can't wait.
     
  33. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Here is a new image with more light and you can see both from the shore and from the top at the same time.



    EDIT: The above image has some artifacts on the water because of jpg compression, it is not there in the actual scene.

    And attached is a waterfall from the same scene.
     

    Attached Files:

    Last edited: Dec 10, 2012
  34. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,472
    I love the faded shorelines, did you also send an update to the shader pack to the assetstore? Looking forward to integrate it in my project :)
     
  35. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Didnt update the shader pack yet, first i need this individual product to be accepted to the store.
    It will take a while.
    I dont mind you supporting me and buy this one individually though, hehe :p
     
  36. 3dDude

    3dDude

    Joined:
    Jul 4, 2010
    Posts:
    1,067
    Looks quite amazing!

    Can you give some details on how the flowmap is generated? How hard is it to set up the flowing water in a scene?
     
  37. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    If you want to write your own flowmap editor for your own custom needs, its basically calculating the 2d vector between mouse start position and mouse end position while dragging and writing this vector on the image.
    You could also automatically generate it from the normals of a mesh.
    Details are in the readme.txt

    Also, there is a flowmap editor from this very nice guy which you can use to generate maps.

    I will also supply my own editor for specific needs at some point in a future update.
     
  38. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    Thanks for the reply. Will the water shader in the Aubergine Shader Pack be included in the Aubergine Water Shaders pack ? I need the water shader not sure I will use the other ones in that large pack. Otherwise I will probably wait for a sale on the large pack to grab it.
     
  39. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Good idea, i will include that water shader in this one too. But i need sometime between updates, i dont want to update the pack for just minor changes.
     
  40. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Hello, just updated the pack to be compatible with Unity 3.5.6 rather than 4.0 and tidied up the folder structure.
    This pack is now also a part of Aubergines Shader Pack
     
  41. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,472
    I have a question, what is the function of the cycle parameter in the flow script? is there a way to disable the cycle and have a permanent visibility of the flow?
    Thaks
     
  42. RC-1290

    RC-1290

    Joined:
    Jul 2, 2012
    Posts:
    635
    Looks nice :D
    I was surprised to see that the water surface I created for debugging my watersim look eerily similar to the water on some of these screenshots. Entirely possible we're inspired by the same things.

    Good thing that we end up with different artifacts ^_^.

    Are you planning on adding controls for fog density, type (linear, exp, exp²) and color ?
     
  43. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Cycle parameter is how many times the normal map will be scrolled across the water surface until it restarts. Big numbers will cause the normal map to look smaller and ugly. A good number is between 0.1 and 1.0

    In order to make flow look better, you should use 2 different wave maps to prevent repeating.
     
  44. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Your water simulation looks awesome, your fresnel calculation needs touching though and you have artifacts at the shores probably because of depth map.
    Fog is already there, just disabled as default. You can remove the Fog Off command from individual shader and then you can use unity fog itself.
     
  45. RC-1290

    RC-1290

    Joined:
    Jul 2, 2012
    Posts:
    635
    Thanks :D. Unfortunately, the list of major artifacts in my sim is more than 10 items long ^^ (Especially the erosion is incredibly buggy :p). The fresnel term power is adjustable, just not in the web demo, and is currently set to Source Engine levels. I think it will look better if I add high frequency detail for the normals, because the reflections are indeed a little weak.

    I saw you already had fog in these shader (In fact, It was the first thing I looked at, because I spent a lot of time yesterday figuring out how to make it work, and then I saw you casually publishing your work :p). It looks nice. I was referring to the different kinds of fog you could use.

    Unity gives you 3 modes for regular fog, and I'm guessing it's pretty standard. I was wondering if you were planning to give a similar option for your water, because of the potential for extra customizability, while they shouldn't be all that difficult for you to add :).
     
  46. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    I could add some spherical volume fog or some box volume or any other shape volume fog or height based fog...etc.
    But the idea about my "commercial" pack is to be usable on generic games and make use of unity provided solutions as much as possible in order to keep my sanity. As im one guy keeping several products up to date.
    Its not like 3d modelling humanoids you know.

    Sooo no need to complicate things you know. Although, often times people ask for customised work and thats when i lose my sanity :p
     
  47. RC-1290

    RC-1290

    Joined:
    Jul 2, 2012
    Posts:
    635
    Haha, I know what you mean. To be honest, I find that the results are often worth my sanity, and I guess it helps to be insane to start with.
    But I understand that you want to limit the scope to manageable levels.
    If you ever feel like you have too much work to handle, feel free to send some assignments my way ;)
     
  48. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,263
    Is this feature now in?
    I realy would like to use this please.
     
  49. aubergine

    aubergine

    Joined:
    Sep 12, 2009
    Posts:
    2,678
    Not yet, im working on it. By the way, i sent you the shader you want. Check your pm.
     
  50. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,263
    Oh yes, thank you very much :)

    aubergine is not only making good products but his service is also excellent !
     
unityunity