Unity Community


Page 1 of 3 123 LastLast
Results 1 to 20 of 54

  1. Location
    Thailand
    Posts
    436

    Ocean/Water Shader for Indies (and Pro)

    I've been working on Ocean and Water since Blitz Basic. I decided to create an Ocean Shader that will work for Indie/Free version of Unity too. Here are some pictures of the result I get. Note: this shader is not a modification of the stock shader or from any other package, it is new and I did it from scratch.
    (better seen in HD of course)


    This shader can be used for any kind of water, here are the features:
    • material on an
    • no repetitive pattern
    • can be used as any shape! (even animated rigidbody)
    • can work from a basic plane primitive, uses almost no polygons
    • underwater, the script switches from one shader to another, also a different skybox with its shader is given for the underwater.
    • caustics (color, strenght)
    • transparency
    • foam (but with no foam texture, the foam is generated by the shader)
    • sun reflection on the water
    • fresnel / refraction
    • faked reflection
    • displacement maps (the map is made from a basic bump map, the animation is generated real time by the shader)
    • color of water, sun, etc.. can be changed from the inspector.
    Attached Images      
    Last edited by nikko; 04-07-2011 at 12:05 AM.


  2. Posts
    89
    Do you going to make a unitypackage of the water to buy


  3. Location
    Thailand
    Posts
    436
    yes, working on that, and also I upload a 300MB video to Youtube. It is better to see it animated.

  4. p6r p6r is offline

    Location
    France
    Posts
    816
    Fantastic ! (For free version too... Great !!!)

    6R


  5. Location
    That creepy house on the end of every street
    Posts
    1,564
    Nice work again nikko! You're a regular little asset store powerhouse
    Resident Lightmap Whore and person voted least likely to take the Apocalypse seriously.
    I'm a PC, and hiding porn on your computer was my idea.
    Support these plugins: Playmaker, uLink, SSE and Volume Grass. Or I'll set Miss Piggy on you.
    Hire niosop - awesome programmer, a genius actually!
    It's too hot to work right now!


  6. Location
    32.71 N, 117.15 W
    Posts
    5,419
    Looks nice. Does it include waves besides the bumpmap surface?


  7. Posts
    1,887
    Damn great thing!
    Will it be good also for lakes and rivers?


  8. Location
    Thailand
    Posts
    436
    Looks nice. Does it include waves besides the bumpmap surface?
    I am not sure to understand. There is no vertex animation. The idea is to fake everything. Typical gaming approach. Everything is done with fresnel/displacement map. So the Ocean is perfectly flat. This is a good and a bad point. The bad point is that of course it is not as impressive as the one in the famous thread you initiated 2 years ago. The good point is that it is more adapted to games and in general the uses of large water plane (industrial presentation etc...), and boyancy is very easy to do. However it would be possible to add the vertex/Ocean animation made by Toretank, but I wanted to do something on my own, so that I can sell it. Also, vertex animation cost a lot in poly, even with LOD. I think this shader can be adapted for iPhone I will do some tests this week.

    Will it be good also for lakes and rivers?
    Yeah, of course. This shader is designed specifically for large amount of water, lakes and rivers are good. However, there is a good river asset is in the Bootcamp demo... This said, it is water, and very open. Just use different textures and you can do different kind of water. Before I will release in the Asset store I will make presets (refabs) so that you can drag and drop a muddy water, a tropical water etc.. in your project.


  9. Location
    32.71 N, 117.15 W
    Posts
    5,419
    Ok, got it. This looks like it would be perfect for those people who wanted something for iPhones/Android/low spec machines or very large areas for flight sims. Since I'm not doing either of these, I'll likely stick with the "original" ocean shader, but I'm sure your version will do well anyways!


  10. Location
    Missouri
    Posts
    211
    Will this be for free or are you planning on selling it? I still have your other ocean asset from a few months back that I downloaded from your website


  11. Location
    Thailand
    Posts
    436
    It will not be free it is a very different shader from the one from my website. I will release an updated version of the Ocean Shader free, and continue to maintain it for free, as it was a collective effort in the first place.
    However, the free ocean shader is very tricky to use and I doubt it can be used on a game without some work. It is a good technical demo.

    This Water shader is different and answer to a need from the Unity users about having a plug and play water to use for anything, quick and easy.

    I started making water with blitz basic in 2004! Back in time it was without any shader, all on CPU.
    Here are some picture: http://www.nikko3d.com/index.php/old...ts-with-water/

    This Ocean for Indie & Pro shader represents years of experience in trying to get the most realistic water from nothing. If I sell some, it will be finally something I get back from all this work done before.

    And btw, here is an image of this water on a lake...that's for @megmaltese
    Of course no special Fx in these pics.
    Attached Images   
    Last edited by nikko; 04-07-2011 at 12:06 AM.


  12. Location
    Spain
    Posts
    837
    How is the performance of your water-ocean shader compared to the new water3 from Unity 3.2 and the standard pro water shader (Unity) ?
    Is it possible to implement real reflection ( for Pro)?
    I ask this because I need a very large ocean and the water3 shader performance is not good enough for me. I like your water better than the standard pro water so I am very interested in using your shader.
    By the way I remember your water project from Blitz forums.


  13. Location
    Thailand
    Posts
    436

    Performance

    This shader is almost invisible on the CPU because it is all in the frag/vertex shader. It is a classic shader (not a surface shader 'made in Unity'). The fragment shader takes 64 instruction, and that's it. I don't think it uses more resources than a 2 or 3 bump mappings.
    Actually there is some work on the CPU too, I increment some variable and copy the Inspector variables in the shader so that you can tweak the parameters live.
    2 textures are animated. The caustics, and the main diffuse texture is in fact a list of 8 textures looping but with fading (the textures are fading from one to another). It is a trick so that the light seems to pass thru the waves and the water get darker/lighter according to the normals position.
    The Displacement map calculation is made in the Shader and uses 2 cos moving together in order to circle the normals at different speed, that's also how you can move the water in one direction for example. The cos calculation is done on the CPU and sent to the shader.
    It is a LOT faster than the free Ocean shader, on my laptop I get around 50FPS with the free ocean shader and about 300FPS with this shader..

    About reflection it is very easy, I will probably do it at one point.

    Btw another demo:
    .
    Last edited by nikko; 03-28-2011 at 03:03 AM.


  14. Posts
    824
    Very nice looking water nikko
    Designer / Artist / Part Time Coder
    XWired Games || @XWiredGames || @Phil_XG

    PC Games: Aftermath || City Living
    Mac Games: Aftermath || City Living


  15. Location
    Chicagoland, USA
    Posts
    165
    Looks fantastic! I'll keep an eye out for its release in the Asset store!
    ------

    The right answer is usually the one that gets the job Done!


  16. Location
    32.71 N, 117.15 W
    Posts
    5,419
    In that video, your water looks a lot like the original Pro water (except it doesn't need Pro and it sounds like it has a lot less overhead).


  17. Posts
    479
    just curious, have you tested it on iphone/android? i would love to use this for my iphone/android game but I'm curious about the speed. I haven't been able to use any of the water included with the standard library, they are all too slow or ugly for the mobile.


  18. Location
    Portland, Or.
    Posts
    309
    As long as this is compatible with Unisky plugin I would buy it in a heartbeat. Looks great If it had foam on waves and beaches it could be a total water replacement system for Unity.


  19. Location
    Thailand
    Posts
    436
    I own Unisky, I will test, also if the author of the boyancy pack could contact me in private I would like to test his pack?
    I still need to fix an artifact with the sun reflection, and I will release maybe tomorrow.


  20. Posts
    295
    can't wait for the release! Keep it up
    any ideas for a price yet?
    Last edited by Sebako; 03-30-2011 at 11:11 AM.

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •