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)
- 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.
Last edited by nikko; 04-07-2011 at 01:05 AM.
Do you going to make a unitypackage of the water to buy
yes, working on that, and also I upload a 300MB video to Youtube. It is better to see it animated.
Fantastic ! (For free version too... Great !!!)
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!
Damn great thing!
Will it be good also for lakes and rivers?
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.Looks nice. Does it include waves besides the bumpmap surface?
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.Will it be good also for lakes and rivers?
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!
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
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.
Last edited by nikko; 04-07-2011 at 01:06 AM.
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.
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 04:03 AM.
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!
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.
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.
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.
can't wait for the release! Keep it up
any ideas for a price yet?
Last edited by Sebako; 03-30-2011 at 12:11 PM.