Search Unity

Wave Creator - Real Waves in Unity!

Discussion in 'Assets and Asset Store' started by SP0KK0, Sep 21, 2013.

  1. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    Hi nasos_333 thanks for your interest in Wave Creator.

    That screenshot was a prototype for Wave Creator 2, it used Deko's animated water shader and a script for mesh displacement. Unfortunately you will not be able to create that exact effect, the main reason is that the image features vertex displacement along x and z axis as well as the y axis, this approach however didn't work with the float and submerged effect scripts. I know that the screenshot does look good but it wouldn't be easy to implement in an actual scene, instead I focused on programming shoreline effects, foam and I programmed it as a shader to increase performance.

    Thanks
     
  2. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,357
    I see

    Is there any plan to have another pack with this effect ? Or would it be possible to have the effect as extra if i buy the pack ? Even if it is in experimental stage, i would like to use it in some specific cases in smaller bodies of water where i really need that small detail.

    Thanks again, the asset looks great

    EDIT: Wow, i just saw another pic, is this possible with the system ? Also is there a sample like that in the pack ? The color variation with depth and foam look stunning.

    http://forum.unity3d.com/attachments/screenshot-7-png.72780/
     
    Last edited: Sep 7, 2014
  3. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    I'm thinking about launching a new asset which deals solely with the wave generation in a script instead of a shader so it would be similiar to the original Wave Creator but have more advanced effects like the displacement you see in those images. I would be happy to give you the script for the wave displacement (the shape of the waves) if you bought a Wave Creator but you would have to bear in mind to get the exact result in the first screenshot you would also have to buy Deko's animated water for $5 and the float and submerged effects scripts wouldn't work this this kind of displacement.

    The second image is also a prototype, again I will think about incorporating these effects in the new asset. Thanks
     
    Last edited: Sep 8, 2014
  4. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,357
    Nice, thanks :)

    I will buy the pack probably tomorrow and let you know, i will PM the receipt too for reference
     
  5. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    I purchased the original WC, before the current shader-oriented incarnation. I'd assumed at time that the original method would stay in WC and was surprised when you removed it instead of leaving it in as an option.

    Is there any way you can incorporate the two wave methods? Maybe that could give a way of obtaining wave reflections on objects, including bodies entering the water.
     
    John-G likes this.
  6. angel_m

    angel_m

    Joined:
    Nov 4, 2005
    Posts:
    1,160
    Is the foam effect working on mobile devices with shader model 2.0?
     
  7. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    You can get the textures used in that shot for free here:

    http://www.rendertextures.com/seamless-water-5/

    I've used them with Wave Creator myself, and they look pretty great. :)
     
  8. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,357
    Thanks a lot for that, amazing texture :)
     
  9. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    There may be a way of combining the two method, i'm going to have a think about it.

    All shaders including in WC use Shader Model 3.0

    Thanks
     
    FargleBargle and hopeful like this.
  10. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    Hi guys

    Wave Creator 2.3 is now out featuring non-repeating, aperiodic foam. Hope you like it.

    Thanks
     
    FargleBargle likes this.
  11. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    Just tried the latest version, and it looks... GREAT! Thanks SP0KK0! :)
     
  12. RealSoftGames

    RealSoftGames

    Joined:
    Jun 8, 2014
    Posts:
    220
    hi using RFPS the underwater Effects scrip does not work, is their an issue that may be causing this?
     
  13. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    Hi aquilinajake

    Sorry for your problem, I haven't used RFPS with Wave Creator so I cant be sure however the submerged effect should work if the object the script is attached to is below the surface of the water, what effect occurs, if any at all, when using RFPS with the submerged script?

    Thanks
     
  14. RealSoftGames

    RealSoftGames

    Joined:
    Jun 8, 2014
    Posts:
    220
    unfortunately nothing at all, you can juts see the underneath of the waves and the terrain as normal and sky as normal if you look straight ahead
     
  15. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    Is the underwater script attached to the actual camera object you are using with RFPS, or to the player, or some other root object in a prefab? It needs to be on the actual camera component to work.
     
  16. RealSoftGames

    RealSoftGames

    Joined:
    Jun 8, 2014
    Posts:
    220
    main Camera
     
  17. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    @aquilinajake: I just tried this out in one of my own projects, and got some funny results as well. I thought I was already using the Wave Creator Submerged Effect script, but it turned out I was running a home-brew solution instead. When I switched to the Wave Creator script, it tinted the player and underwater surface when I was submerged, but not the underwater terrain. So I set up a new clean test project, with just a terrain, Wave Creator, and a third person character. After adding the submerged effect script, everything worked as it was supposed to. My best guess as to why the original test failed is that I was using RTP3 to color the terrain, and it replaces the standard terrain shaders with its own. I'll need to do more tests to confirm this, but suspect your problem may have a similar cause. No idea how to fix it yet though.
     
  18. rayzorUnity

    rayzorUnity

    Joined:
    Sep 3, 2014
    Posts:
    2
    I am a developer working on an underwater game and I am new to unity3d. Wave creator is is very helpful in setting up the scene, but I have a few questions. I am basically trying to recreate something like this:




    1) Is there a way to progressively change the fog color as you move through the world?
    2)Is the next upgrade coming soon so the waves will be more realistic.. including, caustics, blur for the underwater effect and perhaps GodRays.
    3) Do you all have any recommendations on examples and code to study to create a great underwater game

    Thank you for your time.
     
  19. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    Hi rayzorUnity

    Thanks for your interest in Wave Creator. Although Wave Creator doesn't support progressive fog as standard it could be easily implemented so that the fog would change color and density the deeper you go. If you need more information or scripts regarding this don't hesitated to contact me.

    The next update won't be for a while i'm afraid as it should add a fair bit of new content, I'm not sure it will add god rays but it should add caustics. Effects such as motion blur require Unity Pro as it is a post-processing effect.

    It's hard to recommend examples of code etc... because i'm not sure what you would spefically want and underwater games are fairly rare. Sorry i can't be of more help but I hope your game goes well.

    Thanks
     
  20. rayzorUnity

    rayzorUnity

    Joined:
    Sep 3, 2014
    Posts:
    2
    Thanks Spokko. I look forward to the updates. I am using an effects package form this post "http://forum.unity3d.com/threads/in...uality-post-process-fx-to-unity-indie.198568/ " . It seems to work well but slows down the FPS significantly. I will use this for now. If you have time, you should check it out. The package has great post-effects.

    As you mentioned, if you have any scripts to change the fog color progressively, I would appreciate the help. I am a JavaScript guy, but I am learning a lot of C# using unity.

    Thanks again.
     
  21. KamuiSama

    KamuiSama

    Joined:
    Apr 29, 2014
    Posts:
    4
    Hi. I just got your wave creator and the waves are not bad ;)

    I got only a lightning problem.
    When I move the camera near and away from the water, there seems to be some positions where the whole water changes it's color from blue to dark blue and then to red. Here are some screenshots.
     
  22. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    What version of Unity are you using? I had similar problems using Wave Creator with a Unity 5 beta, but it seems fine (for me) in v4.5.4. I was thinking it had to do with the new lighting model in Unity 5, but if you're having trouble with an earlier version, maybe there's a bug.

    I also noticed that the water surface didn't seem to be affected by fog in Unity 5, so the shaders will probably need some tweaking when the new version ships.
     
    Last edited: Oct 19, 2014
  23. KamuiSama

    KamuiSama

    Joined:
    Apr 29, 2014
    Posts:
    4
    I am still using Unity 4 the latest version.
     
  24. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    OK, I remember having similar problems when using DX11 shaders. Since Wave Creator 2.x is shader based, it may have issues with the new shader model. I was using it in a big complicated scene at the time, so I'm not sure if it was just DX11, or a combination of that and laggy overall performance, but I fixed it by going back to DX9. If that isn't it, I'm stumped. Maybe SP0KK0 can shed more light on it for you.
     
  25. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    Hi

    Thank you for purchasing Wave Creator. Sorry for the late reply. This problem is puzzling, I haven't seen it before and can't seem to recreate it. What light colour is the light you are using in the scene? Are you using more than 1 light? Also is the change sudden or gradual? I'm sure there is a simple solution but I need to recreate the problem.

    Thanks
     
  26. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    @SP0KK0: I've just done a few more tests, and it looks like this may be a graphics performance issue. Here's an example from Unity 4.5.4:

    The top image is the way it's supposed to look, and the bottom is the glitch. It seems to happen very suddenly, and always at a given viewing angle as I rotate the camera.

    Edit: I think I've found the smoking gun in my case at least. If you have a light of any kind (point, spot) inside a mesh structure located between the camera and the water, this will happen. To test, make a simple scene, with a directional light, skybox, and water (default settings). Add mouselook to the camera, so you can change the viewing angle, and put it a few units above the water. Then add a point light, with an intensity of 1, and a range of 2, inside a sphere with a diameter of 5, at a height of 10 units above water level, and far enough away from the camera so you can see it and the water at the same time. No light should get out of the sphere, right? Certainly none should reach the water. Wrong. Having something like this in the scene messes up the water whenever it comes into view. Any thoughts?
     
    Last edited: Oct 23, 2014
  27. KamuiSama

    KamuiSama

    Joined:
    Apr 29, 2014
    Posts:
    4
    I am using 2 directional lights in my scene, as they rotate to simulate day/night.
    Yeah it just happens in the blink of an eye. Will look in my scene if I have somewhere else such a point light that might cause it.
     
  28. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    Look inside buildings and other mesh objects you might have put a light inside to provide interior lighting. Interestingly, removing the water from the light's culling mask list has no effect on this problem. The only thing that works is setting the light's render mode to "unimportant", but then you might as well not bother having it there at all. This leaves baking the lighting into the scene and removing it, or adding a trigger, to only turn it on when you're inside the building, and hopefully out of sight of the water.
     
  29. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    Hi

    Sorry for this glitch I have replicated it and will be trying to fix it as quickly as possible. The coding is a little odd with point lights so I will take a closer look at that part of the Shader and hopefully this should be fixed fairly quickly.

    Thanks
     
    hopeful and FargleBargle like this.
  30. KamuiSama

    KamuiSama

    Joined:
    Apr 29, 2014
    Posts:
    4
    Thanks for your fast reply and trying to fix it ;)

    I noticed as soon any kind of object gets some kind of light from a light source like point/spot, the water changes color to the light source color.
    Also I got another question, it is more about how Shader load resources.
    Your Shader uses an height map that needs to be created before running the game, so I wanted to know if there is any way to change this height map in run time in the Shader, as modifying does not work and gives an error that I can not modify textures in memory.
    My whole map gets randomly created in game, that's why I would like to know if there is any possibility to change it at run time with a modified texture.
     
    Last edited: Oct 29, 2014
  31. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    Hi

    You can generate the heightmap at runtime using the WaveCreatorHelperFunctions.CreateHeightmap function. As shown in the script below:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class GenerateHeightmap : MonoBehaviour {
    5.  
    6.     public GameObject waterBody;
    7.     Texture2D heightmap;
    8.  
    9.     void Start () {
    10.  
    11.         heightmap = WaveCreatorHelperFunctions.CreateHeightmap ();
    12.         waterBody.renderer.material.SetTexture ("_Heightmap", heightmap);
    13.     }
    14. }
    15.  
    Is you select the water body in your scene for the waterBody variable this script we generate the heightmap upon the start of your game. Simply use this code in your progam whenever you need it to be updated.

    Thanks
     
    FargleBargle likes this.
  32. GameDev_India

    GameDev_India

    Joined:
    Nov 4, 2012
    Posts:
    88
    Hi SP0KK0... Just bought your wave creator...its awesome...just have a small issue...

    The water looks pixelated in the android build...Ill attach a few screenshots to get and idea...

    I have tried the different shaders too but still the water is pixelated like small blocks...
    even checked the images..they are uncompressed.

    https://www.dropbox.com/s/2fq4ey49l4otk8t/Screen Shot 2014-11-21 at 11.43.21 pm.png?dl=0
    https://www.dropbox.com/s/k5r969gpa9xfu4b/Screen Shot 2014-11-21 at 11.40.08 pm.png?dl=0

    Pls let me know the changes to be done to avoid the pixelation issue....
     
  33. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    I don't know if this has been resolved by anyone. Last I remember hearing on it was that it was a Unity issue. If it has been solved, it would be good to know how.
     
  34. GameDev_India

    GameDev_India

    Joined:
    Nov 4, 2012
    Posts:
    88
    Thanks for the update @hopeful

    Waiting to hear from @SP0KK0 .... Have also PM'ed him about the issue....

    If anyone have any suggestions...please let us know below...it will be very helpful..
     
  35. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    Hi

    Sorry aCat4mIndia I haven't been able to reply to your message recently as I've been away. This issue was talked about a lot on page 3 of this forum. It's an annoying problem and especially apparent when viewing the water from a short distance. It's not a WC specific issue because Water+ and various other shaders have had this problem on mobile devices as well. I'm sorry there is no solution here but I will work on it this week and look at other shaders to see if / how they have managed to find a solution.

    Thanks
     
    hopeful likes this.
  36. GameDev_India

    GameDev_India

    Joined:
    Nov 4, 2012
    Posts:
    88
    Hi @SP0KK0


    Thanks for the update man...it will be very helpful if you can give some solution to that.... needing it for a client project.

    The plugin is pretty awesome and being plagued by this problem is pretty sad... pls solve this.

    Thanks for the time... looking forward to hear some good update from you..

    Thanks
     
  37. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    @SP0KK0: I've found a workaround for creating a larger water body than the terrain I'm using, and giving it a circular shape that looks more like a natural horizon from higher angles. I know you indicated you were looking into this yourself, but thought I'd share my own kludgy solution in the mean time:

    BigWater.JPG

    The first step is to create a mesh for the larger water body. In this example, my terrain and main water body are each 1k x 1k in size, so I created a circular mesh with a 5k diameter, and a 1k x 1k square hole in the middle. I then duplicated the water material and heightmap that Wave Creator generated for my main Water Body. I edited the new heightmap (Heightmap 1), making it all black, and applied it to the new water material (Water Material 1), and used this as the material on my new mesh (Horizon2_1k). The black heightmap ensures the new mesh gets full coverage. Otherwise it would duplicate the cutouts generated by the original terrain. The only other thing was to increase the tiling on the new material to match the apparent wave size on my original water body. Since the distant water is never seen up close, tiling and other artifacts aren't as big an issue, and generally get lost in the fog, if you use it.

    BigWater2.jpg

    I'm not sure how this affects performance, especially on mobiles and lower end systems, but seems to work well on a PC.
     
    Last edited: Dec 5, 2014
  38. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    Cool stuff, FargleBargle! :)
     
  39. unit102

    unit102

    Joined:
    Nov 13, 2014
    Posts:
    26
    Hi everyone,
    Does wave creator works in Unity 5 ? with Oculus DK2 support ?

    I tried it in unity 4 and worked great but after I moved all my assets to unity 5 I don't see the waves anymore :(
    I can't go back to unity 4.. the 64 bit version and large memory is what I was waiting for, but I need wave creator along with my project.. please help.
    thanks.
     
  40. FargleBargle

    FargleBargle

    Joined:
    Oct 15, 2011
    Posts:
    774
    I don't know about Oculus, but have used Wave Creator on some of the Unity 5.0 betas. The only problems I've seen so far have been flickering of the water surface sometimes at different camera angles, and the water not being affected by fog the same as the rest of the scene. I'm not sure at the moment if these are shader problems, beta issues, or are caused by incompatibility with the new light engine. I guess we'll have to wait for the final release of Unity 5 to find out, and then see if any changes are needed in Wave Creator. I'm pretty excited about U5 right now, and hope there are no serious issues that prevent using Wave Creator with it.
     
    Last edited: Dec 13, 2014
  41. zeusrami

    zeusrami

    Joined:
    Dec 12, 2012
    Posts:
    17
  42. unit102

    unit102

    Joined:
    Nov 13, 2014
    Posts:
    26
    The glitch was visible I think since Unity 4 in certain angle as you have described and the waves animation sequence worked fine with the Oculus DK2 but nothing is working in Unity 5..so if its working in Unity 5 I strongly believe it could pass through the Oculus Camera easily and work as it should just like in Unity 4..
    I will keep my eyes open for Unity 5 fix :(
     
  43. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    Hi

    Good work FargleBargle on the large water body effect, it looks great. Wave Creator is currently untested on Unity 5 and the Oculus although I will be doing this soon. I am also looking into the camera glitch and how CG manages point lights.

    zeusrami Wave Creator works in 3D and the webplayer you linked shows a reflection effect in 2D. I don't think Wave Creator could be used to create the effect shown in the webplayer. It could create a wave surface pattern but it can't create that cool underwater effect.

    Thanks
     
  44. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Hi, I just bought this asset, and was pleased with it. I was wondering if you had plans to add breaks in from waves? If not is there an easier way or a way off the top of your head to do this?

    I been messing with this for a few days now. Thanks.
     
  45. PsychoPsam

    PsychoPsam

    Joined:
    Aug 1, 2012
    Posts:
    34
    Hi,
    I just purchased Wave creator 2. It's working pretty well but I've noticed there is a weird square pattern in the waves when I crank up the steepness. Do you know how I can remove this so there are just straight lines?

    See attached.



    Andy H.
     
  46. SP0KK0

    SP0KK0

    Joined:
    Aug 18, 2012
    Posts:
    103
    Hi guys

    Unfortunately recon0303 Wave Creator doesn't support tunneled / breaking waves it would be extremely complicated to implement. Although i'm not ruling it out for a future update it would be hard to achieve.

    Hi PsychoPsam, you could get rid of the square effect by changing line 141 of the shader from:

    Code (CSharp):
    1. for (int i = 0; i < 4; i++) {
    to:

    Code (CSharp):
    1. for (int i = 0; i < 1; i++) {
    If you change this and want to use the float and submerged effect scripts you would also have to change line 117 of the WaveCreatorHelperFunctions script in the same way.

    Thanks
     
  47. PsychoPsam

    PsychoPsam

    Joined:
    Aug 1, 2012
    Posts:
    34
    Awesome thanks SP0KK0 :D
     
  48. shahzad.naseem

    shahzad.naseem

    Joined:
    Aug 21, 2013
    Posts:
    11
    What is the performance of this package on android mobile devices? Please reply as soon as possible; it will be highly appreciated. Thanks
     
  49. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,685
    There's a pixelation issue that seems related to Unity's engine that this and other water packages have been unable to resolve (at least last I heard on it).
     
  50. shahzad.naseem

    shahzad.naseem

    Joined:
    Aug 21, 2013
    Posts:
    11
    @SP0KK0 can you please respond on this and also let me know about its performance on android and iOS mobile devices.