Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Easy Water 2.0 - Mobile Compatible [RELEASED]

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

  1. Assault

    Assault

    Joined:
    Aug 21, 2012
    Posts:
    60
    Hi,

    I just bought the asset and it seems better performance wise than the standard unity water asset. However, I noticed that the transparent object (meaning object that have the built-in Transparent/Diffuce shader applied) are not seen through the water surface. This is true for the underwater water ceiling too.

    Is there any way to make the transparent object be visible through the water surface? It would be essential to my app.

    I attached a screenshot from both above and below the surface. The other box on the left has Mobile/Diffuse shader and the one on the right has the Transparent/Diffuse.
    easywater_transparency.png
     
  2. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi Assault,
    I'll try to solve this this weekend, right? I believe I never tested something like this.
     
  3. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi Assault,
    I have some bad news.. Maybe it's impossible in Unity.. You can test by yourself. Just change the water's shader by the builtin transparent shader and the 'problem' still exists.

    This happens because unity renders each object at a time based on the center of the object and not by the real point position. If you move the objects you will notice that sometimes one of them will be whole in front of the other.

    I can be wrong but I don't know any workarounds..

    There's a lot of threads about it like this one
     
  4. Assault

    Assault

    Joined:
    Aug 21, 2012
    Posts:
    60
  5. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Thanks Assault,
    I'll check it out.
     
  6. Assault

    Assault

    Joined:
    Aug 21, 2012
    Posts:
    60
    Hi Grespon. I have another question: I need to be able to hide the water surface inside my boat that is on the water surface for obvious reasons. I was thinking of adding a cutout texture for the easy water shader, for example to the EW14_C_TT_B_D_FO_R.shader (or make a copy of it and then add the cutout texture).

    But as I am new to shaders, I am not really sure how to do this. Could you help me out a little bit?

    So I would like to combine this idea (or similar) with your shader: http://wiki.unity3d.com/index.php/TextureMask

    I tried adding the Pass {} part from that MaskedTexture in front and to behind of the code in EW14_C_TT_B_D_FO_R but could not get the results that I wanted - the mask was visible on the surface, when I need to have completely non-rendered "holes" in my water surface.
     
    Last edited: Aug 8, 2014
  7. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    I think this is what you want:

    http://wiki.unity3d.com/index.php/DepthMask


    I have no time to help you now, but I'll test it soon and I let you know
     
  8. Assault

    Assault

    Joined:
    Aug 21, 2012
    Posts:
    60
    Hi Grespon,

    I tried that DepthMask approach you suggested, and it in fact works with Easy Water. Unfortunately for my purpose it doesnt really fit, as it hides also my ship mesh as it has material with Transparent/Cutout/Diffuse shader applied to it. I need this because the inner parts of the ship that require it (maybe this sounds weird, but my scene is kind of complicated thin to explain thoroughly)

    So back to my original question, how could I modify your shader so that it would have a texture mask so that I could create "holes" in the water surface? My ship is stationary, so it is no problem if the hole cannot move. This kind of approach would be ideal for my purpose.
     
  9. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Assault,
    I thought your ship would be moving, so I concluded your idea was kinda lame.. sorry about that :p
    I'll see how can it be 'masked' or something and let you know..
     
  10. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Just a thought, but how about using layers to restrict the mask from affecting the ship?
     
  11. Assault

    Assault

    Joined:
    Aug 21, 2012
    Posts:
    60
    How actually would that be possible with Layers? As far as I know, layers are a way to show/hide things completely, not partially. Or am I wrong?
     
  12. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    The DepthMask now affects all geometry in the scene, isn't it possible to only affect the objects in a particular layer, ignoring the rest (e.g. the ship)?
     
  13. Assault

    Assault

    Joined:
    Aug 21, 2012
    Posts:
    60
    OnePxl, as far as I know, there is no way to interact with layers from shader code..or am I wrong?
     
  14. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    Fair point, not that I know of. But the shader is on the boat and the water then?
     
  15. Assault

    Assault

    Joined:
    Aug 21, 2012
    Posts:
    60
    The water has the Easy Water EW14_C_TT_B_D_FO_R shader, the ship has Transparent/Cutout/Diffuse shader and the "lid" on the ship deck that hides the water behind it has the DepthMask shader. Again, the problem is that the DepthMask shader hides also the ship mesh, not only the water.
     
  16. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    My mistake, I thought it was on the water. Never mind!
     
  17. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
  18. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Really ???!?!?
    Thanks for warning.. I didn't receive any notification..

    It's weird.. I can't just change the website.. This is my site!! Why was it blacklisted ?? :(
     
    Last edited: Sep 24, 2014
  19. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    perhaps its not you and its the company that you are using to host your site

    so if its not you who is responsible then just find another company to host your site

    when i search the web the hosting company / ip address is part of a group of ip addresses blacklisted for originating spam and other privacy related complaints
     
    Last edited: Sep 24, 2014
  20. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    My site is: aruangrespan.com

    Well, it's HostGator.. it's kinda famous right ?
    Couldn't it be this WOT that simply related my site to this blacklisted one for no reason at all ?
     
  21. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    could be anything. the web is a mess

    here try this
    https://www.mywot.com/en/claim-site?target=aruangrespan.com

    register as owner to site and go through process

    If you don’t agree with your site’s reputation rating, you can request it to be evaluated on the WOT forum. There you meet the most active WOT users, and can get valuable feedback for improving your website and its reputation.​

    you can post here
    https://www.mywot.com/en/forum/5

    i guess u need to let them know that its some kind of big mistake

    creating a post in their saying its nice site is not going to get u off blacklist...

    sadly your going to have to find who has you black listed and go through their process to get off the list

    i try try to find out who blacklisted you, its a matter of going to each site that does those things and typying in your ip address / domain name and seeing if u are with them and repeat until you hit all the major sites

    if you ask wot they may tell you who has u blacklisted since they indicate on the page they got it form lists...
     
    Last edited: Sep 24, 2014
  22. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    ok pm this guy https://www.mywot.com/en/user/1863955 as him why he did his post. it appears to be mistaken

    still he didnt black list you he just references the fact, but perhaps he can help you find out what black lists your own
     
  23. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Yeah, thanks. I did all these yesterday.. He didn't answer me yet..I'm gonna wait.
    As I was searching the reason to be blacklisted I found out my website was still under my old registrar, so I made the process to transfer to HostGator where my other sites are still "clean".
     
    Last edited: Sep 24, 2014
  24. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Please people,
    Is someone else having troubles accessing my site? aruangrespan.com
     
  25. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    i made a post and i created a post in their forums letting them know that perhaps they made a mistake and that someone should take a look into it...
     
  26. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    I'm not, but I don't use MyWOT. @im, what kind of browser uses MyWOT?
     
  27. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    I read your post in WOT. Thanks, im!
    I still didn't receive any messages from that guy, thought..

    This Wot is strange... it seems they mass rate sites, then they suggest the site's owner to sign in and invite people to install their tool to rate the site positively...
     
  28. OnePxl

    OnePxl

    Joined:
    Aug 6, 2012
    Posts:
    307
    It looks like a scam. Like those sites that rate every domain without ever contacting the owner.
     
  29. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    wot is not a scam. number of internet security suite do basically the same thing..

    they do have reasonable, at no cost way to appeal.

    it keeps me and many other people relatively safe on the web.
     
  30. koberko

    koberko

    Joined:
    Nov 10, 2013
    Posts:
    18
    Hi.
    Here is short video of game wip where I used this shader. I have modified shader a bit, by adding custom diffuse texture slot, so that I can have different water color close to shore and far where is deeper water:


    And here is blog post on my webpage with some screenshots and more info:
    http://dd3d.hr/dev-blog-002-first-test-of-terrain-and-boat/?lang=en
     
  31. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Pretty good!! Nice job. I was thinking about putting colormap options, but the package is already kinda big.

    So does it run fast on mobiles?
     
  32. koberko

    koberko

    Joined:
    Nov 10, 2013
    Posts:
    18
    Not quite... I tried to figure it out what's wrong, but I still get issues as seen on images below. This are screenshots from Samsung Galaxy S3:
    Screenshot_2014-10-12-16-20-02.png Screenshot_2014-10-12-16-26-30.png Screenshot_2014-10-12-16-26-46.png
     
  33. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Which GPU is your Galaxy 3? Mali 400? It has some a limitation with floating-point precision. Just for testing, try using the Unity's builtin bumped specular shader.

    Maybe the best way to fix it is to use smaller connected planes. Or trying an EasyWater shader with no normal map + specular. Try to detect the device's GPU and change the shader if it is Mali GPU. (Please let me know if it's not a Mali GPU)
     
  34. koberko

    koberko

    Joined:
    Nov 10, 2013
    Posts:
    18
    fck; yeah it's Mali-400MP4 GPU... I will do some other tests and see what I get... btw, I got OK results with Unity Pro water before (while testing it on trial): Screenshot_2014-05-23-04-10-10.png
     
  35. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Ahh, I think that's because Unity PRO water doesn't have specular lighting.
     
  36. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Hi,

    I'm also having problems on Samsung Galaxy S3. I use the included waterPlane, scale it to 50x1x50 (not that big), and choose Reflective/EW6_C_T_D_R as shader.

    As you can see at the bottom of the screenshot, I get large pixels, and the animation is choppy. It gets worse if I make the plane bigger (the pixels get bigger).

    2014-10-17 01.22.32.jpg


    I also tried the EasyWaterFastest shader, which worked much better as it's only one texture. However, when I tried EasyWater0_2TO, I got the same problem there.

    Maybe it's related to using more than one texture? I remember reading something about that, and I also noticed someone having similar issues on the terrain engine, when painting many textures. I also read about floating precision errors on Samsung S3, although I'm not sure it's the same thing.

    Here's EasyWater0_2TO:

    2014-10-17 01.47.14.jpg
     
    Last edited: Oct 17, 2014
  37. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Hi, guys .. that's a Mali 400 GPU precision limitation. It happens when the shader has normal maps and specular lighting applied. Even unity's builtin shaders present this 'bug' on Mali 400 GPU. I tried to find a workaround about 1 year ago with no success.. This week, after a hint fom koberko, I noticed Unity PRO water works because it's not affected by light. I'll try to find a workaround based on that... but I don't think it's gonna be perfect. By now, I think the best workaroud is to check the device's GPU and change the shader if it's MALI 400.
    I bought a MALI 400 phone specially for that.. let's see what I can do.
     
  38. Sir-Spunky

    Sir-Spunky

    Joined:
    Apr 7, 2013
    Posts:
    132
    Thanks for the quick reply!

    I don't have Unity Pro to test Water Pro unfortunately, but I noticed that even shaders like EasyWater0_2TO that don't use normal maps or specular seem to have the same problem. The only one I got to work on S3 was EasyWaterFastest.

    You're right that Unity's own shaders also have this problem. I just tried the built-in "Bumped Diffuse", "Bumped Specular" and "Diffuse Detail", and they all look pixelated as well. With "Bumped Diffuse" and "Diffuse Detail", the diffuse texture looks fine, while the bump/detail texture shows big pixels. Considering "Diffuse Detail" also shows pixels, I'm not sure it's related only to normals and specular.

    However, when I tried the mobile shaders "Mobile/Bumped Diffuse" and "Mobile/Bumped Specular" I did not get this problem! So those shaders must be doing something differently, whatever it is.

    In the meantime, I like your idea to identify MALI 400 and use a different material. Do you know how to identify MALI 400 from scripts? Otherwise, I'll look into it and post here if I find out how.
     
  39. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    I believe that's how:http://docs.unity3d.com/ScriptReference/SystemInfo.html

    I never tested thought..
     
  40. Assault

    Assault

    Joined:
    Aug 21, 2012
    Posts:
    60
    Hi. I am using Vectrosity to mimic a rope hanging from an object in a multicamera setup. I call Draw3D in LateUpdate to update the rope. The problem is, when I rotate one camera, the "rope" appear thicked and thinner and also totally invisible from a certain angles. I think this is because the Draw3D aligns the line with a main camera. Is there a way to define which camera is the one where the line is aligned to?
     
  41. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Maybe you should try the Vectrosity forum? :D
     
  42. Assault

    Assault

    Joined:
    Aug 21, 2012
    Posts:
    60
    oops, wrong thread =)
     
  43. jayvd

    jayvd

    Joined:
    Oct 11, 2014
    Posts:
    14
  44. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
  45. Image3d

    Image3d

    Joined:
    Jun 20, 2008
    Posts:
    155
    Hi Grespon,

    I am porting my game to Unity 5 and testing EasyWater in Unity 5 Beta 12 and when I apply the animate.js in the mesh I am using, in the iPhone 5 s device the mesh renderer does not work. It works in the Editor , but not in the iPhone device.

    Unity 5 B 12 changed your script from render.material...to this line: GetComponent.<Renderer>().material.SetTextureOffset("_Texture1", texture1UV);.

    So I don't know if it is your shader bug or Unity 5 B 12.

    Can you take a look ?

    Thanks.
     
  46. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Actually I'm surprised it's working in the Editor for you. I tested in Unity 5 beta (don't remember version) and I got only the pink error color. I tested on Windows. Not sure about on Mac. I'll test again when I get some time.
     
  47. DjEmix

    DjEmix

    Joined:
    Feb 7, 2013
    Posts:
    11
    Hello Gespon!
    I recently bought your plugin, but I can't get the result that you have in the project sample
    http://aruangrespan.com/EasyWater

    Can you share it to see how it works?
     
  48. Grespon

    Grespon

    Joined:
    Apr 13, 2012
    Posts:
    388
    Last edited: Nov 15, 2014
  49. DFledermaus

    DFledermaus

    Joined:
    Sep 30, 2013
    Posts:
    3
    I'm getting a problem on mobile with the shader "stuttering" after a long enough time. It works just fine at first but then about 5 minutes or so later the water moves like normal for a second then jumps back to where it was a second ago, repeating endlessly. When this happens it also drastically reduces the framerate of the game no matter what is on the screen. Destroying the gameobject that has the material does not fix it, only exiting the game entirely and restarting returns it to normal. Do you know why it's doing that?
     
  50. Gekigengar

    Gekigengar

    Joined:
    Jan 20, 2013
    Posts:
    738
    Watching for instabuy list!